Kaynağa Gözat

修改赛程

YY 2 yıl önce
ebeveyn
işleme
8d8002fc8c

+ 4 - 4
pagesMatch/matchAdmin/elimmatch/add.wxml

@@ -23,10 +23,10 @@
                                     <view class="schList">
                                     <view class="schList">
                                         <view class="change">
                                         <view class="change">
                                             <view class="change_1 textOver">
                                             <view class="change_1 textOver">
-                                                <view>{{s.address_id.name||'暂无场地'}}</view>
+                                                <view>{{s.address_id_name||'暂无场地'}}</view>
                                             </view>
                                             </view>
                                             <view class="change_1 textOver">
                                             <view class="change_1 textOver">
-                                                <view>{{s.referee_id.user_id.name||'暂无裁判'}}</view>
+                                                <view>{{s.referee_id_name||'暂无裁判'}}</view>
                                             </view>
                                             </view>
                                             <view class="change_1 textOver">
                                             <view class="change_1 textOver">
                                                 <view>{{s.match_time||'暂无时间'}}</view>
                                                 <view>{{s.match_time||'暂无时间'}}</view>
@@ -64,7 +64,7 @@
                     <view class="label">裁判:</view>
                     <view class="label">裁判:</view>
                     <view class="value">
                     <view class="value">
                         <picker mode="selector" bindchange="refereeChange" name="referee_id" value="{{form.referee_id}}" range="{{refereeList}}" range-key="name">
                         <picker mode="selector" bindchange="refereeChange" name="referee_id" value="{{form.referee_id}}" range="{{refereeList}}" range-key="name">
-                            <view class="picker">{{form.referee_id_name||form.referee_id.user_id.name||'请选择裁判名称'}}</view>
+                            <view class="picker">{{form.referee_id_name||'请选择裁判名称'}}</view>
                         </picker>
                         </picker>
                     </view>
                     </view>
                 </view>
                 </view>
@@ -72,7 +72,7 @@
                     <view class="label">场地:</view>
                     <view class="label">场地:</view>
                     <view class="value">
                     <view class="value">
                         <picker mode="selector" bindchange="addressChange" name="address_id" value="{{form.address_id}}" range="{{addressList}}" range-key="name">
                         <picker mode="selector" bindchange="addressChange" name="address_id" value="{{form.address_id}}" range="{{addressList}}" range-key="name">
-                            <view class="picker">{{form.address_id_name||form.address_id.name||'请选择场地'}}</view>
+                            <view class="picker">{{form.address_id_name||'请选择场地'}}</view>
                         </picker>
                         </picker>
                     </view>
                     </view>
                 </view>
                 </view>

+ 0 - 1
pagesMatch/matchAdmin/elimmatch/edit.js

