Browse Source

Merge branch 'feature/v4.7.31' into master

lianbingjie 2 years ago
parent
commit
f014e69ceb

+ 111 - 11
src/web/staticres/common-module/history-push/js/historypush.js

@@ -1,3 +1,60 @@
+/**
+ * 根据描述获取当前平台页面链接
+ * @param type
+ * @returns {string|*}
+ */
+function getPowerPageLink (type) {
+  var pageLinks = {
+    '订阅管理': {
+      app: '/jyapp/vipsubscribe/toSubVipSetPage',
+      wx: '/front/vipsubscribe/toSubVipSetPage'
+    },
+    '大会员-订阅管理': {
+      app: '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=m',
+      wx: '/front/vipsubscribe/toSubVipSetPage?vSwitch=m'
+    },
+    '超级订阅-订阅管理': {
+      app: '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v',
+      wx: '/front/vipsubscribe/toSubVipSetPage?vSwitch=v'
+    },
+    '订阅': {
+      app: '/jyapp/swordfish/historypush',
+      wx: '/swordfish/newhistorypush'
+    },
+    '关键词设置': {
+      app: '/jyapp/vipsubscribe/toSetKeyWordPage',
+      wx: '/front/vipsubscribe/toSetKeyWordPage'
+    },
+    '旧版-关键词设置': {
+      app: '/jyapp/wxkeyset/keyset/index',
+      wx: '/wxkeyset/keyset/index'
+    },
+    '省份订阅包-设置省份': {
+      app: '/jyapp/areaPack/page/set_area',
+      wx: '/areaPack/wx/page/set_area'
+    },
+    '超级订阅-落地页': {
+      app: '/jyapp/vipsubscribe/introducePage',
+      wx: '/front/vipsubscribe/introducePage'
+    }
+  }
+  if (Object.hasOwnProperty.call(pageLinks, type)) {
+    return pageLinks[type][utils.isWeiXinBrowser ? 'wx': 'app']
+  }
+  return ''
+}
+
+/**
+ * CV 移除缓存逻辑
+ */
+function removeSessionStorageForVm () {
+  sessionStorage.removeItem("historypushDataCache");
+  sessionStorage.removeItem("historypushPageIndexCache");
+  sessionStorage.removeItem("historypushScrollTop");
+  sessionStorage.removeItem("historypushHasNextPage");
+  sessionStorage.removeItem("closeAdvert");
+  sessionStorage.removeItem("hasFreeMore");
+}
 var vm = new Vue({
   el: '#select-meau',
   delimiters: ['${', '}'],
@@ -137,7 +194,8 @@ var vm = new Vue({
     }
     this.subPageMove()
     if(firstTime) {
-      firstTime = firstTime / 1000 +'_'+ firstTime / 1000;
+      const pushtime = this.calcDateTime(firstTime / 1000)
+      firstTime = pushtime.start / 1000 + '_' + pushtime.end / 1000
       this.time = firstTime
       this.setPushTime(firstTime)
     }else {
@@ -146,10 +204,10 @@ var vm = new Vue({
     // console.log(this.selectPro, '用户身份');
   },
   mounted () {
-    var recover = this.recover()
     // 判断是否推送消息进入,清空缓存值,显示底部导航
     try {
       if (pushUrlTime) {
+        sessionStorage.removeItem(this.sessStorageKey)
         this.setPushTime(pushUrlTime + '_' + pushUrlTime)
         this.revorceOtherData()
         JyObj.hiddenBottom("1")
@@ -157,6 +215,7 @@ var vm = new Vue({
     } catch (e) {
       console.log(e)
     }
+    var recover = this.recover()
     if (!recover) {
       setTimeout(() => {
         // 如果订阅消息进来时间不为空
@@ -274,8 +333,8 @@ var vm = new Vue({
         // this.ajaxUrl = '/publicapply/subscribe/historyPush?t=' + new Date().getTime()
       }
       firstTime = ''
-        this.time = ''
-        this.tagText.timeText = '时间'
+      this.time = ''
+      this.tagText.timeText = '时间'
       this.bigSubShow = false
       ajaxFun(this.time, this.area, this.city, this.subscopeclass, this.buyerclass, this.key, this.subtype, this.selectFile, this.selectMoney)
     },
@@ -466,13 +525,22 @@ var vm = new Vue({
         this.showSuperVipDialog()
       }
     },
-    // 订阅推送消息展示数据
-    setPushTime: function(time) {
-      // console.log(time)
+    calcDateTime: function (time) {
+      // @tip 调用时间选择组件函数格式化时间
+      const endTime = parseInt(String(time).split('_')[0] * 1000)
+
       let pushtime = {
-        start: parseInt(time.split('_')[0] * 1000),
-        end: parseInt(time.split('_')[0] * 1000),
+        start: endTime,
+        end: endTime,
       }
+      if (typeof dateComponent.methods.calcNotExactTime === 'function') {
+        pushtime = dateComponent.methods.calcNotExactTime('today', endTime)
+      }
+      return pushtime
+    },
+    // 订阅推送消息展示数据
+    setPushTime: function(time) {
+      const pushtime = this.calcDateTime(time)
       this.tagText.timeText = new Date(pushtime.end).pattern('yyyy.MM.dd')
       this.selectDate.startDate = pushtime.start
       this.selectDate.endDate= pushtime.end
@@ -547,7 +615,7 @@ var vm = new Vue({
             sessionStorage.setItem('save-user-type-' + goTemplateData.params.userId, res.data.vt)
 
             if (type !== 'push' && res.data.vt != oldType) {
-              removeSessionStorage()
+              removeSessionStorageForVm()
               sessionStorage.setItem('need-clear-' + + goTemplateData.params.userId, 'true')
               location.reload()
               return
@@ -778,7 +846,7 @@ var vm = new Vue({
                     setUserType = 'm'
                   }
                   sessionStorage.removeItem('history-set-user-type')
-                  _this.switchVip(setUserType, 'push')
+                  _this.switchVip(setUserType, canSelectMember ? 'push' : '')
                 } else {
                   _this.switchVip()
                 }
@@ -844,6 +912,7 @@ var vm = new Vue({
     },
     confirm: function(data){
       if(data.name === 'dateItem'){
+        firstTime = ''
         const timeRange = {
           start: (data.data.start / 1000).toFixed(0),
           end: (data.data.end / 1000).toFixed(0)
@@ -944,6 +1013,7 @@ var vm = new Vue({
     },
     cancel: function(data){
       if(data.name === 'dateItem'){
+        firstTime = ''
         this.time = ''
         this.tagText.timeText = '时间'
         this.selectDate.start = ''
@@ -1024,3 +1094,33 @@ var vm = new Vue({
     }
   }
 })
+/**
+ * 判断是否推送列表进入 (保留旧版app逻辑)
+ */
+function canChangePushTime () {
+  if (utils.isWeiXinBrowser) {
+    var selectTime = getUrlParam("times")
+    if (selectTime) {
+      removeSessionStorageForVm()
+      vm.setPushTime(selectTime +'_'+ selectTime)
+      if (getUrlParam("t") === 'member') {
+        sessionStorage.setItem('history-set-user-type', 'bigmember')
+      } else {
+        sessionStorage.removeItem('history-set-user-type')
+      }
+      history.replaceState(null, null, getPowerPageLink('订阅'))
+    }
+  } else {
+    if (getUrlParam("f") == "push") {
+      removeSessionStorageForVm();
+      if (history) {
+        var selectTime = getUrlParam("selectTime")
+        sessionStorage.setItem(sessionStorage.userId + "_searchTime", selectTime);
+        history.replaceState(null, null, getPowerPageLink('订阅'));
+      }
+    }
+  }
+}
+
+// 是否推送列表进入
+canChangePushTime()

+ 0 - 77
src/web/staticres/common-module/history-push/js/old-page-script.js

@@ -1,49 +1,3 @@
-/**
- * 根据描述获取当前平台页面链接
- * @param type
- * @returns {string|*}
- */
-function getPowerPageLink (type) {
-  var pageLinks = {
-    '订阅管理': {
-      app: '/jyapp/vipsubscribe/toSubVipSetPage',
-      wx: '/front/vipsubscribe/toSubVipSetPage'
-    },
-    '大会员-订阅管理': {
-      app: '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=m',
-      wx: '/front/vipsubscribe/toSubVipSetPage?vSwitch=m'
-    },
-    '超级订阅-订阅管理': {
-      app: '/jyapp/vipsubscribe/toSubVipSetPage?vSwitch=v',
-      wx: '/front/vipsubscribe/toSubVipSetPage?vSwitch=v'
-    },
-    '订阅': {
-      app: '/jyapp/swordfish/historypush',
-      wx: '/swordfish/newhistorypush'
-    },
-    '关键词设置': {
-      app: '/jyapp/vipsubscribe/toSetKeyWordPage',
-      wx: '/front/vipsubscribe/toSetKeyWordPage'
-    },
-    '旧版-关键词设置': {
-      app: '/jyapp/wxkeyset/keyset/index',
-      wx: '/wxkeyset/keyset/index'
-    },
-    '省份订阅包-设置省份': {
-      app: '/jyapp/areaPack/page/set_area',
-      wx: '/areaPack/wx/page/set_area'
-    },
-    '超级订阅-落地页': {
-      app: '/jyapp/vipsubscribe/introducePage',
-      wx: '/front/vipsubscribe/introducePage'
-    }
-  }
-  if (Object.hasOwnProperty.call(pageLinks, type)) {
-    return pageLinks[type][utils.isWeiXinBrowser ? 'wx': 'app']
-  }
-  return ''
-}
-
 // 双11活动文案修改
 $.get('/jyactive/doubleEleven/isActiving?t=' + new Date().getTime(), function (r) {
   if (r && r.data) {
@@ -173,37 +127,6 @@ var isPageShow = localStorage.getItem('hideBottom')
 var myInfo = {}
 var isInTSguide = null
 
-/**
- * 判断是否推送列表进入 (保留旧版app逻辑)
- */
-function canChangePushTime () {
-  if (utils.isWeiXinBrowser) {
-    var selectTime = getUrlParam("times")
-    if (selectTime) {
-      removeSessionStorage()
-      vm.setPushTime(selectTime +'_'+ selectTime)
-      if (getUrlParam("t") === 'member') {
-        sessionStorage.setItem('history-set-user-type', 'bigmember')
-      } else {
-        sessionStorage.removeItem('history-set-user-type')
-      }
-      history.replaceState(null, null, getPowerPageLink('订阅'))
-    }
-  } else {
-    if (getUrlParam("f") == "push") {
-      removeSessionStorage();
-      if (history) {
-        var selectTime = getUrlParam("selectTime")
-        sessionStorage.setItem(sessionStorage.userId + "_searchTime", selectTime);
-        history.replaceState(null, null, getPowerPageLink('订阅'));
-      }
-    }
-  }
-}
-
-// 是否推送列表进入
-canChangePushTime()
-
 // 是否需要留资
 function isNeedSales(callback) {
   $.ajax({

+ 2 - 2
src/web/templates/weixin/vipsubscribe/keyWord.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="zh-CN">
+<html lang="zh-CN" style="font-size: 50px;">
 
 <head>
     <meta charset="UTF-8">
@@ -186,7 +186,7 @@
                 <button class="j-button-confirm" @click="toKeyManagePage">分类管理</button>
             </div>
         </div>
-    </van-popup> 
+    </van-popup>
 </div>
 
 <script src=//cdn-common.jianyu360.com/cdn/lib/jquery/3.6.0/jquery.min.js></script>