Преглед изворни кода

Merge branch 'dev/v4.8.83_tsz' of qmx/jy into feature/v4.8.83

汤世哲 пре 1 година
родитељ
комит
4f4b8bc00e

+ 4 - 3
src/web/staticres/frontRouter/pc/cooperation/css/index.css

@@ -14,14 +14,15 @@
 .cooperation-page-banner .banner-content .text-theme{
   margin-top: 84px;
   width: 385px;
-  height: 44px;
+  height: 32px;
 }
 .text-partner{
+  margin-top: 20px;
   width: 480px;
-  height: 82px;
+  height: 46px;
 }
 .text-title{
-  margin-top: 4px;
+  margin-top: 26px;
   font-size: 28px;
   color: #383838;
 }

+ 90 - 8
src/web/staticres/js/ent-search-index-pc.js

@@ -309,18 +309,32 @@ var entSearch = new Vue({
         this.inIframe = goTemplateData.inIframe
         this.isLogin = !!params.isLogin
         if (this.isLogin) {
-            this.getPower()
+          this.getPower()
         } else {
-            this.doSearch()
+          this.doSearch()
         }
-        this.getQuery()
-        this.initPageData()
-        this.initProvinceMapList()
     },
     mounted: function () {
+        const entdata = sessionStorage.getItem('entdata')
+        if(entdata) {
+          const {filterState, listState, searchContent} = JSON.parse(entdata)
+          this.filterState = filterState
+          this.listState = listState
+          this.searchContent = searchContent
+          const proviceCity = {
+            province: this.filterState.entArea,
+            city: this.filterState.entCity,
+          }
+          this.$refs.areaCityFilter.setStateData(proviceCity)
+          sessionStorage.removeItem('entdata')
+        } else {
+          this.getQuery()
+          this.initPageData()
+          this.initProvinceMapList()
+        }
         this.initDOMEvents()
-        // 默认选中搜索范围
-        this.$refs.searchType.setState(this.filterState.searchType)
+        this.filterEcho(this.filterState)
+        
         // 全选按钮逻辑
         // this.searchTypeChange([], true)
         this.industryTab()
@@ -340,7 +354,76 @@ var entSearch = new Vue({
         // }
     },
     methods: {
+        // 筛选条件回显
+        filterEcho: function (data) {
+          const filterLabel = [
+            'searchType',
+            'entCapital',
+            'entType',
+            'entState',
+            'entTime',
+          ]
+          filterLabel.forEach(item => {
+            if (data[item] && data[item].length) {
+              if(item ==='entCapital') {
+                // 注册资本输入框是否有值
+                const writePrice = this.priceList.filter(f => {
+                  return data[item].some(v => f.value === v);
+                });
+                if(!writePrice.length) {
+                  console.info(data[item][0])
+                  const priceData = data[item][0].split('-')
+                  priceData.sort((a, b) => a - b)
+                  const min = priceData[0]
+                  const max = priceData[1]
+                  this.$refs.priceRef.setState(min, max)
+                  this.inputStatus = true
+                  this.$refs[item].setState([0])
+                } else {
+                  this.$refs[item].setState(data[item])
+                }
+              } else {
+                this.$refs[item].setState(data[item])
+              }
+            }
+            if(item === 'entTime') {
+              const thisList = []
+              data['establish'].forEach(item => {
+                if (item === '-1y') {
+                  thisList.push('A');
+                } else if (item === '1y-3y') {
+                  thisList.push('B');
+                } else if (item === '3y-5y') {
+                  thisList.push('C');
+                } else if (item === '5y-10y') {
+                  thisList.push('D');
+                } else if (item === '10y-') {
+                  thisList.push('E');
+                } else {
+                  // 回显时间输入框
+                  this.focusColor = true;
+                  thisList.push('0')
+                  const timeData = item.split('-')
+                  timeData[0] = timeData[0] + '000'
+                  timeData[1] = timeData[1] + '000'
+                  this.startTimeChange(parseInt(timeData[0]))
+                  this.endTimeChange(parseInt(timeData[1]))
+                }
+              })
+              this.$refs[item].setState(thisList)
+            }
+            if(item === 'entState') {
+              this.$refs[item].setState(data['entStatus'])
+            }
+          })
+        },
         goWorkSpace: function () {
+          const saveData = {
+            filterState: this.filterState,
+            listState: this.listState,
+            searchContent: this.searchContent
+          }
+          sessionStorage.setItem('entdata',  JSON.stringify(saveData))
           var goHref = location.origin + '/jylab/entSearch/index.html'
           window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref))
         },
@@ -844,7 +927,6 @@ var entSearch = new Vue({
 
             this.listState.loading = true
             this.listState.loaded = false
-
             $.ajax({
                 url: '/publicapply/enterpriseSearch/doQuery',
                 method: 'POST',

+ 42 - 6
src/web/staticres/js/pur-search-index-pc.js

@@ -214,14 +214,17 @@ var vm = new Vue({
       // this.qyCustmer()
       // this.jobRange()
       this.initPageData()
-      this.getList()
     },
     mounted: function () {
-        this.initCollectEvent()
-        this.initDOMEvents()
-        ewmMoveHover()
-        this.$on('updatescope', function(data) {
-            this.setData.keyList = data
+        this.filterEcho()
+        this.$nextTick(() => {
+          this.getList()
+          this.initCollectEvent()
+          this.initDOMEvents()
+          ewmMoveHover()
+          this.$on('updatescope', function(data) {
+              this.setData.keyList = data
+          })
         })
         /**
          * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
@@ -240,6 +243,22 @@ var vm = new Vue({
     },
     methods: {
         goWorkSpace: function () {
+          // 不在工作台,添加缓存
+          if(!this.inIframe) {
+            let obj = {
+              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,
+            }
+            obj.buyerClassObj = this.buyerClassObj
+            sessionStorage.setItem('purParams', JSON.stringify(obj))
+          }
           var goHref = location.origin + '/jylab/purSearch/index.html'
           window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref))
         },
@@ -627,6 +646,23 @@ var vm = new Vue({
               seoTdkUpdate(_title, _keywords, _desc)
             } catch (error) {}
         },
+        filterEcho: function (val) {
+          let purParams = sessionStorage.getItem('purParams')
+          if(purParams) {
+            purParams = JSON.parse(purParams)
+            this.searchContent = purParams.buyerName.trim()
+            this.area.province = purParams.province
+            this.area.city = purParams.city
+            this.$refs.areaCityFilter.setStateData(this.area)
+            this.buyerClassArr = purParams.buyerClass
+            this.isLogin = purParams.isCheckFollow
+            this.buyerPhoneState = purParams.isContact
+            this.listState.pageSize = purParams.pageSize
+            this.listState.pageNum = purParams.pageNum
+            this.buyerClassObj = purParams.buyerClassObj
+            sessionStorage.removeItem('purParams')
+          }
+        },
         getList: function () {
             let obj = {
               buyerName: this.searchContent.trim(),

+ 34 - 0
src/web/staticres/js/selector/area-city-pc.js

@@ -466,6 +466,40 @@ var areaCityComponent = {
             }
             this.getSelectedTagList(data)
         },
+        // 回显省份城市数据
+        // data数据格式:{province: ['北京'], city: ['郑州', '洛阳']}
+        setStateData: function (data) {
+          if(data) {
+            if(data.province.length > 0 || data.city.length > 0) {
+              this.provinceListMap['#'][0].selectedState = ''
+            }
+          }
+          for (var key in this.provinceListMap) {
+            this.provinceListMap[key].forEach(function (item) {
+              if(data.province.length > 0) {
+                data.province.forEach(v => {
+                  if(v === item.name) {
+                    item.selectedState = 'checked'
+                  }
+                })
+                
+              }
+              // 当前被选中的城市数量
+              item.children.forEach(function (iitem) {
+                if(data.city.length > 0) {
+                  data.city.forEach(v => {
+                    if(v === iitem.city) {
+                      iitem.selected = true
+                      item.selectedState = 'half'
+                    }
+                  })
+                }
+              })
+            })
+          }
+          this.selectedCity = this.getSelectedCity()
+          this.getSelectedTagList(this.selectedCity)
+        },
         // 获取当前选中城市数据
         getSelectedCity: function () {
             var counter = {}

+ 2 - 2
src/web/templates/pc/entsearchindex.html

@@ -257,7 +257,7 @@
                     <div class="selector-card">
                         <div class="selector-card-header">注册地:</div>
                         <div class="selector-card-content">
-                            <area-city-component @change="areaCityChange"></area-city-component>
+                            <area-city-component ref="areaCityFilter" @change="areaCityChange"></area-city-component>
                         </div>
                     </div>
                     <div class="selector-card price">
@@ -269,7 +269,7 @@
                                 :list="priceList"
                                 @change="inexactPriceChange"
                             ></select-list-component>
-                            <price-component class="parent-input-group" :class="{'focus-within': getInputStatus}" @confirm="exactPriceChange"></price-component>
+                            <price-component ref="priceRef" class="parent-input-group" :class="{'focus-within': getInputStatus}" @confirm="exactPriceChange"></price-component>
                         </div>
                     </div>
                     <div class="selector-card">

+ 1 - 1
src/web/templates/pc/pursearchindex.html

@@ -177,7 +177,7 @@
                     <div class="selector-card">
                         <div class="selector-card-header">所在地:</div>
                         <div class="selector-card-content">
-                            <area-city-component :show-selected-list="false" @change="areaCityChange" style="padding-right:0;"></area-city-component>
+                            <area-city-component ref="areaCityFilter" :show-selected-list="false" @change="areaCityChange" style="padding-right:0;"></area-city-component>
                         </div>
                     </div>
                     <div class="selector-card">