Commit 1cd6ac20 authored by linxin's avatar linxin

add

parent a94f95d6
......@@ -82,14 +82,15 @@ export default {
},
watch: {},
created () {
this.getLocation()
// this.getLocation()
},
beforeRouteEnter (to, from, next) {
next(vm => {
// if (from.name === 'Login') {
vm.moduleSeparateList = [...functionState.moduleSeparateList]
vm.userQuery()
vm.guessingQuery() // 猜你喜欢查询
// vm.guessingQuery() // 猜你喜欢查询
vm.getLocation()
// }
})
......@@ -101,17 +102,21 @@ export default {
let vm = this
if (vum.Platform.isAndroid()) { // 安卓采用jsapi
var geolocation = new BMap.Geolocation()
vm.hlsPopup.showLoading('数据加载中')
geolocation.getCurrentPosition(function (res) {
vm.hlsPopup.hideLoading()
if (this.getStatus() === 0) {
// 判断是否是手动选择过定位
if (window.localStorage.getItem('province')) {
vm.city = window.localStorage.getItem('city')
vm.province = window.localStorage.getItem('province')
vm.guessingQuery(vm.city)
} else {
// 没有就定位当前位置
console.log(res)
vm.city = res.address.city
vm.province = res.address.province
vm.guessingQuery(res.address.city)
}
}
}, {enableHighAccuracy: true})
......@@ -121,13 +126,16 @@ export default {
if (window.localStorage.getItem('province')) {
vm.city = window.localStorage.getItem('city')
vm.province = window.localStorage.getItem('province')
vm.guessingQuery(vm.city)
} else {
vm.city = result.city
vm.province = result.province
vm.guessingQuery(result.city)
}
}, function (error) {
})
}
// setTimeout(vm.guessingQuery(), 0)
},
goFunctionHome (data) {
this.$router.push({
......@@ -169,12 +177,13 @@ export default {
})
},
// 猜你喜欢
guessingQuery () {
guessingQuery (e) {
console.log(e)
let vm = this
let url = $config.basePath + 'guess_you_like_query'
let param = {
'user_phone': window.localStorage.getItem('user_phone'),
'city': vm.city,
'city': e,
}
vm.hlsPopup.showLoading('数据加载中')
vm.$post(url, param).then(function (res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment