|
|
|
@ -349,10 +349,10 @@ |
|
|
|
|
...mapMutations(['updateUserItem', 'updateTechnicianItem']), |
|
|
|
|
async initIndex(refresh = false) { |
|
|
|
|
// #ifdef H5 |
|
|
|
|
if (!refresh && this.$jweixin.isWechat()) { |
|
|
|
|
await this.$jweixin.initJssdk(); |
|
|
|
|
this.toAppShare() |
|
|
|
|
} |
|
|
|
|
// if (!refresh && this.$jweixin.isWechat()) { |
|
|
|
|
// await this.$jweixin.initJssdk(); |
|
|
|
|
// this.toAppShare() |
|
|
|
|
// } |
|
|
|
|
// #endif |
|
|
|
|
if (!this.configInfo.id || refresh) { |
|
|
|
|
await this.getConfigInfo() |
|
|
|
@ -470,52 +470,52 @@ |
|
|
|
|
} = this |
|
|
|
|
if (!location.lat) { |
|
|
|
|
// #ifdef H5 |
|
|
|
|
if (this.$jweixin.isWechat()) { |
|
|
|
|
this.$util.showLoading() |
|
|
|
|
// await this.$jweixin.initJssdk(); |
|
|
|
|
await this.$jweixin.wxReady2(); |
|
|
|
|
let { |
|
|
|
|
latitude: lat = 0, |
|
|
|
|
longitude: lng = 0 |
|
|
|
|
} = await this.$jweixin.getWxLocation() |
|
|
|
|
location = { |
|
|
|
|
lng, |
|
|
|
|
lat, |
|
|
|
|
address: '定位失败', |
|
|
|
|
province: '', |
|
|
|
|
city: '', |
|
|
|
|
district: '' |
|
|
|
|
} |
|
|
|
|
if (lat && lng) { |
|
|
|
|
let key = `${lat},${lng}` |
|
|
|
|
let data = await this.$api.base.getMapInfo({ |
|
|
|
|
location: key |
|
|
|
|
}) |
|
|
|
|
let { |
|
|
|
|
status, |
|
|
|
|
result |
|
|
|
|
} = JSON.parse(data) |
|
|
|
|
if (status == 0) { |
|
|
|
|
let { |
|
|
|
|
address, |
|
|
|
|
address_component |
|
|
|
|
} = result |
|
|
|
|
let { |
|
|
|
|
province, |
|
|
|
|
city, |
|
|
|
|
district |
|
|
|
|
} = address_component |
|
|
|
|
location = { |
|
|
|
|
lng, |
|
|
|
|
lat, |
|
|
|
|
address, |
|
|
|
|
province, |
|
|
|
|
city, |
|
|
|
|
district |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if (this.$jweixin.isWechat()) { |
|
|
|
|
// this.$util.showLoading() |
|
|
|
|
// // await this.$jweixin.initJssdk(); |
|
|
|
|
// await this.$jweixin.wxReady2(); |
|
|
|
|
// let { |
|
|
|
|
// latitude: lat = 0, |
|
|
|
|
// longitude: lng = 0 |
|
|
|
|
// } = await this.$jweixin.getWxLocation() |
|
|
|
|
// location = { |
|
|
|
|
// lng, |
|
|
|
|
// lat, |
|
|
|
|
// address: '定位失败', |
|
|
|
|
// province: '', |
|
|
|
|
// city: '', |
|
|
|
|
// district: '' |
|
|
|
|
// } |
|
|
|
|
// if (lat && lng) { |
|
|
|
|
// let key = `${lat},${lng}` |
|
|
|
|
// let data = await this.$api.base.getMapInfo({ |
|
|
|
|
// location: key |
|
|
|
|
// }) |
|
|
|
|
// let { |
|
|
|
|
// status, |
|
|
|
|
// result |
|
|
|
|
// } = JSON.parse(data) |
|
|
|
|
// if (status == 0) { |
|
|
|
|
// let { |
|
|
|
|
// address, |
|
|
|
|
// address_component |
|
|
|
|
// } = result |
|
|
|
|
// let { |
|
|
|
|
// province, |
|
|
|
|
// city, |
|
|
|
|
// district |
|
|
|
|
// } = address_component |
|
|
|
|
// location = { |
|
|
|
|
// lng, |
|
|
|
|
// lat, |
|
|
|
|
// address, |
|
|
|
|
// province, |
|
|
|
|
// city, |
|
|
|
|
// district |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// #endif |
|
|
|
|
// #ifndef H5 |
|
|
|
|
location = await this.$util.getBmapLocation() |
|
|
|
|