浏览代码

Merge branch 'dev4.6.3' of http://192.168.3.207:8080/qmx/jy into dev4.6.3

tsz 3 年之前
父节点
当前提交
02b46b8dfc

+ 133 - 134
src/jfw/modules/app/src/web/templates/big-member/page_client_list.html

@@ -60,7 +60,7 @@
                         :finished="finished"
                         finished-text="没有更多了"
                         @load="getProjectList"
-                      >   
+                      >
                       <div class="followList" v-for="(item, index) in list" style="padding-left: 16px;" @click="followView(item.fid,item.sid,item)">
                         <p class="pro_title">
                           <span class="j-icon icon-company"></span>
@@ -104,7 +104,7 @@
                         :finished="finished"
                         finished-text="没有更多了"
                         @load="getProjectList"
-                      >   
+                      >
                       <div class="followList" v-for="(item, index) in havaClaimList" style="padding-left: 16px;" @click="followView(item.fid,item.sid,item)">
                         <p class="pro_title">
                           <span class="j-icon icon-company"></span>
@@ -148,7 +148,7 @@
                         :finished="finished"
                         finished-text="没有更多了"
                         @load="getProjectList"
-                      >   
+                      >
                       <div class="followList" v-for="(item, index) in noClaimList" style="padding-left: 16px;" @click="followView(item.fid,item.sid,item)">
                         <p class="pro_title">
                           <span class="j-icon icon-company"></span>
@@ -231,7 +231,7 @@
               let getclient = sessionStorage.getItem('setClientInfo')
               if(getclient) {
                 getclient = JSON.parse(getclient)
-                vNode.methods.changeFollowState(getclient.data,getclient.str,data,'tag')
+                  vueComponent.changeFollowState(getclient.data,getclient.str,data,'tag')
               }
             }
             // changeKeepStatus (type, that) {
@@ -240,11 +240,11 @@
             // }
         }
     })
