ccf пре 4 година
родитељ
комит
3c4eef45d0
3 измењених фајлова са 54 додато и 20 уклоњено
  1. 27 18
      components/header.vue
  2. 2 2
      pages/user/register.vue
  3. 25 0
      plugins/common.js

+ 27 - 18
components/header.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="proginn-header" :class="{ transparent: transparent }" :style="{ position: customPosition }">
     <div class="list">
-      <a :href="baseUrl" class="nav-item">
+      <a :href="baseUrl"  @click="cnzz('导航栏目','logo','')" class="nav-item">
         <img
           class="logo"
           :src="
@@ -11,19 +11,21 @@
           "
         />
       </a>
-      <a :href="baseUrl" class="nav-item">首页</a>
-      <a :href="baseUrl + '/users'" class="nav-item">程序员</a>
+      <a :href="baseUrl" @click="cnzz('导航栏目','首页','')" class="nav-item">首页</a>
+      <a :href="baseUrl + '/users'" @click="cnzz('导航栏目','程序员','')" class="nav-item">程序员</a>
 
       <div class="dropDownArea">
-        <el-button 
+        <el-button
           type="text"
+          @click="cnzz('导航栏目','解决方案','')"
           class="dashboard-title"
           :class="{ on: selectedDropTitle === 0 }"
           @mouseover.native="handleTitleMouseover(0)"
-          @mouseout.native="handleTitleMouseout(0)">工作</el-button>
+          @mouseout.native="handleTitleMouseout(0)">解决方案</el-button>
         <el-button
           type="text"
           class="dashboard-title"
+          @click="cnzz('导航栏目','服务','')"
           :class="{ on: selectedDropTitle === 1 }"
           style="margin-left: 20px !important;"
           @mouseover.native="handleTitleMouseover(1)"
@@ -51,6 +53,7 @@
                 <a
                   class="smallCell"
                   v-for="(small, smallIndex) in big.list"
+                  @click="cnzz('导航栏目',small.title,'')"
                   :href="small.href"
                   :target="small.blank ? '_blank' : ''"
                 >
@@ -85,28 +88,28 @@
 
       <!-- 更多 -->
       <el-dropdown class="more-dropdown" placement="bottom-start">
-        <el-button type="text" class="dashboard-title">更多</el-button>
+        <el-button type="text" @click="cnzz('导航栏目','更多','')" class="dashboard-title">更多</el-button>
         <el-dropdown-menu slot="dropdown">
           <el-dropdown-item>
-            <a class="more-item" :href="kaifainUrl">
+            <a class="more-item" @click="cnzz('导航栏目','开发屋','')" :href="kaifainUrl">
               <img :src="KaifainIcon" alt="" >
               <span>开发屋</span>
             </a>
           </el-dropdown-item>
           <el-dropdown-item>
-            <a class="more-item" :href="jishuBaseUrl">
+            <a class="more-item"  @click="cnzz('导航栏目','技术圈','')" :href="jishuBaseUrl">
               <img :src="JishuinIcon" alt="" >
               <span>技术圈</span>
             </a>
           </el-dropdown-item>
           <el-dropdown-item>
-            <a class="more-item" href="https://unisms.apistd.com/?source=pi.pc.nav" target="_blank">
+            <a class="more-item" @click="cnzz('导航栏目','UniSMS','')" href="https://unisms.apistd.com/?source=pi.pc.nav" target="_blank">
               <img src="https://uni-cdn.oss-cn-hangzhou.aliyuncs.com/public/img/unisms-icon.png" alt="" >
               <span>UniSMS (合一短信)</span>
             </a>
           </el-dropdown-item>
           <el-dropdown-item>
-            <a class="more-item" href="https://www.yesdev.cn/" target="_blank">
+            <a class="more-item"  @click="cnzz('导航栏目','YesDev','')"  href="https://www.yesdev.cn/" target="_blank">
               <img :src="YesDevIcon" alt="" >
               <span>YesDev</span>
             </a>
@@ -116,22 +119,22 @@
 
       <template v-if="myInfo.nickname">
         <el-dropdown class="nav-dropdown">
-          <el-button type="text" class="dashboard-title">
+          <el-button type="text" @click="cnzz('导航栏目','工作台','')"  class="dashboard-title">
             <i class="el-icon-tickets"></i>工作台
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item>
-              <a class="workstation" :href="baseUrl + '/wo/work_todo'">
+              <a class="workstation"  @click="cnzz('导航栏目','待办任务','')" :href="baseUrl + '/wo/work_todo'">
                 <i class="el-icon-edit"></i>待办任务
               </a>
             </el-dropdown-item>
             <el-dropdown-item>
-              <a class="workstation" :href="baseUrl + '/wo/work_platform'">
+              <a class="workstation" @click="cnzz('导航栏目','整包项目','')" :href="baseUrl + '/wo/work_platform'">
                 <i class="el-icon-date"></i>整包项目
               </a>
             </el-dropdown-item>
             <el-dropdown-item>
