فهرست منبع

Merge branch 'master' of http://git.cc-lotus.info/ball-court/ball-applet

guhongwei 2 سال پیش
والد
کامیت
6d63f939cc

+ 8 - 3
pagesMatch/matchAdmin/group/add.js

@@ -36,7 +36,6 @@ Page({
             return false
             return false
         } else {
         } else {
             let arr;
             let arr;
-            console.log(params);
             if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
             if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
             else { arr = await app.$post(`/matchGroup`, params, 'race') }
             else { arr = await app.$post(`/matchGroup`, params, 'race') }
             if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
             if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
@@ -51,9 +50,17 @@ Page({
         that.setData({ id: options.id || '' })
         that.setData({ id: options.id || '' })
         //验证规则函数
         //验证规则函数
         that.initValidate();
         that.initValidate();
+        // 查询其他信息
+        await that.searchOther();
         // 监听用户是否登录
         // 监听用户是否登录
         await that.watchLogin();
         await that.watchLogin();
     },
     },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        arr = await app.$get(`/match`, { status: "0" }, 'race');
+        if (arr.errcode == '0') that.setData({ matchList: arr.data })
+    },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
@@ -61,8 +68,6 @@ Page({
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let match = await app.$get(`/match`, {}, 'race');
-                if (match.arrcode == '0') that.setData({ matchList: match.data })
                 if (that.data.id) {
                 if (that.data.id) {
                     let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
                     let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {

+ 2 - 2
pagesMatch/matchAdmin/group/add.wxml

@@ -11,8 +11,8 @@
                 <view class="content">
                 <view class="content">
                     <view class="label">比赛名称:</view>
                     <view class="label">比赛名称:</view>
                     <view class="value">
                     <view class="value">
-                        <picker mode="selector" bindchange="matchChange" name="match_id" value="{{form.match_id}}" range="{{matchList}}" range-key="name">
-                            <view class="picker">{{form.match_name||'请选择比赛名称'}}</view>
+                        <picker bindchange="matchChange" name="match_id" value="{{form.match_id}}" range-key='name' range="{{matchList}}">
+                            <view class="picker">{{form.match_name||'请选择赛事'}}</view>
                         </picker>
                         </picker>
                     </view>
                     </view>
                 </view>
                 </view>

+ 1 - 0
pagesMatch/matchAdmin/group/list.js

@@ -29,6 +29,7 @@ Page({
                     const arr = await app.$delete(`/matchGroup/${item._id}`, {}, 'race');
                     const arr = await app.$delete(`/matchGroup/${item._id}`, {}, 'race');
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {
                         wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
                         wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
                         that.watchLogin()
                         that.watchLogin()
                     } else {
                     } else {
                         wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
                         wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })

+ 3 - 1
pagesMatch/matchAdmin/group/list.less

@@ -48,7 +48,6 @@
 
 
             .name {
             .name {
                 font-size: var(--font20Szie);
                 font-size: var(--font20Szie);
-                color: var(--redColor);
                 font-weight: bold;
                 font-weight: bold;
                 margin: 0 0 2vw 0;
                 margin: 0 0 2vw 0;
             }
             }
@@ -69,6 +68,9 @@
             .btn {
             .btn {
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
                 text-align: center;
                 text-align: center;
+                button {
+                    margin: 0 2vw;
+                }
             }
             }
         }
         }
 
 

+ 3 - 3
pagesMatch/matchAdmin/group/list.wxml

@@ -16,11 +16,11 @@
                         <view class="other">
                         <view class="other">
                             <view class="other_1">
                             <view class="other_1">
                                 <text>比赛名称:</text>
                                 <text>比赛名称:</text>
-                                <text>{{item.match_name}}</text>
+                                <text>{{item.match_id_name}}</text>
                             </view>
                             </view>
                             <view class="other_1">
                             <view class="other_1">
                                 <text>年龄限制:</text>
                                 <text>年龄限制:</text>
-                                <text>{{item.age||'暂无'}}</text>
+                                <text>{{item.age||'暂无'}}</text>
                             </view>
                             </view>
                             <view class="other_1">
                             <view class="other_1">
                                 <text>说明:</text>
                                 <text>说明:</text>
@@ -28,7 +28,7 @@
                             </view>
                             </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">
-                            <button type="primary" size="mini" bindtap="toCommon" data-item="{{item}}">信息维护</button>
+                            <button type="primary" size="mini" bindtap="toCommon" data-route="matchAdmin/group/add" data-item="{{item}}">信息维护</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">信息删除</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">信息删除</button>
                         </view>
                         </view>
                     </view>
                     </view>

+ 3 - 1
pagesMatch/matchAdmin/group/list.wxss

@@ -42,7 +42,6 @@
 }
 }
 .main .two .list .name {
 .main .two .list .name {
   font-size: var(--font20Szie);
   font-size: var(--font20Szie);
-  color: var(--redColor);
   font-weight: bold;
   font-weight: bold;
   margin: 0 0 2vw 0;
   margin: 0 0 2vw 0;
 }
 }
@@ -60,6 +59,9 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
   text-align: center;
   text-align: center;
 }
 }
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;
   top: 0;
   top: 0;

+ 7 - 5
pagesMatch/matchAdmin/project/add.js

@@ -98,12 +98,8 @@ Page({
         wx.getStorage({
         wx.getStorage({
             key: 'user',
             key: 'user',
             success: async res => {
             success: async res => {
-                let match = await app.$get(`/match`, {}, 'race');
-                if (match.errcode == '0') that.setData({ matchList: match.data })
-                let group = await app.$get(`/matchGroup`, {}, 'race');
-                if (group.errcode == '0') that.setData({ groupList: group.data })
                 if (that.data.id) {
                 if (that.data.id) {
-                    let arr = await app.$get(`/matchProject/${that.data.id}`, 'race');
+                    let arr = await app.$get(`/matchProject/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {
                         // 比赛名称
                         // 比赛名称
                         let match = matchList.find(i => i._id == arr.data.match_id);
                         let match = matchList.find(i => i._id == arr.data.match_id);
@@ -136,6 +132,12 @@ Page({
         // 项目类别
         // 项目类别
         arr = await app.$get(`/dict`, { code: 'match_project_type' });
         arr = await app.$get(`/dict`, { code: 'match_project_type' });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ typeList: arr.data[0].list });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ typeList: arr.data[0].list });
+        // 比赛
+        arr = await app.$get(`/match`, { status: "0" }, 'race');
+        if (arr.errcode == '0') that.setData({ matchList: arr.data })
+        // 组别
+        arr = await app.$get(`/matchGroup`, {}, 'race');
+        if (arr.errcode == '0') that.setData({ groupList: arr.data })
     },
     },
     /**
     /**
      * 生命周期函数--监听页面初次渲染完成
      * 生命周期函数--监听页面初次渲染完成

+ 2 - 1
pagesMatch/matchAdmin/project/list.js

@@ -30,9 +30,10 @@ Page({
             content: '是否确认删除该条数据?',
             content: '是否确认删除该条数据?',
             async success(res) {
             async success(res) {
                 if (res.confirm) {
                 if (res.confirm) {
-                    const arr = await app.$delete(`/matchProject/${item._id}`, 'race');
+                    const arr = await app.$delete(`/matchProject/${item._id}`, {}, 'race');
                     if (arr.errcode == '0') {
                     if (arr.errcode == '0') {
                         wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
                         wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
                         that.watchLogin()
                         that.watchLogin()
                     } else {
                     } else {
                         wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
                         wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })

+ 5 - 1
pagesMatch/matchAdmin/project/list.less

@@ -30,6 +30,7 @@
             }
             }
         }
         }
     }
     }
+
     .two {
     .two {
         flex-grow: 1;
         flex-grow: 1;
         position: relative;
         position: relative;
@@ -47,7 +48,6 @@
 
 
             .name {
             .name {
                 font-size: var(--font20Szie);
                 font-size: var(--font20Szie);
-                color: var(--redColor);
                 font-weight: bold;
                 font-weight: bold;
                 margin: 0 0 2vw 0;
                 margin: 0 0 2vw 0;
             }
             }
@@ -68,6 +68,10 @@
             .btn {
             .btn {
                 margin: 2vw 0 0 0;
                 margin: 2vw 0 0 0;
                 text-align: center;
                 text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                }
             }
             }
         }
         }
 
 

+ 3 - 7
pagesMatch/matchAdmin/project/list.wxml

@@ -16,11 +16,11 @@
                         <view class="other">
                         <view class="other">
                             <view class="other_1">
                             <view class="other_1">
                                 <text>赛事名称:</text>
                                 <text>赛事名称:</text>
-                                <text>{{item.match_name}}</text>
+                                <text>{{item.match_id_name}}</text>
                             </view>
                             </view>
                             <view class="other_1">
                             <view class="other_1">
                                 <text>年龄限制:</text>
                                 <text>年龄限制:</text>
-                                <text>{{item.age||'暂无'}}</text>
+                                <text>{{item.age||'暂无'}}</text>
                             </view>
                             </view>
                             <view class="other_1">
                             <view class="other_1">
                                 <text>性别限制:</text>
                                 <text>性别限制:</text>
@@ -34,13 +34,9 @@
                                 <text>项目类别:</text>
                                 <text>项目类别:</text>
                                 <text>{{item.zhType||'暂无'}}</text>
                                 <text>{{item.zhType||'暂无'}}</text>
                             </view>
                             </view>
-                            <view class="other_1">
-                                <text>说明:</text>
-                                <text>{{item.explain||'暂无'}}</text>
-                            </view>
                         </view>
                         </view>
                         <view class="btn">
                         <view class="btn">
-                            <button type="primary" size="mini" bindtap="toCommon" data-item="{{item}}">信息维护</button>
+                            <button type="primary" size="mini" bindtap="toCommon" data-route="matchAdmin/project/add" data-item="{{item}}">信息维护</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">信息删除</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">信息删除</button>
                         </view>
                         </view>
                     </view>
                     </view>

+ 3 - 1
pagesMatch/matchAdmin/project/list.wxss

@@ -42,7 +42,6 @@
 }
 }
 .main .two .list .name {
 .main .two .list .name {
   font-size: var(--font20Szie);
   font-size: var(--font20Szie);
-  color: var(--redColor);
   font-weight: bold;
   font-weight: bold;
   margin: 0 0 2vw 0;
   margin: 0 0 2vw 0;
 }
 }
@@ -60,6 +59,9 @@
   margin: 2vw 0 0 0;
   margin: 2vw 0 0 0;
   text-align: center;
   text-align: center;
 }
 }
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;
   top: 0;
   top: 0;