diff --git a/src/project/saas/AppCountryAlbum/Watermark.vue b/src/project/saas/AppCountryAlbum/Watermark.vue index 6f0a0f3b..cfca131a 100644 --- a/src/project/saas/AppCountryAlbum/Watermark.vue +++ b/src/project/saas/AppCountryAlbum/Watermark.vue @@ -120,7 +120,7 @@ import Watermark6 from './components/watermark/Watermark6' import Watermark7 from './components/watermark/Watermark7' import Watermark8 from './components/watermark/Watermark8' - import { mapActions } from 'vuex' + import { mapActions, mapState } from 'vuex' export default { name: 'Watermark', @@ -174,7 +174,8 @@ if (this.currIndex < 0 || !this.watermarkList.length) return [] return this.watermarkList[this.currIndex].itemList - } + }, + ...mapState(['wxwork']) }, onLoad (query) { @@ -215,7 +216,7 @@ }, methods: { - ...mapActions(['injectJWeixin']), + ...mapActions(['injectJWeixin', 'agentSign']), toClipping () { uni.navigateTo({ @@ -325,39 +326,44 @@ }, getLocation () { - this.injectJWeixin(['getLocation']).then(() => { - wx.getLocation({ - type: 'wgs84', - success: res => { - var lat = res.latitude - var lng = res.longitude - console.log(res) - alert(JSON.stringify(res)) - this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => { - if (res.code === 0) { - const data = res.data.result - uni.setStorageSync('address', { - lat, - lng, - address: data.address, - cityCode: `${data.ad_info.adcode}` - }) + this.agentSign({ + corpId: this.wxwork.config.corpId, + suiteId: this.wxwork.config.suiteId + }).then(() => { + this.injectJWeixin(['getLocation']).then(() => { + wx.getLocation({ + type: 'wgs84', + success: res => { + var lat = res.latitude + var lng = res.longitude + console.log(res) + alert(JSON.stringify(res)) + this.$http.post('/api/appdvcpconfig/apiForward', `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1`).then(res => { + if (res.code === 0) { + const data = res.data.result + uni.setStorageSync('address', { + lat, + lng, + address: data.address, + cityCode: `${data.ad_info.adcode}` + }) - this.address = { - ...uni.getStorageSync('address') + this.address = { + ...uni.getStorageSync('address') + } + + this.getWeather(`${data.ad_info.adcode}`) } - - this.getWeather(`${data.ad_info.adcode}`) - } - }) - }, - error: res => { - alert(JSON.stringify(res)) - console.log(res) - } + }) + }, + error: res => { + alert(JSON.stringify(res)) + console.log(res) + } + }) + }).catch(e => { + alert(JOSN.stringify(e)) }) - }).catch(e => { - alert(JOSN.stringify(e)) }) },