Quellcode durchsuchen

fix: 调整首页公众号关注引导

cuiyalong vor 6 Monaten
Ursprung
Commit
14cff02387
1 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen
  1. 12 9
      apps/mobile/src/views/tabbar/Home.vue

+ 12 - 9
apps/mobile/src/views/tabbar/Home.vue

@@ -326,7 +326,7 @@ export default {
       }
     },
     async checkSubscribe() {
-      // if (!this.$envs.inWeiXinMiniApp) return
+      if (!this.$envs.inWxMini) return
       const { error_code: code, data } = await getSubscribeStatus()
       if (code === 0 && data) {
         const r = {
@@ -649,15 +649,18 @@ export default {
       return result
     },
     beforeOpenMiniBanner() {
-      // this.$router.push({
-      //   path: '/static/follow_guide'
-      // })
-      try {
-        wx.miniProgram.navigateTo({
-          url: '/pages/guide/index' // 指定要跳转到的页面路径及参数
+      if (this.$envs.inWxMini) {
+        try {
+          wx.miniProgram.navigateTo({
+            url: '/pages/guide/index' // 指定要跳转到的页面路径及参数
+          })
+        } catch (error) {
+          console.log(error)
+        }
+      } else {
+        this.$router.push({
+          path: '/static/follow_guide'
         })
-      } catch (error) {
-        console.log(error)
       }
       return false
     },