فهرست منبع

Merge branch 'dev_1.1.7_lint' of https://git.yishihui.com/DeNet/de-net-official into dev_1.1.7_lint

jihuaqiang 2 سال پیش
والد
کامیت
ed1dbd5674
2فایلهای تغییر یافته به همراه29 افزوده شده و 23 حذف شده
  1. 11 10
      pages/treasure/index.vue
  2. 18 13
      pages/treasure/invite.vue

+ 11 - 10
pages/treasure/index.vue

@@ -80,7 +80,6 @@ export default {
 			isMobile: false,
 			isMobile: false,
 			isChrome: false,
 			isChrome: false,
 			linkHref: '',
 			linkHref: '',
-			metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
 		};
 		};
 	},
 	},
 	components: {
 	components: {
@@ -95,7 +94,7 @@ export default {
 				// facebook
 				// facebook
 				{
 				{
 					name: 'og:title',
 					name: 'og:title',
-					content: this.metaTitle,
+					content: `Treasure Chest: ${this.detail.amountValue} ${this.detail.currencySymbol} (worth $${this.detail.amountUsdValue}) for ${this.detail.totalCount} winners`,
 				},
 				},
 				{
 				{
 					name: 'og:image',
 					name: 'og:image',
@@ -108,7 +107,7 @@ export default {
 				},
 				},
 				{
 				{
 					name: 'twitter:title',
 					name: 'twitter:title',
-					content: this.metaTitle,
+					content: `Treasure Chest: ${this.detail.amountValue} ${this.detail.currencySymbol} (worth $${this.detail.amountUsdValue}) for ${this.detail.totalCount} winners`,
 				},
 				},
 				{
 				{
 					name: 'twitter:image',
 					name: 'twitter:image',
@@ -145,20 +144,22 @@ export default {
 		this.getConfig();
 		this.getConfig();
 	},
 	},
 	mounted() {
 	mounted() {
+		this.setTreasureInfo();
 		setTimeout(() => {
 		setTimeout(() => {
 			this.checkInstall()
 			this.checkInstall()
 				.then(() => {
 				.then(() => {
-					if (this.detail.srcContentId && this.detail.postUserInfo && this.detail.postUserInfo.postNickName) {
-						let url = `https://twitter.com/${this.detail.postUserInfo.postNickName}/status/${this.detail.srcContentId}`;
-						window.open(url);
+					console.log(this.detail);
+					if (this.detail.srcContentId && this.detail.postUserInfo && this.detail.postUserInfo.nickName) {
+						let url = `https://twitter.com/${this.detail.postUserInfo.nickName}/status/${this.detail.srcContentId}`;
+						window.location.replace(url);
 					}
 					}
+					this.isLoading = false;
 				})
 				})
 				.catch(() => {
 				.catch(() => {
-					this.setTreasureInfo();
+					this.isLoading = false;
 				});
 				});
-		}, 600);
+		}, 1000);
 		this.checkBrowser();
 		this.checkBrowser();
-		this.isLoading = false;
 
 
 		var clipboard = new ClipboardJS('.btn');
 		var clipboard = new ClipboardJS('.btn');
 		let that = this;
 		let that = this;
@@ -278,7 +279,7 @@ export default {
 			let treasureInfo = {
 			let treasureInfo = {
 				createTime: Date.now(),
 				createTime: Date.now(),
 				jump_type: 'treasure_info',
 				jump_type: 'treasure_info',
-				postId: this.detail.srcContentId || '',
+				srcContentId: this.detail.srcContentId || '',
 				postNickName: this.detail.postUserInfo.nickName,
 				postNickName: this.detail.postUserInfo.nickName,
 			};
 			};
 			Cookies.set('jump_info', JSON.stringify(treasureInfo), { expires: 100 });
 			Cookies.set('jump_info', JSON.stringify(treasureInfo), { expires: 100 });

+ 18 - 13
pages/treasure/invite.vue

@@ -74,13 +74,16 @@ export default {
 					avatarUrl: '',
 					avatarUrl: '',
 					nickName: '',
 					nickName: '',
 				},
 				},
+				amountValue: '',
+				currencySymbol: '',
+				amountUsdValue: '',
+				totalCount: '',
 			},
 			},
 			config: {},
 			config: {},
 			title: 'Treasure Hunt',
 			title: 'Treasure Hunt',
 			isMobile: false,
 			isMobile: false,
 			isChrome: false,
 			isChrome: false,
 			linkHref: '',
 			linkHref: '',
-			metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
 		};
 		};
 	},
 	},
 	components: {
 	components: {
@@ -95,7 +98,7 @@ export default {
 				// facebook
 				// facebook
 				{
 				{
 					name: 'og:title',
 					name: 'og:title',
-					content: this.metaTitle,
+					content: `Treasure Chest: ${this.detail.amountValue} ${this.detail.currencySymbol} (worth $${this.detail.amountUsdValue}) for ${this.detail.totalCount} winners`,
 				},
 				},
 				{
 				{
 					name: 'og:image',
 					name: 'og:image',
@@ -108,7 +111,7 @@ export default {
 				},
 				},
 				{
 				{
 					name: 'twitter:title',
 					name: 'twitter:title',
-					content: this.metaTitle,
+					content: `Treasure Chest: ${this.detail.amountValue} ${this.detail.currencySymbol} (worth $${this.detail.amountUsdValue}) for ${this.detail.totalCount} winners`,
 				},
 				},
 				{
 				{
 					name: 'twitter:image',
 					name: 'twitter:image',
@@ -146,20 +149,21 @@ export default {
 	},
 	},
 	mounted() {
 	mounted() {
 		Cookies.set(this.detail.postId, JSON.stringify({ inviteCode: this.$route.params.id }), { expires: 100 });
 		Cookies.set(this.detail.postId, JSON.stringify({ inviteCode: this.$route.params.id }), { expires: 100 });
+		this.setTreasureInfo();
+
 		setTimeout(() => {
 		setTimeout(() => {
 			this.checkInstall()
 			this.checkInstall()
 				.then(() => {
 				.then(() => {
-					if (this.detail.srcContentId && this.detail.postUserInfo && this.detail.postUserInfo.postNickName) {
-						let url = `https://twitter.com/${this.detail.postUserInfo.postNickName}/status/${this.detail.srcContentId}`;
-						window.open(url);
+					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();
-				});
-		}, 600);
+				.catch(() => {});
+		}, 1000);
 		this.checkBrowser();
 		this.checkBrowser();
-		this.isLoading = false;
 
 
 		var clipboard = new ClipboardJS('.btn');
 		var clipboard = new ClipboardJS('.btn');
 		let that = this;
 		let that = this;
@@ -205,6 +209,7 @@ export default {
 		checkInstall() {
 		checkInstall() {
 			return new Promise((resolve, reject) => {
 			return new Promise((resolve, reject) => {
 				let dom = document.querySelector('#denet_message');
 				let dom = document.querySelector('#denet_message');
+				console.log('denet_message', dom);
 				if (dom) {
 				if (dom) {
 					resolve(true);
 					resolve(true);
 				} else {
 				} else {
@@ -279,8 +284,8 @@ export default {
 			let treasureInfo = {
 			let treasureInfo = {
 				createTime: Date.now(),
 				createTime: Date.now(),
 				jump_type: 'treasure_info',
 				jump_type: 'treasure_info',
-				srcContentId: this.detail.srcContentId || '',
-				postNickName: this.detail.postUserInfo.nickName,
+				srcContentId: this.detail.repostSrcContentId || '',
+				postNickName: this.detail.inviteUserInfo.nickName,
 			};
 			};
 			Cookies.set('jump_info', JSON.stringify(treasureInfo), { expires: 100 });
 			Cookies.set('jump_info', JSON.stringify(treasureInfo), { expires: 100 });
 		},
 		},