This commit is contained in:
yanran200730
2022-07-28 15:20:02 +08:00
parent a4d13d0fd8
commit 9ca1892df2
3 changed files with 10 additions and 59 deletions

View File

@@ -182,6 +182,13 @@
this.albumId = query.albumId this.albumId = query.albumId
} }
uni.setStorageSync('address', {
lat: '',
lng: '',
address: '',
weather: '',
cityCode: ``
})
this.img = decodeURIComponent(query.url) this.img = decodeURIComponent(query.url)
this.height = uni.getSystemInfoSync().windowHeight this.height = uni.getSystemInfoSync().windowHeight
@@ -318,7 +325,7 @@
}, },
getLocation () { getLocation () {
this.injectJWeixin(['getLocation']).then(res => { this.injectJWeixin(['getLocation']).then(() => {
wx.getLocation({ wx.getLocation({
type: 'wgs84', type: 'wgs84',
success: res => { success: res => {
@@ -349,6 +356,8 @@
console.log(res) console.log(res)
} }
}) })
}).catch(e => {
alert(JOSON.stringify(e))
}) })
}, },

View File

@@ -101,19 +101,6 @@
uni.$on('change', e => { uni.$on('change', e => {
this.configList = 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 () { destroyed () {
@@ -121,22 +108,6 @@
}, },
methods: { 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) { linkTo (url) {
uni.setStorageSync('waterConfig', this.configList) uni.setStorageSync('waterConfig', this.configList)
uni.navigateTo({ uni.navigateTo({

View File

@@ -54,19 +54,6 @@
this.day = date.format('DD') this.day = date.format('DD')
this.lunar = `${result.monthStr}${result.dayStr}` this.lunar = `${result.monthStr}${result.dayStr}`
this.week = new Date().getDay() 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 () { destroyed () {
@@ -74,22 +61,6 @@
}, },
methods: { 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) { linkTo (url) {
uni.navigateTo({ uni.navigateTo({
url url