Эх сурвалжийг харах

Merge branch 'dev/v4.8.29_yf' of qmx/jy into feature/v4.8.29

yangfeng 2 жил өмнө
parent
commit
e566ead079

+ 75 - 72
src/web/staticres/js/pur-search-index-pc.js

@@ -153,16 +153,21 @@ var vm = new Vue({
               },
               {
                   label: '无联系方式',
-                  value: -1
+                  value: 2
               }
             ],
             buyerClassObj: {},
             buyerClassArr: [],
             buyerPhoneState: 0,
+            inIframe: false,
             isLogin: false,
             isMember: false,
             isEntService: false,
-            isNewEntNiche: false
+            isNewEntNiche: false,
+            area: {
+              province: [],
+              city: []
+            }
         }
     },
     watch: {
@@ -194,11 +199,17 @@ var vm = new Vue({
         },
     },
     created: function () {
+      var params = goTemplateData.params
+      this.inIframe = goTemplateData.inIframe
+      this.isLogin = params.login && Object.keys(params.login).length > 0
+      this.isMember = params.isMember
+      this.isEntService = params.isEntService
+      this.isNewEntNiche = params.isEntnicheNew
       this.initIndustryMap()
       this.qyCustmer()
       this.jobRange()
       this.initPageData()
-      this.getList(1)
+      this.getList()
     },
     mounted: function () {
         this.initCollectEvent()
@@ -218,13 +229,6 @@ var vm = new Vue({
             submitSelector: '.search-button'
           })
         }
-        setTimeout(() => {
-          this.isLogin = loginflag
-          this.isMember = window.memberStatus > 0
-          this.isEntService = window.isEntService
-          this.isNewEntNiche = window.isNewEntNiche
-          console.log('login:'+ this.isLogin, 'isMember:' + this.isMember, 'isEntService:' + this.isEntService, 'isNewEntNiche:' + this.isNewEntNiche)
-        }, 2000)
     },
     methods: {
         randomBgc: function () {
@@ -529,54 +533,59 @@ var vm = new Vue({
         doSearch: function () {
             $('.tags-box').hide()
             this.listState.pageNum = 1
-            this.getList(1, 'search')
+            this.getList()
+            try {
+              var val = this.searchContent
+              var baseDesc = '剑鱼标讯是国内专业的招标采购单位信息查询平台,为您提供包括采购单位信息、招标单位信息、采购人信息、招标人信息、业主单位信息的检索查询服务,查看更多招标采购单位详细信息就用剑鱼标讯!'
+              var _title = val ? val + '相关搜索结果 - 剑鱼标讯' : '采购单位查询_采购单位信息_招标采购单位大全 - 剑鱼标讯'
+              var _keywords = val ? val +',' + val + '招标,' + val + '采购,剑鱼标讯' : '采购单位,采购人信息,招标单位,招标人信息,业主单位,剑鱼标讯'
+              var _desc = val ? '剑鱼标讯是国内专业的招标采购单位信息查询平台,为您提供' + val +'相关的采购单位信息详情,帮助您全面了解采购单位最新动态,获取更多' + val + '相关搜索结果就上剑鱼标讯!' : baseDesc
+              console.log(_title, _keywords, _desc)
+              seoTdkUpdate(_title, _keywords, _desc)
+            } catch (error) {}
         },
-        getList: function (p, str) {
+        getList: function () {
             let obj = {
-                entName: this.searchContent.trim(),
-                area: this.entArea,
-                buyerclass: this.tempData,
-                business_scope: this.indusList1,
-                industry: this.getSelected(),
-                entcustomer: this.qyCheck,
-                pageSize: this.listState.pageSize,
-                pageNum: this.listState.pageNum - 1,
+              buyerName: this.searchContent.trim(),
+              province: this.area.province,
+              city: this.area.city,
+              buyerClass: this.buyerClassArr,
+              isCheckFollow: this.isLogin ? true : false,
+              isCheckReceive: this.isLogin ? true : false,
+              isContact: this.buyerPhoneState,
+              pageSize: this.listState.pageSize,
+              pageNum: this.listState.pageNum,
             }
             this.listState.loading = true
             this.listState.loaded = false
             var _this = this
-            let arrs = [], arr1 = []
             $.ajax({
-                url: '/entnicheNew/customer/corList',
+                // /jybx/buyer/:userType/buyerList
+                // fType:免费用户	pType:付费用户	vType:超级订阅用户	mType:大会员用户	eType:商机管理用户
+                // userType传哪个都一样
+                url: '/jyapi/jybx/buyer/eType/buyerList',
                 method: 'POST',
                 data: JSON.stringify(obj),
                 contentType:'application/json;charset=utf-8',
                 success: function (res) {
                     if (res.error_code === 0 && $.isArray(res.data.list)) {
-                        this.listState.listAll = res.data.list
-                        if (res.data.list.length > this.listState.pageSize) {
-                            arrs = res.data.list.slice((p - 1) * this.listState.pageSize, (p - 1) * this.listState.pageSize + this.listState.pageSize) || []
-                        } else {
-                            arrs = res.data.list
-                        }
-                        arrs.forEach(v => {
-                            v.buyerShortName = _this.getShortName(v.Buyer)
-                            v.randomBgc = _this.randomBgc()
-                            arr1.push(v.Buyer)
+                        this.listState.total = res.data.count
+                        res.data.list.forEach(function(v) {
+                          v.buyerShortName = _this.getShortName(v.buyer)
+                          v.randomBgc = _this.randomBgc()
+                          if (v.province === v.city || v.province.indexOf(v.city) > -1) {
+                            v.city = ''
+                          }
                         })
-                        if (arrs.length == 0) {
-                            this.listState.list = []
-                        } else {
-                            _this.attentionCheck(arrs, String(arr1))
-                        }
-                        this.listState.total = res.data.list.length
+                        this.listState.list = res.data.list
                         this.listState.loading = false
                     } else {
                         if (res.error_msg) {
-                            toastFn(res.error_msg, 2000)
+                          toastFn(res.error_msg, 2000)
                         }
                         this.listState.list = []
                     }
+                    this.listState.loaded = true
                 }.bind(this),
                 complete: function () {
                     this.listState.loading = false
@@ -586,27 +595,16 @@ var vm = new Vue({
         },
         onSizeChange: function (val) {
           this.listState.pageSize = val
-          console.log(this.listState.pageSize, 'pagesize');
           this.listState.pageNum = 1
           this.onPageChange(this.listState.pageNum)
         },
         onPageChange: function (p) {
             $('.tags-box').hide()
             this.listState.pageNum = p
-            let arrs = this.listState.listAll, arr1 = [], arr2 = []
             this.listState.loading = true
-            arr1 = arrs.slice((p - 1) * this.listState.pageSize, (p - 1) * this.listState.pageSize + this.listState.pageSize) || []
-            arr1.forEach(v => {
-                arr2.push(v.Buyer)
-            })
-            if (arr1.length == 0) {
-                this.listState.list = []
-            } else {
-                this.attentionCheck(arr1, String(arr2))
-            }
+            this.getList()
         },
         goTitle(name) {
-            // location.href = '/entpc/unit_portrayal/' + name
             if (this.isNewEntNiche) {
               window.open('/entpc/unit_portrayal/' + name)
             } else {
@@ -706,9 +704,9 @@ var vm = new Vue({
                     }
                     arrs.forEach(v => {
                         if (res.data.names.indexOf(v.Buyer) > -1) {
-                            v.follow1 = true
+                            v.isFollowed = true
                         } else {
-                            v.follow1 = false
+                            v.isFollowed = false
                         }
                     })
                     _this.claimcheck(arrs, item)
@@ -774,19 +772,19 @@ var vm = new Vue({
             let obj = {}, _this = this
             if (type == 0) {
                 obj = {
-                    name: per ? item : item.Buyer,
-                    province: per ? '' : item.WProvince,
-                    city: per ? '' : item.WCity,
+                    name: per ? item : item.buyer,
+                    province: per ? '' : item.province,
+                    city: per ? '' : item.city,
                     mold: type,
-                    B: per ? str : item.follow1,
+                    B: per ? str : item.isFollowed,
                 }
             } else {
                 obj = {
-                    name: per ? item : item.customerId,
-                    province: per ? '' : item.WProvince,
-                    city: per ? '' : item.WCity,
+                    name: per ? item : item.recId,
+                    province: per ? '' : item.province,
+                    city: per ? '' : item.city,
                     mold: type,
-                    D: per ? str : item.claim1,
+                    D: per ? str : item.isReceived,
                 }
             }
             // console.info(obj)
@@ -801,7 +799,7 @@ var vm = new Vue({
                           toastFn(res.error_msg, 2000)
                         } else {
                           if (type == 0) {
-                            if (str || item.follow1) {
+                            if (str || item.isFollowed) {
                               toastFn('取消关注失败!', 2000)
                             } else {
                               toastFn('关注失败!', 2000)
@@ -812,7 +810,7 @@ var vm = new Vue({
                         }
                     } else {
                       if (type == 0) {
-                        if (str || item.follow1) {
+                        if (str || item.isFollowed) {
                           toastFn('取消关注成功!', 2000)
                         } else {
                           toastFn('关注成功!', 2000)
@@ -820,10 +818,10 @@ var vm = new Vue({
                       } else {
                         toastFn('取消认领成功!', 2000)
                       }
-                      this.follow = false
-                      this.claim = false
-                      $('.custom-checkbox').prop('checked', false)
-                      _this.selectName = selectDataIds
+                      // this.follow = false
+                      // this.claim = false
+                      // $('.custom-checkbox').prop('checked', false)
+                      // _this.selectName = selectDataIds
                       _this.getList(_this.listState.pageNum)
                     }
                 }.bind(this)
@@ -890,11 +888,11 @@ var vm = new Vue({
         },
         guanAndren(item, type, index) {
             if (type == 1) {
-                if (!item.claim1) {
+                if (!item.isReceived) {
                     var top = 125 * (index + 1) + 'px'
                     this.datas = {
-                      name: item.Buyer,
-                      industry: item.Buyerclass
+                      name: item.buyer,
+                      industry: item.buyerClass
                     }
                     $('.tags-box').slideToggle(function () {
                         window.activeTags = []
@@ -1018,11 +1016,16 @@ var vm = new Vue({
         },
         areaCityChange: function (area) {
             var city = []
+            var province = []
             for (var key in area) {
+              if (area[key].length === 0) {
+                province.push(key)
+              } else {
                 city = city.concat(area[key])
+              }
             }
-            this.entArea = area
-            // this.searchContent = ''
+            this.area.province = province
+            this.area.city = city
             this.doSearch()
         },
         isFilterShow: function () {