浏览代码

fix: 修复每日仅跳转一次

zhangyuhan 4 年之前
父节点
当前提交
e6aeae9312

+ 6 - 2
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -437,8 +437,12 @@
     $.get('/jyactive/doubleEleven/isActiving', function (r) {
         if (r && r.data) {
             if (r.data.isActiving && r.data.isWritten === 1) {
-                history.pushState({state: 'full'}, null)
-                location.href = '/jyapp/big/page/write_infor'
+                var readToDay = localStorage.getItem('doubleEleven_isActiving') === new Date().toDateString()
+                localStorage.setItem('doubleEleven_isActiving', new Date().toDateString())
+                if (!readToDay) {
+                    history.pushState({state: 'full'}, null)
+                    location.href = '/jyapp/big/page/write_infor'
+                }
             }
         }
     })

+ 6 - 2
src/web/templates/weixin/search/mainSearch.html

@@ -99,8 +99,12 @@
   $.get('/jyactive/doubleEleven/isActiving', function (r) {
       if (r && r.data) {
           if (r.data.isActiving && r.data.isWritten === 1) {
-              history.pushState({state: 'full'}, null)
-              location.href = '/big/wx/page/write_infor_wx'
+              var readToDay = localStorage.getItem('doubleEleven_isActiving') === new Date().toDateString()
+              localStorage.setItem('doubleEleven_isActiving', new Date().toDateString())
+              if (!readToDay) {
+                  history.pushState({state: 'full'}, null)
+                  location.href = '/big/wx/page/write_infor_wx'
+              }
           }
       }
   })