|
|
|
@ -628,15 +628,9 @@ export default { |
|
|
|
|
wx.setNavigationBarTitle({ |
|
|
|
|
title:"一合知道" |
|
|
|
|
}); |
|
|
|
|
if (!this.$util.getStorage('position')) { |
|
|
|
|
getLocation(() => { |
|
|
|
|
this.$store.commit("app/" + SET_POSITION, '南京'); |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log(res); |
|
|
|
|
this.getPositionAddress(res.lng, res.lat); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$store.commit("app/" + SET_POSITION, this.$util.getStorage('position')); |
|
|
|
|
let platform = uni.getSystemInfoSync().platform; |
|
|
|
|
if (platform !== 'android') { |
|
|
|
|
this.authPosition(); |
|
|
|
|
} |
|
|
|
|
this.getIndexData(); |
|
|
|
|
this.getNewsList(); |
|
|
|
@ -675,6 +669,18 @@ export default { |
|
|
|
|
uni.setStorageSync('showWeixinLogin', 0); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
authPosition() { |
|
|
|
|
if (!this.$util.getStorage('position')) { |
|
|
|
|
getLocation(() => { |
|
|
|
|
this.$store.commit("app/" + SET_POSITION, '南京'); |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log(res); |
|
|
|
|
this.getPositionAddress(res.lng, res.lat); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$store.commit("app/" + SET_POSITION, this.$util.getStorage('position')); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getPositionAddress(longitude, latitude,) { |
|
|
|
|
qqmapsdk.reverseGeocoder({ |
|
|
|
|
location: { |
|
|
|
@ -916,9 +922,14 @@ export default { |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
toPosition() { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: `/pages/index/position?position=${this.currentPosition}`, |
|
|
|
|
}); |
|
|
|
|
let platform = uni.getSystemInfoSync().platform; |
|
|
|
|
if (platform === 'android' && !this.currentPosition) { |
|
|
|
|
this.authPosition(); |
|
|
|
|
} else { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: `/pages/index/position?position=${this.currentPosition}`, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|