Ver Fonte

Merge branch 'dev_1.1.7_lint' into feature_220809_treasure_report

wenliming há 2 anos atrás
pai
commit
0969728445
3 ficheiros alterados com 26 adições e 7 exclusões
  1. 22 3
      components/MobileLandPage.vue
  2. 2 2
      pages/index.vue
  3. 2 2
      pages/luckdraw.vue

+ 22 - 3
components/MobileLandPage.vue

@@ -231,7 +231,7 @@ export default {
 				this.twitterAuth();
 				this.twitterAuth();
 			}
 			}
 		},
 		},
-		cancelLogin() {
+		goCoursePage() {
 			location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}&nftProjectId=${this.nftProjectId}&srcContentId=${this.srcContentId}`;
 			location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}&nftProjectId=${this.nftProjectId}&srcContentId=${this.srcContentId}`;
 		},
 		},
 		async twitterAuth() {
 		async twitterAuth() {
@@ -245,6 +245,7 @@ export default {
 				if (code == 0) {
 				if (code == 0) {
 					let url = getOauthUrl(data.authToken);
 					let url = getOauthUrl(data.authToken);
 					this.isLoading = true;
 					this.isLoading = true;
+					setStorage('goto-twitter-login-page', 1);
 					win.location.href = url;
 					win.location.href = url;
 					this.timer.value = setInterval(() => {
 					this.timer.value = setInterval(() => {
 						if (win && win.closed) {
 						if (win && win.closed) {
@@ -253,14 +254,14 @@ export default {
 							if (getStorage(storageKey.backFromTwitterLogin)) {
 							if (getStorage(storageKey.backFromTwitterLogin)) {
 								this.isLoading = false;
 								this.isLoading = false;
 								removeStorage(storageKey.backFromTwitterLogin);
 								removeStorage(storageKey.backFromTwitterLogin);
-								this.cancelLogin();
+								this.goCoursePage();
 							}
 							}
 						}
 						}
 					}, 500);
 					}, 500);
 				} else {
 				} else {
 					Toast('login fail');
 					Toast('login fail');
 					win.close();
 					win.close();
-					this.cancelLogin();
+					this.goCoursePage();
 				}
 				}
 			});
 			});
 		},
 		},
@@ -282,11 +283,29 @@ export default {
 						location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
 						location.href = `/course?useful=${this.useFul ? '1' : '0'}&playType=${this.playType}&rewardType=${this.rewardType}&postId=${this.postId}`;
 					}
 					}
 				});
 				});
+			} else {
+				this.isLoading = false;
 			}
 			}
 		},
 		},
+		visibilityHandle() {
+			document.addEventListener('visibilitychange', function () {
+				var isHidden = document.hidden;
+				if (!isHidden) {
+					const isFromTwitterLoginPage = getStorage('goto-twitter-login-page');
+					if (isFromTwitterLoginPage) {
+						this.isLoading = false;
+						this.goCoursePage();
+					}
+				}
+			});
+		},
+	},
+	mounted() {
+		document.addEventListener('visibilitychange', this.visibilityHandle);
 	},
 	},
 	unmounted() {
 	unmounted() {
 		removeStorage(storageKey.backFromTwitterLogin);
 		removeStorage(storageKey.backFromTwitterLogin);
+		document.removeEventListener('visibilitychange', this.visibilityHandle);
 	},
 	},
 	components: { FontZoom },
 	components: { FontZoom },
 };
 };

+ 2 - 2
pages/index.vue

@@ -92,7 +92,7 @@
 					<custom-card-cover
 					<custom-card-cover
 						:totalCount="detail.postBizData.totalCount"
 						:totalCount="detail.postBizData.totalCount"
 						:amountValue="detail.postBizData.amountValue"
 						:amountValue="detail.postBizData.amountValue"
-						:tokenSymbol="detail.postBizData.tokenSymbol"
+						:tokenSymbol="detail.postBizData.currencySymbol"
 						:currencyIconUrl="detail.postBizData.iconPath"
 						:currencyIconUrl="detail.postBizData.iconPath"
 						:playType="1"
 						:playType="1"
 						:posterType="2"
 						:posterType="2"
@@ -130,7 +130,7 @@
 						<custom-card-cover
 						<custom-card-cover
 							:totalCount="detail.postBizData.totalCount"
 							:totalCount="detail.postBizData.totalCount"
 							:amountValue="detail.postBizData.amountValue"
 							:amountValue="detail.postBizData.amountValue"
-							:tokenSymbol="detail.postBizData.tokenSymbol"
+							:tokenSymbol="detail.postBizData.currencySymbol"
 							:currencyIconUrl="detail.postBizData.iconPath"
 							:currencyIconUrl="detail.postBizData.iconPath"
 							:playType="1"
 							:playType="1"
 							:validity="validity"
 							:validity="validity"

+ 2 - 2
pages/luckdraw.vue

@@ -57,7 +57,7 @@
 									<custom-card-cover
 									<custom-card-cover
 										:totalCount="detail.postBizData.totalCount"
 										:totalCount="detail.postBizData.totalCount"
 										:amountValue="detail.postBizData.amountValue"
 										:amountValue="detail.postBizData.amountValue"
-										:tokenSymbol="detail.postBizData.tokenSymbol"
+										:tokenSymbol="detail.postBizData.currencySymbol"
 										:currencyIconUrl="detail.postBizData.iconPath"
 										:currencyIconUrl="detail.postBizData.iconPath"
 										:playType="2"
 										:playType="2"
 										:posterType="2"
 										:posterType="2"
@@ -101,7 +101,7 @@
 										<custom-card-cover
 										<custom-card-cover
 											:totalCount="detail.postBizData.totalCount"
 											:totalCount="detail.postBizData.totalCount"
 											:amountValue="detail.postBizData.amountValue"
 											:amountValue="detail.postBizData.amountValue"
-											:tokenSymbol="detail.postBizData.tokenSymbol"
+											:tokenSymbol="detail.postBizData.currencySymbol"
 											:currencyIconUrl="detail.postBizData.iconPath"
 											:currencyIconUrl="detail.postBizData.iconPath"
 											:playType="2"
 											:playType="2"
 											:validity="validity"
 											:validity="validity"