wangguoyu 5 hours ago
parent
commit
82b8c6bf35
3 changed files with 42 additions and 8 deletions
  1. 34 1
      pages/Login/clientIndex.vue
  2. 1 1
      pages/client/my/index.vue
  3. 7 6
      pages/kehu/my/my.vue

+ 34 - 1
pages/Login/clientIndex.vue

@@ -63,15 +63,48 @@
 	const openId = ref('');
 	const openId = ref('');
 
 
 	// 新增变量
 	// 新增变量
-	const fromAppShare = ref(true) // 是否来自APP分享
+	const fromAppShare = ref(false) // 是否来自APP分享
 
 
 	const store = useIsCanBack();
 	const store = useIsCanBack();
 
 
 	onLoad((options) => {
 	onLoad((options) => {
+		console.log('options.from',options);
+		if(options.from == 'my'){
+			fromAppShare.value = true
+			return false
+		}
+		console.log('1111111111');
 		if (options.from === 'appcx') {
 		if (options.from === 'appcx') {
 			id.value = options.id
 			id.value = options.id
 			fromPage.value = options.from;
 			fromPage.value = options.from;
 		}
 		}
+		uni.login().then(res1 => {
+			console.log('res2222222', res1);
+			code.value = res1.code
+			httpApi.loginApplet({
+				code: res1.code,
+			}).then(result => {
+				console.log('result2222', result);
+				openId.value = result.data.openId
+				if (result.data.bind) {
+					// 保存用户信息
+					if (result.data.loginVo.type == 4) {
+						cacheManager.set('auth', result.data.loginVo)
+						store.setIsCanBack(false)
+						gotoPage();
+					} else if (result.data.loginVo.type == 6) {
+						cacheManager.set('auth', result.data.loginVo)
+						store.setIsCanBack(false)
+						gotoPage2();
+					} else {
+						toast('登录失败,您的身份有误,请联系管理员。')
+						return
+					}
+				} else {
+					fromAppShare.value = true
+				}
+			})
+		})
 		getAllImg();
 		getAllImg();
 	})
 	})
 
 

+ 1 - 1
pages/client/my/index.vue

@@ -287,7 +287,7 @@
 			toast('退出登录成功')
 			toast('退出登录成功')
 			cacheManager.clearAll();
 			cacheManager.clearAll();
 			uni.reLaunch({
 			uni.reLaunch({
-				url: '/pages/Login/clientIndex'
+				url: '/pages/Login/clientIndex?from=my'
 			});
 			});
 		}).catch(err => {
 		}).catch(err => {
 			toast('退出登录失败,请稍后重试')
 			toast('退出登录失败,请稍后重试')

+ 7 - 6
pages/kehu/my/my.vue

@@ -47,8 +47,8 @@
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 			</view> -->
 			</view> -->
 			<view class="list-row" @click="zhuxiaoLogin">
 			<view class="list-row" @click="zhuxiaoLogin">
-				<icon class="list-icon"
-					:style="{ backgroundImage: 'url(' + myInfoData.imgsArr.yhzxListIcon + ')' }"></icon>
+				<icon class="list-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.yhzxListIcon + ')' }">
+				</icon>
 				<text>用户注销</text>
 				<text>用户注销</text>
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 			</view>
 			</view>
@@ -58,7 +58,7 @@
 				<text>退出登录</text>
 				<text>退出登录</text>
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 				<icon class="jt-icon" :style="{ backgroundImage: 'url(' + myInfoData.imgsArr.jtIcon + ')' }"></icon>
 			</view>
 			</view>
-		
+
 		</view>
 		</view>
 		<!-- 底部区域 -->
 		<!-- 底部区域 -->
 		<customTabbarKehu :currentTab="1"></customTabbarKehu>
 		<customTabbarKehu :currentTab="1"></customTabbarKehu>
@@ -176,17 +176,18 @@
 			toast('退出登录成功')
 			toast('退出登录成功')
 			cacheManager.clearAll();
 			cacheManager.clearAll();
 			uni.reLaunch({
 			uni.reLaunch({
-				url: '/pages/Login/clientIndex'
+				url: '/pages/Login/clientIndex?from=my'
 			});
 			});
 		}).catch(err => {
 		}).catch(err => {
 			toast('退出登录失败,请稍后重试')
 			toast('退出登录失败,请稍后重试')
 		})
 		})
 	}
 	}
-	
+
 	function zhuxiaoLogin() {
 	function zhuxiaoLogin() {
 		zhuxiaoDialogRef.value.handleShow();
 		zhuxiaoDialogRef.value.handleShow();
-	
+
 	}
 	}
+
 	function zhuxiaoBtn() {
 	function zhuxiaoBtn() {
 		yonghuzhuxiao().then(res => {
 		yonghuzhuxiao().then(res => {
 			toast('用户注销成功')
 			toast('用户注销成功')