Explorar o código

feat:冲突修改

wangxiaogang %!s(int64=3) %!d(string=hai) anos
pai
achega
201c360692

+ 1 - 1
src/jfw/modules/app/src/web/templates/frontRouter/messageCenter/sess/index.html

@@ -31,7 +31,7 @@
               <p class="p2" :class="{'active':isRow && !isToggle}">{lastData.content}</p>
             </div>
           </div>
-          <div class="t-list" @click="msgPriDetailed">
+          <div class="t-list" v-if="isShowEntrance" @click="msgPriDetailed">
             <div class="tips">
               <div class="imgs">
                 <van-badge :class="{'no-active':messageCount <= 0}" :content="messageCount" max="99">

+ 31 - 38
src/jfw/modules/app/src/web/templates/me/customer.html

@@ -38,50 +38,43 @@
 {{include "/big-member/commonjs.html"}}
 <script>
   // 客服地址分流
-    // 重置本地人工客服地址
-    function refreshData (res) {
-      const myDate = new Date()
-      const nowDate =  myDate.getFullYear()+'/'+(myDate.getMonth() + 1)+'/'+myDate.getDate()
-      const params = {
-        lastTime: nowDate,
-        url: res.data.url
-      }
-      localStorage.setItem('getParams', JSON.stringify(params))
-      location.href = params.url
-    }
-    const typeModel = JSON.stringify({
-      type: 'APP'
+    let typeModel = JSON.stringify({
+      type: 'APP',
+      isFind: true
     })
     sessionStorage.removeItem('conversation-login-clear')
-    $.post({
-      url: '/jyapi/social/obtainShunt',
-      contentType: 'application/json',
-      data: typeModel,
-      success: function(res) {
-        console.log(res)
-        if (res && res.error_code === 0) {
-        // isShunt为true,标识要分流,先查本地是否有地址
-        if (res.data.isShunt) {
-          // 判断当前时间是否与缓存时间是同一天,是:取缓存url,不是:取接口url
-          const myDate = new Date()
-          const nowDate =  myDate.getFullYear()+'/'+(myDate.getMonth() + 1)+'/'+myDate.getDate()
-          let getParams = localStorage.getItem('getParams')
-          if (getParams) {
-            getParams = JSON.parse(getParams)
-            if (nowDate === getParams.nowDate ) {
-              location.href = getParams.url
+    function getCustomerUrl () {
+      $.post({
+        url: '/jyapi/social/obtainShunt',
+        contentType: 'application/json',
+        data: typeModel,
+        success: function(res) {
+          if (res && res.error_code === 0) {
+            // 分流
+            if (res.data.isShunt) {
+              if (res.data.url !== '') {
+                if (!res.data.isOld) {
+                  location.href = res.data.url
+                }
+              } else {
+                typeModel = JSON.stringify({
+                  type: 'APP',
+                  isFind: false
+                })
+                getCustomerUrl()
+              }
             } else {
-              refreshData(res)
+              if(res.data.url) {
+                if (!res.data.isOld) {
+                  location.href = res.data.url
+                }
+              }
             }
-          } else {
-            refreshData(res)
           }
-        } else {
-          location.href = res.data.url
         }
-      }
-      }
-    })
+      })
+    }
+    getCustomerUrl()
 </script>
 <script>
     $.get('/jyapp/front/app/sobot?t='+new Date().getTime())

+ 36 - 1
src/web/staticres/common-module/messageCenter/js/index.js

@@ -15,7 +15,8 @@ var vm = new Vue({
         {title: '服务通知', url:'fuwu'},{title: '订阅消息', url:'dingyue'},
         {title: '项目动态', url:'xiangmu'},{title: '企业动态', url:'qiye'},
         {title: '分析报告', url:'fenxi'},{title: '系统通知', url:'xitong'}
-      ]
+      ],
+      isShowEntrance: false // 是否展示私信入口
     }
   },
   created() {
@@ -23,6 +24,7 @@ var vm = new Vue({
     this.lastMsg()
     this.msgData()
     this.getPrivateLetter()
+    this.getShuntUrl()
     let wxType = getType()
     if (!wxType) {
       checkMsgCount(true, 0)
@@ -77,6 +79,39 @@ var vm = new Vue({
         }
       })
     },
+    // 获取分流地址
+    getShuntUrl () {
+      const _this = this
+      let typeAppModel = JSON.stringify({
+        type: 'APP',
+        isFind: true
+      })
+      let typeWxModel = JSON.stringify({
+        type: 'WX',
+        isFind: true
+      })
+      let wxType = getType()
+      $.ajax({
+        type:'POST',
+        contentType: 'application/json',
+        url:'/jyapi/social/obtainShunt',
+        data: wxType ? typeWxModel : typeAppModel,
+        success:function (res) {
+          if (res && res.error_code === 0) {
+            // 分流
+            if (res.data.isShunt) {
+              if (res.data.url !== '') {
+                _this.isShowEntrance = !res.data.isOld
+              } else {
+                _this.isShowEntrance = false
+              }
+            } else {
+              _this.isShowEntrance = false
+            }
+          }
+        }
+      })
+    },
     // 消息列表
     msgData() {
       const _this = this

+ 10 - 1
src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js

@@ -42,7 +42,16 @@ var vm = new Vue({
         data: JSON.stringify({type: 'PC', isFind: true}),
         contentType: 'application/json',
         success: function (res) {
-          _this.shunted = res.data
+          // _this.shunted = res.data
+          if(res.data.isShunt) {
+            if (res.data.url !== '') {
+              _this.shunted = !res.data.isOld
+            } else {
+              _this.shunted = false
+            }
+          } else {
+            _this.shunted = false
+          }
         }
       })
     },

+ 125 - 50
src/web/staticres/public-pc/js/pc-bottom.js

@@ -82,12 +82,82 @@ function kfContact(bool) {
     success: function (res) {
       var kfDatas = JSON.stringify(res.data)
       localStorage.setItem('kf-shunt-data', kfDatas)
-      if (!res.data.url) {
-        kfContact(false)
+      if (res.data.isShunt) {
+        if (!res.data.url) {
+          kfContact(false)
+        } else {
+          if (res.data.isOld) {
+            //智齿
+            /* 客服咨询 */
+            ;(function (w, d, e, x) {
+              w[e] = function () { w.cbk = w.cbk || []; w.cbk.push(arguments); }
+              x = d.createElement('script');
+              x.async = true;
+              x.id = 'zhichiScript';
+              x.className="open-customer";
+              // wxh5、app、pc
+              x.src = 'https://pc-jianyu.sobot.com/chat/frame/v2/entrance.js?sysnum=9d1e3980f91e4b75b8f04e2d206a4c76&t=' + new Date().getTime();
+              d.body.appendChild(x);
+            })(window, document, 'zc');
+  
+            var ajaxUserInfo = {
+              headImage: '',
+              nickName: '默认昵称',
+              userId: '',
+            }
+            function setConfig () {
+              typeof window.getUserInfoCallback === 'function' ? getUserInfoCallback() : null
+              zc("config", {
+                custom:true,
+                auto_expand: false,
+                show_face: 1,
+                partnerid: ajaxUserInfo.userId,
+                face: ajaxUserInfo.headImage,
+                height: '640',
+                async: 0,
+                manual: false
+              })
+              zc("offline_message_count",function(res){
+                // console.log(res, 'offline_message_count')
+                if (res && res.size && res.size > 0) {
+                  var omc = res.size > 99 ? '99+' : res.size
+                  $(".icon-badge-number").attr('data-badge-number', omc)
+                } else {
+                  $(".icon-badge-number").removeAttr('data-badge-number')
+                }
+              })
+              zc("dynamic_ready")
+            }
+            $.post("/jypay/user/getSimpleData?t="+new Date().getTime(),{},function(r) {
+              if (r) {
+                Object.keys(ajaxUserInfo).forEach(function (v) {
+                  if (r[v] && r[v] !== '') {
+                    ajaxUserInfo[v] = r[v]
+                  }
+                })
+                // 存储userId 大会员中标预测历史记录要用到
+                localStorage.setItem('BIGMEMBER_PC', r.userId)
+              }
+              setConfig()
+            }).fail(function () {
+              ajaxUserInfo = {
+                headImage: '',
+                nickName: '默认昵称',
+                userId: '',
+              }
+              setConfig()
+            })
+          } else {
+            //剑鱼
+            window.open(res.data.url)
+          }
+        }
       } else {
-        if (res.data.isOld || res.data.url == 'zcpc') {
-          /* 客服咨询 */
-          ;(function (w, d, e, x) {
+        if(res.data.url) {
+          if (res.data.isOld) {
+            //智齿
+           /* 客服咨询 */
+           ;(function (w, d, e, x) {
             w[e] = function () { w.cbk = w.cbk || []; w.cbk.push(arguments); }
             x = d.createElement('script');
             x.async = true;
@@ -97,54 +167,57 @@ function kfContact(bool) {
             x.src = 'https://pc-jianyu.sobot.com/chat/frame/v2/entrance.js?sysnum=9d1e3980f91e4b75b8f04e2d206a4c76&t=' + new Date().getTime();
             d.body.appendChild(x);
           })(window, document, 'zc');
-
-          var ajaxUserInfo = {
-            headImage: '',
-            nickName: '默认昵称',
-            userId: '',
-          }
-          function setConfig () {
-            typeof window.getUserInfoCallback === 'function' ? getUserInfoCallback() : null
-            zc("config", {
-              custom:true,
-              auto_expand: false,
-              show_face: 1,
-              partnerid: ajaxUserInfo.userId,
-              face: ajaxUserInfo.headImage,
-              height: '640',
-              async: 0,
-              manual: false
-            })
-            zc("offline_message_count",function(res){
-              // console.log(res, 'offline_message_count')
-              if (res && res.size && res.size > 0) {
-                var omc = res.size > 99 ? '99+' : res.size
-                $(".icon-badge-number").attr('data-badge-number', omc)
-              } else {
-                $(".icon-badge-number").removeAttr('data-badge-number')
-              }
-            })
-            zc("dynamic_ready")
-          }
-          $.post("/jypay/user/getSimpleData?t="+new Date().getTime(),{},function(r) {
-            if (r) {
-              Object.keys(ajaxUserInfo).forEach(function (v) {
-                if (r[v] && r[v] !== '') {
-                  ajaxUserInfo[v] = r[v]
-                }
-              })
-              // 存储userId 大会员中标预测历史记录要用到
-              localStorage.setItem('BIGMEMBER_PC', r.userId)
-            }
-            setConfig()
-          }).fail(function () {
-            ajaxUserInfo = {
+            var ajaxUserInfo = {
               headImage: '',
               nickName: '默认昵称',
               userId: '',
             }
-            setConfig()
-          })
+            function setConfig () {
+              typeof window.getUserInfoCallback === 'function' ? getUserInfoCallback() : null
+              zc("config", {
+                custom:true,
+                auto_expand: false,
+                show_face: 1,
+                partnerid: ajaxUserInfo.userId,
+                face: ajaxUserInfo.headImage,
+                height: '640',
+                async: 0,
+                manual: false
+              })
+              zc("offline_message_count",function(res){
+                // console.log(res, 'offline_message_count')
+                if (res && res.size && res.size > 0) {
+                  var omc = res.size > 99 ? '99+' : res.size
+                  $(".icon-badge-number").attr('data-badge-number', omc)
+                } else {
+                  $(".icon-badge-number").removeAttr('data-badge-number')
+                }
+              })
+              zc("dynamic_ready")
+            }
+            $.post("/jypay/user/getSimpleData?t="+new Date().getTime(),{},function(r) {
+              if (r) {
+                Object.keys(ajaxUserInfo).forEach(function (v) {
+                  if (r[v] && r[v] !== '') {
+                    ajaxUserInfo[v] = r[v]
+                  }
+                })
+                // 存储userId 大会员中标预测历史记录要用到
+                localStorage.setItem('BIGMEMBER_PC', r.userId)
+              }
+              setConfig()
+            }).fail(function () {
+              ajaxUserInfo = {
+                headImage: '',
+                nickName: '默认昵称',
+                userId: '',
+              }
+              setConfig()
+            })
+          }else{
+            //剑鱼
+            window.open(res.data.url)
+          }
         }
       }
     }
@@ -152,7 +225,9 @@ function kfContact(bool) {
 }
 $(function () {
   scrollSideIconHide()
-  kfContact(true)
+  $('.help-slide-zx.open-customer').click(function() {
+    kfContact(true)
+  })
 })
 var openCustomDig = false
 window.onmessage = function(e){

+ 31 - 38
src/web/templates/big-member/wx/page_customer.html

@@ -48,50 +48,43 @@
 <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>
 <script>
   // 客服地址分流
-    // 重置本地人工客服地址
-    function refreshData (res) {
-      const myDate = new Date()
-      const nowDate =  myDate.getFullYear()+'/'+(myDate.getMonth() + 1)+'/'+myDate.getDate()
-      const params = {
-        lastTime: nowDate,
-        url: res.data.url
-      }
-      localStorage.setItem('getParams', JSON.stringify(params))
-      location.href = params.url
-    }
-    const typeModel = JSON.stringify({
-      type: 'WX'
+    let typeModel = JSON.stringify({
+      type: 'WX',
+      isFind: true
     })
     sessionStorage.removeItem('conversation-login-clear')
-    $.post({
-      url: '/jyapi/social/obtainShunt',
-      contentType: 'application/json',
-      data: typeModel,
-      success: function(res) {
-        console.log(res)
-        if (res && res.error_code === 0) {
-        // isShunt为true,标识要分流,先查本地是否有地址
-        if (res.data.isShunt) {
-          // 判断当前时间是否与缓存时间是同一天,是:取缓存url,不是:取接口url
-          const myDate = new Date()
-          const nowDate =  myDate.getFullYear()+'/'+(myDate.getMonth() + 1)+'/'+myDate.getDate()
-          let getParams = localStorage.getItem('getParams')
-          if (getParams) {
-            getParams = JSON.parse(getParams)
-            if (nowDate === getParams.nowDate ) {
-              location.href = getParams.url
+    function getCustomerUrl () {
+      $.post({
+        url: '/jyapi/social/obtainShunt',
+        contentType: 'application/json',
+        data: typeModel,
+        success: function(res) {
+          if (res && res.error_code === 0) {
+            // 分流
+            if(res.data.isShunt) {
+              if (res.data.url !== '') {
+                if (!res.data.isOld) {
+                  location.href = res.data.url
+                }
+              } else {
+                typeModel = JSON.stringify({
+                  type: 'WX',
+                  isFind: false
+                })
+                getCustomerUrl()
+              }
             } else {
-              refreshData(res)
+              if(res.data.url) {
+                if (!res.data.isOld) {
+                  location.href = res.data.url
+                }
+              }
             }
-          } else {
-            refreshData(res)
           }
-        } else {
-          location.href = res.data.url
         }
-      }
-      }
-    })
+      })
+    }
+    getCustomerUrl()
 </script>
 <script>
     $.get('/front/wx/sobot?t='+new Date().getTime())

+ 2 - 1
src/web/templates/frontRouter/pc/messageCenter/sess/index.html

@@ -76,7 +76,8 @@
                   ></el-pagination>
                 </div>
               </el-tab-pane>
-              <el-tab-pane v-show="shunted.url && !shunted.isOld">
+              <!-- <el-tab-pane v-show="shunted.url && !shunted.isOld"> -->
+              <el-tab-pane v-show="shunted">
                 <div class="msg-label" slot="label" @click="kfHref">
                   <img src='{{Msg "seo" "cdn"}}/frontRouter/pc/mesgCenter/image/sixin@2x.png?v={{Msg "seo" "version"}}'>
                   <i class="b-item" v-show="kfCount">{kfCount > 99 ? '99+' : kfCount}</i>

+ 1 - 1
src/web/templates/frontRouter/wx/messageCenter/sess/index.html

@@ -39,7 +39,7 @@
               <p class="p2" :class="{'active':isRow && !isToggle}">{lastData.content}</p>
             </div>
           </div>
-          <div class="t-list" @click="msgPriDetailed">
+          <div class="t-list" v-if="isShowEntrance" @click="msgPriDetailed">
             <div class="tips">
               <div class="imgs">
                 <van-badge :class="{'no-active':messageCount <= 0}" :content="messageCount" max="99">