代码拉取完成,页面将自动刷新
<script>
export default {
onLaunch: function() {
console.log('App Launch')
uni.onTabBarMidButtonTap(() => {
this.$goto('/pages/demand/release')
})
this.$store.commit('setToken');
this.$store.commit('userLogin');
this.$store.commit('getVer');
this.$store.commit('getCity');
this.checkIsFirst();
this.getLocation();
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
data() {
return {
address: ''
};
},
methods: {
checkIsFirst() {
let isFirst = uni.getStorageSync('isFirst') || ''
if (isFirst) {
} else {
this.$goto('/pages/activity/firstguide')
}
},
getLocation() {
uni.getLocation({
type: 'gcj02',
geocode: true,
success: res => {
this.address = res.address
this.$u.get('/city/choose', {
city: res.address.city
}).then(res => {
this.$store.commit('setCity', res.data.result.city)
})
},
fail: res => {
console.log(res)
}
});
}
}
}
</script>
<style lang="scss">
@import "uview-ui/index.scss";
@import "app.scss";
.u-cell {
align-items: center;
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。