nieyuge 2 years ago
parent
commit
9d57146a73
4 changed files with 243 additions and 6 deletions
  1. 26 0
      src/components/header.vue
  2. 75 3
      src/pages/nft/add.vue
  3. 137 3
      src/pages/nft/list.vue
  4. 5 0
      src/static/report/enum.ts

+ 26 - 0
src/components/header.vue

@@ -21,11 +21,25 @@ import { getOauthUrl, createWindow, callBackUrl } from '../static/utils'
 import { getStorage, removeStorage, setStorage, storageKey } from '../static/utils/storage'
 import { getStorage, removeStorage, setStorage, storageKey } from '../static/utils/storage'
 import { ref } from 'vue'
 import { ref } from 'vue'
 import { ElMessage } from 'element-plus'
 import { ElMessage } from 'element-plus'
+import { Report } from '../static/report'
+import { businessType, pageSource, objectType } from '../static/report/enum'
 
 
 const timer = ref(0)
 const timer = ref(0)
 
 
 const install =  () => {
 const install =  () => {
     window.open(`https://chrome.google.com/webstore/detail/denet/inlfbeejfdgkknpiodhemfcokbdgofja`);
     window.open(`https://chrome.google.com/webstore/detail/denet/inlfbeejfdgkknpiodhemfcokbdgofja`);
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.homePage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: objectType.installDenetButton,
+            }
+        }
+    })
 }
 }
 
 
 const checkInstall = () => {
 const checkInstall = () => {
@@ -51,6 +65,18 @@ const login = () => {
     }).catch(() => {
     }).catch(() => {
         install()
         install()
     })
     })
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.homePage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: objectType.createNftsButton,
+            }
+        }
+    })
 }
 }
 
 
 const twitterAuth = () => {
 const twitterAuth = () => {

+ 75 - 3
src/pages/nft/add.vue

@@ -19,7 +19,7 @@
                         <div
                         <div
                             class="item"
                             class="item"
                             :class="{ on: item.modelName === selectItem.modelName }"
                             :class="{ on: item.modelName === selectItem.modelName }"
-                            @click="select(item)"
+                            @click="select(item, index)"
                             v-for="(item, index) in configList"
                             v-for="(item, index) in configList"
                             :key="index">
                             :key="index">
                             <img :src="item.previewImagePath" alt="" />
                             <img :src="item.previewImagePath" alt="" />
@@ -86,7 +86,7 @@
         </div>
         </div>
     </div>
     </div>
 
 
-    <div class="feedBack">
+    <div class="feedBack" @click="feedback">
         <a href="mailto:service@cybertogether.net">
         <a href="mailto:service@cybertogether.net">
             <div class="mail">
             <div class="mail">
                 <img src="../../static/img/icon-feedback.svg" alt="" />
                 <img src="../../static/img/icon-feedback.svg" alt="" />
@@ -114,6 +114,8 @@ import { ref, onMounted, watchEffect } from 'vue';
 import Api from '../../static/http/api';
 import Api from '../../static/http/api';
 import { postRequest } from '../../static/http';
 import { postRequest } from '../../static/http';
 import { uploadFile } from '../../static/utils/upload'
 import { uploadFile } from '../../static/utils/upload'
+import { Report } from '../../static/report'
+import { businessType, pageSource, objectType } from '../../static/report/enum'
 import currencyList from '../../components/currency-list.vue';
 import currencyList from '../../components/currency-list.vue';
 
 
 const isNext = ref(false);
 const isNext = ref(false);
@@ -130,6 +132,10 @@ const projectDesc = ref('');
 const projectSize = ref('');
 const projectSize = ref('');
 const projectNo = ref('');
 const projectNo = ref('');
 const projectPrice = ref('');
 const projectPrice = ref('');
+const buttonType = {
+    feedback: 'feedback-button',
+    create: 'create-button',
+}
 
 
 const getConfig = () => {
 const getConfig = () => {
     postRequest(Api.createConfig).then(res => {
     postRequest(Api.createConfig).then(res => {
@@ -171,10 +177,50 @@ const next = () => {
     }).finally(() => {
     }).finally(() => {
         showLoading.value = false;
         showLoading.value = false;
     })
     })
+
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.creatorPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.create,
+            }
+        }
+    })
 }
 }
 
 
