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

Loading…
Cancel
Save