-    var vNode = {
+    var vueComponent = new Vue({
         delimiters: ['${', '}'],
         el: '#v-node',
         components: {
-          areaCityMobile: areaCityMobileComponent
+            areaCityMobile: areaCityMobileComponent
         },
         data: {
             sessStorageKey:'$data-pro_follow_list',
@@ -300,143 +300,143 @@
                 return !!$data
             },
             toggle(index) {
-              this.$refs.checkboxes[index].toggle();
+                this.$refs.checkboxes[index].toggle();
             },
             getEntFollow: function(arr) {
-              let _this = this
-              const params = {
-                names: arr.join(',')
-              }
-              // 关注
-              $.ajax({
-                type: 'POST',
-                url: '/entnicheNew/customer/check',
-                contentType: 'application/json',
-                data: JSON.stringify(params),
-                success: function(res) {
-                  console.log(res)
-                  if(res.error_code == 0) {
-                    if(res.data.iscoll) {
-                      _this.list.forEach(item => {
-                        res.data.names.forEach(sum => {
-                          if(sum === item.name) {
-                            item.follow = true
-                          }
-                        })
-                      });
-                    }
-                  }
+                let _this = this
+                const params = {
+                    names: arr.join(',')
                 }
-              })
-              // 认领
-              $.ajax({
-                type: 'POST',
-                url: '/entnicheNew/customer/claimcheck',
-                contentType: 'application/json',
-                data: JSON.stringify(params),
-                success: function(res) {
-                  console.log(res)
-                  if(res.error_code == 0) {
-                    _this.havaClaimList = []
-                    _this.noClaimList = []
-                    let newarr = []
-                    if(res.data.iscoll) {
-                      let listcopy = _this.list
-                      listcopy.forEach((item, index) => {
-                        res.data.names.forEach(sum => {
-                          if(sum === item.name) {
-                            _this.havaClaimList.push(item)
-                            newarr = _this.remove(listcopy, item)
-                            item.claim = true
-                          }
-                        })
-                      });
-                      if(res.data.names.length !== listcopy.length) {
-                        _this.noClaimList = newarr
-                      } else {
-                        _this.noClaimList = _this.list
-                      }
-                    } else {
-                      _this.noClaimList = _this.list
+                // 关注
+                $.ajax({
+                    type: 'POST',
+                    url: '/entnicheNew/customer/check',
+                    contentType: 'application/json',
+                    data: JSON.stringify(params),
+                    success: function(res) {
+                        console.log(res)
+                        if(res.error_code == 0) {
+                            if(res.data.iscoll) {
+                                _this.list.forEach(item => {
+                                    res.data.names.forEach(sum => {
+                                        if(sum === item.name) {
+                                            item.follow = true
+                                        }
+                                    })
+                                });
+                            }
+                        }
                     }
-                  }
-                }
-              })
+                })
+                // 认领
+                $.ajax({
+                    type: 'POST',
+                    url: '/entnicheNew/customer/claimcheck',
+                    contentType: 'application/json',
+                    data: JSON.stringify(params),
+                    success: function(res) {
+                        console.log(res)
+                        if(res.error_code == 0) {
+                            _this.havaClaimList = []
+                            _this.noClaimList = []
+                            let newarr = []
+                            if(res.data.iscoll) {
+                                let listcopy = _this.list
+                                listcopy.forEach((item, index) => {
+                                    res.data.names.forEach(sum => {
+                                        if(sum === item.name) {
+                                            _this.havaClaimList.push(item)
+                                            newarr = _this.remove(listcopy, item)
+                                            item.claim = true
+                                        }
+                                    })
+                                });
+                                if(res.data.names.length !== listcopy.length) {
+                                    _this.noClaimList = newarr
+                                } else {
+                                    _this.noClaimList = _this.list
+                                }
+                            } else {
+                                _this.noClaimList = _this.list
+                            }
+                        }
+                    }
+                })
             },
             remove(arr, item) {
-              var result=[];  
-                  arr.forEach(function(element){  
-                      if(element.name != item.name){  
-                          result.push(element);  
-                      }  
-                  });  
-              return result;  
+                var result=[];
+                arr.forEach(function(element){
+                    if(element.name != item.name){
+                        result.push(element);
+                    }
+                });
+                return result;
             },
             // 关注、认领
             changeFollowState (data, str, taglid, tag) {
-              this.loading = true
-              let params = {
-                "name": data.name, //采购单位名称
-                "province": data.province || data.wProvince, //省份
-                "city": data.wCity, //区域
-              }
-              if(str == 'g') {
-                params.mold = 0
-                params.B = data.follow
-                this.ajaxClaim(params)
-              } else if(str == 'r') {
-                const sessParams = {
-                  data: data,
-                  str: str
+                this.loading = true
+                let params = {
+                    "name": data.name, //采购单位名称
+                    "province": data.province || data.wProvince, //省份
+                    "city": data.wCity, //区域
                 }
-                sessionStorage.setItem('setClientInfo', JSON.stringify(sessParams))
-                params.mold = 1
-                params.D = data.claim
-                // 获取标签
-                if(tag) {
-                  params.label = taglid
-                  this.ajaxClaim(params)
-                } else {
-                  if(data.claim) {
+                if(str == 'g') {
+                    params.mold = 0
+                    params.B = data.follow
                     this.ajaxClaim(params)
-                  } else {
-                    // this.ajaxClaim(params)
-                    if (vKeepComponent) {
-                      vKeepComponent.changeBid(data.name, !data.claim)
-                      // vKeepComponent.changeKeepStatus(!data.claim, this)
+                } else if(str == 'r') {
+                    const sessParams = {
+                        data: data,
+                        str: str
+                    }
+                    sessionStorage.setItem('setClientInfo', JSON.stringify(sessParams))
+                    params.mold = 1
+                    params.D = data.claim
+                    // 获取标签
+                    if(tag) {
+                        params.label = taglid
+                        this.ajaxClaim(params)
+                    } else {
+                        if(data.claim) {
+                            this.ajaxClaim(params)
+                        } else {
+                            // this.ajaxClaim(params)
+                            if (vKeepComponent) {
+                                vKeepComponent.changeBid(data.name, !data.claim)
+                                // vKeepComponent.changeKeepStatus(!data.claim, this)
+                            }
+                        }
                     }
-                  }
                 }
-              }
             },
             ajaxClaim: function (params) {
-              const _this = this
-              $.ajax({
-                type:'POST',
-                url: '/entnicheNew/customer/attention',
-                contentType: 'application/json',
-                data: JSON.stringify(params),
-                success: (res) => {
-                  _this.loading = false
-                  console.log(res)
-                  if(res.error_code == 0) {
-                    if(res.data) {
-                      _this.$toast('取消认领成功')
-                      _this.getProjectList()
-                    } else {
-                      _this.$toast(res.error_msg)
+                const _this = this
+                $.ajax({
+                    type:'POST',
+                    url: '/entnicheNew/customer/attention',
+                    contentType: 'application/json',
+                    data: JSON.stringify(params),
+                    success: (res) => {
+                        _this.loading = false
+                        console.log(res)
+                        if(res.error_code == 0) {
+                            if(res.data) {
+                                _this.$toast('取消认领成功')
+                                _this.getProjectList()
+                            } else {
+                                _this.$toast(res.error_msg)
+                            }
+                        } else {
+                            _this.$toast(res.error_msg)
+                        }
+                    },
+                    error: function(err) {
+                        _this.loading = false
                     }
-                  } else {
-                    _this.$toast(res.error_msg)
-                  }
-                },
-                error: function(err) {
-                  _this.loading = false
-                }
-              })
+                })
             },
             searchFn: function() {
-              this.getProjectList()
+                this.getProjectList()
             },
             // 判断是否开通大会员
             isOpening:function() {
@@ -454,11 +454,11 @@
                 })
             },
             checkAll() {
-              if (this.clientchecked) {
-                this.$refs.checkboxGroup.toggleAll(true);
-              } else {
-                this.$refs.checkboxGroup.toggleAll();
-              }
+                if (this.clientchecked) {
+                    this.$refs.checkboxGroup.toggleAll(true);
+                } else {
+                    this.$refs.checkboxGroup.toggleAll();
+                }
             },
             getProjectList () {
                 // 异步更新数据
@@ -468,7 +468,7 @@
                     type:'get',
                     url:'/entnicheNew/customer/list',
                     data:{
-                      searchCode: _this.inputVal,
+                        searchCode: _this.inputVal,
                     },
                     success:function(res) {
                         if (res.error_code == 0){
@@ -485,7 +485,7 @@
                                 }
                                 _this.list = res.data.list
                                 if(nameArr.length !== 0) {
-                                  _this.getEntFollow(nameArr)
+                                    _this.getEntFollow(nameArr)
                                 }
                                 if(!res.data.hasNext){
                                     _this.loading = true
@@ -569,8 +569,7 @@
                 return td;
             }
         }
-    }
-    var vueComponent = new Vue(vNode)
+    })
 </script>
 
 </body>

+ 17 - 0
src/web/staticres/css/dev2/newBidSearch.css

@@ -561,4 +561,21 @@
 .free-go-open .go-open-btn:hover{
   text-decoration: none;
   color: #fff;
+}
+
+.claim{
+  display: inline-block;
+  width: auto!important;
+  padding-left: 24px;
+  font-size: 16px;
+  color: #2cb7ca;
+  cursor: pointer;
+}
+.claim-no{
+  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAA1FJREFUWEftmM1u2kAQx//jjzaqekjfIL21ClJBammiXsKlCskleYKSJ0jzBIEnCHmCJE+Aqkqh6oVcqqikEhxsqbfyBuXQqJGwPdUu2DJm/QEkElLhhOzdnd/+Z3ZnxoQF/9GC82EJOK+HlgoujIIvmtdrJvSWANLvzEJ3v9CfF07Mz+zitUZn9emKcwjivrVdPI0az32+2YLBEhBwS1Z582piTPPmWMw3/poXWTeQCXC92a5ohBNmrAqj7A0K9u67bhggDTD8noCe56Fm7xbP01ROBFz/+i1PrnkCYMtfiIGeC7f0s7zZmwYw3+isDlYGHQLW/HkCdKBYK7xuLODLyx97OnmNYDChD+bTP3eP6j1FfKUp6K+Ta36vgugQI29Ij0Cr2OXXFyo1lYAy4EnvBC4Fzl24tahq0ygYHivW11mrEtEH+Zwg4vK5Ki6VgLnLdh2EQ7k79o7snY16WqxkVXBsU0JN0LF85nHN2n1bjdpRAzbb4jRuiZ1Z28VnaXDi/SyAct6X9m/hbob3yS5v7E0HCFxZ5WLpQQF9MWJsJSu4BARySwVHATrzIfnvFJRFg+HkJ062ya/AkPeluDvJ1cdytXjuGE5vIkXet4IyP3tmK5yqslxD4k512C08OKCAmRqS0GdtULLfj1dA8qK+bwV9tQQkXLMRrk6USibAPSigWFwmfeitOMi40mw8H4/S6kyZhNC1touFpBiLg8wCN7uClzcNEO8llUET5VNIyaxwYnMG9F/DmnCKYmG9eV0h6GcSgtF1yN1PqgXD7hb/VRV31Avyuno8aIEgryz2cKBqAWIr6tDpkgUlmOpW+U0t05WSMMhvvoj4Y1AQM7r2jjqUYgGl/Kw3/B0Km9M0OypGkQ7J4DMO9SUArhy4B3EeSu3qhLsB/Th8UjlDCxCNUWMYMkHzJbzCLo7SOrtUQD++DGiVoDwPrFPVgXMRt/uglwZHSnmuxTVfmSrquBCaaHYS3B7tpUdrJrpTZTeTgtGJKrfL+GTvVGOtzxpEtzbWSxPcA9XXhrRDNxOgv6iqxx0zmNJLp8GNDmaWYfFjVG4fXp/pvXQWy3MpGDYwPBB3eda9/u3tk57q60MWoLkOySwG5p1zbwrOCxI3f+EB/wEsbk5HCowJ7QAAAABJRU5ErkJggg==) no-repeat left center;
+  background-size: 20px 20px;
+}
+.claim-yes{
+  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAudJREFUWEft2EFPE0EUB/D/sAVbYgnxiImpB8MaagImFLjBcfECiXeoX8By8tj26AnwAwjfoBoT9theDNKatIc2lpONiRwNkUYK7e4zs1BS2912ZneNTWSO7czOb997s7szDEPe2JD78P8AI5ni5N1Aa5ZnpN4KlGrrc6d+ZMdzBFX9MBJgI9sgttYJImDfgJGuaks1L1DXQCtiwdZLxihBhElnBEuVtfm0W6Qr4OODz2sBZm4TEBGZmAE100S68iy2L9K/s48UMPqhsIwAJQEsy05k9WcotchYl0m7EJCnMxxqJYko4QrWNUimPgcCo3ohObjO5Nk87QS2P6g+HYF8dY5CyYrW2f3QGN7GVEv6/GMFZy1DSM2hTRgrTml3BD7R819FcVwyfy98A3yRr6Lw40wIeFWaqCmN0bmSzbPTFjij5zcZsCc8g0cgn4fI3KqsLu50z2kLjOr5rOxK9RJBCwjzfUVb/ONhfx3d3jj9CyCAXFmLrQxtBG+BXmvwNoJDE8FwQIE6Md6z9KcnxvFKfWD9/rr6Dcc/f/X0OTm/wPfzS6fHqz+reDo8jr0FFRwq0/irj78COdKh+QPkF5dFclz8qIrjs96odmD9A7aRb54+wlRorG8gBXH8Gv4C+RWnQnewF1MdkSfnl4jnq/3S2nlz/gP7ISVxkhE8KGTAqOfF7ZTL7ki6wMkBZw4+JRjfSkq0NpIPkUjrzQxkIm63qbL93JrNFCebwWaRCe7aJO7DtisBtYoWe2j3Z99PfgVK9m8jOc5w88nfvpuofpQisA3foQynINotawupfhkYuKvjg/kGSqGRFGNsw2s6rfGE3frFaErk/EYI2EZZ5zCkZMBgHRK5aDnASJe1pZzoWClg+6Iz+uEmoCRF087rzCTa+rK68E4U1u7nCthZnwDjRyH27brO6o2xHZF0Sq1i0Tt1qk+Z4w3Pi0QEe3Uc17g6wGwEh+cAUwTvpY+nGvQysejYoQf+BiROhjgdpNiKAAAAAElFTkSuQmCC) no-repeat left center;
+  background-size: 20px 20px;
 }

+ 10 - 10
src/web/staticres/js/pc_detail_tags.js

@@ -181,20 +181,20 @@ function deleteInputTag(item) {
   var id = $(item).parent().attr('data-id')
   activeTags.splice(index, 1)
   inputTagList()
-  $('.tags-item[data-id="' + id + '"]').removeClass('tags-active')
+  $('#collectTags .tags-item[data-id="' + id + '"]').removeClass('tags-active')
 }
 
 function inputTagList () {
   var ht = '';
-  $('.tag-labels').html(ht)
+  $('#collectTags .tag-labels').html(ht)
   activeTags.forEach(function(v,i) {
     ht+='<span class="tag-label" data-index=' + i + ' data-id="' + v.lid + '">'
     ht+='<em>'+ v.lname + '</em>'
     ht+='<i class="tag-close" onclick="deleteInputTag(this)"></i>'
     ht+='</span>'
   });
-  $('.tag-labels').html(ht)
-  if ($('.tag-labels').children('.tag-label').length > 0) {
+  $('#collectTags .tag-labels').html(ht)
+  if ($('#collectTags .tag-labels').children('.tag-label').length > 0) {
     $('.tag-placeholder').hide()
   }
   checkTagDisabled()
@@ -206,11 +206,11 @@ function renderTagsList (data) {
     data.forEach(function(v,i) {
       ht+='<span class="tags-item" data-count=' + v.count + ' data-id=' + v.lid + '>'+ v.lanme +'</span>'
     });
-    $(".tags-list").html(ht)
+    $("#collectTags .tags-list").html(ht)
     activeTags.forEach(function(s,j){
-      $('.tags-list .tags-item[data-id="' + s.lid +  '"]').addClass('tags-active')
+      $('#collectTags .tags-list .tags-item[data-id="' + s.lid +  '"]').addClass('tags-active')
     })
-    $('.tags-item').click(function(e) {
+    $('#collectTags .tags-item').click(function(e) {
       e.stopPropagation()
       if ($(this).hasClass('disabled')) return
       var id = $(this).attr('data-id');
@@ -285,7 +285,7 @@ function addTagsAjax (name) {
     dataType:'json',
     success: function(r){
       if (r.data) {
-        $('.tag-input .clear-input').val('')
+        $('#collectTags .tag-input .clear-input').val('')
         // 添加标签成功后 绑定标签
         if (activeTags.length < 3) {
           activeTags.push({
@@ -331,10 +331,10 @@ function collBidAction (baction, binfo, callback) {
 function checkTagDisabled () {
   if (activeTags.length >= 3) {
     // 禁用标签
-    $('.tags-list').find('.tags-item:not(.tags-active)').addClass('disabled')
+    $('#collectTags .tags-list').find('.tags-item:not(.tags-active)').addClass('disabled')
   } else {
     // 解除禁用
-    $('.tags-list').find('.disabled').removeClass('disabled')
+    $('#collectTags .tags-list').find('.disabled').removeClass('disabled')
   }
 }
 // toast提示

+ 151 - 0
src/web/staticres/js/pc_entniche_tags.js

@@ -0,0 +1,151 @@
+var entNicheTags = []; //选中的自定义标签 作为全局变量使用
+// 解绑自定义标签
+function deleteEntInputTag(item) {
+  var index = $(item).parent().attr('data-index')
+  var id = $(item).parent().attr('data-id')
+  entNicheTags.splice(index, 1)
+  inputEntTagList()
+  $('#entNicheTags .tags-item[data-id="' + id + '"]').removeClass('tags-active')
+}
+// 获取用户自定义标签
+function geEntNicheUserTags () {
+  $.ajax({
+    type:'post',
+    url:'/entnicheNew/customer/getLabel?t=' + Date.now(),
+    success: function(r){
+      if (r.error_code == 0 && $.isArray(r.data)) {
+        renderEntTagsList(r.data.reverse())
+      }
+    }
+  })
+}
+function inputEntTagList () {
+  var ht = '';
+  $('#entNicheTags .tag-labels').html(ht)
+  entNicheTags.forEach(function(v,i) {
+    ht+='<span class="tag-label" data-index=' + i + ' data-id="' + v.lid + '">'
+    ht+='<em>'+ v.lname + '</em>'
+    ht+='<i class="tag-close" onclick="deleteEntInputTag(this)"></i>'
+    ht+='</span>'
+  });
+  $('#entNicheTags .tag-labels').html(ht)
+  if ($('#entNicheTags .tag-labels').children('.tag-label').length > 0) {
+    $('#entNicheTags .tag-placeholder').hide()
+  }
+  checkEntTagDisabled()
+}
+// 渲染标签列表数据
+function renderEntTagsList (data) {
+  if (data && data.length > 0) {
+    var ht = '';
+    data.forEach(function(v,i) {
+      ht+='<span class="tags-item" data-count=' + v.count + ' data-id=' + v.lid + '>'+ v.lanme +'</span>'
+    });
+    $("#entNicheTags .tags-list").html(ht)
+    entNicheTags.forEach(function(s,j){
+      $('#entNicheTags .tags-list .tags-item[data-id="' + s.lid +  '"]').addClass('tags-active')
+    })
+    $('#entNicheTags .tags-item').click(function(e) {
+      e.stopPropagation()
+      if ($(this).hasClass('disabled')) return
+      var id = $(this).attr('data-id');
+      var name = $(this).text()
+      $(this).toggleClass('tags-active')
+      if ($(this).hasClass('tags-active')) {
+        entNicheTags.push({
+          lid: id,
+          lname: name
+        })
+        inputEntTagList ()
+      } else {
+        var newArr = entNicheTags.filter(function(item) {
+          return item.lid != id
+        })
+        entNicheTags = newArr
+        inputEntTagList ()
+      }
+    })
+  }
+  inputEntTagList()
+}
+// 新增标签
+function addEntTagsAjax (name) {
+  $.ajax({
+    type:'post',
+    url:'/entnicheNew/customer/addLabel',
+    data: {
+      name: name
+    },
+    dataType:'json',
+    success: function(r){
+      if (r.data) {
+        $('#entNicheTags .tag-input .clear-input').val('')
+        // 添加标签成功后 绑定标签
+        if (entNicheTags.length < 3) {
+          entNicheTags.push({
+            lid: r.data,
+            lname: name
+          })
+        }
+        geEntNicheUserTags()
+      } else {
+        // toastFn(r.error_msg, 1000)
+        toastFn('标签已经存在,无需添加', 1000)
+      }
+    }
+  })
+}
+function checkEntTagDisabled () {
+  if (entNicheTags.length >= 3) {
+    // 禁用标签
+    $('#entNicheTags .tags-list').find('.tags-item:not(.tags-active)').addClass('disabled')
+  } else {
+    // 解除禁用
+    $('#entNicheTags .tags-list').find('.disabled').removeClass('disabled')
+  }
+}
+
+// 标签输入框事件
+$('#entNicheTags.tags-box').click(function(e) {
+  e.stopPropagation()
+})
+
+$('#entNicheTags .tag-input').click(function(e) {
+  e.stopPropagation()
+  $(this).children('.tag-placeholder').hide()
+  $(this).children('input').focus()
+})
+// 标签输入框回车事件
+$('#entNicheTags .tag-input .clear-input').keydown(function(event){
+  event.stopPropagation()
+  if (event.keyCode == 13) {
+    if (!$('#entNicheTags.tags-box').is(':hidden')) {
+      $('#entNicheTags .tags-inputs .add-tag-button').trigger('click')
+    }
+  }
+})
+// 添加标签按钮事件
+$('#entNicheTags .tags-inputs .add-tag-button').on('click', function () {
+  var input = $('#entNicheTags .tag-input .clear-input')
+  if(input.val().length >= 2 && input.val().length < 6) {
+    // ajax提交自定义标签
+    addEntTagsAjax(input.val())
+  }
+})
+// 标签输入框失去焦点事件
+$('#entNicheTags .tag-input .clear-input').blur(function() {
+  if($('#entNicheTags .tag-labels').children().length == 0 && $(this).val() == '') {
+    $('.tag-placeholder').show()
+  }
+})
+
+$('#entNicheTags .tags-footer .button-cancel').on('click', function () {
+  $('.tags-box').hide(function() {
+    // 标签弹框消失时 清除上次选择的标签分类
+    entNicheTags = []
+    $('.tag-labels').empty()
+    $('.clear-input').val('')
+    $('.tags-list').find('.tags-item').removeClass('tags-active')
+    $('.tag-placeholder').show()
+  })
+})

文件差异内容过多而无法显示
+ 1 - 1
src/web/staticres/pccss/pc-detail.css


+ 225 - 16
src/web/templates/pc/biddetail_rec.html

@@ -100,11 +100,10 @@
 			<div class="com-title" id="com-title">
 				<!--			<span style="border-bottom:1px solid #2cb7ca">{{.T.obj.title}}</span>-->
 				{{.T.obj.title}}
-
 			</div>
 			<div class="com-statusbar" id="statusbar">
 				<!-- 自定义标签弹框 -->
-				<div class="tags-box">
+				<div class="tags-box" id="collectTags">
 					<div class="tags-inputs">
 						<div class="tag-input">
 							<div class="tag-labels"></div>
@@ -172,7 +171,7 @@
 									toastFn('收藏成功')
 									$('#bidCollected').show()
 									$('#bidCollect').hide()
-									$('.tags-box').show().css('top', top)
+									$('#collectTags.tags-box').show().css({'top': top, 'right' : 0, 'left':'unset'})
 									getUserTags()
 								} else {
 									toastFn(r.error_msg)
@@ -194,44 +193,44 @@
 						})
 					})
 					// 标签输入框事件
-					$('.tags-box').click(function(e) {
+					$('#collectTags.tags-box').click(function(e) {
 						e.stopPropagation()
 					})
 
-					$('.tag-input').click(function(e) {
+					$('#collectTags .tag-input').click(function(e) {
 						e.stopPropagation()
 						$(this).children('.tag-placeholder').hide()
 						$(this).children('input').focus()
 					})
 					// 标签输入框回车事件
-					$('.tag-input .clear-input').keydown(function(event){
+					$('#collectTags .tag-input .clear-input').keydown(function(event){
 						event.stopPropagation()
 						if (event.keyCode == 13) {
 							if (!$('.tags-box').is(':hidden')) {
-								$('.tags-inputs .add-tag-button').trigger('click')
+								$('#collectTags .tags-inputs .add-tag-button').trigger('click')
 							}
 						}
 					})
 					// 添加标签按钮事件
-					$('.tags-inputs .add-tag-button').on('click', function () {
-						var input = $('.tag-input .clear-input')
+					$('#collectTags .tags-inputs .add-tag-button').on('click', function () {
+						var input = $('#collectTags .tag-input .clear-input')
 						if(input.val().length >= 2 && input.val().length < 6) {
 							// ajax提交自定义标签
 							addTagsAjax(input.val())
 						}
 					})
 					// 标签输入框失去焦点事件
-					$('.tag-input .clear-input').blur(function() {
+					$('#collectTags .tag-input .clear-input').blur(function() {
 						if($('.tag-labels').children().length == 0 && $(this).val() == '') {
 							$('.tag-placeholder').show()
 						}
 					})
 					// 点击确定按钮,绑定标签
-					$('.tags-footer .button-confirm').on('click', function () {
-						if (!$('.tags-box').is(':hidden')){
+					$('#collectTags .tags-footer .button-confirm').on('click', function () {
+						if (!$('#collectTags.tags-box').is(':hidden')){
 							var lids = ""
 							var lname = ""
-							$('.tags-item.tags-active').each(function() {
+							$('#collectTags .tags-item.tags-active').each(function() {
 								if ($(this).attr('data-id')){
 									if(lids != ""){
 										lids += ",";
@@ -253,12 +252,12 @@
 							// 执行保存绑定标签操作
 							if (params.lids !== '') {
 								saveChooseTags(params, function () {
-									$('.tags-footer .button-cancel').trigger('click')
+									$('#collectTags .tags-footer .button-cancel').trigger('click')
 								})
 							}
 						}
 					})
-					$('.tags-footer .button-cancel').on('click', function () {
+					$('#collectTags .tags-footer .button-cancel').on('click', function () {
 						$('.tags-box').hide(function() {
 							// 标签弹框消失时 清除上次选择的标签分类
 							activeTags = []
@@ -339,7 +338,72 @@
 						}
 					})
 				</script>
+        {{else if .T.isEntnicheNew }}
+        <!-- 新商机管理关注项目 -->
+          <span class="com-guanzhu" id="followedProject" style="display: none">
+            <img class="icon-title-img" src="{{Msg "seo" "cdn"}}/images/focused.png">
+                      <font>已关注</font>
+          </span>
+           <span class="com-guanzhu" id="unfollowedProject" style="display: none;cursor: pointer;">
+            <img class="icon-title-img" src="{{Msg "seo" "cdn"}}/images/focus.png">
+                      <font>关注项目</font>
+          </span>
 
+        <script>
+          $(function(){
+            var followProjectId = ""
+            var doReq = false
+
+            $.post("/entnicheNew/follow/project/check",{sid:{{.T.obj._id}}},function(res){
+              if(res.data.showFollow){
+                if( res.data.flag ){
+                  //已关注
+                  $("#followedProject").css("display","")
+                }else {
+                  //未关注
+                  $("#unfollowedProject").css("display","")
+                }
+                followProjectId= res.data.fig
+                //取消关注
+                $("#followedProject").on("click",cancelFollow)
+                //关注
+                $("#unfollowedProject").on("click",addFollow)
+              } else {
+                $('.bid_dev').hide()
+              }
+            });
+            function cancelFollow() {
+              if (followProjectId ===""||doReq){
+                return
+              }
+              doReq = true
+              $.post("/entnicheNew/follow/project/cance",{fid:followProjectId},function(r){
+                if (r.data === "success"){
+                  followProjectId= ""
+                  $("#followedProject").css("display","none")
+                  $("#unfollowedProject").css("display","")
+                }
+                doReq =	false
+              });
+            }
+            function addFollow() {
+              if (doReq){
+                return
+              }
+              doReq = true
+              $.post("/entnicheNew/follow/project/add",{sid:{{.T.obj._id}}},function(r){
+                if(r.error_code===0&&r.data!==""){
+                  followProjectId = r.data
+                  $("#unfollowedProject").css("display","none")
+                  $("#followedProject").css("display","")
+                } else {
+                  EasyAlert.show(r.error_msg, { 'max-width': 'unset' }, 1500);
+                }
+                doReq =	false
+              });
+            }
+          })
+        </script>
 				{{else}}
 				<!--非大会员用户,只能扫码跳转微信关注项目 -->
 				<span class="com-guanzhu">
@@ -636,7 +700,11 @@
 									  <div class="cont-cont portrait_img" href-data="/swordfish/page_big_pc/unit_portrayal/{{.T.obj.buyer}}" tip-data="查看采购单位画像">{{.T.obj.buyer}} </div>
 									  {{end}}
                     <div class="cont-recy" onclick="recoveryerr(this,'buyer','')">纠错</div>
+                    {{if .T.isEntnicheNew}}
+                    <div class="claim">{{if .T.obj.buyer}}认领{{end}}</div>
+                    {{else}}
                     <div class="portrait_img only-text">{{if .T.obj.buyer}}立即查看{{end}}</div>
+                    {{end}}
                     <div style="display:none;"></div>
 									{{else}}
 									<el-popover
@@ -1157,6 +1225,22 @@
 				}
 			</script>
 		</div>
+    <!-- 商机管理认领-自定义标签弹框 -->
+    <div class="tags-box" id="entNicheTags">
+      <div class="tags-inputs">
+        <div class="tag-input">
+          <div class="tag-labels"></div>
+          <input type="text" class="clear-input" maxlength="5" oninput="this.value=this.value.replace(/\s+/g,'')">
+          <div class="tag-placeholder">新增标签回车保存</div>
+        </div>
+        <div class="add-tag-button">添加并使用</div>
+      </div>
+      <div class="tags-list clearfix"></div>
+      <div class="tags-footer">
+        <div class="tags-button button-confirm">确认添加</div>
+        <div class="tags-button button-cancel">暂不添加</div>
+      </div>
+    </div>
 	</div>
 	<div id="popup" class="pop-up poperr">
 		<div class="pop-head" id="pop-head">
@@ -1200,7 +1284,8 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
 	<script src=//cdn-common.jianyu360.com/cdn/lib/element-ui/2.15.7/lib/index.js></script>
 	<script src="{{Msg "seo" "cdn"}}/js/pc-collect-bid-info.js?v={{Msg "seo" "version"}}"></script>
 	<script src="{{Msg "seo" "cdn"}}/js/pc-collect-user-info.js?v={{Msg "seo" "version"}}"></script>
-	<script>
+	<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/pc_entniche_tags.js?v={{Msg "seo" "version"}}"></script>
+  <script>
     console.log({{.T.isEntnicheNew}})
 		// 广告点击事件
 		var IframeOnClick = {
@@ -3680,7 +3765,131 @@ function fromwhere(text){
 		  $('.super-vip-show').hide()
 	  }
   }
+  var isEntnicheNew = {{.T.isEntnicheNew}}
+  var isHasBuyer = {{.T.obj.buyer}}
+  console.log(isEntnicheNew, isHasBuyer)
+  // 新商机管理用户是否认领该采购单位
+  function getClaimStatus() {
+    if (!isEntnicheNew || !isHasBuyer) return
+    var params = {
+      names:{{.T.obj.buyer}}
+    }
+    $.ajax({
+      type:'post',
+      url:'/entnicheNew/customer/claimcheck',
+      contentType: "application/json",
+      data: JSON.stringify(params),
+      success: function(res){
+        if (res.data) {
+          if (res.data.iscoll) {
+            $('.claim').addClass('claim-yes').removeClass('claim-no').text('已认领')
+            // 认领
+            $('.claim-yes').unbind('click').click(function() {
+              cancelClaim()
+            })
+          } else {
+            $('.claim').addClass('claim-no').removeClass('claim-yes').text('认领')
+            // 认领
+            $('.claim-no').unbind('click').click(function(e) {
+              var top = e.target.offsetParent.offsetTop + 50
+              var left = e.target.offsetLeft
+              $('#entNicheTags.tags-box').show().css({'top': top, 'left': left})
+              geEntNicheUserTags()
+              // 点击确定按钮,绑定标签
+              $('#entNicheTags .tags-footer .button-confirm').on('click', function () {
+                if (!$('#entNicheTags.tags-box').is(':hidden')){
+                  var lids = ""
+                  var lname = ""
+                  $('#entNicheTags .tags-item.tags-active').each(function() {
+                    if ($(this).attr('data-id')){
+                      if(lids != ""){
+                        lids += ",";
+                      }
+                      if(lname != "") {
+                        lname+= ",";
+                      }
+                      lids += $(this).attr('data-id');
+                      lname += $(this).text()
+                    }
+                  })
+                  let lidArr = []
+                  activeTags.forEach(v => {
+                    lidArr.push(v.lid)
+                  })
+                  var params = {
+                    name: {{.T.obj.buyer}},
+                    mold: 1,
+                    D: false,
+                    label: lidArr.toString()
+                  }
+                  console.log(params)
+                  // 执行保存绑定标签操作
+                  if (params.name !== '') {
+                    confirmClaim(params, function(res) {
+                        if (res.data) {
+                          toastFn('认领成功', 1000)
+                          $('.claim').addClass('claim-yes').removeClass('claim-no').text('已认领')
+                          getClaimStatus()
+                        } else {
+                          toastFn(res.error_msg)
+                        }
+                      $('#entNicheTags .tags-footer .button-cancel').trigger('click')
+                    })
+                  }
+                }
+              })
+              // confirmClaim()
+            })
+          }
+        }
+      }
+    })
+  }
+  // 新商机管理-认领采购单位
+  function confirmClaim (params, callback) {
+    if (!isEntnicheNew || !isHasBuyer) return
+    $.ajax({
+      type:'post',
+      url:'/entnicheNew/customer/attention',
+      contentType: "application/json",
+      data: JSON.stringify(params),
+      success: function(res){
+        if (res.error_code == 0) {
+          callback && callback(res)
+        } else {
+          console.log(res.error_msg)
+        }
+      }
+    })
+  }
+  // 新商机管理-取消认领采购单位
+  function cancelClaim() {
+    if (!isEntnicheNew || !isHasBuyer) return
+    var params = {
+      name:{{.T.obj.buyer}},
+      mold: 1,
+      D: true, // false:认领 true:取消认领
+    }
+    $.ajax({
+      type:'post',
+      url:'/entnicheNew/customer/attention',
+      contentType: "application/json",
+      data: JSON.stringify(params),
+      success: function(res){
+        if (res.error_code == 0) {
+          if (res.data) {
+            toastFn('已取消认领', 1000)
+            $('.claim').addClass('claim-no').removeClass('claim-yes').text('认领')
+            getClaimStatus()
+          } else {
+            toastFn(res.error_msg)
+          }
+        }
+      }
+    })
+  }
   $(function() {
+    getClaimStatus()
     getFileData();
     // 定时取login.js里isAdd接口返回的用户身份(暴露给window变量) 取到清除定时器
     var timer = null

部分文件因为文件数量过多而无法显示