cuiyalong 2 жил өмнө
parent
commit
d042f29c75

+ 1 - 1
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -2538,7 +2538,7 @@
       })
       content = content.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"");
       if (content) {
-        content = keyWordHighlight(content,thirdPartyVerify.keywordsList,"<span class='highlight-text third-party-verify-highlight'>$1</span>");
+        content = thirdPartyVerify.replaceKeys(content)
       }
       if(projectname != "" && projectname != null && content.toLowerCase().indexOf(projectname.toLowerCase()) > -1){
           content = keyWordHighlight(content,projectname,"<span class='keyword myfollow project hideLine'>$1</span>");

+ 51 - 32
src/web/staticres/common-module/mainSearch/js/third-party-verify-mobile.js

@@ -21,7 +21,7 @@ var thirdPartyVerify = {
     // 证书编号
     number: [
       /(ISO\s{0,1}9001)/g,
-      /(GB\/T 50430)/g,
+      /(GB\/T\s{0,1}50430)/g,
       /(ISO\s{0,1}14001)/g,
       /(ISO\s{0,1}45001)/g,
       'HACCP',
@@ -61,48 +61,67 @@ var thirdPartyVerify = {
       thirdPartyVerifyDialog.showDialog(true)
     })
   },
+  replaceKeys: function (content) {
+    // 1.先将关键词替换
+    var replaced = keyWordHighlight(content,this.keywordsList,"<span class='highlight-text third-party-verify-highlight'>$1</span>");
+    // 2.替换关键词后面最近的一个中文句号(用来插入button)
+    replaced = replaced.replace(/third-party-verify-highlight(.*?)(。|;|;)/g, function (match, p1, p2) {
+      return match.replace(p2, `<span class='paragraph-last'>${p2}</span>`)
+    })
+    return replaced
+  },
   getInsertButton: function () {
     return '<span class="third-party-popover third-party-verify-button"><span class="icon icon-third-party-verify-logo"></span><span class="button-text">剑鱼认证服务</span></span>'
   },
-  checkHighlightInsert: function () {
-    var container = $('#tab2')
-    var verifyIconButton = container.find('.third-party-verify-button')
-    if (verifyIconButton.length) return
+  findNextMark: function (callback) {
     var waitingInsertList = [] // 待插入节点dom对象
+    var container = $('#tab2')
     var highlights = container.find('.third-party-verify-highlight')
-    // 1. 先找highlights同级next的br
     highlights.each(function () {
-      var $br = $(this).next('br')
-      var br = $br[0]
-      if (br) {
-        waitingInsertList.push(br)
+      var $mark = callback(this)
+      var mark = $mark[0]
+      if (mark) {
+        waitingInsertList.push(mark)
       }
     })
     // 去重
-    waitingInsertList = $.uniqueSort(waitingInsertList)
-    // 2.1 找到了,则在其前面插入
-    // 2.2 找不到,找到其父级标签,在其末尾插入
+    return $.uniqueSort(waitingInsertList)
+  },
+  checkHighlightInsert: function () {
+    var container = $('#tab2')
+    var verifyIconButton = container.find('.third-party-verify-button')
+    if (verifyIconButton.length) return
+    var waitingInsertList = [] // 待插入节点dom对象
     // 获取要插入元素
     var button = this.getInsertButton()
+    // 1. 先找highlights同级next的.paragraph-last
+    waitingInsertList = container.find('.paragraph-last').toArray()
+    waitingInsertList = $.uniqueSort(waitingInsertList)
     if (waitingInsertList.length) {
-      // 找到br
-      for (var i = 0; i < waitingInsertList.length; i++) {
-        $(waitingInsertList[i]).before(button)
-      }
+      // 找到了.paragraph-last在其后插入button
+      waitingInsertList.forEach(function (dom) {
+        $(dom).after(button)
+      })
     } else {
-      // 没找到br,找到其父级标签,并在其末尾插入
-      highlights.each(function () {
-        var $parent = $(this).parent()
-        var parent = $parent[0]
-        if (parent) {
-          waitingInsertList.push(parent)
-        }
+      // 2. 找不到.paragraph-last。找同级next的br
+      waitingInsertList = this.findNextMark(function (_this) {
+        return $(_this).next('br')
       })
-      // 去重
-      waitingInsertList = $.uniqueSort(waitingInsertList)
-      if (waitingInsertList) {
-        for (var i = 0; i < waitingInsertList.length; i++) {
-          $(waitingInsertList[i]).append(button)
+      if (waitingInsertList.length) {
+        // 找到了br,则在其前面插入
+        waitingInsertList.forEach(function (dom) {
+          $(dom).before(button)
+        })
+      } else {
+        // 3. 找不到br,找到其父级标签,并在其末尾插入
+        waitingInsertList = this.findNextMark(function (_this) {
+          return $(_this).parent()
+        })
+        if (waitingInsertList.length) {
+          // 找到了br,则在其前面插入
+          waitingInsertList.forEach(function (dom) {
+            $(dom).append(button)
+          })
         }
       }
     }
@@ -150,15 +169,15 @@ var thirdPartyVerifyDialogTemplate = `
             </div>
             <div class="p-c-h-c-item">
               <span class="icon-verify-tick"></span>
-              <span>类似项目帮多维度分析</span>
+              <span>体系认证:品牌提升,投标加分,提升企业竞争力</span>
             </div>
             <div class="p-c-h-c-item">
               <span class="icon-verify-tick"></span>
-              <span>辅助投标策略及报价参考</span>
+              <span>信用认证:企业信用名片,招投标必备</span>
             </div>
             <div class="p-c-h-c-item">
               <span class="icon-verify-tick"></span>
-              <span>辅助投标策略及报价参考</span>
+              <span>服务体系认证:实力认证,竞争有优势</span>
             </div>
           </div>
         </div>

+ 50 - 30
src/web/staticres/common-module/mainSearch/js/third-party-verify.js

@@ -4,6 +4,7 @@ var thirdPartyVerify = {
   certificate: {
     // 证书名称
     name: [
+      '发布',
       '质量管理体系认证',
       '工程建设施工质量管理体系认证',
       '环境管理体系认证',
@@ -20,7 +21,7 @@ var thirdPartyVerify = {
     // 证书编号
     number: [
       /(ISO\s{0,1}9001)/g,
-      /(GB\/T 50430)/g,
+      /(GB\/T\s{0,1}50430)/g,
       /(ISO\s{0,1}14001)/g,
       /(ISO\s{0,1}45001)/g,
       'HACCP',
@@ -94,53 +95,72 @@ var thirdPartyVerify = {
       }
     })
   },
+  replaceKeys: function (content) {
+    // 1.先将关键词替换
+    var replaced = keyWordHighlight(content,this.keywordsList,"<span class='jykeyword third-party-verify-highlight'>$1</span>");
+    // 2.替换关键词后面最近的一个中文句号(用来插入button)
+    replaced = replaced.replace(/third-party-verify-highlight(.*?)(。|;|;)/g, function (match, p1, p2) {
+      return match.replace(p2, `<span class='paragraph-last'>${p2}</span>`)
+    })
+    return replaced
+  },
   getInsertButton: function () {
     return '<span class="third-party-popover third-party-verify-button"><span class="icon icon-third-party-verify-logo"></span><span class="button-text">剑鱼认证服务</span></span>'
   },
-  checkHighlightInsert: function () {
-    var container = $('.com-detail')
-    var verifyIconButton = container.find('.third-party-verify-button')
-    if (verifyIconButton.length) return
+  findNextMark: function (callback) {
     var waitingInsertList = [] // 待插入节点dom对象
+    var container = $('.com-detail')
     var highlights = container.find('.third-party-verify-highlight')
-    // 1. 先找highlights同级next的br
     highlights.each(function () {
-      var $br = $(this).next('br')
-      var br = $br[0]
-      if (br) {
-        waitingInsertList.push(br)
+      var $mark = callback(this)
+      var mark = $mark[0]
+      if (mark) {
+        waitingInsertList.push(mark)
       }
     })
     // 去重
-    waitingInsertList = $.uniqueSort(waitingInsertList)
-    // 2.1 找到了,则在其前面插入
-    // 2.2 找不到,找到其父级标签,在其末尾插入
+    return $.uniqueSort(waitingInsertList)
+  },
+  checkHighlightInsert: function () {
+    var container = $('.com-detail')
+    var verifyIconButton = container.find('.third-party-verify-button')
+    if (verifyIconButton.length) return
+    var waitingInsertList = [] // 待插入节点dom对象
     // 获取要插入元素
     var button = this.getInsertButton()
+    // 1. 先找highlights同级next的.paragraph-last
+    waitingInsertList = container.find('.paragraph-last').toArray()
+    waitingInsertList = $.uniqueSort(waitingInsertList)
     if (waitingInsertList.length) {
-      // 找到br
-      for (var i = 0; i < waitingInsertList.length; i++) {
-        $(waitingInsertList[i]).before(button)
-      }
+      // 找到了.paragraph-last在其后插入button
+      waitingInsertList.forEach(function (dom) {
+        $(dom).after(button)
+      })
     } else {
-      // 没找到br,找到其父级标签,并在其末尾插入
-      highlights.each(function () {
-        var $parent = $(this).parent()
-        var parent = $parent[0]
-        if (parent) {
-          waitingInsertList.push(parent)
-        }
+      // 2. 找不到.paragraph-last。找同级next的br
+      waitingInsertList = this.findNextMark(function (_this) {
+        return $(_this).next('br')
       })
-      // 去重
-      waitingInsertList = $.uniqueSort(waitingInsertList)
-      if (waitingInsertList) {
-        for (var i = 0; i < waitingInsertList.length; i++) {
-          $(waitingInsertList[i]).append(button)
+      if (waitingInsertList.length) {
+        // 找到了br,则在其前面插入
+        waitingInsertList.forEach(function (dom) {
+          $(dom).before(button)
+        })
+      } else {
+        // 3. 找不到br,找到其父级标签,并在其末尾插入
+        waitingInsertList = this.findNextMark(function (_this) {
+          return $(_this).parent()
+        })
+        if (waitingInsertList.length) {
+          // 找到了br,则在其前面插入
+          waitingInsertList.forEach(function (dom) {
+            $(dom).append(button)
+          })
         }
       }
     }
 
-    // 找到替换的元素了
+    // 找到替换的元素了,显示底部提示
     // if (waitingInsertList.length) {
     //   $('#third-party-verify-attention').show().append(button)
     // }

+ 4 - 4
src/web/staticres/public-pc/js/article-content.js

@@ -542,9 +542,9 @@ function clearup(rp){
     }
     //dtcontent = keyWordHighlight(dtcontent,s_winner,"<span class='keyword winner' style=\"border-bottom:1px solid #2cb7ca\">$1</span>");
   }
-  // 替换第三方认证
+  // 第三方认证替换
   if (dtcontent) {
-    dtcontent = keyWordHighlight(dtcontent,thirdPartyVerify.keywordsList,"<span class='jykeyword third-party-verify-highlight'>$1</span>");
+    dtcontent = thirdPartyVerify.replaceKeys(dtcontent)
   }
   // 替换关键词高亮
   var wordsArray = getQueryString("kds").split(" ");
@@ -1303,8 +1303,8 @@ $(function(){
     }
   }
   if(sds&&content){
-    // 替换第三方认证
-    content = keyWordHighlight(content,thirdPartyVerify.keywordsList,"<span class='jykeyword third-party-verify-highlight'>$1</span>");
+    // 第三方认证替换
+    content = thirdPartyVerify.replaceKeys(content)
     var wordsArray = sds.split(" ");
     if(wordsArray!=""){
       for(var i=0;i<wordsArray.length;i++){

+ 3 - 3
src/web/templates/pc/biddetail_rec.html

@@ -1303,15 +1303,15 @@
         <div class="p-c-m-content-l bid_classfun">
           <div class="classfun_list">
             <img src="/images/blue-duihao.png" alt="" style="width: 20px; height: 20px;">
-            <span class="classs_text">类似项目帮多维度分析</span>
+            <span class="classs_text">体系认证:品牌提升,投标加分,提升企业竞争力</span>
           </div>
           <div class="classfun_list">
             <img src="/images/blue-duihao.png" alt="" style="width: 20px; height: 20px;">
-            <span class="classs_text">辅助投标策略及报价参考</span>
+            <span class="classs_text">信用认证:企业信用名片,招投标必备</span>
           </div>
           <div class="classfun_list">
             <img src="/images/blue-duihao.png" alt="" style="width: 20px; height: 20px;">
-            <span class="classs_text">辅助投标策略及报价参考</span>
+            <span class="classs_text">服务体系认证:实力认证,竞争有优势</span>
           </div>
         </div>
         <div class="p-c-m-content-r">

+ 1 - 1
src/web/templates/weixin/wxinfocontent_rec.html

@@ -2816,7 +2816,7 @@ $(function(){
 
 	originalCon = content;
 	if (content) {
-		content = keyWordHighlight(content,thirdPartyVerify.keywordsList,"<span class='highlight-text third-party-verify-highlight'>$1</span>");
+		content = thirdPartyVerify.replaceKeys(content)
 	}
 	if(lsgim!="T"&&fwtsname != "" && content.indexOf(fwtsname) > -1){
 		content = content.replace(fwtsname,"<span id='fphl' class='fphl' dataCode='"+fwtscode+"'>"+fwtsname+"</span>");