-              <a class="workstation" :href="baseUrl + '/wo/work_hire'">
+              <a class="workstation" @click="cnzz('导航栏目','按月雇佣','')" :href="baseUrl + '/wo/work_hire'">
                 <i class="el-icon-news"></i>按月雇佣
               </a>
             </el-dropdown-item>
@@ -143,7 +146,7 @@
           </el-dropdown-menu>
         </el-dropdown>
         <el-dropdown class="nav-dropdown">
-          <el-button type="text" class="message-box-title">
+          <el-button type="text" @click="cnzz('导航栏目','消息','')" class="message-box-title">
             <i class="el-icon-message"></i>消息
             <span
               v-if="messageCount.total > 0"
@@ -275,20 +278,22 @@
               </a> -->
               <a
                 class="vip-item divider"
+                @click="cnzz('我的','我的主页','')"
                 :href="baseUrl + `/wo/manage_homepage/`"
               >
                 <i class="el-icon-document"></i>我的主页
               </a>
-              <a class="vip-item" :href="baseUrl + '/credit/pages'">
+              <a class="vip-item" @click="cnzz('我的','技术信用','')" :href="baseUrl + '/credit/pages'">
                 <i class="el-icon-credit"></i>技术信用
               </a>
               <a
                 class="vip-item"
+                @click="cnzz('我的','收藏中心','')"
                 :href="baseUrl + '/otherpage/user/collection'"
               >
                 <i class="el-icon-collection"></i>收藏中心
               </a>
-              <a class="vip-item divider" :href="baseUrl + '/index/app'">
+              <a class="vip-item divider" @click="cnzz('我的','APP下载','')" :href="baseUrl + '/index/app'">
                 <i class="el-icon-download-app"></i>APP下载
               </a>
               <a class="vip-item" @click="clickQuit">
@@ -302,13 +307,15 @@
       <div v-else>
         <a
           class="account-ctrl"
+          @click="cnzz('导航栏目','APP下载','')"
           style="margin-right: 40px"
           :href="baseUrl + '/index/app'"
           >APP下载</a
         >
-        <a class="account-ctrl" :href="loginUrl">登录</a>
+        <a class="account-ctrl" @click="cnzz('导航栏目','登录','')" :href="loginUrl">登录</a>
         <a
           class="account-ctrl"
+          @click="cnzz('导航栏目','注册','')"
           style="margin-left: 40px;"
           :href="baseUrl + '/user/register'"
           >注册</a
@@ -434,6 +441,7 @@ export default {
   },
   methods: {
     async clickQuit() {
+      this.cnzz('我的','退出登录','');
       location.href = this.baseUrl + "/user/quit";
     },
     clickMessages(url) {
@@ -448,6 +456,7 @@ export default {
         url = "/user/searchTopic?keyword=" + this.keywork;
       }
       console.log(url);
+      this.cnzz('我的','放大镜搜索','');
       window.location.href = url;
     },
     async getMessageCount() {

+ 2 - 2
pages/user/register.vue

@@ -197,7 +197,7 @@ export default {
      * 点击注册
      */
     doRegist() {
-      this.$pushCNZZ.event("注册","注册点击","");
+      this.cnzz("注册","注册点击","");
       let mobile = this.ruleFormPhone.mobile;
       let register = async body => {
         if (this.isRegistering) {
@@ -218,7 +218,7 @@ export default {
           setTimeout(() => {
             location.href = "/user/success";
           }, 1000);
-          this.$pushCNZZ.event("注册","注册成功","");
+          this.cnzz("注册","注册成功","");
         }
       };
       if (this.usePhone) {

+ 25 - 0
plugins/common.js

@@ -19,11 +19,18 @@ Vue.mixin({
     }, {
       neverLogout: true
     });
+    let home_page_type=0;
     if (res && res.data) {
+      home_page_type=res.data.home_page_type;
+      Cookies.set("home_page_type",home_page_type);
       store.commit('updateUserinfo', {
         userinfo: res.data || {}
       })
     }
+    else
+    {
+      Cookies.set("home_page_type",home_page_type);
+    }
   },
   components: {},
   data() {
@@ -45,6 +52,23 @@ Vue.mixin({
         this.goLogin();
       }
     },
+    async cnzz(category,action,label) {
+      let home_page_type="";
+      if(Cookies.get('home_page_type')==1)
+      {
+        home_page_type="企业方";
+      }
+      if(Cookies.get('home_page_type')==2)
+      {
+        home_page_type="开发者";
+      }
+      else
+      {
+        home_page_type="游客";
+      }
+      label=label+""+home_page_type;
+      this.$pushCNZZ.event(category,action,label);
+    },
     async needLoginQrcode() {
       const userInfo = await this.getUserInfo();
       if (!userInfo || !userInfo.nickname) {
@@ -87,6 +111,7 @@ Vue.mixin({
         );
         res = result.data;
       }
+      console.log("用户登录",res);
       return res;
     },
     goVerify() {