ソースを参照

feat: 微信端专属优化

zhangyuhan 4 年 前
コミット
643b345bbe

+ 3 - 5
src/web/staticres/common-module/keep-tags/keep-tags-template.js

@@ -409,7 +409,7 @@ Vue.component('keep-component', {
                   shoucang: type
                 }))
                 try {
-                  if (SuperSearch && typeof SuperSearch.setSessionStorage === 'function') {
+                  if (utils.isWeiXinBrowser && SuperSearch && typeof SuperSearch.setSessionStorage === 'function') {
                     SuperSearch.setSessionStorage();
                   }
                 } catch (e) {
@@ -556,9 +556,7 @@ function checkBackSuccess () {
       }
     }
     if (sessionData.type === 'article_original') {
-      if (utils.isWeiXinBrowser) {
-          location.href = sessionData.url
-      } else {
+      if (!utils.isWeiXinBrowser) {
         JyObj.openExternalLink(sessionData.url,"查看原文");
       }
     }
@@ -567,5 +565,5 @@ function checkBackSuccess () {
   sessionStorage.removeItem('salesBackData')
 }
 $(function () {
-      checkBackSuccess()
+    checkBackSuccess()
 })

+ 8 - 2
src/web/templates/frontRouter/wx/bigmember/free/perfect_info.html

@@ -913,8 +913,14 @@
                   history.back()
                 });
               } else {
-                sessionStorage.setItem('salesBackStatus', 'true')
-                history.back()
+                var sessionData = JSON.parse(sessionStorage.getItem('salesBackData') || '{}')
+                if (sessionData.type === 'article_original') {
+                  sessionStorage.removeItem('salesBackStatus')
+                  location.replace(sessionData.url)
+                } else {
+                  sessionStorage.setItem('salesBackStatus', 'true')
+                  history.back()
+                }
               }
             } else {
               _this.showToast(r.error_msg || '提交失败')