diff --git a/page_user/ditu.vue b/page_user/ditu.vue index d52d3e6..68dc869 100644 --- a/page_user/ditu.vue +++ b/page_user/ditu.vue @@ -195,6 +195,26 @@ address: this.mapaddress }); }, + async setMapScale(e, val) { + let mapContext = uni.createMapContext('map', this); + let setScale = () => { + return new Promise((resolve, reject) => { + mapContext.getScale({ + success: r => { + resolve() + } + }) + }) + }; + await setScale(); + mapContext.moveToLocation({ + success: (res) => { + const timer = setTimeout(() => { + clearTimeout(timer); + }, 500); + } + }) + }, getMyLocation() { uni.getLocation({ @@ -203,6 +223,7 @@ this.jinweidu = res.longitude + ',' + res.latitude this.latitude = Number(res.latitude.toFixed(5)) - 0.004 this.longitude = Number(res.longitude.toFixed(5)) + 0.004 + this.setMapScale() // 请求附近的店铺 this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => { if (res.code == 200) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 7f07286..34a9e91 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -472,6 +472,7 @@ this.jinweidu = res.longitude + ',' + res.latitude this.latitude = Number(res.latitude.toFixed(5)) - 0.004 this.longitude = Number(res.longitude.toFixed(5)) + 0.004 + this.setMapScale() // 请求附近的店铺 this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then( res => { @@ -860,6 +861,7 @@ image { width: 680rpx; height: 238rpx; + border-radius: 20rpx; } } diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 6f0c135..b6ac6b7 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -196,6 +196,7 @@ this.jinweidu = res.longitude + ',' + res.latitude this.latitude = Number(res.latitude.toFixed(5)) - 0.004 this.longitude = Number(res.longitude.toFixed(5)) + 0.004 + this.setMapScale() // 请求附近的店铺 this.$u.get("/app/store/listNearBy?center=" + this.jinweidu + '&radius=' + 1000).then(res => { if (res.code == 200) { diff --git a/pages/personal/index.vue b/pages/personal/index.vue index 52a7bf0..fa097f1 100644 --- a/pages/personal/index.vue +++ b/pages/personal/index.vue @@ -4,7 +4,7 @@ height='38'> - @@ -27,8 +27,8 @@ - 押金 未充值 + + 押金 未充值 @@ -36,7 +36,8 @@ - 我的订单 + + 我的订单 @@ -44,7 +45,8 @@ - 用户协议 + + 用户协议 @@ -52,7 +54,8 @@ - 隐私政策 + + 隐私政策 @@ -60,7 +63,8 @@ - 关于我们 + + 关于我们 @@ -68,7 +72,8 @@ - 合作加盟 + + 合作加盟 @@ -97,24 +102,24 @@ export default { data() { return { - nickName:'', - tel:'', - imgad:'', - flag:false, - userid:'' + nickName: '', + tel: '', + imgad: '', + flag: false, + userid: '' } }, - onLoad() { - + onLoad() { + }, onShow() { this.nickName = uni.getStorageSync('userdata').nickName this.tel = uni.getStorageSync('userdata').mobile this.userid = uni.getStorageSync('userdata').agentId // console.log(this.userid); - if(this.userid == '' || this.userid == null){ + if (this.userid == '' || this.userid == null) { this.flag = false - }else{ + } else { this.flag = true } this.getad() @@ -136,25 +141,25 @@ uni.navigateTo({ url: '/pages/myorder/index' }) - }else if(num == 0){ + } else if (num == 0) { uni.navigateTo({ - url:'/pages/agentpages/index/index' + url: '/pages/agentpages/index/index' }) - }else if(num == 6){ + } else if (num == 6) { uni.navigateTo({ - url:'/page_user/hezuo/index' + url: '/page_user/hezuo/index' }) - }else if(num == 3){ + } else if (num == 3) { uni.navigateTo({ - url:'/page_user/about?tit=' + '用户协议' + url: '/page_user/about?tit=' + '用户协议' }) - }else if(num == 4){ + } else if (num == 4) { uni.navigateTo({ - url:'/page_user/about?tit=' + '隐私政策' + url: '/page_user/about?tit=' + '隐私政策' }) - }else if(num == 5){ + } else if (num == 5) { uni.navigateTo({ - url:'/page_user/about?tit=' + '关于我们' + url: '/page_user/about?tit=' + '关于我们' }) } } @@ -205,7 +210,8 @@ position: fixed; left: 42rpx; top: 160px; - view{ + + view { background: #7FE3BA; border-radius: 6rpx 6rpx 6rpx 6rpx; margin-right: 10rpx; @@ -351,13 +357,14 @@ } .bdpic { - width: 100%; + width: 680rpx; height: 238rpx; + margin: auto; margin-top: 32rpx; - image { - width: 100%; - height: 100%; + width: 680rpx; + height: 238rpx; + border-radius: 20rpx; } }