Sfoglia il codice sorgente

Merge branch 'feature_220519_facebook_share' of DeNet/de-net-official into master

v1.0.6
wenliming 3 anni fa
parent
commit
492b2845dd
3 ha cambiato i file con 77 aggiunte e 9 eliminazioni
  1. 4 2
      log-center/logEnum.js
  2. 17 0
      pages/facebook/shareCallback.vue
  3. 56 7
      pages/index.vue

+ 4 - 2
log-center/logEnum.js

@@ -9,9 +9,11 @@ export const businessType = {
 }
 }
 
 
 export const objectType = {
 export const objectType = {
-    installButton: "install-button"
+    installButton: "install-button",
+    copyLinkButton: "copy-link-button"
 }
 }
 
 
 export const pageSource = {
 export const pageSource = {
-    newUserLandingPage: "new-user-landing-page"
+    newUserLandingPage: "new-user-landing-page",
+    mobileLandingPage: "mobile-landing-page"
 }
 }

+ 17 - 0
pages/facebook/shareCallback.vue

@@ -0,0 +1,17 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  name: "shareCallback",
+  data() {
+    return {
+    };
+  },
+  mounted() {
+  },
+};
+</script>
+
+<style scoped></style>

+ 56 - 7
pages/index.vue

@@ -199,7 +199,7 @@
 					{{ cp_link }}
 					{{ cp_link }}
 				</div>
 				</div>
 				<div class="area-btn">
 				<div class="area-btn">
-					<div class="btn" :data-clipboard-text="cp_link">Copy Link</div>
+					<div class="btn" :data-clipboard-text="cp_link" @click="copyLinkHandle">Copy Link</div>
 				</div>
 				</div>
 			</div>
 			</div>
 			<div class="layer" v-show="layer_show">
 			<div class="layer" v-show="layer_show">
@@ -238,13 +238,13 @@ const jumpUrl = page[process.env.NUXT_ENV.MODE] + '/'
 const baseURL = api[process.env.NUXT_ENV.MODE]
 const baseURL = api[process.env.NUXT_ENV.MODE]
 const appType = 1;
 const appType = 1;
 
 
-
+let appVersionCode = 6;
 export default {
 export default {
 	name: "index",
 	name: "index",
 	data() {
 	data() {
 		return {
 		return {
 			cp_link: '',
 			cp_link: '',
-			appVersionCode: 3,
+			appVersionCode: appVersionCode,
 			mid: '',
 			mid: '',
 			show_moblie: false,
 			show_moblie: false,
 			show_home: false,
 			show_home: false,
@@ -263,7 +263,7 @@ export default {
 			},
 			},
 			currencyIconPath: '',
 			currencyIconPath: '',
 			title: 'DeNet Giveaway',
 			title: 'DeNet Giveaway',
-			twitterTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
+			metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
 			jumpUrl: jumpUrl,
 			jumpUrl: jumpUrl,
 			status: '',
 			status: '',
 			page_index: 1,
 			page_index: 1,
@@ -285,6 +285,20 @@ export default {
 			title: this.title,
 			title: this.title,
 			appVersionCode: 3,
 			appVersionCode: 3,
 			meta: [
 			meta: [
+				// facebook 
+				{
+					name: 'og:url',
+					content: this.jumpUrl + this.detail.postId
+				},
+				{
+					name: 'og:title',
+					content: this.metaTitle
+				},
+				{
+					name: 'og:image',
+					content: this.detail.postBizData.imagePath || ''
+				},
+				// twitter
 				{
 				{
 					name: 'twitter:card',
 					name: 'twitter:card',
 					content: 'summary_large_image'
 					content: 'summary_large_image'
@@ -295,7 +309,7 @@ export default {
 				},
 				},
 				{
 				{
 					name: 'twitter:title',
 					name: 'twitter:title',
-					content: this.twitterTitle
+					content: this.metaTitle
 				},
 				},
 				{
 				{
 					name: 'twitter:image',
 					name: 'twitter:image',
@@ -305,6 +319,23 @@ export default {
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {
+		copyLinkHandle() {
+			Report.reportLog({
+				baseInfo: {
+					appVersionCode: this.appVersionCode,
+					mid: this.mid,
+					pageSource: Report.pageSource.mobileLandingPage,
+					appType,
+					machineCode: this.mid
+				},
+				params: {
+					eventData: {
+						businessType: Report.businessType.buttonClick,
+						objectType: Report.objectType.copyLinkButton
+					}
+				}
+			})
+		},
 		clickOpenChrome() {
 		clickOpenChrome() {
 			window.open('https://www.google.com/chrome')
 			window.open('https://www.google.com/chrome')
 		},
 		},
@@ -320,7 +351,8 @@ export default {
 					appVersionCode: this.appVersionCode,
 					appVersionCode: this.appVersionCode,
 					mid: this.mid,
 					mid: this.mid,
 					pageSource: Report.pageSource.newUserLandingPage,
 					pageSource: Report.pageSource.newUserLandingPage,
-					appType
+					appType,
+					machineCode: this.mid
 				},
 				},
 				params: {
 				params: {
 					eventData: {
 					eventData: {
@@ -521,6 +553,7 @@ export default {
 		let { route } = params;
 		let { route } = params;
 		let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
 		let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
 			baseInfo: {
 			baseInfo: {
+				appVersionCode: appVersionCode,
 				mid: function () {
 				mid: function () {
 					return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
 					return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
 						var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
 						var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
@@ -573,6 +606,21 @@ export default {
 
 
 		document.documentElement.style.fontSize = '62.5%'
 		document.documentElement.style.fontSize = '62.5%'
 		if (this.isMobile()) {
 		if (this.isMobile()) {
+			this.setCookieMid();
+			Report.reportLog({
+				baseInfo: {
+					appVersionCode: this.appVersionCode,
+					mid: this.mid,
+					pageSource: Report.pageSource.mobileLandingPage,
+					appType,
+					machineCode: this.mid
+				},
+				params: {
+					eventData: {
+						businessType: Report.businessType.pageView
+					}
+				}
+			})
 			this.show_moblie = true
 			this.show_moblie = true
 			this.cp_link = window.location.href
 			this.cp_link = window.location.href
 			// 复制链接
 			// 复制链接
@@ -609,7 +657,8 @@ export default {
 					appVersionCode: this.appVersionCode,
 					appVersionCode: this.appVersionCode,
 					mid: this.mid,
 					mid: this.mid,
 					pageSource: Report.pageSource.newUserLandingPage,
 					pageSource: Report.pageSource.newUserLandingPage,
-					appType
+					appType,
+					machineCode: this.mid
 				},
 				},
 				params: {
 				params: {
 					eventData: {
 					eventData: {