Browse Source

微信登录增加隐私协议弹窗

tanxue 4 months ago
parent
commit
840bee90c6
1 changed files with 20 additions and 1 deletions
  1. 20 1
      pages/login/index.vue

+ 20 - 1
pages/login/index.vue

@@ -33,6 +33,7 @@
 		<agree-content-dialog ref="agreeContentDialogRef" :agreeType="agreeType"></agree-content-dialog>
 		<agree-dialog ref="agreeDialogRef" @confirm-btn="confirmBtn"></agree-dialog>
 		<agree-dialog ref="agreeYkDialog" @confirm-btn="ykConfirmBtn"></agree-dialog>
+		<agree-dialog ref="agreeWxDialog" @confirm-btn="wxConfirmBtn"></agree-dialog>
 		<tel-dialog ref="telDialogRef" @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
 	</view>
 </template>
@@ -72,6 +73,7 @@
 	const agreeType = ref(null);
 	const agreeDialogRef = ref(null);
 	const agreeYkDialog = ref(null);
+	const agreeWxDialog = ref(null);
 	const telDialogRef = ref(null);
 	let telDialogFlag = ref(false);
 	let showAppleLogin = ref(false);
@@ -134,6 +136,11 @@
 			url: `/pages/selectGradesTerms/index`
 		})
 	}
+	
+	const wxConfirmBtn= () => {
+		wxLoginFun();
+	}
+	
 	// 手机号校验规则
 	const validatePhoneNumber = (value) => {
 		const phoneRegex = /^1[3-9]\d{9}$/;
@@ -239,7 +246,18 @@
 			}
 		});
 	}
+	
+	
+	// 游客登录
 	const wxLoginClick = () => {
+		if (indexData.isAgreed === true) {
+			wxLoginFun();
+		} else {
+			agreeWxDialog.value.handleShow();
+		}
+	}
+	
+	const wxLoginFun= () => {
 		//获取服务商信息判断手机端是否安装了app
 		// uni.getProvider({
 		// 	service: 'oauth',// oauth  代表授权登录
@@ -255,7 +273,8 @@
 		// 		  }
 		// 	  });
 		//    }
-		// });
+		// });
+		
 		if(plus.runtime.isApplicationExist({ pname: 'com.tencent.mm', action: 'weixin://' })) {
 			console.log('111',"已安装微信");
 		uni.login({