zs 2 years ago
parent
commit
515be7a4e7
2 changed files with 11 additions and 2 deletions
  1. 10 1
      pages/openMatch/index.js
  2. 1 1
      pages/openMatch/index.wxml

+ 10 - 1
pages/openMatch/index.js

@@ -112,6 +112,7 @@ Page({
         ],
         btnList: [],
         btnActive: ['1'],
+        active: '',
     },
     // 选项卡
     tabsChange: function (e) {
@@ -120,10 +121,18 @@ Page({
         that.setData({ 'tabs.active': name });
     },
     // 场地选项卡
-    fieldtabsChange: function (e) {
+    fieldtabsChange: async function (e) {
         const that = this;
         const { name } = e.detail;
         that.setData({ 'fieldtabs.active': name });
+        let group = that.data.fieldtabs.list.find((i) => i.name == name);
+        if (group) {
+            that.setData({ active: group.name });
+            // const arr = await app.$get(`/newCourt/api/race`, { ground_id: group._id });
+            // if (arr.errcode == '0') {
+            //     that.setData({ racelist: arr.data })
+            // }
+        }
     },
     toCommon: function (e) {
         const { route } = e.currentTarget.dataset;

+ 1 - 1
pages/openMatch/index.wxml

@@ -112,7 +112,7 @@
                         </view>
                     </scroll-view>
                 </view>
-                <view wx:if="{{fieldtabs.active=='1'}}" class="a d_2">
+                <view wx:if="{{fieldtabs.active==active}}" class="a d_2">
                     <scroll-view scroll-y="true" class="scroll-view">
                         <view class="list-scroll-view">
                             <view class="list" wx:for="{{racelist}}" wx:key="item">