mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
物业小程序支持 巡检定位
Signed-off-by: java110 <928255095@qq.com>
This commit is contained in:
parent
5658df9a7e
commit
a7f9fbe2fb
@ -63,7 +63,13 @@
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
"usingComponents" : true,
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "物业员工巡检需要获取巡检地方位置"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": ["getLocation"]
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
|
||||
@ -53,6 +53,8 @@
|
||||
import uploadImageAsync from "../../components/vc-upload-async/vc-upload-async.vue";
|
||||
import Vue from 'vue'
|
||||
Vue.prototype.$preventClick = preventClick;
|
||||
|
||||
import QQMapWX from '@/lib/qqmap-wx-jssdk.min.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -103,7 +105,20 @@
|
||||
success: (res) => {
|
||||
this.latitude = res.latitude;
|
||||
this.longitude = res.longitude;
|
||||
|
||||
// #ifdef H5
|
||||
|
||||
this.getCurrentLocation();
|
||||
|
||||
// #endiff
|
||||
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
|
||||
this.getMiniWechatLocation();
|
||||
|
||||
// #endif
|
||||
|
||||
}
|
||||
});
|
||||
this.taskDetailId = option.taskDetailId;
|
||||
@ -157,6 +172,48 @@
|
||||
that.titles = _data.data;
|
||||
})
|
||||
},
|
||||
|
||||
getMiniWechatLocation:function(){
|
||||
|
||||
let qqmapsdk = new QQMapWX({
|
||||
|
||||
key:this.mapKey
|
||||
|
||||
});
|
||||
|
||||
qqmapsdk.reverseGeocoder({
|
||||
|
||||
location: {
|
||||
|
||||
latitude: this.latitude,
|
||||
|
||||
longitude: this.longitude
|
||||
|
||||
},
|
||||
|
||||
success:(locaRes)=>{
|
||||
|
||||
//这里能获取到地址相关信息
|
||||
|
||||
console.log(locaRes);
|
||||
|
||||
// this.defaultRegionList.push(locaRes.result.ad_info.province)
|
||||
|
||||
// this.defaultRegionList.push(locaRes.result.ad_info.city)
|
||||
|
||||
this.reverseGeocoderSimplify = locaRes.result.address
|
||||
|
||||
},
|
||||
|
||||
fail:(err)=>{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
// 地址逆解析
|
||||
getCurrentLocation: function(){
|
||||
let locationObj = this.latitude + ',' + this.longitude;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user