This commit is contained in:
yanran200730
2022-05-24 11:14:29 +08:00
parent 72d814c913
commit e01eb4fe28
15 changed files with 168 additions and 48 deletions

View File

@@ -58,6 +58,7 @@
import Watermark6 from './components/watermark/Watermark6'
import Watermark7 from './components/watermark/Watermark7'
import Watermark8 from './components/watermark/Watermark8'
import { mapActions } from 'vuex'
export default {
name: 'Watermark',
@@ -115,9 +116,17 @@
this.height = uni.getSystemInfoSync().windowHeight
this.getWatermarkList()
this.getLocation()
this.$http.post('/api/appdvcpconfig/apiForward', '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)
})
},
methods: {
...mapActions(['injectJWeixin']),
save () {
this.isHide = true
this.$loading()
@@ -161,6 +170,27 @@
})
},
getLocation () {
this.injectJWeixin(['getLocation']).then(res => {
console.log(res)
wx.getLocation({
type: 'wgs84',
success: function (res) {
var lat = res.latitude
var lng = res.longitude
console.log(lat, lng)
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 => {
console.log(res)
})
},
error: res => {
console.log(res)
}
})
})
},
dataURLtoFile (dataurl, filename) {
let arr = dataurl.split(',')
let mime = arr[0].match(/:(.*?);/)[1]