-const select = (item: any) => {
+const select = (item: any, index: number) => {
     selectItem.value = item;
     selectItem.value = item;
+    let objectType;
+    switch(index) {
+        case 0:
+            objectType = `first-NFT-selection-button`;
+            break;
+        case 1:
+            objectType = `second-NFT-selection-button`;
+            break;
+        case 2:
+            objectType = `third-NFT-selection-button`;
+            break;
+        case 3:
+            objectType = `forth-NFT-selection-button`;
+            break;
+    }
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.creatorPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: objectType,
+            }
+        }
+    })
 }
 }
 
 
 const showCurrencyDialog = () => {
 const showCurrencyDialog = () => {
@@ -209,6 +255,21 @@ const changePrice = (e: any) => {
     projectPrice.value = String(Math.abs(e.target.value))
     projectPrice.value = String(Math.abs(e.target.value))
 }
 }
 
 
+const feedback = () => {
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.feedback,
+            }
+        }
+    })
+}
+
 watchEffect(() => {
 watchEffect(() => {
     // 数量
     // 数量
     let num = projectSize.value;
     let num = projectSize.value;
@@ -238,6 +299,17 @@ watchEffect(() => {
 onMounted(() => {
 onMounted(() => {
     // config
     // config
     getConfig()
     getConfig()
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.creatorPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.pageView,
+            }
+        }
+    })
 })
 })
 </script>
 </script>
 
 

+ 137 - 3
src/pages/nft/list.vue

@@ -67,7 +67,7 @@
     </div>
     </div>
     <div class="bg" v-if="deleteDialog"></div>
     <div class="bg" v-if="deleteDialog"></div>
 
 
-    <div class="feedBack">
+    <div class="feedBack" @click="feedback">
         <a href="mailto:service@cybertogether.net">
         <a href="mailto:service@cybertogether.net">
             <div class="mail">
             <div class="mail">
                 <img src="../../static/img/icon-feedback.svg" alt="" />
                 <img src="../../static/img/icon-feedback.svg" alt="" />
@@ -83,6 +83,8 @@ import { ElMessage } from 'element-plus'
 import Api from '../../static/http/api';
 import Api from '../../static/http/api';
 import { postRequest } from '../../static/http'
 import { postRequest } from '../../static/http'
 import { getStorage, storageKey, removeStorage } from '../../static/utils/storage'
 import { getStorage, storageKey, removeStorage } from '../../static/utils/storage'
+import { Report } from '../../static/report'
+import { businessType, pageSource, objectType } from '../../static/report/enum'
 
 
 const userInfo: any = ref({})
 const userInfo: any = ref({})
 
 
@@ -96,6 +98,15 @@ const deleteDialog = ref(false)
 const pageNum = ref(1)
 const pageNum = ref(1)
 const pageSize = 1000
 const pageSize = 1000
 const pageList = ref([])
 const pageList = ref([])
+const buttonType = {
+    publish: 'publish-button',
+    delete: 'delete-button',
+    unlist: 'unlist-button',
+    view: 'view-button',
+    feedback: 'feedback-button',
+    cancel: 'cancel-button',
+    continue: 'continue-button',
+}
 
 
 const logout = () => {
 const logout = () => {
     removeStorage(storageKey.userInfo)
     removeStorage(storageKey.userInfo)
@@ -109,18 +120,54 @@ const add = () => {
 const remove = (item: any) => {
 const remove = (item: any) => {
     deleteItem.value = JSON.parse(JSON.stringify(item));
     deleteItem.value = JSON.parse(JSON.stringify(item));
     showDeleteLayer()
     showDeleteLayer()
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.delete,
+            }
+        }
+    })
 }
 }
 
 
 const publish = (item: any) => {
 const publish = (item: any) => {
     publishType.value = 1;
     publishType.value = 1;
     publishItem.value = item;
     publishItem.value = item;
     showPublishLayer()
     showPublishLayer()
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.publish,
+            }
+        }
+    })
 }
 }
 
 
 const unpublish = (item: any) => {
 const unpublish = (item: any) => {
     publishType.value = 2;
     publishType.value = 2;
     publishItem.value = item;
     publishItem.value = item;
     showPublishLayer()
     showPublishLayer()
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.unlist,
+            }
+        }
+    })
 }
 }
 
 
 const view = () => {
 const view = () => {
@@ -128,6 +175,33 @@ const view = () => {
     let nickName = userInfo && userInfo.nickName || '';
     let nickName = userInfo && userInfo.nickName || '';
     // open
     // open
     window.open(`https://twitter.com/${nickName}`);
     window.open(`https://twitter.com/${nickName}`);
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.view,
+            }
+        }
+    })
+}
+
+const feedback = () => {
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.buttonClick,
+                objectType: buttonType.feedback,
+            }
+        }
+    })
 }
 }
 
 
 const getList = () => {
 const getList = () => {
@@ -171,6 +245,7 @@ const confirmDeleteLayer = () => {
                 type: 'success',
                 type: 'success',
                 message: 'Delete Success!',
                 message: 'Delete Success!',
             })
             })
