flat: 国庆节暂存
This commit is contained in:
@@ -92,24 +92,18 @@
|
||||
},
|
||||
mounted() {
|
||||
const _this = this
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(res) {
|
||||
const {
|
||||
longitude,
|
||||
latitude
|
||||
} = res
|
||||
_this.latitude = latitude
|
||||
_this.longitude = longitude
|
||||
_this.getList(longitude, latitude).then((covers) => {
|
||||
_this.$refs.uMap.addFeature(covers)
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
_this.$api.msg('无法获得周边信息')
|
||||
},
|
||||
complete: function(e) {}
|
||||
})
|
||||
console.log(this.$store.state.user.userLocation)
|
||||
if (this.$store.state.user.userLocation) {
|
||||
const {
|
||||
latitude,
|
||||
longitude
|
||||
} = this.$store.state.user.userLocation
|
||||
_this.getList(longitude, latitude).then((covers) => {
|
||||
_this.$refs.uMap.addFeature(covers)
|
||||
})
|
||||
} else {
|
||||
_this.$api.msg('无法获得周边信息')
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// const _this = this
|
||||
@@ -144,25 +138,17 @@
|
||||
},
|
||||
search() {
|
||||
const _this = this
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(res) {
|
||||
const {
|
||||
longitude,
|
||||
latitude
|
||||
} = res
|
||||
_this.latitude = latitude
|
||||
_this.longitude = longitude
|
||||
_this.getList(longitude, latitude).then((covers) => {
|
||||
_this.$api.msg('成功获得周边信息')
|
||||
_this.$refs.uMap.addFeature(covers)
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
_this.$api.msg('无法获得周边信息')
|
||||
},
|
||||
complete: function(e) {}
|
||||
})
|
||||
if (this.$store.state.user.userLocation) {
|
||||
const {
|
||||
latitude,
|
||||
longitude
|
||||
} = this.$store.state.user.userLocation
|
||||
_this.getList(longitude, latitude).then((covers) => {
|
||||
_this.$refs.uMap.addFeature(covers)
|
||||
})
|
||||
} else {
|
||||
_this.$api.msg('无法获得周边信息')
|
||||
}
|
||||
// this.getList(this.longitude, this.latitude).then((covers) => {
|
||||
// this.$api.msg('成功获得周边信息')
|
||||
// console.log(covers)
|
||||
|
||||
Reference in New Issue
Block a user