瀏覽代碼

switchtab

xujing 5 年之前
父節點
當前提交
d4d1f878b3
共有 2 個檔案被更改,包括 8 行新增3 行删除
  1. 3
    2
      src/pages/activity/activity.js
  2. 5
    1
      src/pages/project/activity/index.js

+ 3
- 2
src/pages/activity/activity.js 查看文件

@@ -44,10 +44,11 @@ export default class active extends Component {
44 44
       this.setState({
45 45
         current: 1
46 46
       }, Taro.getApp().props.projectIndex = 0)
47
-    } else {
47
+    }
48
+    if (Taro.getApp().props.projectIndex == 2) {
48 49
       this.setState({
49 50
         current: 0
50
-      })
51
+      }, Taro.getApp().props.projectIndex = 0)
51 52
     }
52 53
   }
53 54
   componentWillUnmount() {

+ 5
- 1
src/pages/project/activity/index.js 查看文件

@@ -13,8 +13,12 @@ export default class SwiperBanner extends Component {
13 13
 
14 14
     }
15 15
     toActivity() {
16
+        Taro.getApp().props.projectIndex = 2
16 17
         Taro.switchTab({
17
-            url: `/pages/activity/activity`
18
+            url: `/pages/activity/activity`,
19
+            fail: res => {
20
+                Taro.getApp().props.projectIndex = 0
21
+            }
18 22
         })
19 23
     }
20 24
     handleItemClick(item) {