Переглянути джерело

fix: 从公众号登录返回页面请求

xuqiaoying 3 роки тому
батько
коміт
9fb8710bfb

+ 0 - 3
pages2/appointment/appointment_success.vue

@@ -82,9 +82,6 @@ export default {
 		};
 	},
 	onLoad(option) {
-		if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
-			return;
-		}
 		this.subscribeId = Number(option.subscribeId);
 		this.getInfo();
 	},

+ 6 - 0
pages2/appointment/index.vue

@@ -111,6 +111,12 @@ export default {
     this.goodsId = Number(option.goodsId);
     this.gradeId = Number(option.gradeId);
     this.orderGoodsId = Number(option.orderGoodsId) || "";
+    
+  },
+  onShow() {
+    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+			return;
+		}
     if (this.applyId) {
       this.getInfo();
     } else {

+ 10 - 7
pages2/exam/exam_appointment.vue

@@ -162,18 +162,23 @@ export default {
 				applySiteEndTime: '',
 				applySiteStartTrainTime: '',
 				applySiteEndTrainTime: ''
-			}
+			},
+			paramCount: '',
 		};
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
+		option.current && (this.paramCount = option.current)
+	},
+	onShow() {
+		console.log('111111',this.paramCount)
 		if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
 			return;
 		}
-		if (String(option.current)) {
-			console.log('公众号', option)
-			this.current = +option.current
-			this.change(+option.current)
+		if (String(this.paramCount)) {
+			console.log('公众号', this.paramCount)
+			this.current = +this.paramCount
+			this.change(+this.paramCount)
 			return
 		}
 		this.setSystemTime()
@@ -182,8 +187,6 @@ export default {
 				this.listData = res.data.rows;
 			}
 		});
-	},
-	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
 			this.$refs.refMy.init();
 		} */

+ 9 - 6
pages2/exam/exam_result.vue

@@ -154,17 +154,22 @@ export default {
 				applySiteStartTrainTime: '',
 				applySiteEndTrainTime: ''
 			},
+			paramCount: '',
 		};
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
+		option.current && (this.paramCount = option.current)
+	},
+	onShow() {
+		console.log('111111',this.paramCount)
 		if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
 			return;
 		}
-		if (String(option.current)) {
-			console.log('公众号', option)
-			this.current = +option.current
-			this.change(+option.current)
+		if (String(this.paramCount)) {
+			console.log('公众号', this.paramCount)
+			this.current = +this.paramCount
+			this.change(+this.paramCount)
 			return
 		}
 		this.$api.getApplylist().then(res => {
@@ -190,8 +195,6 @@ export default {
 				this.listData = a
 			}
 		});
-	},
-	onShow() {
 		/* if(this.current === 2 && this.$method.isLogin()){
 			this.$refs.refMy.init();
 		} */

+ 5 - 4
pages2/learn/details.vue

@@ -51,16 +51,17 @@ export default {
     };
   },
   onLoad(option) {
-    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
-      return;
-    }
     this.orderGoodsId = option.orderGoodsId || "";
     this.goodsId = Number(option.goodsId);
     this.gradeId = Number(option.gradeId);
+  },
+  onShow() {
+    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+      return;
+    }
     this.getInfo();
     this.orderInfo();
   },
-  onShow() {},
   methods: {
     orderInfo() {
       this.$api