Bläddra i källkod

订阅推送消息数据回显

TANGSHIZHE 4 år sedan
förälder
incheckning
3fb549e895

+ 23 - 2
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -14,7 +14,6 @@ var vm = new Vue({
     return {
       // 时间参数
       time:'',
-      timeText: '时间',
       // 选择的时间数据
       selectDate: {
         startDate: '',
@@ -47,12 +46,20 @@ var vm = new Vue({
       selectNoticeList: [] // 选择的公告类型列表
     }
   },
-  mounted () {
+  created () {
     var recover = this.recover()
     if (!recover) {
       this.getUserRoot()
     }
   },
+  mounted () {
+    setTimeout(() => {
+      console.log(this.time)
+      if(this.time !== '') {
+        this.setPushTime(this.time)
+      }
+    })
+  },
   methods: {
     recover: function () {
       let _this = this
@@ -112,6 +119,20 @@ var vm = new Vue({
       }
       return !!$data
     },
+
+    // 订阅推送消息展示数据
+    setPushTime: function(time) {
+      console.log(time)
+      let pushtime = {
+        start: parseInt(time.split('_')[0]),
+        end: parseInt(time.split('_')[0]),
+      }
+      this.tagText.timeText = new Date(pushtime.start).pattern('yyyy.MM.dd') + '~' + new Date(pushtime.end).pattern('yyyy.MM.dd')
+      this.selectDate.startDate = pushtime.start
+      this.selectDate.endDate= pushtime.end
+      this.selectDate.exact = 'exact'
+    },
+
     // 判断是否是有筛选条件
     getUserRoot: function() {
       let _this = this

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

@@ -31,7 +31,9 @@
           <div class="search-container van-fade-an" ref="searchContainer">
             <div class="listaction">
               <div class="action_editor">
-                <span v-show="screenShow" @click="screenBtn">筛选</span>
+                <span @click="screenBtn">
+                  <span v-if="screenShow">筛选</span>
+                </span>
               </div>
               <div class="data_report">
                 <div class="collec_datareport" @click="dataReport">

+ 14 - 9
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -87,7 +87,7 @@
   <ul>
     <li>订阅</li>
     <li{{if or .T.isIosExam .T.isIosExamPhone}} style="visibility:hidden;"{{end}}>
-      <div class="switch only-member" data-need-bind-phone id="app-historypush-vipSub-btn" style="display:none;">
+      <div class="switch" data-need-bind-phone id="app-historypush-vipSub-btn" style="display:none;">
         <span></span>
       </div>
     </li>
@@ -127,7 +127,8 @@
                         <p class="area_box" id="showArea">
                             <span class="jymobile-tab-triangle">地区</span>
                         </p>
-                    </div> -->
+                    </div>
+                </div> -->
                     <van-dropdown-menu style="width: auto;overflow-x: auto;">
                         <van-dropdown-item :title="tagText.timeText"  ref="dateItem">
                             <date-component @cancel="cancel" @confirm="confirm" :selectdate="selectDate"/>
@@ -193,10 +194,11 @@
             </div>
         </div>
         <div class="color_top" style="display:none;"></div>
-        <div class="listcontent j-main" onscroll="listScroll()">
-            <div id="list"></div>
+        <div class="j-main">
+            <div class="listcontent" onscroll="listScroll()">
+                <div id="list"></div>
+            </div>
         </div>
-
         <span class="empty findnull-no-key">
             <div><img class="empty-img" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/images/wxkeyset/nopush.png?v={{Msg "seo" "version"}}"></div>
             <div class="empty-text">订阅关键词,接收最新招投标信息</div>
@@ -524,11 +526,13 @@
         isinitpage = true;
       }
   });
-  var firstTime
-  if({{.T.selectTime}} == '') {
-    firstTime = vm.time
+  var firstTime = {{.T.selectTime}}
+    // firstTime = '1624377600'
+  if( firstTime != '') {
+    firstTime = firstTime + "000" +'_'+ firstTime + "000";
+    vm.time = firstTime
   }else {
-    firstTime = {{.T.selectTime}}+'-'+{{.T.selectTime}};
+    firstTime = vm.time
   }
   
   var userId = "";
@@ -1648,6 +1652,7 @@ function hasNoData() {
         }
         // 点击选择时间
         $('#showDatePicker').on('click', function () {
+            console.log('11')
             var that = this
             // 判断头部vip订阅广告是否显示
             var isAdShow = $('.header_header').is(':visible')

+ 2 - 0
src/web/staticres/common-module/collection/js/index-wx.js

@@ -80,6 +80,8 @@ var vNode = {
   mounted() {
     if(this.tagText.timeText !=='' || this.tagText.perText != '' || this.tagText.cateText != '' ||  this.limitlist.buyerPhone != 0 || this.limitlist.winnerPhone != 0) {
       this.limitshow = true
+    } else {
+      this.limitshow = false
     }
   },
   mounted () {

+ 22 - 12
src/web/staticres/common-module/collection/js/industry-mobile.js

@@ -121,20 +121,30 @@ var industryComponent = {
       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
-            }
+      if(indArr && indArr.length == 0) {
+        this.tablist.forEach(function(item){
+          item[Object.keys(item)[0]].forEach(function(data) {
+            data.type = false
           })
         })
-      })
-      this.canClick = bool
+        this.canClick = bool
+      } else {
+        indArr.forEach(function(sum) {
+          newindArr.push(sum.split('_')[1])
+        })
+        console.log(newindArr)
+        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
+              }
+            })
+          })
+        })
+        this.canClick = bool
+      }
     },
     // 总全选
     checkBoxAll:function() {

+ 31 - 3
src/web/staticres/vipsubscribe/js/historypush.js

@@ -41,18 +41,25 @@ var vm = new Vue({
         noticeText: '公告类型'
       },
       selectCateList: [], // 选择的采购单位类型列表
-      selectAreaList: [], // 选择的采购单位类型列表
+      selectAreaList: [], // 选择的地区列表
       selectIndustryList: [], // 选择的行业列表
-      selectKeyWordList: [], // 选择的行业列表
+      selectKeyWordList: [], // 选择的关键词列表
       selectNoticeList: [] // 选择的公告类型列表
     }
   },
