Browse Source

筛选数据回显

TANGSHIZHE 4 years ago
parent
commit
ba354374aa

+ 117 - 22
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -15,6 +15,12 @@ var vm = new Vue({
       // 时间参数
       time:'',
       timeText: '时间',
+      // 选择的时间数据
+      selectDate: {
+        startDate: '',
+        endDate: '',
+        exact: ''
+      },
       // 地区参数
       area: '',
       // 行业参数
@@ -25,13 +31,87 @@ var vm = new Vue({
       key: '',
       // 公告类型
       subtype: '',
-      screenShow: false
+      screenShow: false,
+      tagText: {
+        timeText: '时间',
+        areaText: '地区',
+        industryText: '行业',
+        cateText: '采购单位',
+        keywordText: '关键词',
+        noticeText: '公告类型'
+      },
+      selectCateList: [], // 选择的采购单位类型列表
+      selectAreaList: [], // 选择的采购单位类型列表
+      selectIndustryList: [], // 选择的行业列表
+      selectKeyWordList: [], // 选择的行业列表
+      selectNoticeList: [] // 选择的公告类型列表
     }
   },
-  created () {
-    this.getUserRoot()
+  mounted () {
+    var recover = this.recover()
+    if (!recover) {
+      this.getUserRoot()
+    }
   },
   methods: {
+    recover: function () {
+      let _this = this
+      var excludeKey = ['sessStorageKey']
+      var $data = sessionStorage.getItem(this.sessStorageKey)
+      if ($data) {
+          $data = JSON.parse($data)
+          for (var key in $data) {
+              if (excludeKey.indexOf(key) !== -1) {
+                  continue
+              }
+              this.$data[key] = $data[key]
+          }
+          const res = $data
+          // 时间
+          console.log(res)
+          if(res.time != '') {
+            this.selectDate.startDate = res.time.split('_')[0] * 1000
+            this.selectDate.endDate= res.time.split('_')[1] * 1000
+          }
+          // 地区
+          if(res.area != '') {
+            setTimeout(() => {
+              $('.areaText').html(res.tagText.areaText)
+            })
+            this.selectAreaList = res.area.split(',')
+          }
+          // 采购单位类型
+          if(res.buyerclass != '') {
+            setTimeout(() => {
+              $('.cateText').html(res.tagText.cateText)
+            })
+            this.selectCateList = res.buyerclass.split(',')
+          }
+          // 行业
+          if(res.subscopeclass != '') {
+            setTimeout(() => {
+              $('.industryText').html(res.tagText.industryText)
+            })
+            this.selectIndustryList = res.subscopeclass.split(',')
+          }
+          // 关键词
+          if(res.key != '') {
+            setTimeout(() => {
+              $('.keywordText').html(res.tagText.keywordText)
+            })
+            this.selectKeyWordList = res.key.split(',')
+          }
+          // 公告类型
+          if(res.subtype != '') {
+            setTimeout(() => {
+              $('.noticeText').html(res.tagText.noticeText)
+            })
+            this.selectNoticeList = res.subtype.split(',')
+          }
+          sessionStorage.removeItem(this.sessStorageKey)
+      }
+      return !!$data
+    },
     // 判断是否是有筛选条件
     getUserRoot: function() {
       let _this = this
@@ -39,7 +119,9 @@ var vm = new Vue({
         url: '/publicapply/bidcoll/power',
         type: 'POST',
         success: function(res) {
-          console.log(res)
+          if(res.data.member) {
+            $(".switch").addClass("only-member");
+          }
           if(res.data.entniche || res.data.member || res.data.vip > 0) {
             _this.screenShow = true
           } else {
@@ -57,7 +139,7 @@ var vm = new Vue({
         }
         if (timeRange.start == 0 && timeRange.end == 0) {
           this.time = ''
-          this.timeText = '不限'
+          this.tagText.timeText = '不限'
         } else if(timeRange.start == 0 && timeRange.end != 0) {
           this.time = '_' + timeRange.end
         } else if(timeRange.start != 0 && timeRange.end == 0) {
@@ -65,48 +147,54 @@ var vm = new Vue({
         } else {
           this.time = timeRange.start + '_' + timeRange.end
         }
+        this.selectDate.exact = data.exact
         switch (data.data.exact) {
           case 'all': {
-            this.timeText = '不限'
+            this.tagText.timeText = '不限'
             break
           }
           case 'lately7': {
-            this.timeText = '最近7天'
+            this.tagText.timeText = '最近7天'
             break
           }
           case 'lately30': {
-            this.timeText = '最近30天'
+            this.tagText.timeText = '最近30天'
             break
           }
           case 'lastYear': {
-            this.timeText = '去年'
+            this.tagText.timeText = '去年'
             break
           }
           case 'exact': {
-            this.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
+            this.tagText.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
             break
           }
         }
         this.setToggle()
         setTimeout(() => {
-          FTAGData(this.time)
+          FTAGData(this.time, this.area, this.subscopeclass, this.buyerclass, this.key, this.subtype)
         }, 500)
         return
       } else if(data.name === 'areaItem'){
         $('.areaText').html(data.t)
-        this.area = data.data.join('、')
+        this.tagText.areaText = data.t
+        this.area = data.data.join(',')
       } else if(data.name === 'industryItem'){
         $('.industryText').html(data.t)
-        this.subscopeclass = data.data.join(',')
+        this.tagText.industryText = data.t
+        this.subscopeclass = data.data.join(',')
       } else if(data.name === 'cateItem'){
         $('.cateText').html(data.t)
-        this.buyerclass = data.data.join(',')
+        this.tagText.cateText = data.t
+        this.buyerclass = data.data.join(',')
       } else if(data.name === 'keywordItem'){
         $('.keywordText').html(data.t)
+        this.tagText.keywordText = data.t
         this.key = data.data.join(',')
       } else if(data.name === 'noticeItem'){
         $('.noticeText').html(data.t)
-        this.subtype = data.data.join(',')
+        this.tagText.noticeText = data.t
+        this.subtype = data.data.join(',')
       } else if(data.name === 'rootItem'){
         tointroducepage()
       }
@@ -118,20 +206,27 @@ var vm = new Vue({
     cancel: function(data){
       console.log(data)
       if(data.name === 'dateItem'){
-        firstTime = (data.data.start / 1000).toFixed(0) + '_' + (data.data.end / 1000).toFixed(0)
-        initpage()
+        this.time = ''
       } else if(data.name === 'areaItem'){
-        // this.area = data.data.join('、')
+        this.area = ''
+        $('.areaText').html('地区')
       } else if(data.name === 'industryItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.subscopeclass = ''
+        $('.industryText').html('行业')
       } else if(data.name === 'cateItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.buyerclass = ''
+        $('.cateText').html('采购单位')
       } else if(data.name === 'keywordItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.key = ''
+        $('.keywordText').html('关键词')
       } else if(data.name === 'noticeItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.subtype = ''
+        $('.noticeText').html('公告类型')
       }
       this.setToggle()
+      setTimeout(()=>{
+        this.getAjaXParams()
+      }, 500)
     },
     getAjaXParams: function() {
       ajaxFun(this.time, this.area, this.subscopeclass, this.buyerclass, this.key, this.subtype)

+ 5 - 5
src/jfw/modules/app/src/web/templates/frontRouter/collection/sess/index.html

@@ -42,14 +42,14 @@
             </div>
           </div>
           <van-dropdown-menu v-show="limitshow" :get-container="getContainer" :close-on-click-outside="false">
-            <van-dropdown-item  title="个人标签"  ref="tagItem">
-              <tags-component @confirm="confirm" @cancel="cancel" :taglist="tagList"></tags-component>
+            <van-dropdown-item  :title="tagText.perText"  ref="tagItem">
+              <tags-component ref="tagcomp" @confirm="confirm" @cancel="cancel" :selecttaglist="selectTagList" :taglist="tagList"></tags-component>
             </van-dropdown-item>
             <van-dropdown-item :title="tagText.timeText" ref="dateItem">
-              <date-component @confirm="confirm" @cancel="cancel"></date-component>
+              <date-component ref="datecom" @confirm="confirm" @cancel="cancel" :selectdate="selectDate"></date-component>
             </van-dropdown-item>
-            <van-dropdown-item title="采购单位类型" ref="cateItem">
-              <cate-component @confirm="confirm" @cancel="cancel"></cate-component>
+            <van-dropdown-item :title="tagText.cateText" ref="cateItem">
+              <cate-component @confirm="confirm" @cancel="cancel" :selectcatelist="selectCateList"></cate-component>
             </van-dropdown-item>
             <van-dropdown-item ref="buyerItem" v-model="limitlist.buyerPhone" title="采购单位联系方式">
               <phone-component :data="params.buyerData" @confirm="confirm"></phone-component>

+ 55 - 54
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -75,11 +75,14 @@
         }
     </style>
 </head>
-<body class="p13" id="viperSuper" style="background: #fff;">
+<body class="p13" id="viperSuper" style="background: #fff;overflow: hidden;">
 <!-- 加载数据-->
 <div class="loading_" id="loading">
     <p><span></span></p>
 </div>
+<div id="jyKeepComponent">
+    <keep-component ref="vKeepComponent" @on-change-keep="changeKeepStatus"  :bid="nowOpenBid" :first="false"></keep-component>
+</div>
 <div class="app-layout-header">
   <ul>
     <li>订阅</li>
@@ -126,8 +129,8 @@
                         </p>
                     </div> -->
                     <van-dropdown-menu style="width: auto;overflow-x: auto;">
-                        <van-dropdown-item :title="timeText"  ref="dateItem">
-                            <date-component @cancel="cancel" @confirm="confirm" />
+                        <van-dropdown-item :title="tagText.timeText"  ref="dateItem">
+                            <date-component @cancel="cancel" @confirm="confirm" :selectdate="selectDate"/>
                         </van-dropdown-item>
                         <van-dropdown-item ref="areaItem">
                             <template #title>
@@ -137,7 +140,7 @@
                                     <span class="root_open">开通</span>
                                 </span>
                             </template>
-                            <area-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></area-component>
+                            <area-component v-if="screenShow" @cancel="cancel" @confirm="confirm" :selectarealist="selectAreaList"></area-component>
                             <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item ref="industryItem">
@@ -148,7 +151,7 @@
                                     <span class="root_open">开通</span>
                                 </span>
                             </template>
-                            <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></industry-component>
+                            <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm" :selectindustrylist="selectIndustryList"></industry-component>
                             <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item  ref="cateItem">
@@ -159,7 +162,7 @@
                                     <span class="root_open">开通</span>
                                 </span>
                             </template>
-                            <cate-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></cate-component>
+                            <cate-component @cancel="cancel" v-if="screenShow" @confirm="confirm"  :selectcatelist="selectCateList"></cate-component>
                             <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item title="关键词" ref="keywordItem">
@@ -170,7 +173,7 @@
                                     <span class="root_open">开通</span>
                                 </span>
                             </template>
-                            <keyword-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></keyword-component>
+                            <keyword-component @cancel="cancel" v-if="screenShow" @confirm="confirm"  :selectkeywordlist="selectKeyWordList"></keyword-component>
                             <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                         <van-dropdown-item title="公告类型" ref="noticeItem">
@@ -181,7 +184,7 @@
                                     <span class="root_open">开通</span>
                                 </span>
                             </template>
-                            <notice-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></notice-component>
+                            <notice-component @cancel="cancel" v-if="screenShow" @confirm="confirm" :selectnoticelist="selectNoticeList"></notice-component>
                             <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
                         </van-dropdown-item>
                     </van-dropdown-menu>
@@ -347,6 +350,7 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/cate-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/keyword-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/js/notice-mobile.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/keep-tags/keep-tags-template.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/historypush.js?v={{Msg "seo" "version"}}'></script>
 <!--<script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/local/weui.min.js"></script>-->
 <script src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
@@ -810,16 +814,6 @@
             extend(0);
         }
       });
-    //   判断是否是大会员
-      $.ajax({
-        url: '/publicapply/bidcoll/power',
-        type: 'POST',
-        success: function(res) {
-          if(res.data.member) {
-            $(".switch").addClass("only-member");
-          }
-        }
-      })
   }
   // 是否有未读的周报月报
   function reportHtml(r){
@@ -1158,49 +1152,55 @@ function hasNoData() {
             $('.collec_star').eq(item).find('.weishoucang').show()
         }
       })
-  }
 
-  // 收藏或取消收藏
-  $(document).off('click').on('click','.collec_star', function(e){
-      const _this = this
-      e.stopPropagation()
-      const id = $(this).attr('data-id')
-    const paramsObj = {
-        baction: 'C',
-        binfo: [
-            {
-            bid: id
+       // 收藏或取消收藏
+        $('.collec_star').on('click', function(e){
+            const _this = this
+            e.stopPropagation()
+            const id = $(this).attr('data-id')
+            const paramsObj = {
+                binfo: [
+                    {
+                    bid: id
+                    }
+                ]
             }
-        ]
-    }
-    $.ajax({
-        url: '/publicapply/bidcoll/action',
-        type: "POST",
-        contentType: 'application/json;charset=utf-8',
-        data:JSON.stringify(paramsObj),
-        success: function(res){
-            console.log(res)
-            if(res.error_code == 0) {
-                if(res.data) {
-                    $(_this).find('.shoucang').show()
-                    $(_this).find('.weishoucang').hide()
-                    _this.$toast(res.error_msg)
-                } else {
-                    _this.$toast(res.error_msg)
-                }
+            var shoucang = $(_this).find('.weishoucang').is(':hidden')
+            // 说明未收藏,点击收藏
+            if (vKeepComponent) {
+                vKeepComponent.changeBid(id, !shoucang)
+                vKeepComponent.changeKeepStatus(!shoucang, _this)
             }
+        })
+  }
+
+  var vKeepComponent = new Vue({
+        delimiters: ['${', '}'],
+        el: '#jyKeepComponent',
+        data: {
+            nowOpenBid: ''
         },
-        error: function(err){
-            _this.$toast(res.error_msg)
+        methods: {
+            changeBid (id, type) {
+                this.nowOpenBid = id
+                this.$refs.vKeepComponent.ajaxAddKeep(id, type)
+            },
+            changeKeepStatus (type, that) {
+                changeCollectStatus(type, that)
+            }
         }
     })
-    this.listState.list.map((item,index) => {
-    console.log(item)
-    if(id === item._id) {
-        this.getList()
+
+    function changeCollectStatus(type, that) {
+        console.log(type, that)
+        if(type) {
+            $(that).find('.shoucang').show()
+            $(that).find('.weishoucang').hide()
+        } else {
+            $(that).find('.shoucang').hide()
+            $(that).find('.weishoucang').show()
+        }
     }
-    })
-  })
 
   //
   function formatDate(date, sl) {
@@ -1242,6 +1242,7 @@ function hasNoData() {
           var index = $(this).find("a.bt").attr("projectm");
           var pdate = $(this).find("a.bt").attr("push_date");
           beforeJump(eid, h, sds, index, pdate, isv);
+          sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
       });
       $("#list").append(content);
       $(".findnull").hide();

+ 20 - 0
src/web/staticres/common-module/collection/js/area-mobile.js

@@ -29,6 +29,10 @@ var areaComponent = {
     multiple: {
       type: Boolean,
       default: true
+    },
+    selectarealist: {
+      type: Array,
+      default: []
     }
   },
   data:function () {
@@ -72,6 +76,7 @@ var areaComponent = {
             this.optionData(this.setParam.area,pushtime)
         }
     }
+    this.setState()
 },
   methods: {
     recover: function () {
@@ -114,6 +119,21 @@ var areaComponent = {
     }
     })
 },
+  // 回显数据
+  setState: function () {
+    console.log(this.selectarealist)
+    let optionArr = this.selectarealist
+    for (var key in this.indexListMap) {
+      this.indexListMap[key].forEach(function (item) {
+          item.selected = false
+          optionArr.forEach(function(sum) {
+            if(item.name == sum) {
+              item.selected = true
+            }
+          })
+      })
+    }
+  },
    // 每个按钮点击事件
   clickItems:function (item) {
       if (this.multiple) {

+ 22 - 4
src/web/staticres/common-module/collection/js/cate-mobile.js

@@ -63,6 +63,7 @@ var cateComponentTemplate = `<div class="j-container">
 
 var cateComponent = {
   name: 'cate-mobile',
+  props: ['selectcatelist'],
   template: cateComponentTemplate,
   data:function () {
     return {
@@ -79,12 +80,29 @@ var cateComponent = {
     }
   },
   created () {
-    this.getIndustryData()
+    this.getData()
     this.getbBtnClick()
+    this.setState()
   },
   methods: {
-    // 获取行业数据
-    getIndustryData: function(){
+    setState: function() {
+      console.log(this.selectcatelist)
+      let arr = this.selectcatelist
+      if (this.selectcatelist) {
+        this.tablist.forEach(function(item) {
+          item[Object.keys(item)[0]].forEach(function(data) {
+            arr.forEach(function(sum) {
+              if(data.name == sum) {
+                data.type = true
+              }
+            })
+          })
+        })
+        this.canClick = false
+      }
+    },
+    // 获取数据
+    getData: function(){
       const _this = this
       let maxarr = []
       _this.tablist.forEach(function(item,index) {
@@ -221,7 +239,7 @@ var cateComponent = {
           }
         })
       })
-      t = '采购单位' + cateArr.length
+      t = '采购单位类型' + cateArr.length
       let params = {
         name: 'cateItem',
         data: cateArr,

+ 28 - 9
src/web/staticres/common-module/collection/js/date-mobile.js

@@ -25,7 +25,7 @@ var dateComponentTemplate = `<div class="j-container">
           class="datepopup"
           :show-toolbar="false"
           swipe-duration="300"
-          v-model="datePicker.currentDate"
+          v-model="datePicker.startcurrentDate"
           type="date"
           title="选择年月日"
           ref="getstartValues"
@@ -59,7 +59,7 @@ var dateComponentTemplate = `<div class="j-container">
           class="datepopup"
           :show-toolbar="false"
           swipe-duration="300"
-          v-model="datePicker.currentDate"
+          v-model="datePicker.endcurrentDate"
           ref="getendValues"
           type="date"
           title="选择年月日"
@@ -88,6 +88,7 @@ var dateComponentTemplate = `<div class="j-container">
 
 var dateComponent = {
   name: 'date-mobile',
+  props: ['selectdate'],
   template: dateComponentTemplate,
   data:function () {
     return {
@@ -122,7 +123,8 @@ var dateComponent = {
         endshow: false,
         minDate: new Date(2020, 0, 1),
         maxDate: new Date(2025, 10, 1),
-        currentDate: new Date(),
+        startcurrentDate: new Date(),
+        endcurrentDate: new Date(),
       },
       dateTimePickerState: {
         start: '',
@@ -132,13 +134,19 @@ var dateComponent = {
       },
     }
   },
+  created () {
+    this.setState()
+  },
   methods: {
-    setState (data) {
+    setState () {
       // {
       //   start: 1620230400000, // 2021-5-6
       //   end: 1620489600000, // 2021-5-9
       //   exact: 'all'
       // }
+      console.log(this.selectdate)
+      let data = this.selectdate
+      console.log(data)
       if (!data || Object.keys(data).length === 0) {
         this.setTimeSelectListState('all')
       } else {
@@ -164,11 +172,14 @@ var dateComponent = {
             break
           }
           case 'exact': {
-            // if (!data.start || !data.end) break
-            if (data.start < data.end) {
-              this.dateTimePickerState.start = new Date(data.start)
-              this.dateTimePickerState.end = new Date(data.end)
-            }
+            this.setTimeSelectListState('exact')
+            this.dateStyle = true
+            this.dateTimePickerState.start = new Date(data.startDate)
+            this.dateTimePickerState.end = new Date(data.endDate)
+            this.dateTimePickerState.startPlaceHolder = new Date(data.startDate).pattern('yyyy年MM月dd日')
+            this.dateTimePickerState.endPlaceHolder = new Date(data.endDate).pattern('yyyy年MM月dd日')
+            this.datePicker.startcurrentDate = new Date(new Date(data.startDate).pattern('yyyy'), new Date(data.startDate).pattern('MM') - 1 , new Date(data.startDate).pattern('dd'))
+            this.datePicker.endcurrentDate = new Date(new Date(data.endDate).pattern('yyyy'), new Date(data.endDate).pattern('MM') - 1, new Date(data.endDate).pattern('dd'))
             break
           }
           default: {
@@ -177,6 +188,14 @@ var dateComponent = {
         }
       }
     },
+    setTimeSelectListState: function (value, callback) {
+      this.timeSelectList.forEach(function (item) {
+          item.selected = false
+          if(item.value == value) {
+            item.selected = true
+          }
+      })
+    },
     clearDateTimePicker () {
       this.dateTimePickerState.start = ''
       this.dateTimePickerState.end = ''

+ 83 - 33
src/web/staticres/common-module/collection/js/index-wx.js

@@ -31,8 +31,9 @@ var vNode = {
       buyerPhone: 0,
       winnerPhone: 0
     },
-    // 个人标签列表
-    tagList: [],
+    tagList: [], // 个人标签列表
+    selectTagList: [], //选择标签列表
+    selectCateList: [], // 选择的采购单位类型列表
     // 下拉菜单参数
     params: {
       value2: '',
@@ -54,26 +55,41 @@ var vNode = {
     // 收藏日期选择时间参数
     selectDate: {
       startDate: '',
-      endDate: ''
+      endDate: '',
+      exact: ''
     },
     tagText: {
-      timeText: '收藏时间'
+      timeText: '收藏时间',
+      perText: '个人标签',
+      cateText: '采购单位类型',
     },
     limitshow: false, // 筛选框显示
     condition: true, // 列表星星显示
     personTagactive:0, //个人标签选择按钮下标
-    screenShow: false // 筛选按钮是否显示
+    screenShow: false, // 筛选按钮是否显示
   },
   computed: {},
   created () {
-    this.getUserRoot()
-    this.getList()
-    this.getTagsList()
+    var recover = this.recover()
+    if (!recover) {
+      this.getList()
+      this.getUserRoot()
+      this.getTagsList()
+    }
   },
   mounted() {
+    if(this.tagText.timeText !=='' || this.tagText.perText != '' || this.tagText.cateText != '' ||  this.limitlist.buyerPhone != 0 || this.limitlist.winnerPhone != 0) {
+      this.limitshow = true
+    }
+  },
+  mounted () {
+    setTimeout(() => {
+      $(this.$refs.jList).scrollTop(this.listState.scrollTop)
+    }, 300)
   },
   methods: {
     recover: function () {
+      let _this = this
       var excludeKey = ['sessStorageKey']
       var $data = sessionStorage.getItem(this.sessStorageKey)
       if ($data) {
@@ -84,11 +100,25 @@ var vNode = {
               }
               this.$data[key] = $data[key]
           }
+          const res = _this.$data.limitlist
+          // 标签
+          if(res.label != '') {
+            this.selectTagList = res.label.split(',')
+          }
+          // 时间
+          if(res.selectTime != '') {
+            this.selectDate.startDate = res.selectTime.split('_')[0] * 1000
+            this.selectDate.endDate= res.selectTime.split('_')[1] * 1000
+          }
+          // 采购单位类型
+          if(res.buyerclass != '') {
+            this.selectCateList = res.buyerclass.split(',')
+          }
           sessionStorage.removeItem(this.sessStorageKey)
       }
       return !!$data
-  },
-    // 判断是否是有筛选条件
+    },
+    // 判断是否是有权限
     getUserRoot: function() {
       let _this = this
       $.ajax({
@@ -108,13 +138,8 @@ var vNode = {
     linkRouter: function(id) {
       var scrollTop = $(this.$refs.jList).scrollTop()
       // 如果滚动高度为0,或者entList长度为0,则不缓存数据(即返回刷新)
-      if (scrollTop == 0 || this.listState.list.length === 0) {
-          // do something
-      } else {
-          this.listInfo.scrollTop = $(this.$refs.jList).scrollTop()
-          sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
-      }
-      // location.href = '/front/wx_dataExport/submitOrder?id=' + id + '&source=d&dataspec='
+      this.listState.scrollTop = scrollTop
+      sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
       location.href = '/article/content/' + id + '.html'
     },
     // 筛选按钮
@@ -237,6 +262,7 @@ var vNode = {
         } else {
           this.limitlist.selectTime = timeRange.start + '_' + timeRange.end
         }
+        this.selectDate.exact = data.data.exact
         switch (data.data.exact) {
           case 'all': {
             this.tagText.timeText = '不限'
@@ -261,20 +287,41 @@ var vNode = {
         }
         this.limitlist.selectTime = (data.data.start / 1000).toFixed(0) + '_' + (data.data.end / 1000).toFixed(0)
       } else if (data.name == 'cateItem') {
+        this.tagText.cateText = data.t
         this.limitlist.buyerclass = data.data.join(',')
       } else if (data.name == 'tagsItem') {
+        this.tagText.perText = data.t
         this.limitlist.label = data.data
       } else if (data.name == 'buyerItem') {
         this.limitlist.buyerPhone = parseInt(data.data)
       } else if (data.name == 'winnerItem') {
         this.limitlist.winnerPhone = parseInt(data.data)
       }
+      sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
       this.setToggle()
       this.reLoadList()
     },
     // 取消按钮事件
     cancel: function(data) {
       console.log(data)
+      if(data.name == 'dateItem'){
+        this.limitlist.selectTime = ''
+        this.tagText.timeText = '收藏时间'
+        this.selectDate.exact = 'all'
+        this.$refs.datecom.setState()
+      } else if (data.name == 'cateItem') {
+        this.tagText.cateText = '采购单位类型'
+        this.limitlist.buyerclass = ''
+      } else if (data.name == 'tagsItem') {
+        this.limitlist.label = ''
+        this.tagText.perText = '个人标签'
+      } else if (data.name == 'buyerItem') {
+        this.limitlist.buyerPhone = 0
+      } else if (data.name == 'winnerItem') {
+        this.limitlist.winnerPhone = 0
+      }
+      this.reLoadList()
+      this.setToggle()
     },
     // 刷新列表
     reLoadList: function() {
@@ -324,23 +371,26 @@ var vNode = {
     },
     // 数据导出
     dataReport: function() {
-      let idArr = []
-      this.listState.list.forEach(function(item) {
-        idArr.push(item._id)
-      })
-      $.ajax({
-        url: '/publicapply/dataexpoet/bycollection',
-        type: 'POST',
-        data: {
-          selectIds: idArr.join(',')
-        },
-        success: function(res) {
-          console.log(res)
-          if(res.error_code == 0 && res.data) {
-            location.href = '/front/wx_dataExport/submitOrder?id=' + res.data._id + '&source=d&dataspec='
+      if(this.listState.list.length == 0) {
+        this.$toast('暂无数据')
+      } else {
+        $.ajax({
+          url: '/publicapply/dataexpoet/bycollection',
+          type: 'POST',
+          data: {
+            label: this.limitlist.label,
+            selectTime: this.limitlist.selectTime,
+            buyerclass: this.limitlist.buyerclass,
+            buyerPhone: this.limitlist.buyerPhone,
+            winnerPhone: this.limitlist.winnerPhone,
+          },
+          success: function(res) {
+            if(res.error_code == 0 && res.data) {
+              location.href = '/front/wx_dataExport/submitOrder?id=' + res.data._id + '&source=d&dataspec='
+            }
           }
-        }
-      })
+        })
+      }
     }
   }
 }

+ 81 - 40
src/web/staticres/common-module/collection/js/index.js

@@ -19,9 +19,6 @@ var vNode = {
       total: 0,
       list: []
     },
-    listInfo: {
-      scrollTop: 0
-    },
     // 筛选参数
     limitlist: {
       pageNum: 1,
@@ -31,8 +28,9 @@ var vNode = {
       buyerPhone: 0,
       winnerPhone: 0
     },
-    // 个人标签列表
-    tagList: [],
+    tagList: [], // 个人标签列表
+    selectTagList: [], //选择标签列表
+    selectCateList: [], // 选择的采购单位类型列表
     // 下拉菜单参数
     params: {
       value2: '',
@@ -54,32 +52,40 @@ var vNode = {
     // 收藏日期选择时间参数
     selectDate: {
       startDate: '',
-      endDate: ''
+      endDate: '',
+      exact: ''
     },
     // 标签文案
     tagText: {
-      timeText: '收藏时间'
+      timeText: '收藏时间',
+      perText: '个人标签',
+      cateText: '采购单位类型',
     },
     limitshow: false, // 筛选框显示
     condition: true, // 列表星星显示
     personTagactive:0, //个人标签选择按钮下标
-    screenShow: false // 筛选按钮是否显示
+    screenShow: false, // 筛选按钮是否显示
   },
   computed: {},
   created () {
     var recover = this.recover()
     if (!recover) {
-      this.getUserRoot()
       this.getList()
+      this.getUserRoot()
       this.getTagsList()
     }
+    if(this.tagText.timeText !=='' || this.tagText.perText != '' || this.tagText.cateText != '' ||  this.limitlist.buyerPhone != 0 || this.limitlist.winnerPhone != 0) {
+      this.limitshow = true
+    }
   },
   mounted() {
-    console.log(this.listInfo.scrollTop, $(this.$refs.jList))
-    $(this.$refs.jList).scrollTop(this.listInfo.scrollTop)
+    setTimeout(() => {
+      $(this.$refs.jList).scrollTop(this.listState.scrollTop)
+    }, 300)
   },
   methods: {
     recover: function () {
+      let _this = this
       var excludeKey = ['sessStorageKey']
       var $data = sessionStorage.getItem(this.sessStorageKey)
       if ($data) {
@@ -90,11 +96,25 @@ var vNode = {
               }
               this.$data[key] = $data[key]
           }
+          const res = _this.$data.limitlist
+          // 标签
+          if(res.label != '') {
+            this.selectTagList = res.label.split(',')
+          }
+          // 时间
+          if(res.selectTime != '') {
+            this.selectDate.startDate = res.selectTime.split('_')[0] * 1000
+            this.selectDate.endDate= res.selectTime.split('_')[1] * 1000
+          }
+          // 采购单位类型
+          if(res.buyerclass != '') {
+            this.selectCateList = res.buyerclass.split(',')
+          }
           sessionStorage.removeItem(this.sessStorageKey)
       }
       return !!$data
   },
-    // 判断是否是有筛选条件
+    // 判断是否是有权限
     getUserRoot: function() {
       let _this = this
       $.ajax({
@@ -114,12 +134,8 @@ var vNode = {
     linkRouter: function(id) {
       var scrollTop = $(this.$refs.jList).scrollTop()
       // 如果滚动高度为0,或者entList长度为0,则不缓存数据(即返回刷新)
-      if (scrollTop == 0 || this.listState.list.length === 0) {
-          // do something
-      } else {
-          this.listInfo.scrollTop = $(this.$refs.jList).scrollTop()
-          sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
-      }
+      this.listState.scrollTop = scrollTop
+      sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
       location.href = '/jyapp/article/content/' + id + '.html'
     },
     // 筛选按钮
@@ -233,7 +249,7 @@ var vNode = {
         }
         if (timeRange.start == 0 && timeRange.end == 0) {
           this.limitlist.selectTime = ''
-          this.timeText = '不限'
+          this.tagText.timeText = '不限'
         } else if(timeRange.start == 0 && timeRange.end != 0) {
           this.limitlist.selectTime = '_' + timeRange.end
         } else if(timeRange.start != 0 && timeRange.end == 0) {
@@ -241,43 +257,65 @@ var vNode = {
         } else {
           this.limitlist.selectTime = timeRange.start + '_' + timeRange.end
         }
+        this.selectDate.exact = data.data.exact
         switch (data.data.exact) {
           case 'all': {
-            this.timeText = '不限'
+            this.tagText.timeText = '不限'
             break
           }
           case 'lately7': {
-            this.timeText = '最近7天'
+            this.tagText.timeText = '最近7天'
             break
           }
           case 'lately30': {
-            this.timeText = '最近30天'
+            this.tagText.timeText = '最近30天'
             break
           }
           case 'lastYear': {
-            this.timeText = '去年'
+            this.tagText.timeText = '去年'
             break
           }
           case 'exact': {
-            this.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
+            this.tagText.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
             break
           }
         }
       } else if (data.name == 'cateItem') {
+        this.tagText.cateText = data.t
         this.limitlist.buyerclass = data.data.join(',')
       } else if (data.name == 'tagsItem') {
+        this.tagText.perText = data.t
         this.limitlist.label = data.data
       } else if (data.name == 'buyerItem') {
         this.limitlist.buyerPhone = parseInt(data.data)
       } else if (data.name == 'winnerItem') {
         this.limitlist.winnerPhone = parseInt(data.data)
       }
+      sessionStorage.setItem(this.sessStorageKey, JSON.stringify(this.$data))
       this.setToggle()
       this.reLoadList()
     },
     // 取消按钮事件
     cancel: function(data) {
       console.log(data)
+      if(data.name == 'dateItem'){
+        this.limitlist.selectTime = ''
+        this.tagText.timeText = '收藏时间'
+        this.selectDate.exact = 'all'
+        this.$refs.datecom.setState()
+      } else if (data.name == 'cateItem') {
+        this.tagText.cateText = '采购单位类型'
+        this.limitlist.buyerclass = ''
+      } else if (data.name == 'tagsItem') {
+        this.limitlist.label = ''
+        this.tagText.perText = '个人标签'
+      } else if (data.name == 'buyerItem') {
+        this.limitlist.buyerPhone = 0
+      } else if (data.name == 'winnerItem') {
+        this.limitlist.winnerPhone = 0
+      }
+      this.reLoadList()
+      this.setToggle()
     },
     // 刷新列表
     reLoadList: function() {
@@ -327,23 +365,26 @@ var vNode = {
     },
     // 数据导出
     dataReport: function() {
-      let idArr = []
-      this.listState.list.forEach(function(item) {
-        idArr.push(item._id)
-      })
-      $.ajax({
-        url: '/publicapply/dataexpoet/bycollection',
-        type: 'POST',
-        data: {
-          selectIds: idArr.join(',')
-        },
-        success: function(res) {
-          console.log(res)
-          if(res.error_code == 0 && res.data) {
-            location.href = '/jyapp/front/dataExport/toCreateOrderPage?id=' + res.data._id + '&source=d&payway=&dataspec='
+      if(this.listState.list.length == 0) {
+        this.$toast('暂无数据')
+      }else {
+        $.ajax({
+          url: '/publicapply/dataexpoet/bycollection',
+          type: 'POST',
+          data: {
+            label: this.limitlist.label,
+            selectTime: this.limitlist.selectTime,
+            buyerclass: this.limitlist.buyerclass,
+            buyerPhone: this.limitlist.buyerPhone,
+            winnerPhone: this.limitlist.winnerPhone,
+          },
+          success: function(res) {
+            if(res.error_code == 0 && res.data) {
+              location.href = '/jyapp/front/dataExport/toCreateOrderPage?id=' + res.data._id + '&source=d&payway=&dataspec='
+            }
           }
-        }
-      })
+        })
+      }
     }
   }
 }

+ 48 - 137
src/web/staticres/common-module/collection/js/industry-mobile.js

@@ -62,6 +62,7 @@ var industryComponentTemplate = `<div class="j-container">
 
 var industryComponent = {
   name: 'industry-mobile',
+  props: ['selectindustrylist'],
   template: industryComponentTemplate,
   data:function () {
     return {
@@ -78,146 +79,55 @@ var industryComponent = {
     // 获取行业数据
     getIndustryData: function(){
       const _this = this
-      _this.tablist =  [
-        {
-          "建筑工程": [
-            "勘察设计",
-            "工程施工",
-            "监理咨询",
-            "材料设备",
-            "机电安装"
-          ]
-        },
-        {
-          "水利水电": [
-            "水利工程",
-            "发电工程",
-            "航运工程",
-            "其他工程"
-          ]
-        },
-        {
-          "能源化工": [
-            "原材料",
-            "仪器仪表",
-            "新能源",
-            "设备物资",
-            "化工产品",
-            "设备"
-          ]
-        },
-        {
-          "弱电安防": [
-            "综合布线",
-            "智能系统",
-            "智能家居"
-          ]
-        },
-        {
-          "信息技术": [
-            "系统集成及安全",
-            "软件开发",
-            "运维服务",
-            "其他"
-          ]
-        },
-        {
-          "行政办公": [
-            "办公家具",
-            "通用办公设备",
-            "专业设备",
-            "办公用品",
-            "生活用品"
-          ]
-        },
-        {
-          "机械设备": [
-            "矿山机械",
-            "工程机械",
-            "机械零部件",
-            "机床相关",
-            "车辆",
-            "其他机械设备"
-          ]
-        },
-        {
-          "交通工程": [
-            "道路",
-            "轨道",
-            "桥梁",
-            "隧道",
-            "其他"
-          ]
-        },
-        {
-          "医疗卫生": [
-            "设备",
-            "耗材",
-            "药品"
-          ]
-        },
-        {
-          "市政设施": [
-            "道路",
-            "绿化",
-            "线路管网",
-            "综合项目"
-          ]
-        },
-        {
-          "服务采购": [
-            "法律咨询",
-            "会计",
-            "物业",
-            "审计",
-            "安保",
-            "仓储物流",
-            "广告宣传印刷",
-            "其他"
-          ]
+      $.ajax({
+        url: '/publicapply/free/getindustrys',
+        type:'POST',
+        success: function(res){
+          let maxarr = []
+          res.data.forEach(function(item,index) {
+            let minarr = []
+            let keyname = Object.keys(item)[0]
+            let eachArr = item[Object.keys(item)[0]]
+            eachArr.forEach(function(data, i){
+              data = {
+                name: data,
+                type: false
+              }
+              minarr.push(data)
+            })
+            let obj = {
+              [keyname]: minarr,
+              type: false
+            }
+            maxarr.push(obj)
+          })
+          _this.tablist = maxarr
+          _this.setState()
         },
-        {
-          "农林牧渔": [
-            "生产物资",
-            "生产设备",
-            "相关服务"
-          ]
+        error: function(err){
+          console.log(err)
         }
-      ]
-      let maxarr = []
-      _this.tablist.forEach(function(item,index) {
-        let minarr = []
-        let keyname = Object.keys(item)[0]
-        let eachArr = item[Object.keys(item)[0]]
-        eachArr.forEach(function(data, i){
-          data = {
-            name: data,
-            type: false
-          }
-          minarr.push(data)
+      })
+    },
+    // 回显数据
+    setState: function() {
+      let indArr = this.selectindustrylist
+      let newindArr = []
+      let bool = true
+      indArr.forEach(function(sum) {
+        newindArr.push(sum.split('_')[1])
+      })
+      this.tablist.forEach(function(item){
+        item[Object.keys(item)[0]].forEach(function(data) {
+          newindArr.forEach(function(sum) {
+            if(data.name == sum) {
+              data.type = true
+              bool = false
+            }
+          })
         })
-        let obj = {
-          [keyname]: minarr,
-          type: false
-        }
-        maxarr.push(obj)
       })
-      _this.tablist = maxarr
-      // $.ajax({
-      //   url: '/publicapply/free/getindustrys',
-      //   type:'POST',
-      //   success: function(res){
-      //     console.log(res)
-      //     // _this.tablist = res.data
-      //     _this.tablist = res.data
-      //     res.data.forEach(function(item,i) {
-      //       console.log(item[Object.keys(item)[0]])
-      //     })
-      //   },
-      //   error: function(err){
-      //     console.log(err)
-      //   }
-      // })
+      this.canClick = bool
     },
     // 总全选
     checkBoxAll:function() {
@@ -247,10 +157,12 @@ var industryComponent = {
       let dataArr = data[Object.keys(data)[0]]
       console.log(selectBool, dataArr)
       if(selectBool) {
+        data[Object.keys(data)[1]] = false
         dataArr.forEach(function(item, index){
           item.type = false
         })
       }else{
+        data[Object.keys(data)[1]] = true
         dataArr.forEach(function(item, index){
           item.type = true
         })
@@ -328,7 +240,6 @@ var industryComponent = {
       this.tablist.forEach(function(item, index){
         item[Object.keys(item)[0]].forEach(function(data, i) {
           if(data.type){
-            console.log(data)
             let str = Object.keys(item)[0] +'_'+data.name
             industryArr.push(str)
           }

+ 19 - 1
src/web/staticres/common-module/collection/js/keyword-mobile.js

@@ -62,6 +62,7 @@ var keywordComponentTemplate = `<div class="j-container">
 
 var keywordComponent = {
   name: 'keyword-mobile',
+  props: ['selectkeywordlist'],
   template: keywordComponentTemplate,
   data:function () {
     return {
@@ -105,13 +106,28 @@ var keywordComponent = {
             maxarr.push(obj)
           })
           _this.tablist = maxarr
-          console.log(maxarr)
+          _this.setState()
         },
         error: function(err){
           console.log(err)
         }
       })
     },
+    setState: function() {
+      let bool = true
+      let keyArr = this.selectkeywordlist
+      this.tablist.forEach(function(item) {
+        item[Object.keys(item)[0]].forEach(function(data) {
+          keyArr.forEach(function(sum) {
+            if(data.name = sum) {
+              data.type = true
+              bool = false
+            }
+          })
+        })
+      })
+      this.canClick = bool
+    },
     // 总全选
     checkBoxAll:function() {
       if(this.checkedAll){
@@ -140,10 +156,12 @@ var keywordComponent = {
       let dataArr = data[Object.keys(data)[0]]
       console.log(selectBool, dataArr)
       if(selectBool) {
+        data[Object.keys(data)[1]] = false
         dataArr.forEach(function(item, index){
           item.type = false
         })
       }else{
+        data[Object.keys(data)[1]] = true
         dataArr.forEach(function(item, index){
           item.type = true
         })

+ 12 - 2
src/web/staticres/common-module/collection/js/notice-mobile.js

@@ -63,6 +63,7 @@ var noticeComponentTemplate = `<div class="j-container">
 
 var noticeComponent = {
   name: 'notice-mobile',
+  props: ['selectnoticelist'],
   template: noticeComponentTemplate,
   data:function () {
     return {
@@ -74,6 +75,7 @@ var noticeComponent = {
   created () {
     this.getIndustryData()
     this.getbBtnClick()
+    this.setStates()
   },
   methods: {
     // 获取行业数据
@@ -139,29 +141,35 @@ var noticeComponent = {
       _this.tablist = maxarr
     },
     // 回显数据
-    setStates: function(arr1) {
+    setStates: function() {
+      let bool = true
+      let noticeArr = this.selectnoticelist
       this.tablist.forEach(function(item) {
         console.log(item)
         item[Object.keys(item)[0]].forEach(function(sum) {
-          arr1.forEach(data => {
+          noticeArr.forEach(data => {
             if (data == sum.name) {
               sum.type = true
+              bool = false
             } else if(data == '拟建') {
               if(Object.keys(item)[0] == '拟建项目') {
                 item[Object.keys(item)[0]].forEach(function(d) {
                   d.type = true
+                  bool = false
                 })
               }
             } else if(data == '预告') {
               if(Object.keys(item)[0] == '招标预告') {
                 item[Object.keys(item)[0]].forEach(function(d) {
                   d.type = true
+                  bool = false
                 })
               }
             }
           });
         })
       })
+      this.canClick = bool
     },
     // 总全选
     checkBoxAll:function() {
@@ -191,10 +199,12 @@ var noticeComponent = {
       let dataArr = data[Object.keys(data)[0]]
       console.log(selectBool, dataArr)
       if(selectBool) {
+        data[Object.keys(data)[1]] = false
         dataArr.forEach(function(item, index){
           item.type = false
         })
       }else{
+        data[Object.keys(data)[1]] = true
         dataArr.forEach(function(item, index){
           item.type = true
         })

+ 18 - 4
src/web/staticres/common-module/collection/js/tags-mobile.js

@@ -14,17 +14,28 @@ var tagsComponentTemplate = `
 
 var tagsComponent = {
   name: 'tags-mobile',
-  props: ['taglist'],
+  props: ['taglist', 'selecttaglist'],
   template: tagsComponentTemplate,
   data:function () {
     return {
     }
   },
   created () {
+    this.setState()
   },
   methods: {
     // 个人标签方法
-    setState (data) {
+    setState () {
+      let arr = this.selecttaglist
+      if(!!arr.length) {
+        this.taglist.forEach(function(item,index) {
+          arr.forEach(function(data) {
+            if(item.lid == data) {
+              item.type = true
+            }
+          })
+        })
+      }
     },
     getState (data) {
       let dataArr2 = []
@@ -34,7 +45,7 @@ var tagsComponent = {
       data2.forEach((item)=>{
         dataArr2.push(item.lid)
       })
-      return dataArr2.join(',')
+      return dataArr2
     },
     // 个人标签重置
     resetAll: function() {
@@ -46,9 +57,12 @@ var tagsComponent = {
     },
     // 个人标签确定
     onConfirm: function(){
+      let t = ''
+      t = '个人标签' + this.getState(this.taglist).length
       let params = {
         name: 'tagsItem',
-        data: this.getState(this.taglist)
+        data: this.getState(this.taglist).join(','),
+        t:t
       }
       this.$emit('confirm', params)
     },

+ 117 - 22
src/web/staticres/vipsubscribe/js/historypush.js

@@ -12,9 +12,15 @@ var vm = new Vue({
   },
   data () {
     return {
+      sessStorageKey: '$data-historypush',
       // 时间参数
       time:'',
-      timeText: '时间',
+      // 选择的时间数据
+      selectDate: {
+        startDate: '',
+        endDate: '',
+        exact: ''
+      },
       // 地区参数
       area: '',
       // 行业参数
@@ -25,13 +31,87 @@ var vm = new Vue({
       key: '',
       // 公告类型
       subtype: '',
-      screenShow: false
+      screenShow: false,
+      tagText: {
+        timeText: '时间',
+        areaText: '地区',
+        industryText: '行业',
+        cateText: '采购单位',
+        keywordText: '关键词',
+        noticeText: '公告类型'
+      },
+      selectCateList: [], // 选择的采购单位类型列表
+      selectAreaList: [], // 选择的采购单位类型列表
+      selectIndustryList: [], // 选择的行业列表
+      selectKeyWordList: [], // 选择的行业列表
+      selectNoticeList: [] // 选择的公告类型列表
     }
   },
-  created () {
-    this.getUserRoot()
+  mounted () {
+    var recover = this.recover()
+    if (!recover) {
+      this.getUserRoot()
+    }
   },
   methods: {
+    recover: function () {
+      let _this = this
+      var excludeKey = ['sessStorageKey']
+      var $data = sessionStorage.getItem(this.sessStorageKey)
+      if ($data) {
+          $data = JSON.parse($data)
+          for (var key in $data) {
+              if (excludeKey.indexOf(key) !== -1) {
+                  continue
+              }
+              this.$data[key] = $data[key]
+          }
+          const res = $data
+          // 时间
+          console.log(res)
+          if(res.time != '') {
+            this.selectDate.startDate = res.time.split('_')[0] * 1000
+            this.selectDate.endDate= res.time.split('_')[1] * 1000
+          }
+          // 地区
+          if(res.area != '') {
+            setTimeout(() => {
+              $('.areaText').html(res.tagText.areaText)
+            })
+            this.selectAreaList = res.area.split(',')
+          }
+          // 采购单位类型
+          if(res.buyerclass != '') {
+            setTimeout(() => {
+              $('.cateText').html(res.tagText.cateText)
+            })
+            this.selectCateList = res.buyerclass.split(',')
+          }
+          // 行业
+          if(res.subscopeclass != '') {
+            setTimeout(() => {
+              $('.industryText').html(res.tagText.industryText)
+            })
+            this.selectIndustryList = res.subscopeclass.split(',')
+          }
+          // 关键词
+          if(res.key != '') {
+            setTimeout(() => {
+              $('.keywordText').html(res.tagText.keywordText)
+            })
+            this.selectKeyWordList = res.key.split(',')
+          }
+          // 公告类型
+          if(res.subtype != '') {
+            setTimeout(() => {
+              $('.noticeText').html(res.tagText.noticeText)
+            })
+            this.selectNoticeList = res.subtype.split(',')
+          }
+          sessionStorage.removeItem(this.sessStorageKey)
+      }
+      return !!$data
+    },
     // 判断是否是有筛选条件
     getUserRoot: function() {
       let _this = this
@@ -39,7 +119,9 @@ var vm = new Vue({
         url: '/publicapply/bidcoll/power',
         type: 'POST',
         success: function(res) {
-          console.log(res)
+          if(res.data.member) {
+            $(".switch").addClass("only-member");
+          }
           if(res.data.entniche || res.data.member || res.data.vip > 0) {
             _this.screenShow = true
           } else {
@@ -57,7 +139,7 @@ var vm = new Vue({
         }
         if (timeRange.start == 0 && timeRange.end == 0) {
           this.time = ''
-          this.timeText = '不限'
+          this.tagText.timeText = '不限'
         } else if(timeRange.start == 0 && timeRange.end != 0) {
           this.time = '_' + timeRange.end
         } else if(timeRange.start != 0 && timeRange.end == 0) {
@@ -65,25 +147,26 @@ var vm = new Vue({
         } else {
           this.time = timeRange.start + '_' + timeRange.end
         }
+        this.selectDate.exact = data.data.exact
         switch (data.data.exact) {
           case 'all': {
-            this.timeText = '不限'
+            this.tagText.timeText = '不限'
             break
           }
           case 'lately7': {
-            this.timeText = '最近7天'
+            this.tagText.timeText = '最近7天'
             break
           }
           case 'lately30': {
-            this.timeText = '最近30天'
+            this.tagText.timeText = '最近30天'
             break
           }
           case 'lastYear': {
-            this.timeText = '去年'
+            this.tagText.timeText = '去年'
             break
           }
           case 'exact': {
-            this.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
+            this.tagText.timeText = new Date(timeRange.start*1000).pattern('yyyy.MM.dd') + '~' + new Date(timeRange.end*1000).pattern('yyyy.MM.dd')
             break
           }
         }
@@ -94,19 +177,24 @@ var vm = new Vue({
         return
       } else if(data.name === 'areaItem'){
         $('.areaText').html(data.t)
-        this.area = data.data.join('、')
+        this.tagText.areaText = data.t
+        this.area = data.data.join(',')
       } else if(data.name === 'industryItem'){
         $('.industryText').html(data.t)
-        this.subscopeclass = data.data.join(',')
+        this.tagText.industryText = data.t
+        this.subscopeclass = data.data.join(',')
       } else if(data.name === 'cateItem'){
         $('.cateText').html(data.t)
-        this.buyerclass = data.data.join(',')
+        this.tagText.cateText = data.t
+        this.buyerclass = data.data.join(',')
       } else if(data.name === 'keywordItem'){
         $('.keywordText').html(data.t)
+        this.tagText.keywordText = data.t
         this.key = data.data.join(',')
       } else if(data.name === 'noticeItem'){
         $('.noticeText').html(data.t)
-        this.subtype = data.data.join(',')
+        this.tagText.noticeText = data.t
+        this.subtype = data.data.join(',')
       } else if(data.name === 'rootItem'){
         tointroducepage()
       }
@@ -118,20 +206,27 @@ var vm = new Vue({
     cancel: function(data){
       console.log(data)
       if(data.name === 'dateItem'){
-        firstTime = (data.data.start / 1000).toFixed(0) + '_' + (data.data.end / 1000).toFixed(0)
-        initpage()
+        this.time = ''
       } else if(data.name === 'areaItem'){
-        // this.area = data.data.join('、')
+        this.area = ''
+        $('.areaText').html('地区')
       } else if(data.name === 'industryItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.subscopeclass = ''
+        $('.industryText').html('行业')
       } else if(data.name === 'cateItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.buyerclass = ''
+        $('.cateText').html('采购单位')
       } else if(data.name === 'keywordItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.key = ''
+        $('.keywordText').html('关键词')
       } else if(data.name === 'noticeItem'){
-        // this.subscopeclass = data.data.join(',')
+        this.subtype = ''
+        $('.noticeText').html('公告类型')
       }
       this.setToggle()
+      setTimeout(()=>{
+        this.getAjaXParams()
+      }, 500)
     },
     getAjaXParams: function() {
       ajaxFun(this.time, this.area, this.subscopeclass, this.buyerclass, this.key, this.subtype)

+ 5 - 5
src/web/templates/frontRouter/wx/collection/sess/index.html

@@ -48,14 +48,14 @@
             </div>
           </div>
           <van-dropdown-menu v-show="limitshow" :get-container="getContainer" :close-on-click-outside="false">
-            <van-dropdown-item  title="个人标签"  ref="tagItem">
-              <tags-component @confirm="confirm" @cancel="cancel" :taglist="tagList"></tags-component>
+            <van-dropdown-item  :title="tagText.perText"  ref="tagItem">
+              <tags-component ref="tagcomp" @confirm="confirm" @cancel="cancel" :selecttaglist="selectTagList" :taglist="tagList"></tags-component>
             </van-dropdown-item>
             <van-dropdown-item :title="tagText.timeText" ref="dateItem">
-              <date-component @confirm="confirm" @cancel="cancel"></date-component>
+              <date-component ref="datecom" @confirm="confirm" @cancel="cancel" :selectdate="selectDate"></date-component>
             </van-dropdown-item>
-            <van-dropdown-item title="采购单位类型" ref="cateItem">
-              <cate-component @confirm="confirm" @cancel="cancel"></cate-component>
+            <van-dropdown-item :title="tagText.cateText" ref="cateItem">
+              <cate-component @confirm="confirm" @cancel="cancel" :selectcatelist="selectCateList"></cate-component>
             </van-dropdown-item>
             <van-dropdown-item ref="buyerItem" v-model="limitlist.buyerPhone" title="采购单位联系方式">
               <phone-component :data="params.buyerData" @confirm="confirm"></phone-component>

+ 96 - 52
src/web/templates/weixin/historypush.html

@@ -525,6 +525,9 @@
     </style>
 </head>
 <body class="p13">
+    <div id="jyKeepComponent">
+        <keep-component ref="vKeepComponent" @on-change-keep="changeKeepStatus" :bid="nowOpenBid" :first="false"></keep-component>
+    </div>
 <div class="_header collection" id="select-meau">
     <div class="wx_header">
         <div class="wx_header_left">
@@ -580,8 +583,8 @@
             </div>
         </div> -->
         <van-dropdown-menu style="width: auto;overflow-x: auto;">
-            <van-dropdown-item :title="timeText"  ref="dateItem">
-                <date-component @cancel="cancel" @confirm="confirm" />
+            <van-dropdown-item :title="tagText.timeText"  ref="dateItem">
+                <date-component ref="datecom" @cancel="cancel" @confirm="confirm" :selectdate="selectDate"/>
             </van-dropdown-item>
             <van-dropdown-item ref="areaItem">
                 <template #title>
@@ -591,7 +594,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <area-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></area-component>
+                <area-component v-if="screenShow" @cancel="cancel" @confirm="confirm" :selectarealist="selectAreaList"></area-component>
                 <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
             </van-dropdown-item>
             <van-dropdown-item ref="industryItem">
@@ -602,7 +605,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm"></industry-component>
+                <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm" :selectindustrylist="selectIndustryList"></industry-component>
                 <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
             </van-dropdown-item>
             <van-dropdown-item  ref="cateItem">
@@ -613,7 +616,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <cate-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></cate-component>
+                <cate-component @cancel="cancel" v-if="screenShow" @confirm="confirm" :selectcatelist="selectCateList"></cate-component>
                 <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
             </van-dropdown-item>
             <van-dropdown-item title="关键词" ref="keywordItem">
@@ -624,7 +627,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <keyword-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></keyword-component>
+                <keyword-component @cancel="cancel" v-if="screenShow" @confirm="confirm" :selectkeywordlist="selectKeyWordList"></keyword-component>
                 <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
             </van-dropdown-item>
             <van-dropdown-item title="公告类型" ref="noticeItem">
@@ -635,7 +638,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <notice-component @cancel="cancel" v-if="screenShow" @confirm="confirm"></notice-component>
+                <notice-component @cancel="cancel" v-if="screenShow" @confirm="confirm" :selectnoticelist="selectNoticeList"></notice-component>
                 <root-component v-if="!screenShow" @cancel="cancel" @confirm="confirm"></root-component>
             </van-dropdown-item>
         </van-dropdown-menu>
@@ -785,6 +788,7 @@
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/cate-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/keyword-mobile.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/common-module/collection/js/notice-mobile.js?v={{Msg "seo" "version"}}'></script>
+<script src='{{Msg "seo" "cdn"}}/common-module/keep-tags/keep-tags-template.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/vipsubscribe/js/historypush.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Msg "seo" "cdn"}}/vipsubscribe/js/mapArea.js?v={{Msg "seo" "version"}}'></script>
@@ -944,18 +948,6 @@
           day = day < 10 ? '0' + day : day;
           return year + '-' + month + '-' + day;
       })();
-
-      //   判断是否是大会员
-      $.ajax({
-        url: '/publicapply/bidcoll/power',
-        type: 'POST',
-        success: function(res) {
-          if(res.data.member) {
-            $(".switch").addClass("only-member");
-          }
-        }
-      })
-
       //初始化数据
       function initpage() {
           if (sessionStorage && sessionStorage.historypushScrollTop && sessionStorage.historypushDataCache) {
@@ -1431,49 +1423,82 @@
                 $('.collec_star').eq(item).find('.weishoucang').show()
             }
         })
-      }
 
-      // 收藏或取消收藏
-        $(document).off('click').on('click','.collec_star', function(e){
+        // 收藏或取消收藏
+        $('.collec_star').on('click', function(e){
             const _this = this
             e.stopPropagation()
             const id = $(this).attr('data-id')
             const paramsObj = {
-                baction: 'C',
                 binfo: [
                     {
                     bid: id
                     }
                 ]
             }
-            $.ajax({
-                url: '/publicapply/bidcoll/action',
-                type: "POST",
-                contentType: 'application/json;charset=utf-8',
-                data:JSON.stringify(paramsObj),
-                success: function(res){
-                    console.log(res)
-                    if(res.error_code == 0) {
-                        if(res.data) {
-                            $(_this).find('.shoucang').show()
-                            $(_this).find('.weishoucang').hide()
-                            _this.$toast(res.error_msg)
-                        } else {
-                            _this.$toast(res.error_msg)
-                        }
-                    }
-                },
-                error: function(err){
-                    _this.$toast(res.error_msg)
-                }
-            })
-            this.listState.list.map((item,index) => {
-            console.log(item)
-            if(id === item._id) {
-                this.getList()
+            var shoucang = $(_this).find('.weishoucang').is(':hidden')
+            // 说明未收藏,点击收藏
+            console.log(vKeepComponent)
+            if (vKeepComponent) {
+                vKeepComponent.changeBid(id, !shoucang)
+                vKeepComponent.changeKeepStatus(!shoucang, _this)
             }
-            })
+            // $.ajax({
+            //     url: '/publicapply/bidcoll/action',
+            //     type: "POST",
+            //     contentType: 'application/json;charset=utf-8',
+            //     data:JSON.stringify(paramsObj),
+            //     success: function(res){
+            //         console.log(res)
+            //         if(res.error_code == 0) {
+            //             if(res.data) {
+            //                 $(_this).find('.shoucang').show()
+            //                 $(_this).find('.weishoucang').hide()
+            //             } else {
+            //             }
+            //         }
+            //     },
+            //     error: function(err){
+            //         _this.$toast(res.error_msg)
+            //     }
+            // })
+            // this.listState.list.map((item,index) => {
+            // console.log(item)
+            // if(id === item._id) {
+            //     this.getList()
+            // }
+            // })
         })
+      }
+
+      var vKeepComponent = new Vue({
+        delimiters: ['${', '}'],
+        el: '#jyKeepComponent',
+        data: {
+            nowOpenBid: ''
+        },
+        methods: {
+            changeBid (id, type) {
+                this.nowOpenBid = id
+                this.$refs.vKeepComponent.ajaxAddKeep(id, type)
+            },
+            changeKeepStatus (type, that) {
+                changeCollectStatus(type, that)
+            }
+        }
+    })
+
+    function changeCollectStatus(type, that) {
+        console.log(type, that)
+        if(type) {
+            $(that).find('.shoucang').show()
+            $(that).find('.weishoucang').hide()
+        } else {
+            $(that).find('.shoucang').hide()
+            $(that).find('.weishoucang').show()
+        }
+    }
+    
       //
       function formatDate(date, sl) {
           var myDate = new Date(date * 1000);
@@ -1505,8 +1530,7 @@
 
       //
       function appendList(content) {
-          content.children(".tslist").on("click", function (event) {
-              event.stopPropagation() // 阻止冒泡
+          content.children(".tslist").on("click", function () {
               var isv = $(this).find("a.bt").hasClass("visited");//是否为已读
               setVisitedIndex($(this), "");
               var sds = $(this).attr("words");
@@ -1515,6 +1539,7 @@
               var index = $(this).find("a.bt").attr("projectm");
               var pdate = $(this).find("a.bt").attr("push_date");
               beforeJump(eid, h, sds, index, pdate, isv);
+              sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
           });
           $("#list").append(content);
           $(".findnull").hide();
@@ -1579,10 +1604,29 @@
                 }
                 if (area == undefined || area == "") {
                     sessionStorage.removeItem(userId + "_selectCity");
-                    sessionStorage.removeItem(userId + "_selectCityName");
                 } else {
                     sessionStorage.setItem(userId + "_selectCity", area);
                 }
+                if (subscopeclass == undefined || subscopeclass == "") {
+                    sessionStorage.removeItem(userId + "_selectIndustry");
+                } else {
+                    sessionStorage.setItem(userId + "_selectIndustry", subscopeclass);
+                }
+                if (buyerclass == undefined || buyerclass == "") {
+                    sessionStorage.removeItem(userId + "_selectCate");
+                } else {
+                    sessionStorage.setItem(userId + "_selectCate", buyerclass);
+                }
+                if (key == undefined || key == "") {
+                    sessionStorage.removeItem(userId + "_selectKeyword");
+                } else {
+                    sessionStorage.setItem(userId + "_selectKeyword", key);
+                }
+                if (subtype == undefined || subtype == "") {
+                    sessionStorage.removeItem(userId + "_selectNotice");
+                } else {
+                    sessionStorage.setItem(userId + "_selectNotice", subtype);
+                }
                 ajaxFlag = true;
             },
             error: function (xhr, type) {