Ver código fonte

Merge branch 'feature/v4.7.13' of http://192.168.3.207:8080/qmx/jy into feature/v4.7.13

tsz 3 anos atrás
pai
commit
9384485c46

+ 14 - 0
src/jfw/front/frontRouter.go

@@ -53,6 +53,10 @@ type CommonRouter struct {
 	//pcweb
 	webIndex  xweb.Mapper `xweb:"/swordfish/page_web_pc/"`
 	webPcPage xweb.Mapper `xweb:"/swordfish/page_web_pc/(.*)"`
+
+	//socialweb
+	socialIndex  xweb.Mapper `xweb:"/swordfish/page_social_pc/"`
+	socialPcPage xweb.Mapper `xweb:"/swordfish/page_social_pc/(.*)"`
 }
 
 func init() {
@@ -110,6 +114,16 @@ func (this *CommonRouter) WebPcPage(page string) error {
 	return this.Render(fmt.Sprintf("/micro/web-pc/index.html"))
 }
 
+// SocialIndex 前端vue页面公共路由
+func (this *CommonRouter) SocialIndex() error {
+	return this.Render(fmt.Sprintf("/micro/social-pc/index.html"))
+}
+
+// SocialPcPage 前端vue页面公共路由
+func (this *CommonRouter) SocialPcPage(page string) error {
+	return this.Render(fmt.Sprintf("/micro/social-pc/index.html"))
+}
+
 //积分
 func (this *CommonRouter) IntegralIndex() error {
 	return this.doIntegralPage()

BIN
src/web/staticres/frontRouter/pc/mesgCenter/image/sixin@2x.png


+ 36 - 13
src/web/staticres/frontRouter/pc/mesgCenter/js/index-pc.js

@@ -7,12 +7,15 @@ var vm = new Vue({
       loading: false,
       activeName: '0',
       counts: [],
+      kfCount: 0,
       isTabs: '',
+      shunted: {},
       imgSrcs: [
-        {type: '0', title: '全部', url:'/images/pc/quanbu@2x.png'},{type: '1', title: '活动优惠', url:'/images/pc/huodong@2x.png'},
-        {type: '2', title: '服务通知', url:'/images/pc/fuwu@2x.png'},{type: '3', title: '订阅消息', url:'/images/pc/dingyue@2x.png'},
-        {type: '4', title: '项目动态', url:'/images/pc/xiangmu@2x.png'},{type: '5', title: '企业动态', url:'/images/pc/qiye@2x.png'},
-        {type: '6', title: '分析报告', url:'/images/pc/fenxi@2x.png'},{type: '7', title: '系统通知', url:'/images/pc/xitong@2x.png'}
+        { type: '0', title: '全部', url: '/images/pc/quanbu@2x.png' }, { type: '1', title: '活动优惠', url: '/images/pc/huodong@2x.png' },
+        { type: '2', title: '服务通知', url: '/images/pc/fuwu@2x.png' }, { type: '3', title: '订阅消息', url: '/images/pc/dingyue@2x.png' },
+        { type: '4', title: '项目动态', url: '/images/pc/xiangmu@2x.png' }, { type: '5', title: '企业动态', url: '/images/pc/qiye@2x.png' },
+        { type: '6', title: '分析报告', url: '/images/pc/fenxi@2x.png' }, { type: '7', title: '系统通知', url: '/images/pc/xitong@2x.png' },
+        { type: '8', title: '私信', url: '/images/pc/sixin@2x.png' }
       ],
       tabsList: {
         lasts: [],
@@ -24,10 +27,30 @@ var vm = new Vue({
     }
   },
   created() {
+    this.shunted = JSON.parse(localStorage.getItem('kf-shunt-data'))
+    console.log(this.shunted)
     this.tabsCount()
     this.tabsData('0')
+    this.kfData()
   },
   methods: {
+    // 私信数量
+    kfData() {
+      $.ajax({
+        type: 'POST',
+        url: '/message/messageCount',
+        data: {},
+        success: function (res) {
+          _this.kfCount = res.data
+        }
+      })
+    },
+    kfHref() {
+      location.href = shunted.url + '&mini=1'
+    },
+    kfClick() {
+      $('.help-slide-zx.open-customer').trigger('click')
+    },
     tabClick(val) {
       this.isTabs = val.name
       this.tabsList.offset = 1
@@ -36,10 +59,10 @@ var vm = new Vue({
     tabsCount() {
       const _this = this
       $.ajax({
-        type:'GET',
-        url:'/jymessageCenter/ClassCount',
+        type: 'GET',
+        url: '/jymessageCenter/ClassCount',
         data: {},
-        success:function (res) {
+        success: function (res) {
           if (res && res.status == 1) {
             _this.counts = res.data
           }
@@ -50,8 +73,8 @@ var vm = new Vue({
       const _this = this
       this.loading = true
       $.ajax({
-        type:'POST',
-        url:'/jymessageCenter/messageList',
+        type: 'POST',
+        url: '/jymessageCenter/messageList',
         data: {
           needFilter: 0,
           msgType: num,
@@ -59,7 +82,7 @@ var vm = new Vue({
           offset: this.tabsList.offset,
           pageSize: this.tabsList.pageSize
         },
-        success:function (res) {
+        success: function (res) {
           setTimeout(() => {
             _this.loading = false
           }, 300)
@@ -80,12 +103,12 @@ var vm = new Vue({
       const _this = this
       $.ajax({
         type: 'POST',
-        url:'/jymessageCenter/markRead',
+        url: '/jymessageCenter/markRead',
         data: {
           msgId: ids,
           msgType: type
         },
-        success:function () {
+        success: function () {
           _this.tabsData(_this.isTabs)
           _this.tabsCount()
           message.checkOpened()
@@ -104,7 +127,7 @@ var vm = new Vue({
           msgLogId: logid,
           platform: '1'
         },
-        success:function () {}
+        success: function () { }
       })
     },
     linked(id, url, str, num, type, msgLogid) {

BIN
src/web/staticres/images/pc/sixin@2x.png


+ 103 - 56
src/web/staticres/public-pc/js/pc-bottom.js

@@ -68,66 +68,103 @@ function scrollSideIconHide(el) {
     }
   })
 }
-$(function () {
-  scrollSideIconHide()
-})
-/* 客服咨询 */
-;(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 getKfDate(res) {
+  var current = new Date(new Date()).toLocaleDateString()
+  console.info(current)
+
 }
-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')
+var kfType = {}
+function kfContact() {
+  /* 客服咨询 */
+  $.post({
+    url: '/jyapi/message/obtainShunt',// 分流
+    type: 'POST',
+    data: JSON.stringify({type: 'PC'}),
+    contentType: 'application/json',
+    success: function (res) {
+      var kfDatas = JSON.stringify({
+        isShunt: res.data.isShunt,
+        url: res.data.url,
+        currentDate: new Date(new Date()).toLocaleDateString()
+      })
+      var getDates = localStorage.getItem('kf-shunt-data')
+      var currents = new Date(new Date()).toLocaleDateString()
+      console.info(getDates, currents)
+      if (getDates) {
+        if (currents !== JSON.parse(getDates).currentDate) {
+          localStorage.setItem('kf-shunt-data', kfDatas)
+        }
+      } else {
+        localStorage.setItem('kf-shunt-data', kfDatas)
+      }
+      kfType = localStorage.getItem('kf-shunt-data')
+      console.info(JSON.parse(kfType).isShunt,JSON.parse(kfType).url)
+      if (JSON.parse(kfType).isShunt && JSON.parse(kfType).url == 'zcpc') {
+        ;(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()
+        })
+      }
     }
   })
-  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()
+$(function () {
+  scrollSideIconHide()
+  kfContact()
 })
 var openCustomDig = false
 window.onmessage = function(e){
@@ -150,6 +187,16 @@ $(window).on('click', function (e) {
   var openDom = $(e.target).hasClass('open-customer') || $(e.target).parents().hasClass('open-customer')
   if (openDom) {
     openCustomDig = true
+    var shunt = JSON.parse(localStorage.getItem('kf-shunt-data'))
+    console.info(shunt)
+    if (!shunt.url && shunt.url !== 'zcpc') {
+      // 登录判断
+      if (!loginflag) {
+        openLoginDig()
+        return
+      }
+      location.href = shunt.url + '&mini=0'
+    }
     $(".icon-badge-number").removeAttr('data-badge-number');
     var href = window.location.href;
     var sourceStr =""

+ 7 - 0
src/web/templates/frontRouter/pc/messageCenter/sess/index.html

@@ -76,6 +76,13 @@
                   ></el-pagination>
                 </div>
               </el-tab-pane>
+              <el-tab-pane v-if="shunted.shunt && shunted.url !== zcpc">
+                <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>
+                  <p class="words">私信</p>
+                </div>
+              </el-tab-pane>
             </el-tabs>
           </div>
         </div>

+ 98 - 0
src/web/templates/micro/social-pc/index.html

@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>剑鱼标讯,全行业招标信息智能推送领导者</title>
+    <meta content="IE=edge,Chrome=1" http-equiv="X-UA-Compatible"/>
+    <meta content="招标订阅,招标项目,中标项目,招标信息,剑鱼标讯" name="Keywords"/>
+    <meta content="使用剑鱼标讯,可以精准匹配招标信息,只需要微信关注剑鱼标讯公众号,然后自行设定所关注的招标关键词和地区,满足订阅需求的招标信息就会在两个小时内自动推送。" name="Description"/>
+    <meta content="webkit" name="renderer">
+    <meta content="telephone=no" name="format-detection"/>
+    <meta content="知识库" theme="light" name="enable-header">
+    {{include "/common/pnc.html"}}
+    <link href='{{Msg "seo" "cdn"}}/css/reset.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/reset_pc.css' rel="stylesheet" type="text/css"/>
+    <link href='{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}' rel="stylesheet"/>
+    <link href='{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}' rel="stylesheet" type="text/css"/>
+    <!-- 高级语法兼容性处理  -->
+    <script>
+        if (String.prototype.startsWith === 'undefined') {
+            String.prototype.startsWith = function (str) {
+                if (str==null || str == "" || this.length == 0 || str.length > this.length) {
+                    return false
+                }
+                if (this.substr(0,str.length) == str) {
+                    return true
+                } else {
+                    return false
+                }
+            }
+        }
+        if (typeof Promise === 'undefined') {
+            document.write('<script src="https://cdn-common.jianyu360.com/cdn/lib/bluebird/3.7.2/js/browser/bluebird.core.min.js"><\/script>');
+        }
+        if (typeof fetch === 'undefined') {
+            document.write('<script src="//cdn-common.jianyu360.com/cdn/lib/whatwg-fetch/3.4.1/dist/fetch.umd.min.js"><\/script>');
+        }
+    </script>
+    <style>
+        #public-nav {
+            border-bottom: 1px solid #e0e0e0;
+            background: #fff;
+        }
+        .page--web--index .page-container {
+            min-height: calc(100vh - 364px);
+            padding-top: 64px;
+            box-sizing: border-box;
+        }
+    </style>
+</head>
+<body class="page--web--index">
+{{include "/common/pchead.html"}}
+<div class="w-box page-container" >
+    <div id="main-app"></div>
+</div>
+<!-- 主应用依赖 -->
+<script src=//cdn-common.jianyu360.com/cdn/lib/url-polyfill/1.1.12/url-polyfill.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/qiankun/2.7.0/index.umd.min.js></script>
+
+<!-- 子应用依赖 -->
+<!-- <script src=//cdn-common.jianyu360.com/cdn/lib/pdfjs-dist/2.1.266/build/pdf.min.js></script>
+<script src=//cdn-common.jianyu360.com/cdn/lib/pdfjs-dist/2.1.266/web/pdf_viewer.js></script> -->
+<script>
+    qiankun.registerMicroApps(
+        [
+            {
+                name: 'social-pc',
+                entry: '/page_knowledge_base/index.html',
+                container: '#main-app',
+                activeRule: '/'
+            }
+        ],
+        {
+            beforeLoad: function (app) {
+                console.log('before load', app) 
+            },
+            beforeMount: [
+                function (app) {
+                    console.log('before mount', app) 
+                }
+            ]
+        }
+    )
+    qiankun.start({
+        sandbox: false
+    })
+</script>
+<script src='{{Msg "seo" "cdn"}}/js/jquery.cookie.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script src='{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}' type="text/javascript"></script>
+<script>
+    $(function () {
+        haslogin({{.T.logid}});
+    })
+</script>
+<!--S-百度统计-->
+{{include "/common/pcbottom.html"}}
+{{include "/common/baiducc.html"}}
+<!--E-百度统计-->
+</body>
+</html>