2022-07-30 08:05:50 +00:00
|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<image class="width100" src="/static/icon/welcome-img.jpg" mode="widthFix"></image>
|
|
|
|
<view class="fon60 bold mar-s50 mar-x50 tcenter" style="color: #010101;">洛河民意通</view>
|
|
|
|
<view class="fon30 col6 tcenter" style="max-width: 560rpx;margin: 0 auto;">
|
|
|
|
我是说明文案我是说明文案我是说明文案我是说明文案我是说明文案我是说明文案
|
|
|
|
</view>
|
|
|
|
<view class="disjcac mar-s120">
|
|
|
|
<view class="disjcac enter-btn posir" @tap="goLogin">
|
|
|
|
进入
|
|
|
|
</view>
|
|
|
|
<!-- <view class="disjcac enter-btn posir">
|
|
|
|
进入
|
|
|
|
<button :disabled="ifFlag" @click="bindGetUserInfo" class="posia syxzo">立即授权</button>
|
|
|
|
</view> -->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
userInfo:'',
|
2022-07-31 04:01:43 +00:00
|
|
|
ifFlag:true
|
2022-07-30 08:05:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 前往登录页
|
|
|
|
goLogin(){
|
2022-07-31 04:01:43 +00:00
|
|
|
// 前往群众对应的列表页
|
|
|
|
// uni.reLaunch({
|
|
|
|
// url:'/pagesA/my-opinion-list/my-opinion-list'
|
|
|
|
// })
|
|
|
|
// 前往社区对应的列表页
|
|
|
|
// uni.reLaunch({
|
|
|
|
// url:'/pagesA/community/opinion-handle/opinion-handle'
|
|
|
|
// })
|
|
|
|
// 前往管理员对应的列表页
|
|
|
|
// uni.reLaunch({
|
|
|
|
// url:'/pagesA/manager/examine-list/examine-list'
|
|
|
|
// })
|
|
|
|
if(this.ifFlag){
|
|
|
|
this.ifFlag = false;
|
|
|
|
uni.login({
|
|
|
|
provider: 'weixin',
|
|
|
|
success: (rescode)=> {
|
|
|
|
this.updateUserInfo(rescode.code);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
this.$toolAll.tools.showToast('正在检查是否已授权','none',10000);
|
|
|
|
}
|
2022-07-30 08:05:50 +00:00
|
|
|
},
|
|
|
|
//调用登录接口
|
|
|
|
updateUserInfo(code) {
|
|
|
|
var params = {
|
2022-07-31 02:40:15 +00:00
|
|
|
code:code
|
2022-07-30 08:05:50 +00:00
|
|
|
}
|
|
|
|
this.$requst.post('user/login',params).then(res => {
|
2022-07-31 02:40:15 +00:00
|
|
|
uni.hideToast();
|
2022-07-31 02:48:36 +00:00
|
|
|
if(res.data.token!=''){
|
2022-07-31 04:01:43 +00:00
|
|
|
this.$toolAll.tools.showToast('已授权');
|
2022-07-31 02:40:15 +00:00
|
|
|
let dataObj = res.data;
|
|
|
|
uni.setStorageSync('token',dataObj.token);
|
2022-07-31 04:01:43 +00:00
|
|
|
|
2022-07-31 02:40:15 +00:00
|
|
|
this.$toolAll.tools.showToast('登录成功');
|
|
|
|
setTimeout(()=>{
|
|
|
|
if(dataObj.utype=='def'){
|
|
|
|
// 前往群众对应的列表页
|
|
|
|
uni.reLaunch({
|
|
|
|
url:'/pagesA/my-opinion-list/my-opinion-list'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(dataObj.utype=='community_worker'){
|
|
|
|
// 前往社区对应的列表页
|
|
|
|
uni.reLaunch({
|
|
|
|
url:'/pagesA/community/opinion-handle/opinion-handle'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if(dataObj.utype=='app_manager'){
|
|
|
|
// 前往管理员对应的列表页
|
|
|
|
uni.reLaunch({
|
|
|
|
url:'/pagesA/manager/examine-list/examine-list'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},500)
|
|
|
|
} else {
|
|
|
|
// 前往授权登录
|
|
|
|
uni.navigateTo({
|
|
|
|
url:'/pagesA/login/login'
|
|
|
|
})
|
2022-07-30 08:05:50 +00:00
|
|
|
}
|
|
|
|
},error => {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<style>
|
|
|
|
.enter-btn{
|
|
|
|
width: 480rpx;padding: 20rpx 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
</style>
|