Browse Source

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

jihuaqiang 2 years ago
parent
commit
9a28e51b70

+ 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>

+ 1 - 1
log-center/logEnum.js

@@ -17,7 +17,7 @@ export const objectType = {
 };
 
 export const pageSource = {
-	newUserLandingPage: 'new-user-landing-page',
+	newUserLandingPage: 'pc-landing-page',
 	mobileLandingPage: 'mobile-landing-page',
 	tutorialPage: 'tutorial-page',
 };

+ 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,
 					},
 				},
 			});

+ 54 - 1
pages/toolbox/index.vue

@@ -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 || '',

+ 37 - 40
pages/treasure/index.vue

@@ -42,7 +42,7 @@
 import axios from 'axios';
 import Cookies from 'js-cookie';
 import { Toast } from 'vant';
-import { isBrowser, appVersionCode } from '../../utils/help.js';
+import { isBrowser, appVersionCode, appType } from '../../utils/help.js';
 import Report from '@/log-center/log';
 import MobileLandPage from '@/components/MobileLandPage.vue';
 import { PlayType } from '@/types';
@@ -174,24 +174,23 @@ export default {
 		if (this.isMobile) {
 			this.pageSource = Report.pageSource.mobileLandingPage;
 		}
-		// 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,
-		//             senderId: this.detail.srcUserId,
-		//             redPacketType: 2,
-		//         }
-		//     }
-		// })
+		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: 4,
+				},
+			},
+		});
 	},
 	methods: {
 		clickBtn() {
@@ -199,6 +198,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();
 			}
 		},
@@ -212,27 +229,7 @@ export default {
 				}
 			});
 		},
-		trackingClick() {
-			// 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,
-			//             senderId: this.detail.srcUserId,
-			//             redPacketType: 2,
-			//         }
-			//     }
-			// })
-		},
+		trackingClick() {},
 		guid() {
 			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
 				var r = (Math.random() * 16) | 0,

+ 38 - 40
pages/treasure/invite.vue

@@ -42,7 +42,7 @@
 import axios from 'axios';
 import Cookies from 'js-cookie';
 import { Toast } from 'vant';
-import { isBrowser, appVersionCode } from '../../utils/help.js';
+import { isBrowser, appVersionCode, appType } from '../../utils/help.js';
 import Report from '@/log-center/log';
 import MobileLandPage from '@/components/MobileLandPage.vue';
 import { PlayType } from '@/types';
@@ -180,24 +180,24 @@ export default {
 		if (this.isMobile) {
 			this.pageSource = Report.pageSource.mobileLandingPage;
 		}
-		// 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,
-		//             senderId: this.detail.srcUserId,
-		//             redPacketType: 2,
-		//         }
-		//     }
-		// })
+		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: 4,
+					shareLinkId: window.location.href,
+				},
+			},
+		});
 	},
 	methods: {
 		clickBtn() {
@@ -205,6 +205,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();
 			}
 		},
@@ -219,27 +237,7 @@ export default {
 				}
 			});
 		},
-		trackingClick() {
-			// 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,
-			//             senderId: this.detail.srcUserId,
-			//             redPacketType: 2,
-			//         }
-			//     }
-			// })
-		},
+		trackingClick() {},
 		guid() {
 			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
 				var r = (Math.random() * 16) | 0,