wangguoyu il y a 4 mois
Parent
commit
3e5a76cd21
3 fichiers modifiés avec 37 ajouts et 22 suppressions
  1. 11 5
      App.vue
  2. 2 2
      manifest.json
  3. 24 15
      pages/login/index.vue

+ 11 - 5
App.vue

@@ -12,15 +12,21 @@
 		onLaunch: function() {
 			if (cacheManager.get('auth')) {
 				uni.reLaunch({
-					url: `/pages/study/index`
+					url: `/pages/study/index`,
+					success() {
+						  plus.navigator.closeSplashscreen();
+					}
 				})
-			}else if(!(cacheManager.get('wxLogin').bind)){
-					console.log('asdfadsfadsfasd')
+			}else if(cacheManager.get('wxLogin') &&!(cacheManager.get('wxLogin').bind)){
+					console.log('微信登录且未绑定')
 				// 微信登录且未绑定 
 			} else {
 				cacheManager.clearAll()
-				uni.redirectTo({
-					url: '/pages/login/index' 
+				uni.reLaunch({
+					url: '/pages/login/index' ,
+					success() {
+						  plus.navigator.closeSplashscreen();
+					}
 				});
 			}
 			

+ 2 - 2
manifest.json

@@ -11,9 +11,9 @@
         "nvueStyleCompiler" : "uni-app",
         "compilerVersion" : 3,
         "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
+            "alwaysShowBeforeRender" : false,
             "waiting" : true,
-            "autoclose" : true,
+            "autoclose" : false,
             "delay" : 0
         },
         "screenOrientation" : [

+ 24 - 15
pages/login/index.vue

@@ -18,8 +18,8 @@
 							:checked="indexData.isAgreed" />
 					</checkbox-group>
 					<view class="agreement-text-box">
-						我已阅读并同意<view class="agreement-text" @click="agreeBtn('yhxy')">《用户协议》</view>和<view @click="agreeBtn('ystk')"
-							class="agreement-text">《隐私政策》</view>
+						我已阅读并同意<view class="agreement-text" @click="agreeBtn('yhxy')">《用户协议》</view>和<view
+							@click="agreeBtn('ystk')" class="agreement-text">《隐私政策》</view>
 					</view>
 				</view>
 				<view class="login-btn" @click="getYzmBtn" :class="indexData.telStatus"></view>
@@ -139,9 +139,9 @@
 	}
 
 	const agreeBtn = (data) => {
-		if(data==='yhxy'){
+		if (data === 'yhxy') {
 			agreeType.value = 'yhxy'
-		}else{
+		} else {
 			agreeType.value = 'ystk'
 		}
 		agreeContentDialogRef.value.handleShow();
@@ -194,7 +194,7 @@
 				let req = {
 					"apple": false,
 					"code": code
-				}
+				}
 				console.log(req);
 				wxLogin(req).then(res => {
 					console.log(res);
@@ -208,16 +208,25 @@
 							telDialogRef.value.getOpenId(res.data.openId);
 						})
 					} else {
-						cacheManager.set('auth', res.data.loginVo)
-						if (res.data.loginVo.cardId == 0) {
-							uni.redirectTo({
-								url: `/pages/selectGradesTerms/index`
-							})
-						} else {
-							uni.redirectTo({
-								url: `/pages/study/index`
-							})
-						}
+						uni.showLoading({
+							title: '登录中'
+						});
+						setTimeout(()=>{
+							cacheManager.set('auth', res.data.loginVo)
+							if (res.data.loginVo.cardId == 0) {
+							
+								uni.redirectTo({
+									url: `/pages/selectGradesTerms/index`
+								})
+									uni.hideLoading();
+							} else {
+							
+								uni.redirectTo({
+									url: `/pages/study/index`
+								})
+									uni.hideLoading();
+							}
+						},1000)	
 					}
 				}).catch((error) => {
 					console.log(error);