From b599de9d4d5414aa1e3069aae3bbd0a1827a6ac2 Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Thu, 29 Aug 2024 18:02:17 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BA=8A=E5=9E=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.interceptor.js | 10 +-
page_user/bangding.vue | 3 -
page_user/caiwu.vue | 20 ++-
page_user/changsuoxq.vue | 4 +-
page_user/creadtg.vue | 22 +--
page_user/daili.vue | 6 +-
page_user/dailixq.vue | 12 +-
page_user/deviceedit.vue | 15 +-
page_user/devicelist.vue | 18 +--
page_user/dianpu.vue | 5 -
page_user/dianpuedit.vue | 12 --
page_user/guzhang.vue | 21 ---
page_user/homepage.vue | 24 ++-
page_user/mydetail.vue | 11 +-
page_user/orderdetail.vue | 14 +-
page_user/orderlist.vue | 10 +-
page_user/promote.vue | 8 +-
page_user/touzi.vue | 4 +-
page_user/touzixq.vue | 6 +-
page_user/tuiguang.vue | 8 +-
page_user/yewuyuan.vue | 6 +-
page_user/yewuyuanxq.vue | 10 +-
pages/index/index.vue | 177 ++++++++------------
pages/myorder/index.vue | 160 ++++++++----------
pages/nearbystores/index.vue | 305 ++++++++++++++++-------------------
25 files changed, 393 insertions(+), 498 deletions(-)
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 451f4f3..7f24251 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -20,8 +20,8 @@ const install = (Vue, vm) => {
// },
// });
Vue.prototype.$u.http.setConfig({
- // baseUrl: 'http://192.168.2.8:3302',
- baseUrl: 'https://kang.chuangtewl.com/prod-api',
+ baseUrl: 'http://192.168.2.8:3302',
+ // baseUrl: 'https://kang.chuangtewl.com/prod-api',
loadingText: '努力加载中~',
loadingTime: 800,
// 设置自定义头部content-type
@@ -122,9 +122,9 @@ const install = (Vue, vm) => {
} else if (res.code == 200) {
// console.log("老用户登录",res.data)
- uni.switchTab({
- url:'/pages/index/index'
- })
+ // uni.switchTab({
+ // url:'/pages/index/index'
+ // })
}
});
diff --git a/page_user/bangding.vue b/page_user/bangding.vue
index a407aa3..cee4b74 100644
--- a/page_user/bangding.vue
+++ b/page_user/bangding.vue
@@ -32,9 +32,6 @@
-
diff --git a/page_user/caiwu.vue b/page_user/caiwu.vue
index 9a17064..ddf23f6 100644
--- a/page_user/caiwu.vue
+++ b/page_user/caiwu.vue
@@ -34,9 +34,11 @@
提现
-
+
- 订单收入
+ 充值订单
+ 订单退款
+ 提现申请
¥{{item.amount}}
@@ -130,10 +132,16 @@
// 跳转到提现详情
- btntxdeta(id) {
- uni.navigateTo({
- url: '/page_user/caiwudetail?id=' + id
- })
+ btntxdeta(id,type) {
+ if(type == 1 || type == 2){
+ uni.navigateTo({
+ url:'/page_user/orderdetail?billId=' + id
+ })
+ }else{
+ uni.navigateTo({
+ url: '/page_user/caiwudetail?id=' + id
+ })
+ }
},
// 跳转到提现
btntx() {
diff --git a/page_user/changsuoxq.vue b/page_user/changsuoxq.vue
index 0b5f792..887a749 100644
--- a/page_user/changsuoxq.vue
+++ b/page_user/changsuoxq.vue
@@ -7,11 +7,11 @@
{{obj.name == undefined ? '--' : obj.name}}
- 业务员:
+ 渠道商:
{{obj.bizManCount == undefined ? '--' : obj.bizManCount}}人
- 投资人:
+ 创业者:
{{obj.investorCount == undefined ? '--' : obj.investorCount}}人
diff --git a/page_user/creadtg.vue b/page_user/creadtg.vue
index bb7bfbb..5bbf3e1 100644
--- a/page_user/creadtg.vue
+++ b/page_user/creadtg.vue
@@ -13,9 +13,9 @@
- 投资人
+ 创业者
-
+
@@ -32,7 +32,7 @@
-
+
@@ -58,14 +58,14 @@
btnflag:true,
list:[{
value: '1',
- label: '代理'
+ label: '合作伙伴'
},
{
value: '2',
- label: '投资人'
+ label: '创业者'
},{
value: '3',
- label: '业务员'
+ label: '渠道商'
},
{
value: '4',
@@ -101,7 +101,7 @@
}
},
methods: {
- // 获取所有的投资人列表
+ // 获取所有的创业者列表
gettzr(){
this.$u.get(`/agent/user/investorList`).then(res => {
if(res.code == 200){
@@ -140,7 +140,7 @@
},
- // 拿投资人id
+ // 拿创业者id
confirms(e){
this.investorId = e[0].value
this.touzi = e[0].label
@@ -154,13 +154,13 @@
if(this.name == '经营场所'){
this.flag = true
this.userType = 5
- }else if(this.name == '代理'){
+ }else if(this.name == '合作伙伴'){
this.flag = false
this.userType = 2
- }else if(this.name == '业务员'){
+ }else if(this.name == '渠道商'){
this.flag = false
this.userType = 3
- }else if(this.name == '投资人'){
+ }else if(this.name == '创业者'){
this.flag = false
this.userType = 4
}
diff --git a/page_user/daili.vue b/page_user/daili.vue
index a6596f5..893474e 100644
--- a/page_user/daili.vue
+++ b/page_user/daili.vue
@@ -1,6 +1,6 @@
-
@@ -22,7 +22,7 @@
- 投资人
+ 创业者
{{item.investorCount == undefined ? '--' : item.investorCount}}
@@ -97,7 +97,7 @@
}
},
methods: {
- // 获取代理列表
+ // 获取合作伙伴列表
getlist(){
this.$u.get(`/agent/user/agentList?pageNum=${this.pagenum}&pageSize=${this.pagesize}&keyword=${this.keyword}`).then(res => {
if(res.code == 200){
diff --git a/page_user/dailixq.vue b/page_user/dailixq.vue
index daa2929..0b3f4c4 100644
--- a/page_user/dailixq.vue
+++ b/page_user/dailixq.vue
@@ -1,6 +1,6 @@
-
@@ -8,14 +8,14 @@
推广人:
- {{obj.referenceName == undefined ? '--' : obj.referenceName}}(代理业务员投资人经营场所)
+ {{obj.referenceName == undefined ? '--' : obj.referenceName}}(合作伙伴渠道商创业者经营场所)
- 推广代理:
+ 推广合作伙伴:
{{obj.agentCount == undefined ? '--' : obj.agentCount}}人
- 推广业务员:
+ 推广渠道商:
{{obj.bizManCount == undefined ? '--' : obj.bizManCount}}人
@@ -37,11 +37,11 @@
{{obj.createTime == undefined ? '--' : obj.createTime}}
- 投资人:
+ 创业者:
{{obj.investorCount == undefined ? '--' : obj.investorCount}}人
diff --git a/page_user/deviceedit.vue b/page_user/deviceedit.vue
index 880468e..b366700 100644
--- a/page_user/deviceedit.vue
+++ b/page_user/deviceedit.vue
@@ -22,15 +22,15 @@
不可用
- 所属代理
+ 所属合作伙伴
{{obj.agentName == undefined ? '--' : obj.agentName}}
- 所属业务员
+ 所属渠道商
{{obj.bizManName == undefined ? '--' : obj.bizManName}}
- 所属投资人
+ 所属创业者
{{obj.userName == undefined ? '--' : obj.userName}}
@@ -102,15 +102,13 @@
- 比例明细
+ 收益明细
- {{item.arrivalName}}(平台公司代理商业务员投资人经营场所){{item.point}}%
-
+ {{item.arrivalName == undefined ? '--' : item.arrivalName}}(平台公司合作伙伴商渠道商创业者经营场所){{item.point}}%
+ ¥{{item.amount== undefined ? '--' : otem.amount}}
-
-
@@ -215,7 +213,6 @@
background: #FFFFFF;
box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.07);
border-radius: 20rpx 20rpx 20rpx 20rpx;
-
.devixexq {
display: flex;
justify-content: space-between;
diff --git a/page_user/devicelist.vue b/page_user/devicelist.vue
index ea2759e..1a9c200 100644
--- a/page_user/devicelist.vue
+++ b/page_user/devicelist.vue
@@ -57,16 +57,16 @@
不可用
- 所属代理
+ 所属合作伙伴
{{item.agentName == undefined ? '--' : item.agentName}}
- 所属业务员
+ 所属渠道商
{{item.bizManName == undefined ? '--' : item.bizManName}}
- 所属投资人
+ 所属创业者
{{item.userName == undefined ? '--' : item.userName}}
未绑定
@@ -86,7 +86,7 @@
-已经到底了-
-
+
@@ -214,16 +214,16 @@
}
})
},
- // 点击绑定业务员
+ // 点击绑定渠道商
// btnbd() {
// this.show = true
// },
- // 点击绑定投资人
+ // 点击绑定创业者
btntz(deviceId) {
this.showtz = true
this.deviceId = deviceId
},
- // 点击确定绑定投资人
+ // 点击确定绑定创业者
confirmtz(e) {
let userId = e[0].value
let data = {
@@ -315,7 +315,7 @@
}
})
},
- // 代理取所有投资人
+ // 合作伙伴取所有创业者
gettzr() {
this.$u.get(`/agent/user/allInvestorList`).then(res => {
if (res.code == 200) {
@@ -328,7 +328,7 @@
}
})
},
- // 业务员
+ // 渠道商
gettzr() {
this.$u.get(`/biz/user/allInvestorList`).then(res => {
if (res.code == 200) {
diff --git a/page_user/dianpu.vue b/page_user/dianpu.vue
index 44ce799..ee252f3 100644
--- a/page_user/dianpu.vue
+++ b/page_user/dianpu.vue
@@ -8,11 +8,6 @@
场所名称
-
营业时间
场所名称
-
营业时间
详细地址
-
@@ -50,10 +43,6 @@
是否展示场所
-
@@ -65,7 +54,6 @@
-
@@ -49,21 +37,12 @@
-
-
上传问题图片可以让问题快速解决哦!
-
-
提交
diff --git a/page_user/homepage.vue b/page_user/homepage.vue
index b85e5c4..93bb72f 100644
--- a/page_user/homepage.vue
+++ b/page_user/homepage.vue
@@ -5,11 +5,25 @@
-
- {{infoobj.nickName == undefined ?'--' : infoobj.nickName}}
+
+
+ {{infoobj.nickName == undefined ?'--' : infoobj.nickName}}
+
+
+ {{infoobj.phonenumber == undefined ? '--' :infoobj.phonenumber}}
+
-
- {{infoobj.phonenumber == undefined ? '--' :infoobj.phonenumber}}
+
+ 当前角色:合作伙伴
+
+
+ 当前角色:渠道商
+
+
+ 当前角色:创业者
+
+
+ 当前角色:经营场所
@@ -468,7 +482,7 @@
.my{
display: flex;
align-items: center;
- margin-top: 20rpx;
+ // margin-top: 20rpx;
.mylt{
margin-right: 34rpx;
.myname{
diff --git a/page_user/mydetail.vue b/page_user/mydetail.vue
index 4ef1001..0bb79b0 100644
--- a/page_user/mydetail.vue
+++ b/page_user/mydetail.vue
@@ -40,9 +40,6 @@
设备编号:{{detailobj.deviceNo == undefined ? '--' : detailobj.deviceNo}}
-
@@ -188,8 +185,7 @@
}
})
} else if (res.cancel) {
- console.log('用户点击取消');
- // 执行取消后的逻辑
+ console.log('用户点击取消')
}
}
})
@@ -207,10 +203,9 @@
let expireTimeParts = expireTimeStr.split(" ")
let expireDateParts = expireTimeParts[0].split("-")
let expireTimePartsTime = expireTimeParts[1].split(":")
- let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[
- 2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
+ let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
let now = new Date()
- let differenceInMs = expireDate - now;
+ let differenceInMs = expireDate - now
if (differenceInMs <= 0) {
this.timeday = 0
} else {
diff --git a/page_user/orderdetail.vue b/page_user/orderdetail.vue
index 70d6fe2..95cef00 100644
--- a/page_user/orderdetail.vue
+++ b/page_user/orderdetail.vue
@@ -60,23 +60,23 @@
使用中
- 直属代理
+ 直属合作伙伴
{{obj.agentName == undefined ? '--' : obj.agentName}}({{obj.agentMobile == undefined ? '--' : obj.agentMobile}})
- 直属业务员
+ 直属渠道商
{{obj.bizName == undefined ? '--' : obj.bizName}}({{obj.bizMobile == undefined ? '--' : obj.bizMobile}})
- 投资人
+ 创业者
{{obj.investorName == undefined ? '--' : obj.investorName}}({{obj.investorMobile == undefined ? '--' : obj.investorMobile}})
- 比例明细
+ 收益明细
- {{item.arrivalName}}(平台公司代理商业务员投资人经营场所){{item.point}}%
-
+ {{item.arrivalName == undefined ? '--' : item.arrivalName}}(平台公司合作伙伴商渠道商创业者经营场所){{item.point}}%
+ ¥{{item.amount == undefined ? '--' : item.amount}}
- 代理信息
+ 合作伙伴信息
{{item.agentName}}({{item.agentMobile}})
@@ -101,7 +101,7 @@
},
onLoad() {
let today = new Date()
- this.firsTime = this.formatDate(today)
+ this.firsTime = this.formatDates(today)
this.lasTime = this.formatDate(today)
this.getlist()
},
@@ -186,6 +186,12 @@
let day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
},
+ formatDates(date) {
+ let year = date.getFullYear()
+ let month = String(date.getMonth()).padStart(2, '0')
+ let day = String(date.getDate()).padStart(2, '0')
+ return `${year}-${month}-${day}`
+ },
// 查询订单
getlist(){
diff --git a/page_user/promote.vue b/page_user/promote.vue
index 54e6202..145841c 100644
--- a/page_user/promote.vue
+++ b/page_user/promote.vue
@@ -10,7 +10,7 @@
角色:{{txt}}
推广人:{{obj.userName == undefined ? '' : obj.userName}}
- 投资人:{{obj.investorName == undefined ? '' : obj.investorName}}
+ 创业者:{{obj.investorName == undefined ? '' : obj.investorName}}
可支配分成比例:{{obj.point == undefined ? '' : obj.point}}%
@@ -110,11 +110,11 @@
if(res.data.userType == 5){
this.txt = '经营场所'
}else if(res.data.userType == 4){
- this.txt = '投资人'
+ this.txt = '创业者'
}else if(res.data.userType == 3){
- this.txt = '业务员'
+ this.txt = '渠道商'
}else if(res.data.userType == 2){
- this.txt = '代理'
+ this.txt = '合作伙伴'
}
}
})
diff --git a/page_user/touzi.vue b/page_user/touzi.vue
index f7f8dc9..60e886e 100644
--- a/page_user/touzi.vue
+++ b/page_user/touzi.vue
@@ -1,6 +1,6 @@
-
@@ -92,7 +92,7 @@
}
},
methods: {
- // 代理
+ // 合作伙伴
getlist(){
this.$u.get(`/agent/user/investorList?pageNum=${this.pagenum}&pageSize=${this.pagesize}&type=${this.type}&keyword=${this.keyword}`).then(res => {
if(res.code == 200){
diff --git a/page_user/touzixq.vue b/page_user/touzixq.vue
index 8169be3..18a804a 100644
--- a/page_user/touzixq.vue
+++ b/page_user/touzixq.vue
@@ -1,17 +1,17 @@
-
{{obj.userName == undefined ? '--' : obj.userName}}
- 直属代理:
+ 直属合作伙伴:
{{obj.agentName == undefined ? '--' : obj.agentName}}
- 业务员:
+ 渠道商:
{{obj.referenceName == undefined ? '--' : obj.referenceName}}
diff --git a/page_user/tuiguang.vue b/page_user/tuiguang.vue
index bfc41ef..e77ccd1 100644
--- a/page_user/tuiguang.vue
+++ b/page_user/tuiguang.vue
@@ -4,16 +4,16 @@
title-size='36' height='44'>
-
+
-
+
-
+
-
+
diff --git a/page_user/yewuyuan.vue b/page_user/yewuyuan.vue
index 904fd4f..0c0ac7b 100644
--- a/page_user/yewuyuan.vue
+++ b/page_user/yewuyuan.vue
@@ -1,6 +1,6 @@
-
@@ -22,7 +22,7 @@
- 投资人
+ 创业者
{{item.investorCount == undefined ? '--' : item.investorCount}}
@@ -103,7 +103,7 @@
}
},
methods: {
- // 代理
+ // 合作伙伴
getlist(){
this.$u.get(`/agent/user/bizList?pageNum=${this.pagenum}&pageSize=${this.pagesize}&keyword=${this.keyword}`).then(res => {
if(res.code == 200){
diff --git a/page_user/yewuyuanxq.vue b/page_user/yewuyuanxq.vue
index 28408e9..5cbf4de 100644
--- a/page_user/yewuyuanxq.vue
+++ b/page_user/yewuyuanxq.vue
@@ -1,6 +1,6 @@
-
@@ -8,14 +8,14 @@
推广人:
- {{obj.referenceName == undefined ? '--' : obj.referenceName}}(代理业务员投资人经营场所)
+ {{obj.referenceName == undefined ? '--' : obj.referenceName}}(合作伙伴渠道商创业者经营场所)
- 直属代理:
+ 直属合作伙伴:
{{obj.agentName == undefined ? '--' : obj.agentName}}
- 推广业务员:
+ 推广渠道商:
{{obj.bizManCount == undefined ? '--' : obj.bizManCount}}人
@@ -37,7 +37,7 @@
{{obj.createTime == undefined ? '--' : obj.createTime}}
- 投资人:
+ 创业者:
{{obj.investorCount == undefined ? '--' : obj.investorCount}}人
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 36a83e5..e4625ad 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -7,7 +7,9 @@
+ :show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange" />
+
@@ -17,17 +19,12 @@
您有正在使用中的设备...
-
-
-
-
+
+
{{item.deviceName}}
-
@@ -91,9 +88,9 @@
推广用户角色:
- 代理商
- 业务员
- 投资人
+ 合作伙伴商
+ 渠道商
+ 创业者
场所负责人
@@ -141,7 +138,7 @@
longitude: '', // 初始经度
covers: [], // 覆盖物数组
jinweidu: '',
- userType: '',
+ userType: 1,
isMch: false,
imgad: [],
listmap: [],
@@ -171,7 +168,9 @@
storeId: '',
dianpulist: [],
shows: false,
- xztxt: '点击选择'
+ xztxt: '点击选择',
+ clickPosition: null, // 存储点击位置的像素坐标
+ iconflag: false
};
},
onLoad(option) {
@@ -233,7 +232,6 @@
this.networkInterval = null
}
},
-
methods: {
// 获取所有本人店铺
getdianpu() {
@@ -265,6 +263,8 @@
this.shows = true
}
},
+
+
// 点击成为推广人
tocz() {
// 判断是否为经营场所
@@ -350,7 +350,7 @@
uni.navigateTo({
url: '/pages/webview?url=' + item.url
})
- } else {
+ } else {
uni.navigateTo({
url: '/' + item.url
})
@@ -386,8 +386,7 @@
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`)
let results = regex.exec(url);
- return results ? decodeURIComponent(results[1].replace(/\+/g,
- ' ')) : null
+ return results ? decodeURIComponent(results[1].replace(/\+/g,' ')) : null
}
let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue)
@@ -402,7 +401,8 @@
}
that.$u.get(`/app/device/isBind?deviceNo=${id}`).then(res => {
if (res.data == 2) {
- that.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
+ that.$u.get(`/app/device/${id}/withSuitList`).then(
+ (res) => {
if (res.code == 200) {
uni.navigateTo({
url: '/page_user/fuwu?id=' + id
@@ -517,63 +517,47 @@
onControltap(control) {
this.setMapScale()
},
- // 点击地图查询点击地方的店铺
- onMapTap(e){
- this.jinweidu = e.detail.longitude + ',' + e.detail.latitude
- this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
- res => {
- if (res.code == 200) {
- this.listmap = res.data
- res.data.forEach(item => {
- // if (item.deviceCount !== null && item.deviceCount > 0) {
- const shopCover = {
- id: parseFloat(item.storeId),
- latitude: item.lat,
- longitude: item.lng,
- width: 25,
- height: 30,
- iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
- // iconPath:item.picture
- label: {
- content: item.name,
- anchorX: (() => {
- if (item.name.length <= 2) {
- return -12
- } else if (item.name.length <=
- 3) {
- return -20
- } else if (item.name.length <=
- 4) {
- return -25
- } else if (item.name.length <=
- 5) {
- return -30
- } else if (item.name.length <=
- 6) {
- return -35
- } else if (item.name.length <=
- 8) {
- return -40
- } else if (item.name.length <=
- 10) {
- return -45
- } else {
- return -item.name.length *
- 6
- }
- })(),
- fontWeight: 700,
- color: '#8883F0',
- borderColor: '#fff',
- borderRadius: 5,
- bgColor: '#fff'
+ // 查询拖动到指定为止的店铺
+ regionchange(e) {
+ this.iconflag = true
+ if (e.type == 'end') {
+ this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude
+ this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => {
+ if (res.code == 200) {
+ this.covers = []
+ this.listmap = res.data
+ this.listmap.forEach(item => {
+ // if (item.deviceCount !== null && item.deviceCount > 0) {
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
+ // iconPath:item.picture
+ label: {
+ content: item.name,
+ anchorX: this.calculateAnchorX(item.name),
+ fontWeight: 700,
+ color: '#8883F0',
+ borderColor: '#fff',
+ borderRadius: 5,
+ bgColor: '#fff'
+ }
}
- }
- this.covers.push(shopCover)
- // }
- })
- }
- })
+ this.covers.push(shopCover)
+ // console.log(this.covers);
+ // }
+ })
+ }
+ })
+ setTimeout(()=>{
+ this.iconflag = false
+ },500)
+ } else {
+ // this.iconflag = false
+ }
},
// 地图回正
async setMapScale(e, val) {
@@ -622,32 +606,7 @@
// iconPath:item.picture
label: {
content: item.name,
- anchorX: (() => {
- if (item.name.length <= 2) {
- return -12
- } else if (item.name.length <=
- 3) {
- return -20
- } else if (item.name.length <=
- 4) {
- return -25
- } else if (item.name.length <=
- 5) {
- return -30
- } else if (item.name.length <=
- 6) {
- return -35
- } else if (item.name.length <=
- 8) {
- return -40
- } else if (item.name.length <=
- 10) {
- return -45
- } else {
- return -item.name.length *
- 6
- }
- })(),
+ anchorX: this.calculateAnchorX(item.name),
fontWeight: 700,
color: '#8883F0',
borderColor: '#fff',
@@ -743,7 +702,7 @@
uni.setStorageSync('userType', res.data)
this.userType = res.data.type
this.deviceCount = res.data.deviceCount
- } else {
+ } else if(res.code == 401){
this.jmlogin()
}
})
@@ -786,12 +745,6 @@
}
})
},
-
- // tocz() {
- // uni.navigateTo({
- // url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
- // })
- // },
},
mounted() {
this.getMyLocation() // 获取并设置自身位置的覆盖物
@@ -1254,6 +1207,16 @@
margin: auto;
// border-radius: 30rpx;
overflow: hidden;
+ position: relative;
+
+ .picimg {
+ width: 80rpx;
+ height: 100rpx;
+ position: absolute;
+ left: 50%;
+ transform: translateX(-50%);
+ top: 50%;
+ }
}
.tubiao {
diff --git a/pages/myorder/index.vue b/pages/myorder/index.vue
index 76e57c7..8d54446 100644
--- a/pages/myorder/index.vue
+++ b/pages/myorder/index.vue
@@ -4,7 +4,9 @@
title-size='44' height='44'>
+ :show-location="true" :markers="covers" :scale="mapScale" @regionchange="regionchange"/>
+
-
@@ -23,20 +26,21 @@
- {{item.address}}
+ {{item.address}}
经营时间:{{item.businessTimeStart}}-{{item.businessTimeEnd}}可使用:{{item.deviceCount}}
-
+
{{String(item.distance).split('.')[0]}}m
-
-
+
+
该区域暂无店铺...
@@ -55,12 +59,13 @@
isMch: false,
gxlist: [],
bgc: {
- background:'linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%)'
+ background: 'linear-gradient(to right, #FFEFEF 20%, #D9F6FF 100%)'
},
mapScale: 15,
mapContext: null,
mapScaleInterval: null,
listmap: [],
+ iconflag: false
}
},
onLoad() {
@@ -74,21 +79,21 @@
this.mapScaleInterval = setInterval(this.updateMarkers, 1000)
},
// 分享到好友(会话)
- onShareAppMessage: function () {
- return {
- title: '创亿康',
- path: '/pages/index/index'
- }
- },
-
- // 分享到朋友圈
- onShareTimeline: function () {
- return {
- title: '创亿康',
- query: '',
- path: '/pages/index/index'
- }
- },
+ onShareAppMessage: function() {
+ return {
+ title: '创亿康',
+ path: '/pages/index/index'
+ }
+ },
+
+ // 分享到朋友圈
+ onShareTimeline: function() {
+ return {
+ title: '创亿康',
+ query: '',
+ path: '/pages/index/index'
+ }
+ },
beforeDestroy() {
// 在组件卸载前清除定时器
if (this.mapScaleInterval) {
@@ -98,72 +103,51 @@
},
methods: {
// 点击地图查询点击地方的店铺
- onMapTap(e){
- this.gxlist = []
- this.jinweidu = e.detail.longitude + ',' + e.detail.latitude
- // 请求附近的店铺
- this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
- response => {
- if (response.code == 200) {
- this.listmap = response.data
- let gxlist = response.data
- gxlist.forEach(item => {
- // if (item.deviceCount !== null && item.deviceCount > 0) {
- // 计算距离
- const distance = this.getDistance(this.latitude, this.longitude, item.lat, item.lng)
- // 将距离添加到店铺对象中
- item.distance = distance
- // 创建店铺覆盖物对象
- const shopCover = {
- id: parseFloat(item.storeId),
- latitude: item.lat,
- longitude: item.lng,
- width: 25,
- height: 30,
- iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
- distance: distance, // 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
- label: {
- content: item.name,
- anchorX: (() => {
- if (item.name.length <= 2) {
- return -12
- } else if (item.name.length <=
- 3) {
- return -20
- } else if (item.name.length <=
- 4) {
- return -25
- } else if (item.name.length <=
- 5) {
- return -30
- } else if (item.name.length <=
- 6) {
- return -35
- } else if (item.name.length <=
- 8) {
- return -40
- } else if (item.name.length <=
- 10) {
- return -45
- } else {
- return -item.name.length *
- 5
- }
- })(),
- fontWeight: 700,
- color: '#8883F0',
- textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
- borderRadius:5,
- bgColor: '#fff'
- }
- }
- this.covers.push(shopCover)
- this.gxlist.push(item)
- // }
-
- })
- }
- })
+ regionchange(e) {
+ if (e.type == 'end') {
+ // this.gxlist = []
+ this.jinweidu = e.detail.centerLocation.longitude + ',' + e.detail.centerLocation.latitude
+ this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(
+ res => {
+ if (res.code == 200) {
+ this.gxlist = res.data
+ this.covers = []
+ this.listmap = res.data
+ res.data.forEach(item => {
+ const distance = this.getDistance(this.latitude, this.longitude, item.lat, item.lng)
+ // 将距离添加到店铺对象中
+ item.distance = distance
+ // if (item.deviceCount !== null && item.deviceCount > 0) {
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
+ distance:distance,
+ // iconPath:item.picture
+ label: {
+ content: item.name,
+ anchorX: this.calculateAnchorX(item.name),
+ fontWeight: 700,
+ color: '#8883F0',
+ borderColor: '#fff',
+ borderRadius: 5,
+ bgColor: '#fff'
+ }
+ }
+ this.covers.push(shopCover)
+ // }
+ })
+ }
+ })
+ setTimeout(() => {
+ this.iconflag = false
+ }, 500)
+ } else {
+ this.iconflag = true
+ }
},
updateMarkers() {
this.mapContext.getScale({
@@ -184,17 +168,17 @@
addMarkersWithoutLabels() {
this.listmap.forEach((item) => {
// if (item.deviceCount !== null && item.deviceCount > 0) {
- const shopCover = {
- id: parseFloat(item.storeId),
- latitude: item.lat,
- longitude: item.lng,
- width: 25,
- height: 30,
- iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
- borderRadius:5,
- bgColor: '#fff'
- }
- this.covers.push(shopCover)
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
+ borderRadius: 5,
+ bgColor: '#fff'
+ }
+ this.covers.push(shopCover)
// }
})
@@ -202,24 +186,24 @@
addMarkersWithLabels() {
this.listmap.forEach((item) => {
// if (item.deviceCount !== null && item.deviceCount > 0) {
- const shopCover = {
- id: parseFloat(item.storeId),
- latitude: item.lat,
- longitude: item.lng,
- width: 25,
- height: 30,
- iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
- label: {
- content: item.name,
- anchorX: this.calculateAnchorX(item.name),
- fontWeight: 700,
- color: '#8883F0',
- textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
- borderRadius:5,
- bgColor: '#fff'
- }
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
+ label: {
+ content: item.name,
+ anchorX: this.calculateAnchorX(item.name),
+ fontWeight: 700,
+ color: '#8883F0',
+ textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
+ borderRadius: 5,
+ bgColor: '#fff'
}
- this.covers.push(shopCover)
+ }
+ this.covers.push(shopCover)
// }
})
@@ -300,56 +284,32 @@
let gxlist = response.data
gxlist.forEach(item => {
// if (item.deviceCount !== null && item.deviceCount > 0) {
- // 计算距离
- const distance = this.getDistance(this.latitude, this.longitude, item.lat, item.lng)
- // 将距离添加到店铺对象中
- item.distance = distance
- // 创建店铺覆盖物对象
- const shopCover = {
- id: parseFloat(item.storeId),
- latitude: item.lat,
- longitude: item.lng,
- width: 25,
- height: 30,
- iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
- distance: distance, // 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
- label: {
- content: item.name,
- anchorX: (() => {
- if (item.name.length <= 2) {
- return -12
- } else if (item.name.length <=
- 3) {
- return -20
- } else if (item.name.length <=
- 4) {
- return -25
- } else if (item.name.length <=
- 5) {
- return -30
- } else if (item.name.length <=
- 6) {
- return -35
- } else if (item.name.length <=
- 8) {
- return -40
- } else if (item.name.length <=
- 10) {
- return -45
- } else {
- return -item.name.length *
- 5
- }
- })(),
- fontWeight: 700,
- color: '#8883F0',
- textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
- borderRadius:5,
- bgColor: '#fff'
- }
+ // 计算距离
+ const distance = this.getDistance(this.latitude, this
+ .longitude, item.lat, item.lng)
+ // 将距离添加到店铺对象中
+ item.distance = distance
+ // 创建店铺覆盖物对象
+ const shopCover = {
+ id: parseFloat(item.storeId),
+ latitude: item.lat,
+ longitude: item.lng,
+ width: 25,
+ height: 30,
+ iconPath: 'https://api.ccttiot.com/smartmeter/img/static/u0yXGqCqoDjuK4QPJHZY',
+ distance: distance, // 可以在这里也添加距离到覆盖物对象中,但通常只需要在店铺对象中
+ label: {
+ content: item.name,
+ anchorX:this.calculateAnchorX(item.name),
+ fontWeight: 700,
+ color: '#8883F0',
+ textShadow: '2px 2px 0px white, -2px -2px 0px white, 2px -2px 0px white, -2px 2px 0px white',
+ borderRadius: 5,
+ bgColor: '#fff'
}
- this.covers.push(shopCover)
- this.gxlist.push(item)
+ }
+ this.covers.push(shopCover)
+ this.gxlist.push(item)
// }
})
@@ -370,7 +330,8 @@
const phi2 = lat2 * Math.PI / 180
const deltaPhi = (lat2 - lat1) * Math.PI / 180
const deltaLambda = (lon2 - lon1) * Math.PI / 180
- const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) + Math.cos(phi1) * Math.cos(phi2) * Math.sin(deltaLambda / 2) * Math.sin(deltaLambda / 2)
+ const a = Math.sin(deltaPhi / 2) * Math.sin(deltaPhi / 2) + Math.cos(phi1) * Math.cos(phi2) * Math.sin(
+ deltaLambda / 2) * Math.sin(deltaLambda / 2)
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
const distance = R * c
return distance
@@ -436,6 +397,7 @@
position: fixed;
top: 0;
left: 0;
+
.dtxs {
width: 100%;
height: 100vh;
@@ -443,6 +405,14 @@
top: 0;
left: 0;
z-index: -1;
+ .picimg {
+ width: 80rpx;
+ height: 100rpx;
+ position: absolute;
+ left: 50%;
+ transform: translateX(-50%);
+ top: 50%;
+ }
}
.listbox {
@@ -456,6 +426,7 @@
height: 40vh;
overflow-y: scroll;
padding-bottom: 400rpx;
+
.moshi {
position: absolute;
bottom: 48vh;