Bläddra i källkod

Merge branch 'dev/v1.0.75_yf' of jianyu/web into feature/v1.0.75

yangfeng 8 månader sedan
förälder
incheckning
24b63a990d

+ 1 - 1
apps/mobile/src/components/treasure-box/SunshineGuide.vue

@@ -2,7 +2,7 @@
   <div class="sunshine-guide">
     <van-overlay
       :show="show"
-      :custom-style="{ height: 'calc(100% - 13.333vw)' }"
+      :custom-style="{ height: 'calc(100% - 13.333vw)', 'z-index': '100' }"
     >
       <div class="guide-wrapper" @click.stop>
         <div class="van-popup--safe-area-inset-bottom sunshine-popup">

+ 22 - 3
apps/mobile/src/views/tabbar/Box.vue

@@ -97,6 +97,8 @@ export default {
   },
   created() {
     this.featureType = this.boxFeatureType
+  },
+  mounted() {
     this.actionSunshineGuide()
   },
   methods: {
@@ -185,14 +187,20 @@ export default {
         }
         const { error_code: code, data } = await getMoveDialog(params)
         if (code === 0) {
-          this.tipTimes = data || 0
-          this.showSunshineGuide = this.tipTimes < 2
           if (know && data === 1) {
             this.showSunshineGuide = false
+          } else {
+            if (data === 0) {
+              this.scrollToSunshine(() => {
+                this.showSunshineGuide = true
+              })
+            } else {
+              this.showSunshineGuide = false
+            }
           }
         }
       } catch (err) {
-        return {}
+        console.log(err)
       }
     },
     async toSunshineMore() {
@@ -201,6 +209,17 @@ export default {
     },
     toSunshineKnow() {
       this.actionSunshineGuide('know')
+    },
+    scrollToSunshine(callback) {
+      setTimeout(() => {
+        const sunshineTab = document.querySelectorAll('.van-tab__pane')[1]
+        if (sunshineTab) {
+          sunshineTab.scrollIntoView({ block: 'end', behavior: 'smooth' })
+          callback && callback()
+        } else {
+          callback && callback()
+        }
+      }, 500)
     }
   }
 }