From 9ca1892df202a4d037edf5d6d4db1aee6d1932b5 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Thu, 28 Jul 2022 15:20:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../saas/AppCountryAlbum/Watermark.vue | 11 ++++++- .../components/watermark/Watermark7.vue | 29 ------------------- .../components/watermark/Watermark8.vue | 29 ------------------- 3 files changed, 10 insertions(+), 59 deletions(-) diff --git a/src/project/saas/AppCountryAlbum/Watermark.vue b/src/project/saas/AppCountryAlbum/Watermark.vue index 9a3fc670..8659b86d 100644 --- a/src/project/saas/AppCountryAlbum/Watermark.vue +++ b/src/project/saas/AppCountryAlbum/Watermark.vue @@ -182,6 +182,13 @@ this.albumId = query.albumId } + uni.setStorageSync('address', { + lat: '', + lng: '', + address: '', + weather: '', + cityCode: `` + }) this.img = decodeURIComponent(query.url) this.height = uni.getSystemInfoSync().windowHeight @@ -318,7 +325,7 @@ }, getLocation () { - this.injectJWeixin(['getLocation']).then(res => { + this.injectJWeixin(['getLocation']).then(() => { wx.getLocation({ type: 'wgs84', success: res => { @@ -349,6 +356,8 @@ console.log(res) } }) + }).catch(e => { + alert(JOSON.stringify(e)) }) }, diff --git a/src/project/saas/AppCountryAlbum/components/watermark/Watermark7.vue b/src/project/saas/AppCountryAlbum/components/watermark/Watermark7.vue index e4a872b6..a45166d0 100644 --- a/src/project/saas/AppCountryAlbum/components/watermark/Watermark7.vue +++ b/src/project/saas/AppCountryAlbum/components/watermark/Watermark7.vue @@ -101,19 +101,6 @@ uni.$on('change', e => { this.configList = e }) - - this.injectJWeixin(['getLocation']).then(res => { - console.log(res) - wx.getLocation({ - type: 'wgs84', - success: function (res) { - var latitude = res.latitude - var longitude = res.longitude - var speed = res.speed - var accuracy = res.accuracy - } - }); - }) }, destroyed () { @@ -121,22 +108,6 @@ }, methods: { - ...mapActions(['injectJWeixin']), - getLocation () { - uni.getLocation({ - type: 'wgs84', - success: res => { - console.log(res) - this.$http.get('https://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1').then(res => { - console.log(res) - }) - }, - fail: error => { - console.log(error) - } - }) - }, - linkTo (url) { uni.setStorageSync('waterConfig', this.configList) uni.navigateTo({ diff --git a/src/project/saas/AppCountryAlbum/components/watermark/Watermark8.vue b/src/project/saas/AppCountryAlbum/components/watermark/Watermark8.vue index 2013ee1e..b06a64cc 100644 --- a/src/project/saas/AppCountryAlbum/components/watermark/Watermark8.vue +++ b/src/project/saas/AppCountryAlbum/components/watermark/Watermark8.vue @@ -54,19 +54,6 @@ this.day = date.format('DD') this.lunar = `${result.monthStr}${result.dayStr}` this.week = new Date().getDay() - - this.injectJWeixin(['getLocation']).then(res => { - console.log(res) - wx.getLocation({ - type: 'wgs84', - success: function (res) { - var latitude = res.latitude - var longitude = res.longitude - var speed = res.speed - var accuracy = res.accuracy - } - }); - }) }, destroyed () { @@ -74,22 +61,6 @@ }, methods: { - ...mapActions(['injectJWeixin']), - getLocation () { - uni.getLocation({ - type: 'wgs84', - success: res => { - console.log(res) - this.$http.get('https://apis.map.qq.com/ws/geocoder/v1/?location=39.984154,116.307490&key=3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY&get_poi=1').then(res => { - console.log(res) - }) - }, - fail: error => { - console.log(error) - } - }) - }, - linkTo (url) { uni.navigateTo({ url