+            
         } else {
         } else {
             ElMessage({
             ElMessage({
                 type: 'error',
                 type: 'error',
@@ -181,8 +256,22 @@ const confirmDeleteLayer = () => {
     })
     })
 }
 }
 
 
-const hidePublishLayer = () => {
+const hidePublishLayer = (ifReport = true) => {
     publishDialog.value = false;
     publishDialog.value = false;
+    if (publishType.value === 1 && ifReport) {
+        // Report
+        Report({
+            baseInfo: {
+                pageSource: pageSource.confirmationPage,
+            },
+            params: {
+                eventData: {
+                    businessType: businessType.buttonClick,
+                    objectType: buttonType.cancel,
+                }
+            }
+        })
+    }
 }
 }
 
 
 const showPublishLayer = () => {
 const showPublishLayer = () => {
@@ -211,13 +300,47 @@ const confirmPublishLayer = () => {
                 type: 'success',
                 type: 'success',
                 message: publishType.value === 1 ? 'Published Successfully!' : 'We have listed your NFT collection!',
                 message: publishType.value === 1 ? 'Published Successfully!' : 'We have listed your NFT collection!',
             })
             })
+            if (publishType.value === 1) {
+                // Report
+                Report({
+                    baseInfo: {
+                        pageSource: pageSource.confirmationPage,
+                    },
+                    params: {
+                        eventData: {
+                            businessType: businessType.buttonClick,
+                            objectType: buttonType.continue,
+                        },
+                        extParams: {
+                            Publish: 'success'
+                        }
+                    }
+                })
+            }
         } else {
         } else {
             ElMessage({
             ElMessage({
                 type: 'error',
                 type: 'error',
                 message: msg
                 message: msg
             })
             })
+            if (publishType.value === 1) {
+                // Report
+                Report({
+                    baseInfo: {
+                        pageSource: pageSource.confirmationPage,
+                    },
+                    params: {
+                        eventData: {
+                            businessType: businessType.buttonClick,
+                            objectType: buttonType.continue,
+                        },
+                        extParams: {
+                            Publish: 'fail'
+                        }
+                    }
+                })
+            }
         }
         }
-        hidePublishLayer()
+        hidePublishLayer(false)
     })
     })
 }
 }
 
 
@@ -225,6 +348,17 @@ onMounted(() => {
     userInfo.value = getStorage(storageKey.userInfo);
     userInfo.value = getStorage(storageKey.userInfo);
     // 获取列表
     // 获取列表
     getList()
     getList()
+    // Report
+    Report({
+        baseInfo: {
+            pageSource: pageSource.managerPage,
+        },
+        params: {
+            eventData: {
+                businessType: businessType.pageView,
+            }
+        }
+    })
 })
 })
 </script>
 </script>
 
 

+ 5 - 0
src/static/report/enum.ts

@@ -10,8 +10,13 @@ export const businessType = {
 }
 }
 
 
 export const objectType = {
 export const objectType = {
+    createNftsButton: 'create-nfts-button',
+    installDenetButton: 'install-denet-button',
 }
 }
 
 
 export const pageSource = {
 export const pageSource = {
     homePage: 'denet-web-home-page',
     homePage: 'denet-web-home-page',
+    managerPage: 'denet-nft-manager-page',
+    creatorPage: 'denet-nft-creator-page',
+    confirmationPage: 'denet-nft-manager-publish-confirmation-page',
 }
 }