wenliming hace 2 años
padre
commit
185ac7be96
Se han modificado 2 ficheros con 6 adiciones y 5 borrados
  1. 2 2
      pages/treasure/index.vue
  2. 4 3
      pages/treasure/invite.vue

+ 2 - 2
pages/treasure/index.vue

@@ -144,6 +144,7 @@ export default {
 		this.getConfig();
 	},
 	mounted() {
+		this.setTreasureInfo();
 		setTimeout(() => {
 			this.checkInstall()
 				.then(() => {
@@ -156,7 +157,6 @@ export default {
 				})
 				.catch(() => {
 					this.isLoading = false;
-					this.setTreasureInfo();
 				});
 		}, 1000);
 		this.checkBrowser();
@@ -279,7 +279,7 @@ export default {
 			let treasureInfo = {
 				createTime: Date.now(),
 				jump_type: 'treasure_info',
-				postId: this.detail.srcContentId || '',
+				srcContentId: this.detail.srcContentId || '',
 				postNickName: this.detail.postUserInfo.nickName,
 			};
 			Cookies.set('jump_info', JSON.stringify(treasureInfo), { expires: 100 });

+ 4 - 3
pages/treasure/invite.vue

@@ -149,18 +149,19 @@ export default {
 	},
 	mounted() {
 		Cookies.set(this.detail.postId, JSON.stringify({ inviteCode: this.$route.params.id }), { expires: 100 });
+		this.setTreasureInfo();
+
 		setTimeout(() => {
 			this.checkInstall()
 				.then(() => {
+					console.log(this.detail);
 					if (this.detail.repostSrcContentId && this.detail.inviteUserInfo && this.detail.inviteUserInfo.nickName) {
 						let url = `https://twitter.com/${this.detail.inviteUserInfo.nickName}/status/${this.detail.repostSrcContentId}`;
 						window.location.replace(url);
 					}
 					this.isLoading = false;
 				})
-				.catch(() => {
-					this.setTreasureInfo();
-				});
+				.catch(() => {});
 		}, 1000);
 		this.checkBrowser();