This commit is contained in:
yanran200730
2023-03-20 16:55:19 +08:00
3 changed files with 34 additions and 31 deletions

View File

@@ -69,6 +69,7 @@ export const user = {
//checkType 1、登录认证 2、居民认证 3、党员认证 //checkType 1、登录认证 2、居民认证 3、党员认证
//判断是否需要校验认证信息 //判断是否需要校验认证信息
let {user: userInfo, token} = rootState let {user: userInfo, token} = rootState
console.log();
if (!checkType) { if (!checkType) {
//如果需要校验认证信息,必定要先验证是否登录 //如果需要校验认证信息,必定要先验证是否登录
uni.navigateTo({url: modulePath}); uni.navigateTo({url: modulePath});
@@ -93,6 +94,19 @@ export const user = {
return uni.showToast({title: "您还不是党员,暂时无法使用该功能", icon: "none"}); return uni.showToast({title: "您还不是党员,暂时无法使用该功能", icon: "none"});
} }
uni.navigateTo({url: modulePath}); uni.navigateTo({url: modulePath});
} else if (checkType == 4) {
if (!token) {
return dispatch('autoLogin').then(() => dispatch('authCheck', { checkType, modulePath }));
}
if (!userInfo.areaId) {
this.$dialog.confirm({
content: '您只有完成信息认证后,才可进行相关操作。',
confirmText: '去认证'
}).then(() => {
uni.switchTab({ url: '/pages/AppMine/userInfo' })
}).catch(() => {
})
}
} }
} }
} }

View File

@@ -118,38 +118,27 @@ export default {
}) })
}, },
handleClick({type, appId, modulePath, url, checkType, corpId}) { handleClick({type, appId, modulePath, url, checkType, corpId}) {
if(this.user.areaId) { //先判读是不是系统应用
//先判读是不是系统应用 if (type != "0") {
if (type != "0") { if (type == "1") {
if (type == "1") { uni.navigateToMiniProgram({appId});
uni.navigateToMiniProgram({appId}); } else if (type == "2") {
} else if (type == "2") { uni.navigateTo({url: "/subPages/h5/webview?link=" + url});
uni.navigateTo({url: "/subPages/h5/webview?link=" + url}); } else if (type == "3") {
} else if (type == "3") { this.$linkTo(url);
this.$linkTo(url); } else if (type == "4") {
} else if (type == "4") { uni.openCustomerServiceChat({
uni.openCustomerServiceChat({ extInfo: {url: url},
extInfo: {url: url}, corpId: corpId,
corpId: corpId, fail: () => {
fail: () => { this.$u.toast('请使用普通微信打开小程序进行咨询');
this.$u.toast('请使用普通微信打开小程序进行咨询'); }
} });
});
}
} else if (type && type == "0") {
uni.showLoading({title: '正在进入应用...'})
this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading())
} }
} else { } else if (type && type == "0") {
this.$dialog.confirm({ uni.showLoading({title: '正在进入应用...'})
content: '您只有完成信息认证后,才可进行相关操作。', this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading())
confirmText: '去认证'
}).then(() => {
uni.switchTab({ url: '/pages/AppMine/userInfo' })
}).catch(() => {
})
} }
}, },
handleBannerClick(index) { handleBannerClick(index) {
if (!this.swiperList[index].linkUrl) return if (!this.swiperList[index].linkUrl) return

View File

@@ -161,7 +161,7 @@ export default {
}, },
getAuth() { getAuth() {
this.$nextTick(() => { this.$nextTick(() => {
this.token && this.getUserInfo() this.token && this.getUserInfo('qujing')
}) })
}, },
onLogout() { onLogout() {