-  mounted () {
+  created () {
     var recover = this.recover()
     if (!recover) {
       this.getUserRoot()
     }
   },
+  mounted () {
+    setTimeout(() => {
+      if(this.time !== '') {
+        this.setPushTime(this.time)
+      }
+    })
+  },
   methods: {
     recover: function () {
       let _this = this
@@ -112,6 +119,17 @@ var vm = new Vue({
       }
       return !!$data
     },
+    // 订阅推送消息展示数据
+    setPushTime: function(time) {
+      let pushtime = {
+        start: parseInt(time.split('_')[0]),
+        end: parseInt(time.split('_')[0]),
+      }
+      this.tagText.timeText = new Date(pushtime.start).pattern('yyyy.MM.dd') + '~' + new Date(pushtime.end).pattern('yyyy.MM.dd')
+      this.selectDate.startDate = pushtime.start
+      this.selectDate.endDate= pushtime.end
+      this.selectDate.exact = 'exact'
+    },
     // 判断是否是有筛选条件
     getUserRoot: function() {
       let _this = this
@@ -209,18 +227,28 @@ var vm = new Vue({
         this.time = ''
       } else if(data.name === 'areaItem'){
         this.area = ''
+        this.selectAreaList = []
+        this.$refs.areaItem.setState()
         $('.areaText').html('地区')
       } else if(data.name === 'industryItem'){
         this.subscopeclass = ''
+        this.selectIndustryList = []
+        this.$refs.industryCom.setState()
         $('.industryText').html('行业')
       } else if(data.name === 'cateItem'){
         this.buyerclass = ''
+        this.selectCateList = []
+        this.$refs.cateItem.setState()
         $('.cateText').html('采购单位')
       } else if(data.name === 'keywordItem'){
         this.key = ''
+        this.selectKeyWordList = []
+        this.$refs.keywordItem.setState()
         $('.keywordText').html('关键词')
       } else if(data.name === 'noticeItem'){
         this.subtype = ''
+        this.selectNoticeList = []
+        this.$refs.noticeItem.setState()
         $('.noticeText').html('公告类型')
       }
       this.setToggle()

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

@@ -38,7 +38,9 @@
         <div class="j-main">
           <div class="search-container van-fade-an" ref="searchContainer">
             <div class="listaction">
-              <div class="action_editor" @click="screenBtn">筛选</div>
+              <div class="action_editor" @click="screenBtn">
+                <span  v-if="screenShow">筛选</span>
+              </div>
               <div class="data_report">
                 <div class="collec_datareport" @click="dataReport">
                   <span class="data_download"></span>

+ 6 - 4
src/web/templates/weixin/historypush.html

@@ -531,7 +531,7 @@
 <div class="_header collection" id="select-meau">
     <div class="wx_header">
         <div class="wx_header_left">
-            <div class="switch only-member" data-need-bind-phone style="display:none;margin-left: 0;">
+            <div class="switch" data-need-bind-phone style="display:none;margin-left: 0;">
                 <span></span>
             </div>
         </div>
@@ -583,7 +583,7 @@
             </div>
         </div> -->
         <van-dropdown-menu style="width: auto;overflow-x: auto;">
-            <van-dropdown-item :title="tagText.timeText"  ref="dateItem">
+            <van-dropdown-item :title="tagText.timeText"  ref="dateItem" id="showDatePicker">
                 <date-component ref="datecom" @cancel="cancel" @confirm="confirm" :selectdate="selectDate"/>
             </van-dropdown-item>
             <van-dropdown-item ref="areaItem">
@@ -605,7 +605,7 @@
                         <span class="root_open">开通</span>
                     </span>
                 </template>
-                <industry-component v-if="screenShow" @cancel="cancel" @confirm="confirm" :selectindustrylist="selectIndustryList"></industry-component>
+                <industry-component ref="industryCom" 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">
@@ -928,8 +928,10 @@
       var userId = "";
       //
       var firstTime = {{.T.stime}}; // 时间
+    //   firstTime = '1624377600'
       if (firstTime != "") {
-          firstTime = firstTime + "000";
+          firstTime = firstTime + "000" +'_'+ firstTime + "000";
+          vm.time = firstTime
       } else {
           firstTime = vm.time
       }