Browse Source

关闭自动获取定位

xiaowang-feature
mk 9 months ago
parent
commit
ddfc7879fa
  1. 33
      src/views/selectAgency/index.vue

33
src/views/selectAgency/index.vue

@ -11,7 +11,7 @@
</div> </div>
</span> </span>
</div> </div>
<van-button type="info" size="small" round class="m-right10" @click="restAddress" v-if="autoFlag">手动选择</van-button> <!-- <van-button type="info" size="small" round class="m-right10" @click="restAddress" v-if="autoFlag">手动选择</van-button> -->
</div> </div>
<div class="search"> <div class="search">
<van-field <van-field
@ -48,7 +48,7 @@ export default {
autoFlag:true, autoFlag:true,
latLng:null, latLng:null,
searchKey:null, searchKey:null,
organizationName:null, organizationName:'',
backNav:false backNav:false
}; };
}, },
@ -57,9 +57,7 @@ export default {
mounted() { mounted() {
setConfig(['checkJsApi', 'openLocation', 'getLocation', 'updateAppMessageShareData', 'updateTimelineShareData']) setConfig(['checkJsApi', 'openLocation', 'getLocation', 'updateAppMessageShareData', 'updateTimelineShareData'])
this.signWX() this.signWX()
if(this.latLng){ this.getNeighborHoodListByName()
this.getAgency()
}
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next((vm) => { next((vm) => {
@ -68,7 +66,6 @@ export default {
} }
}); });
}, },
methods: { methods: {
search(){ search(){
this.organizationName = this.searchKey; this.organizationName = this.searchKey;
@ -93,18 +90,18 @@ export default {
} }
} }
}) })
wx.ready(function () { // wx.ready(function () {
wx.getLocation({ // wx.getLocation({
type: 'gcj02', // wgs84gpsopenLocation'gcj02' // type: 'gcj02', // wgs84gpsopenLocation'gcj02'
success: function (res) { // success: function (res) {
_this.latLng = new qq.maps.LatLng(res.latitude, res.longitude) // _this.latLng = new qq.maps.LatLng(res.latitude, res.longitude)
_this.getAddress() // _this.getAddress()
}, // },
cancel: function (res) { // cancel: function (res) {
alert('用户拒绝授权获取地理位置') // alert('')
} // }
}) // })
}) // })
wx.error(function (res) { wx.error(function (res) {
console.log('微信js-sdk 配置失败000' + res.errMsg) console.log('微信js-sdk 配置失败000' + res.errMsg)
}) })

Loading…
Cancel
Save