Ver código fonte

[edit] report

wenliming 2 anos atrás
pai
commit
f011d445d3

+ 24 - 24
components/InstallExtension.vue

@@ -1,32 +1,32 @@
 <template>
-    <div>
-        <img @click="installExtension" src="/svg/icon-install-nft-plugin.svg" />
-    </div>
+	<div>
+		<img @click="installExtension" src="/svg/icon-install-nft-plugin.svg" />
+	</div>
 </template>
 <script>
 export default {
-    name: 'install_chrome',
-    props: {
-        extensionsInstallUrl: {
-            type: String,
-            default: ''
-        } 
-    },
-    data() {
-        return {
-            config: {},
-        }
-    },
-    methods: {
-        installExtension() {
-            window.open(this.extensionsInstallUrl)
-        }
-    }
-}
-
+	name: 'install_chrome',
+	props: {
+		extensionsInstallUrl: {
+			type: String,
+			default: '',
+		},
+	},
+	data() {
+		return {
+			config: {},
+		};
+	},
+	methods: {
+		installExtension() {
+			this.$emit('installClick', {});
+			window.open(this.extensionsInstallUrl);
+		},
+	},
+};
 </script>
 <style lang="scss" scoped>
 img {
-    cursor: pointer;
+	cursor: pointer;
 }
-</style>
+</style>

+ 2 - 0
pages/nft/index.vue

@@ -166,6 +166,7 @@ export default {
 				eventData: {
 					businessType: Report.businessType.pageView,
 					nftProjectId: this.detail.nftProjectId,
+					redPacketType: 2,
 				},
 			},
 		});
@@ -184,6 +185,7 @@ export default {
 						businessType: Report.businessType.buttonClick,
 						objectType: Report.objectType.installButton,
 						nftProjectId: this.detail.nftProjectId,
+						redPacketType: 2,
 					},
 				},
 			});

+ 55 - 2
pages/toolbox/index.vue

@@ -14,7 +14,7 @@
 			<!-- chrome -->
 			<div v-if="device == 'chrome'">
 				<div class="txt">Use chrome browser to access Subway Surfers</div>
-				<install-extension :extensionsInstallUrl="config.extensionsInstallUrl"></install-extension>
+				<install-extension :extensionsInstallUrl="config.extensionsInstallUrl" @installClick="installClick"></install-extension>
 			</div>
 		</div>
 
@@ -35,10 +35,11 @@
 import VLogo from '@/components/logo.vue';
 import InstallChrome from '@/components/InstallChrome.vue';
 import InstallExtension from '@/components/InstallExtension.vue';
-import { getBrowserType, baseURL, appVersionCode, jumpUrl } from '@/utils/help.js';
+import { getBrowserType, baseURL, appVersionCode, jumpUrl, appType } from '@/utils/help.js';
 import axios from 'axios';
 import Cookies from 'js-cookie';
 import { Toast } from 'vant';
+import Report from '@/log-center/log';
 
 var ClipboardJS = require('clipboard');
 
@@ -52,6 +53,8 @@ export default {
 			metaTitle: 'Install DeNet Plugin to Participate',
 			device: '',
 			detail: {},
+			mid: '',
+			pageSource: '',
 		};
 	},
 	head() {
@@ -126,6 +129,26 @@ export default {
 		}
 	},
 	mounted() {
+		this.pageSource = Report.pageSource.newUserLandingPage;
+		this.setCookieMid();
+		Report.reportLog({
+			baseInfo: {
+				appVersionCode: appVersionCode,
+				mid: this.mid,
+				pageSource: this.pageSource,
+				appType,
+				machineCode: this.mid,
+			},
+			params: {
+				eventData: {
+					businessType: Report.businessType.pageView,
+					postId: this.detail.postId,
+					srcContentId: this.detail.srcContentId,
+					redPacketType: 5,
+					postEditorUrl: this.detail.postBizData.convertUrl,
+				},
+			},
+		});
 		this.copy_link = window.location.href;
 		this.device = getBrowserType();
 		this.getConfig();
@@ -136,6 +159,36 @@ export default {
 	},
 
 	methods: {
+		installClick() {
+			Report.reportLog({
+				baseInfo: {
+					appVersionCode: appVersionCode,
+					mid: this.mid,
+					pageSource: this.pageSource,
+					appType,
+					machineCode: this.mid,
+				},
+				params: {
+					eventData: {
+						businessType: Report.businessType.buttonClick,
+						objectType: Report.objectType.installButton,
+						postId: this.detail.postId,
+						srcContentId: this.detail.srcContentId,
+						redPacketType: 5,
+						postEditorUrl: this.detail.postBizData.convertUrl,
+					},
+				},
+			});
+		},
+		setCookieMid() {
+			let _cookie_mid_arr = Cookies.get('mid') || [];
+			if (_cookie_mid_arr.length > 0) {
+				this.mid = JSON.parse(_cookie_mid_arr)[0].mid;
+			} else {
+				this.mid = this.guid();
+				Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 });
+			}
+		},
 		setCookie() {
 			let pickupInfo = {
 				srcContentId: this.detail.srcContentId || '',

+ 19 - 1
pages/treasure/index.vue

@@ -186,7 +186,7 @@ export default {
 					businessType: Report.businessType.pageView,
 					postId: this.detail.postId,
 					srcContentId: this.detail.srcContentId,
-					redPacketType: 5,
+					redPacketType: 4,
 				},
 			},
 		});
@@ -197,6 +197,24 @@ export default {
 				let { extensionsInstallUrl } = this.config;
 				window.open(extensionsInstallUrl);
 			} else {
+				Report.reportLog({
+					baseInfo: {
+						appVersionCode: appVersionCode,
+						mid: this.mid,
+						pageSource: this.pageSource,
+						appType,
+						machineCode: this.mid,
+					},
+					params: {
+						eventData: {
+							businessType: Report.businessType.buttonClick,
+							postId: this.detail.postId,
+							srcContentId: this.detail.srcContentId,
+							redPacketType: 4,
+							shareLinkId: window.location.href,
+						},
+					},
+				});
 				this.installChrome();
 			}
 		},

+ 19 - 1
pages/treasure/invite.vue

@@ -187,7 +187,7 @@ export default {
 					businessType: Report.businessType.pageView,
 					postId: this.detail.postId,
 					srcContentId: this.detail.srcContentId,
-					redPacketType: 5,
+					redPacketType: 4,
 					shareLinkId: window.location.href,
 				},
 			},
@@ -199,6 +199,24 @@ export default {
 				let { extensionsInstallUrl } = this.config;
 				window.open(extensionsInstallUrl);
 			} else {
+				Report.reportLog({
+					baseInfo: {
+						appVersionCode: appVersionCode,
+						mid: this.mid,
+						pageSource: this.pageSource,
+						appType,
+						machineCode: this.mid,
+					},
+					params: {
+						eventData: {
+							businessType: Report.businessType.buttonClick,
+							postId: this.detail.postId,
+							srcContentId: this.detail.srcContentId,
+							redPacketType: 4,
+							shareLinkId: window.location.href,
+						},
+					},
+				});
 				this.installChrome();
 			}
 		},