洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.0 KiB

<script>
export default {
onLaunch: function() {
this.getLocationAuthority()
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
methods: {
getLocationAuthority() {
let _this = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
_this.$store.dispatch('getUserInfo')
},
fail: function(err) {
console.log('为什么失败了')
console.log(err)
uni.showModal({
content: '为了能够获取精确的数据,请去手机设置里手动开启app定位权限',
showCancel: false,
confirmText: '知道了,关闭弹窗',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
});
}
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@import 'common/css/app.scss'
</style>