@@ -181,7 +181,6 @@ Page({
                 // 查询其他信息
                 // 查询其他信息
                 await that.searchOther();
                 await that.searchOther();
                 if (that.data.id) {
                 if (that.data.id) {
-                    console.log('1');
                     const arr = await app.$get(`/eliminate/${that.data.id}`, {}, 'race');
                     const arr = await app.$get(`/eliminate/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {
                         // 状态
                         // 状态

+ 23 - 16
pagesMatch/matchAdmin/elimmatch/list.js

@@ -30,7 +30,7 @@ Page({
         this.WxValidate = new WxValidate(rules, messages)
         this.WxValidate = new WxValidate(rules, messages)
     },
     },
     // 返回
     // 返回
-    back: function () { wx.navigateBack({ delta: 1 }) },
+    back: function () { wx.navigateBack({ delta: 1 }); wx.setStorage({ key: "match", data: {} }) },
     // 添加
     // 添加
     toAdd: function (e) {
     toAdd: function (e) {
         const that = this;
         const that = this;
@@ -81,26 +81,33 @@ Page({
         if (match_id && group_id && project_id) {
         if (match_id && group_id && project_id) {
             if (that.data.btn == '2') {
             if (that.data.btn == '2') {
                 wx.navigateTo({ url: `/pagesMatch/matchAdmin/elimmatch/add?match_id=${match_id}&group_id=${group_id}&project_id=${project_id}` }); that.toClose();
                 wx.navigateTo({ url: `/pagesMatch/matchAdmin/elimmatch/add?match_id=${match_id}&group_id=${group_id}&project_id=${project_id}` }); that.toClose();
-            } else that.search(e.detail.value); that.toClose();
+            } else {
+                wx.setStorage({ key: "match", data: e.detail.value })
+                that.search(); that.toClose();
+            }
         } else {
         } else {
             wx.showToast({ title: '请选择数据', icon: 'error', duration: 2000 })
             wx.showToast({ title: '请选择数据', icon: 'error', duration: 2000 })
         }
         }
     },
     },
     search: async function (e) {
     search: async function (e) {
         const that = this;
         const that = this;
-        let match = that.data.match;
         let arr;
         let arr;
-        let info = { skip: that.data.skip, limit: that.data.limit, match_id: match.match_id, group_id: match.group_id, project_id: match.project_id };
-        arr = await app.$get(`http://192.168.1.197:15001/newCourt/race/v2/api/eliminate`, { ...info });
-        if (arr.errcode == '0') {
-            let list = [...that.data.list, ...arr.data]
-            for (const val of list) {
-                let status = that.data.statusList.find(i => i.value == val.status)
-                if (status) val.zhStatus = status.label;
-            }
-            that.setData({ list })
-            that.setData({ total: arr.total })
-        } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+        wx.getStorage({
+            key: 'match',
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit, match_id: res.data.match_id, group_id: res.data.group_id, project_id: res.data.project_id };
+                arr = await app.$get(`http://192.168.1.197:15001/newCourt/race/v2/api/eliminate`, { ...info });
+                if (arr.errcode == '0') {
+                    let list = [...that.data.list, ...arr.data]
+                    for (const val of list) {
+                        let status = that.data.statusList.find(i => i.value == val.status)
+                        if (status) val.zhStatus = status.label;
+                    }
+                    that.setData({ list })
+                    that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
+        })
     },
     },
     // 赛程上分
     // 赛程上分
     toScore: function (e) {
     toScore: function (e) {
@@ -119,7 +126,7 @@ Page({
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
             return false
             return false
         } else {
         } else {
-            let arr = await app.$post(`/eliminate/${form.id}`, params,'race');
+            let arr = await app.$post(`/eliminate/${form.id}`, params, 'race');
             if (arr.errcode == '0') {
             if (arr.errcode == '0') {
                 wx.showToast({ title: `上分成功`, icon: 'success', duration: 2000 });
                 wx.showToast({ title: `上分成功`, icon: 'success', duration: 2000 });
                 that.toClose();
                 that.toClose();
@@ -185,7 +192,7 @@ Page({
                 let arr;
                 let arr;
                 arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
                 arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
                 if (arr.errcode == '0') { that.setData({ matchList: arr.data }) }
                 if (arr.errcode == '0') { that.setData({ matchList: arr.data }) }
-                // if (that.data.match) that.search();
+                that.search();
             },
             },
             fail: async res => {
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
                 wx.redirectTo({ url: '/pages/index/index' })

+ 4 - 4
pagesMatch/matchAdmin/elimmatch/list.wxml

@@ -19,10 +19,10 @@
                     <view class="list" wx:for="{{list}}" wx:key="item">
                     <view class="list" wx:for="{{list}}" wx:key="item">
                         <view class="list_0">
                         <view class="list_0">
                             <view class="name">
                             <view class="name">
-                                <text>{{item.match_id.name||'暂无'}}</text>
-                                <text>{{item.group_id.name||'暂无'}}</text>
-                                <text>{{item.project_id.name||'暂无'}}</text>
-                                <text>{{item.address_id.name||'暂无场地'}}</text>
+                                <text>{{item.match_id_name||'暂无'}}</text>
+                                <text>{{item.group_id_name||'暂无'}}</text>
+                                <text>{{item.project_id_name||'暂无'}}</text>
+                                <text>{{item.address_id_name||'暂无场地'}}</text>
                             </view>
                             </view>
                             <view class="pk">
                             <view class="pk">
                                 <view class="pk_1">
                                 <view class="pk_1">