Просмотр исходного кода

Merge branch '2025北京诚祥-家政版' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025北京诚祥-家政版

tanxue 6 часов назад
Родитель
Сommit
f2273144b4
3 измененных файлов с 51 добавлено и 13 удалено
  1. 43 6
      pages/Login/clientIndex.vue
  2. 1 1
      pages/client/my/index.vue
  3. 7 6
      pages/kehu/my/my.vue

+ 43 - 6
pages/Login/clientIndex.vue

@@ -18,11 +18,12 @@
 							@click="agreeBtn('ystk')" class="agreement-text">《诚祥学隐私政策》</view>,如您同意,请勾选后开始使用
 					</view>
 				</view>
-				<button v-show="isAgreedTuceng" hover-class="none" @click="tucengClick" class="phone-green-btn wechat-auth-btn" type="default">
+				<button v-show="isAgreedTuceng" hover-class="none" @click="tucengClick"
+					class="phone-green-btn wechat-auth-btn" type="default">
 					微信一键登录
 				</button>
-				<button v-show="!isAgreedTuceng" hover-class="none" class="phone-green-btn wechat-auth-btn" type="default" open-type="getPhoneNumber"
-					@getphonenumber="onWechatAuth">
+				<button v-show="!isAgreedTuceng" hover-class="none" class="phone-green-btn wechat-auth-btn"
+					type="default" open-type="getPhoneNumber" @getphonenumber="onWechatAuth">
 					微信一键登录
 				</button>
 				<view class="qtdl-btn"><text class="qtdl-text" @click="handleChangeFangshi">其他登录</text></view>
@@ -63,16 +64,50 @@
 	const openId = ref('');
 
 	// 新增变量
-	const fromAppShare = ref(true) // 是否来自APP分享
+	const fromAppShare = ref(false) // 是否来自APP分享
 
 	const store = useIsCanBack();
 
 	onLoad((options) => {
+		console.log('options.from', options);
+		getAllImg();
+		if (options.from == 'my') {
+			fromAppShare.value = true
+			return false
+		}
+		console.log('1111111111');
 		if (options.from === 'appcx') {
 			id.value = options.id
 			fromPage.value = options.from;
 		}
-		getAllImg();
+		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
+				}
+			})
+		})
+
 	})
 
 	function handleChange() {
@@ -80,12 +115,14 @@
 		isAgreedTuceng.value = !isAgreedTuceng.value
 
 	}
-	function tucengClick (){
+
+	function tucengClick() {
 		if (!isAgreed.value) {
 			toast('请先阅读并同意用户协议和隐私政策')
 			return // 直接返回,不执行后面的授权逻辑
 		}
 	}
+
 	function agreeBtn(code) {
 		if (code === 'yhxy') {
 			uni.navigateTo({

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

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

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

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