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