zs 2 anni fa
parent
commit
8bf863c8f6

+ 43 - 51
pagesMatch/matchAdmin/mtschedule/add.js

@@ -15,11 +15,13 @@ Page({
         // 小组设置列表
         teamList: [],
         // 裁判
-        coachList: [],
+        refereeList: [],
         // 场地
         addressList: [],
         // 选手
-        memberList: []
+        memberList: [],
+        // 赛程状态
+        statusList: []
     },
     initValidate() {
         const rules = { match_id: { required: true }, group_id: { required: true }, project_id: { required: true }, team_id: { required: true }, address_id: { required: true }, referee_id: { required: true }, match_time: { required: true }, player_type: { required: true }, player_one: { required: true }, player_two: { required: true } }
@@ -34,7 +36,7 @@ Page({
         const that = this;
         let data = that.data.matchList[e.detail.value];
         if (data) {
-            that.setData({ 'form.match_id': data._id, 'form.match_name': data.name });
+            that.setData({ 'form.match_id': data._id, 'form.match_id_name': data.name });
             const arr = await app.$get(`/matchGroup`, { match_id: data._id }, 'race');
             if (arr.errcode == '0') { that.setData({ groupList: arr.data }) }
         }
@@ -44,7 +46,7 @@ Page({
         const that = this;
         let data = that.data.groupList[e.detail.value];
         if (data) {
-            that.setData({ 'form.group_id': data._id, 'form.group_name': data.name });
+            that.setData({ 'form.group_id': data._id, 'form.group_id_name': data.name });
             const arr = await app.$get(`/matchProject`, { match_id: data.match_id, group_id: data._id }, 'race');
             if (arr.errcode == '0') { that.setData({ projectList: arr.data }) }
         }
@@ -54,7 +56,7 @@ Page({
         const that = this;
         let data = that.data.projectList[e.detail.value];
         if (data) {
-            that.setData({ 'form.project_id': data._id, 'form.project_name': data.name });
+            that.setData({ 'form.project_id': data._id, 'form.project_id_name': data.name });
             const arr = await app.$get(`/matchTeamGroup`, { match_id: data.match_id, group_id: data.group_id, project_id: data._id }, 'race');
             if (arr.errcode == '0') { that.setData({ teamList: arr.data }) }
         }
@@ -64,19 +66,12 @@ Page({
         const that = this;
         let data = that.data.teamList[e.detail.value];
         if (data) {
-            that.setData({ 'form.team_id': data._id, 'form.team_name': data.name });
+            that.setData({ 'form.team_id': data._id, 'form.team_id_name': data.name });
             const arr = await app.$get(`/matchTeamGroup/${data._id}`, {}, 'race');
             if (arr.errcode == '0') {
-                if (arr.data.person_type == 'User') { that.setData({ 'form.player_type': '0', 'form.type_name': '单打' }) }
-                if (arr.data.person_type == 'TeamApply') { that.setData({ 'form.player_type': '1', 'form.type_name': '双打' }) }
-                for (const val of arr.data.person) {
-                    let memberList = [];
-                    val.map(function (item, index) {
-                        var member = {}; member['name'] = item.user_name; member['id'] = item; memberList[index] = member
-                    })
-                    that.setData({ memberList });
-                    console.log(that.data.memberList);
-                }
+                if (arr.data.person_type == 'User') { that.setData({ 'form.player_type': 'User', 'form.type_name': '单打' }) }
+                if (arr.data.person_type == 'TeamApply') { that.setData({ 'form.player_type': 'TeamApply', 'form.type_name': '双打' }) }
+                that.setData({ memberList: arr.data.person });
             }
 
         }
@@ -86,15 +81,15 @@ Page({
         const that = this;
         let data = that.data.addressList[e.detail.value];
         if (data) {
-            that.setData({ 'form.address_id': data._id, 'form.address_name': data.name });
+            that.setData({ 'form.address_id': data._id, 'form.address_id_name': data.name });
         }
     },
     // 裁判
-    coachChange: async function (e) {
+    refereeChange: async function (e) {
         const that = this;
-        let data = that.data.coachList[e.detail.value];
+        let data = that.data.refereeList[e.detail.value];
         if (data) {
-            that.setData({ 'form.coach_id': data._id, 'form.coach_name': data.name });
+            that.setData({ 'form.referee_id': data._id, 'form.referee_id_name': data.name });
         }
     },
     // 确认选择
@@ -107,7 +102,7 @@ Page({
         const that = this;
         let data = that.data.memberList[e.detail.value];
         if (data) {
-            that.setData({ 'form.player_one': data._id, 'form.member_one_name': data.name });
+            that.setData({ 'form.player_one': data.id, 'form.player_one_name': data.name });
         }
     },
     // 选手一
@@ -115,13 +110,23 @@ Page({
         const that = this;
         let data = that.data.memberList[e.detail.value];
         if (data) {
-            that.setData({ 'form.player_two': data._id, 'form.member_two_name': data.name });
+            that.setData({ 'form.player_two': data.id, 'form.player_two_name': data.name });
+        }
+    },
+    // 选择状态
+    statusChange: function (e) {
+        const that = this;
+        let data = that.data.statusList[e.detail.value];
+        if (data) {
+            that.setData({ 'form.status': data.value, 'form.zhStatus': data.label });
         }
     },
     // 提交保存
     onSubmit: async function (e) {
         const that = this;
         const params = e.detail.value;
+        const form = that.data.form;
+        params.match_time = form.match_time;
         if (!this.WxValidate.checkForm(params)) {
             const error = this.WxValidate.errorList[0];
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
@@ -152,17 +157,20 @@ Page({
         const that = this;
         const raceuser = that.data.raceuser;
         let arr;
+        // 状态
+        arr = await app.$get(`/dict`, { code: 'schedule_status' });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
         // 比赛
-        arr = await app.$get(`/match`, { belong_id: '630ec0480a92b0a015ccfbe1' }, 'race');
+        arr = await app.$get(`/match`, { belong_id: raceuser._id, status: '2' }, 'race');
         if (arr.errcode == '0') that.setData({ matchList: arr.data });
         // 场地
-        arr = await app.$get(`/matchAddress`, { belong_id: '630ec0480a92b0a015ccfbe1' }, 'race');
+        arr = await app.$get(`/matchAddress`, { belong_id: raceuser._id, is_use: '0' }, 'race');
         if (arr.errcode == '0') that.setData({ addressList: arr.data });
         // 裁判
         arr = await app.$get(`/user`, { type: '2' }, 'race');
         if (arr.errcode == '0') {
             for (const val of arr.data) { val.name = val.user_id.name }
-            that.setData({ coachList: arr.data });
+            that.setData({ refereeList: arr.data });
         }
     },
     // 监听用户是否登录
@@ -173,32 +181,16 @@ Page({
             success: async res => {
                 that.setData({ raceuser: res.data })
                 if (that.data.id) {
-                    if (that.data.id) {
-                        const arr = await app.$get(`/msgs/${that.data.id}`, {}, 'race');
-                        if (arr.errcode == '0') {
-                            let aee;
-                            // 比赛
-                            aee = await app.$get(`/match/${arr.data.match_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.match_name = aee.data.name;
-                            // 组别
-                            aee = await app.$get(`/matchGroup/${arr.data.group_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.project_name = aee.data.name;
-                            // 项目
-                            aee = await app.$get(`/matchProject/${arr.data.project_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.group_name = aee.data.name
-                            // 小组赛设置
-                            aee = await app.$get(`/matchTeamGroup/${arr.data.team_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.team_name = aee.data.name
-                            // 裁判
-                            aee = await app.$get(`/user/${arr.data.referee_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.referee_name = aee.data.name
-                            // 场地
-                            aee = await app.$get(`/matchAddress/${arr.data.address_id}`, {}, 'race');
-                            if (aee.errcode == '0') arr.data.address_name = aee.data.name
-                            that.setData({ info: arr.data })
-                        } else {
-                            wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
-                        }
+                    const arr = await app.$get(`/msgs/${that.data.id}`, {}, 'race');
+                    if (arr.errcode == '0') {
+                        // 状态
+                        let status = that.data.statusList.find(i => i.value == arr.data.status)
+                        if (status) arr.data.zhStatus = status.label;
+                        if (arr.data.player_type == 'User') { arr.data.type_name = '单打' }
+                        if (arr.data.player_type == 'TeamApply') { arr.data.type_name = '双打' }
+                        that.setData({ form: arr.data })
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
                     }
                 }
             },

+ 15 - 17
pagesMatch/matchAdmin/mtschedule/add.wxml

@@ -12,7 +12,7 @@
                     <view class="label">比赛名称:</view>
                     <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>
+                            <view class="picker">{{form.match_id_name||'请选择赛事'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -20,7 +20,7 @@
                     <view class="label">赛事组别:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="groupChange" name="group_id" value="{{form.group_id}}" range="{{groupList}}" range-key="name">
-                            <view class="picker">{{form.group_name||'请选择赛事分组'}}</view>
+                            <view class="picker">{{form.group_id_name||'请选择赛事分组'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -28,7 +28,7 @@
                     <view class="label">组内项目:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="projectChange" name="project_id" value="{{form.project_id}}" range="{{projectList}}" range-key="name">
-                            <view class="picker">{{form.project_name||'请选择组内项目'}}</view>
+                            <view class="picker">{{form.project_id_name||'请选择组内项目'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -36,7 +36,7 @@
                     <view class="label">小组名称:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="teamChange" name="team_id" value="{{form.team_id}}" range="{{teamList}}" range-key="name">
-                            <view class="picker">{{form.team_name||'请选择小组名称'}}</view>
+                            <view class="picker">{{form.team_id_name||'请选择小组名称'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -44,15 +44,15 @@
                     <view class="label">场地名称:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="addressChange" name="address_id" value="{{form.address_id}}" range="{{addressList}}" range-key="name">
-                            <view class="picker">{{form.address_name||'请选择场地名称'}}</view>
+                            <view class="picker">{{form.address_id_name||'请选择场地名称'}}</view>
                         </picker>
                     </view>
                 </view>
                 <view class="content">
                     <view class="label">裁判名称:</view>
                     <view class="value">
-                        <picker mode="selector" bindchange="coachChange" name="coach_id" value="{{form.coach_id}}" range="{{coachList}}" range-key="name">
-                            <view class="picker">{{form.coach_name||'请选择裁判名称'}}</view>
+                        <picker mode="selector" bindchange="refereeChange" name="referee_id" value="{{form.referee_id}}" range="{{refereeList}}" range-key="name">
+                            <view class="picker">{{form.referee_id_name||'请选择裁判名称'}}</view>
                         </picker>
                     </view>
                 </view>
@@ -78,28 +78,26 @@
                     <view class="label">选手一:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="oneMemberChange" name="player_one" value="{{form.player_one}}" range="{{memberList}}" range-key="name">
-                            <view class="picker">{{form.member_one_name||'请选择选手一'}}</view>
+                            <view class="picker">{{form.player_one_name||'请选择选手一'}}</view>
                         </picker>
                     </view>
                 </view>
-                <view class="content">
-                    <view class="label">选手一比分:</view>
-                    <view class="value">
-                        <input type="text" name="player_one_score" value="{{form.player_one_score}}" placeholder="请输入选手一比分" />
-                    </view>
-                </view>
                 <view class="content">
                     <view class="label">选手二:</view>
                     <view class="value">
                         <picker mode="selector" bindchange="twoMemberChange" name="player_two" value="{{form.player_two}}" range="{{memberList}}" range-key="name">
-                            <view class="picker">{{form.member_two_name||'请选择选手二'}}</view>
+                            <view class="picker">{{form.player_two_name||'请选择选手二'}}</view>
                         </picker>
                     </view>
                 </view>
                 <view class="content">
-                    <view class="label">选手二比分:</view>
+                    <view class="label">赛程状态:</view>
                     <view class="value">
-                        <input type="text" name="player_two_score" value="{{form.player_two_score}}" placeholder="请输入选手一比分" />
+                        <view class="value">
+                            <picker mode="selector" bindchange="statusChange" name="status" value="{{form.status}}" range="{{statusList}}" range-key="label">
+                                <view class="picker">{{form.zhStatus||'请选择赛程状态'}}</view>
+                            </picker>
+                        </view>
                     </view>
                 </view>
                 <view class="btn">

+ 111 - 7
pagesMatch/matchAdmin/mtschedule/list.js

@@ -1,7 +1,22 @@
 const app = getApp();
+import WxValidate from '../../../utils/wxValidate';
 Page({
     data: {
         frameStyle: { useTop: true, name: '赛程设置', leftArrow: true, useBar: false },
+        dialog: { title: '赛程上分', show: false, type: '1' },
+        form: {},
+        list: [],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
+        statusList: []
+    },
+    initValidate() {
+        const rules = { player_one_score: { required: true }, player_two_score: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { player_one_score: { required: '选手一比分' }, player_two_score: { required: '选手二比分' } };
+        this.WxValidate = new WxValidate(rules, messages)
     },
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
@@ -12,7 +27,75 @@ Page({
         that.setData({ skip: 0, page: 0, list: [] });
         wx.navigateTo({ url: `/pagesMatch/${route}?id=${item && item._id ? item._id : ''}` })
     },
-
+    // 赛程上分
+    toScore: function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        that.setData({ form: item })
+        that.setData({ dialog: { title: '赛程上分', show: true, type: '1' } })
+    },
+    // 删除
+    toDel: function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/msgs/${item._id}`, {}, 'race');
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.setData({ skip: 0, page: 0, list: [] })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+    },
+    // 提交保存
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const form = that.data.form;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
+            let arr = await app.$post(`/msgs/${form.id}`, params, 'race');
+            if (arr.errcode == '0') {
+                wx.showToast({ title: `上分成功`, icon: 'success', duration: 2000 });
+                that.toClose();
+                that.setData({ skip: 0, page: 0, list: [] })
+                that.watchLogin()
+            }
+            else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    // 分页
+    toPage: function () {
+        const that = this;
+        let list = that.data.list;
+        let limit = that.data.limit;
+        if (that.data.total > list.length) {
+            wx.showLoading({ title: '加载中', mask: true })
+            let page = that.data.page + 1;
+            that.setData({ page: page })
+            let skip = page * limit;
+            that.setData({ skip: skip })
+            that.watchLogin();
+            wx.hideLoading()
+        } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
+    },
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ form: {} })
+        that.setData({ dialog: { title: '赛程上分', show: false, type: '1' } })
+    },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -24,17 +107,38 @@ Page({
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow: function () {
+    onShow: async function () {
         const that = this;
+        //验证规则函数
+        that.initValidate();
+        // 查询其他信息
+        await that.searchOther();
         // 监听用户是否登录
-        that.watchLogin();
+        await that.watchLogin();
+    },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        arr = await app.$get(`/dict`, { code: "schedule_status" });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
     },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
         wx.getStorage({
             key: 'raceuser',
-            success: async res => { },
+            success: async res => {
+                let info = { skip: that.data.skip, limit: that.data.limit };
+                let arr = await app.$get(`/msgs`, { ...info }, 'race');
+                if (arr.errcode == '0') {
+                    for (const val of arr.data) {
+                        let status = that.data.statusList.find(i => i.value == val.status)
+                        if (status) val.zhStatus = status.label;
+                    }
+                    that.setData({ list: [...that.data.list, ...arr.data] })
+                    that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+            },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
             }
@@ -47,15 +151,15 @@ Page({
      * 生命周期函数--监听页面隐藏
      */
     onHide: function () {
-
+        const that = this;
+        that.setData({ skip: 0, page: 0, list: [] })
     },
 
     /**
      * 生命周期函数--监听页面卸载
      */
     onUnload: function () {
-        const that = this;
-        that.setData({ skip: 0, page: 0, list: [] })
+
     },
 
     /**

+ 6 - 5
pagesMatch/matchAdmin/mtschedule/list.json

@@ -1,6 +1,7 @@
 {
-    "component": true,
-    "usingComponents": {
-      "mobile-main": "/commpents/mobile-frame/index"
-    }
-  }
+  "component": true,
+  "usingComponents": {
+    "mobile-main": "/commpents/mobile-frame/index",
+    "dialog": "/commpents/dialog/index"
+  }
+}

+ 66 - 15
pagesMatch/matchAdmin/mtschedule/list.less

@@ -38,33 +38,56 @@
         padding: 0 2vw;
 
         .list {
-            background-color: var(--f9Color);
+            background-color: #328d26;
             margin: 0 0 2vw 0;
             padding: 2vw;
-            margin: 0 2vw 2vw 2vw;
-            border-radius: 5px;
 
-            .name {
-                font-size: var(--font16Szie);
-                font-weight: bold;
-                margin: 0 0 1vw 0;
-            }
+            .list_0 {
+                .name {
+                    padding: 1vw 0;
+                    color: var(--whiteColor);
+                    margin: 0 0 1vw 0;
 
-            .other {
-                margin: 0 0 1vw 0;
+                    text {
+                        padding: 0 2vw 0 0;
+                    }
+                }
 
-                .other_1 {
-                    margin: 0 0 1vw 0;
-                    font-size: var(--font14Size);
+                .pk {
+                    display: flex;
+                    flex-direction: row;
+                    justify-content: space-around;
+                    background-color: var(--whiteColor);
 
-                    text:first-child {
-                        color: var(--f85Color);
+                    .pk_1 {
+                        width: 30vw;
+                        text-align: center;
+                        padding: 2vw;
+                    }
+
+                    .pk_2 {
+                        text-align: center;
+                        box-shadow: 0 0 5px var(--fcColor);
+
+                        .time {
+                            background-color: #328d26;
+                            color: var(--whiteColor);
+                            padding: 1vw 0;
+                            font-size: var(--font14Size);
+                        }
+
+                        .score {
+                            font-size: var(--font20Szie);
+                            padding: 1vw 0;
+                            font-weight: bold;
+                        }
                     }
                 }
             }
 
             .btn {
                 text-align: center;
+                margin: 2vw 0 0 0;
 
                 button {
                     margin: 0 2vw;
@@ -72,6 +95,10 @@
                 }
             }
         }
+
+        .list:last-child {
+            margin: 0;
+        }
     }
 }
 
@@ -86,4 +113,28 @@
         display: flex;
         flex-direction: column;
     }
+}
+
+.dialog_1 {
+    .content {
+        display: flex;
+        flex-direction: row;
+        border-bottom: 1px dashed var(--f1Color);
+        padding: 2vw 0;
+        margin: 0 2vw 2vw 2vw;
+
+        .value {
+            flex-grow: 1;
+            color: var(--blackColor);
+        }
+    }
+
+    .btn {
+        text-align: center;
+        margin: 3vw 0;
+
+        button {
+            margin: 0 2vw;
+        }
+    }
 }

+ 57 - 22
pagesMatch/matchAdmin/mtschedule/list.wxml

@@ -12,31 +12,31 @@
             <scroll-view scroll-y="true" class="scroll-view" bindscrolltolower="toPage">
                 <view class="list-scroll-view">
                     <view class="list" wx:for="{{list}}" wx:key="item">
-                        <view class="name">{{item.name||'暂无'}}</view>
-                        <view class="other">
-                            <view class="other_1">
-                                <text>赛事类别:</text>
-                                <text>{{item.zhtype}}</text>
+                        <view class="list_0">
+                            <view class="name">
+                                <text>{{item.match_id_name}}</text>
+                                <text>{{item.group_id_name}}</text>
+                                <text>{{item.project_id_name}}</text>
+                                <text>{{item.team_id_name}}</text>
+                                <text>{{item.address_id_name}}</text>
                             </view>
-                            <view class="other_1">
-                                <text>比赛时间:</text>
-                                <text>{{item.start_time}}至{{item.end_time}}</text>
-                            </view>
-                            <view class="other_1">
-                                <text>报名截止时间:</text>
-                                <text>{{item.sign_time}}</text>
-                            </view>
-                            <view class="other_1">
-                                <text>报名费用:</text>
-                                <text>{{item.money}}</text>
-                            </view>
-                            <view class="other_1">
-                                <text>比赛状态:</text>
-                                <text>{{item.zhstatus}}</text>
+                            <view class="pk">
+                                <view class="pk_1">
+                                    <text>{{item.player_one_name}}</text>
+                                </view>
+                                <view class="pk_2">
+                                    <view class="time">{{item.match_time}}</view>
+                                    <view class="time">{{item.zhStatus}}</view>
+                                    <view class="score"><text>{{item.player_one_score||0}}</text>-{{item.player_two_score||0}}</view>
+                                </view>
+                                <view class="pk_1">
+                                    <text>{{item.player_two_name}}</text>
+                                </view>
                             </view>
                         </view>
                         <view class="btn">
-                            <button type="primary" size="mini" bindtap="toEdit" data-item="{{item}}">信息维护</button>
+                            <button type="primary" size="mini" bindtap="toCommon" data-route="matchAdmin/mtschedule/add" data-item="{{item}}">信息维护</button>
+                            <button type="primary" size="mini" bindtap="toScore" data-item="{{item}}">赛程上分</button>
                             <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">赛事删除</button>
                         </view>
                     </view>
@@ -44,4 +44,39 @@
             </scroll-view>
         </view>
     </view>
-</mobile-main>
+</mobile-main>
+<dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info" class="dialog">
+        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <view class="label">选手一:</view>
+                    <view class="value">
+                        <input type="text" name="player_one_name" value="{{form.player_one_name}}" disabled placeholder="请输入选手一" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">选手一比分:</view>
+                    <view class="value">
+                        <input type="text" name="player_one_score" value="{{form.player_one_score}}" placeholder="请输入选手一比分" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">选手二:</view>
+                    <view class="value">
+                        <input type="text" name="player_two_name" value="{{form.player_two_name}}" disabled placeholder="请输入选手二" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">选手二比分:</view>
+                    <view class="value">
+                        <input type="text" name="player_two_score" value="{{form.player_two_score}}" placeholder="请输入选手二比分" />
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</dialog>

+ 51 - 12
pagesMatch/matchAdmin/mtschedule/list.wxss

@@ -32,34 +32,55 @@
   padding: 0 2vw;
 }
 .main .two .list {
-  background-color: var(--f9Color);
+  background-color: #328d26;
   margin: 0 0 2vw 0;
   padding: 2vw;
-  margin: 0 2vw 2vw 2vw;
-  border-radius: 5px;
 }
-.main .two .list .name {
-  font-size: var(--font16Szie);
-  font-weight: bold;
+.main .two .list .list_0 .name {
+  padding: 1vw 0;
+  color: var(--whiteColor);
   margin: 0 0 1vw 0;
 }
-.main .two .list .other {
-  margin: 0 0 1vw 0;
+.main .two .list .list_0 .name text {
+  padding: 0 2vw 0 0;
 }
-.main .two .list .other .other_1 {
-  margin: 0 0 1vw 0;
+.main .two .list .list_0 .pk {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  background-color: var(--whiteColor);
+}
+.main .two .list .list_0 .pk .pk_1 {
+  width: 30vw;
+  text-align: center;
+  padding: 2vw;
+}
+.main .two .list .list_0 .pk .pk_2 {
+  text-align: center;
+  box-shadow: 0 0 5px var(--fcColor);
+}
+.main .two .list .list_0 .pk .pk_2 .time {
+  background-color: #328d26;
+  color: var(--whiteColor);
+  padding: 1vw 0;
   font-size: var(--font14Size);
 }
-.main .two .list .other .other_1 text:first-child {
-  color: var(--f85Color);
+.main .two .list .list_0 .pk .pk_2 .score {
+  font-size: var(--font20Szie);
+  padding: 1vw 0;
+  font-weight: bold;
 }
 .main .two .list .btn {
   text-align: center;
+  margin: 2vw 0 0 0;
 }
 .main .two .list .btn button {
   margin: 0 2vw;
   font-size: var(--font14Size);
 }
+.main .two .list:last-child {
+  margin: 0;
+}
 .scroll-view {
   position: absolute;
   top: 0;
@@ -71,3 +92,21 @@
   display: flex;
   flex-direction: column;
 }
+.dialog_1 .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.dialog_1 .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+}
+.dialog_1 .btn {
+  text-align: center;
+  margin: 3vw 0;
+}
+.dialog_1 .btn button {
+  margin: 0 2vw;
+}

+ 1 - 1
pagesMatch/system/index.js

@@ -49,7 +49,7 @@ Page({
                     const aee = await app.$get(`/user/${arr.data.user_id}`);
                     if (aee.errcode == '0') { arr.data.user_id = aee.data; }
                     that.setData({ user: arr.data })
-                    let btnData = match_menu.find((i) => i.type == '1');
+                    let btnData = match_menu.find((i) => i.type == arr.data.type);
                     that.setData({ list: [...btnData.menu, ...school_sysmenu] })
                 }
                 else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }

+ 8 - 44
pagesMatch/userAdmin/schedule/list.js

@@ -11,46 +11,9 @@ Page({
             ],
         },
         // 小组赛
-        groupList: [
-            {
-                match_id_name: '赛事名称',
-                group_id_name: '赛事组别',
-                project_id_name: '组内项目',
-                address_id_name: '场地名称',
-                smgroup_name: '小组名称',
-                player_one_name: '选手一',
-                player_one_score: '10',
-                match_time: '2022-02-02 01:00:00',
-                player_two_name: '选手二',
-                player_two_score: '5',
-            },
-            {
-                match_id_name: '赛事名称',
-                group_id_name: '赛事组别',
-                project_id_name: '组内项目',
-                address_id_name: '场地名称',
-                smgroup_name: '小组名称',
-                player_one_name: '选手一',
-                player_one_score: '10',
-                match_time: '2022-02-02 01:00:00',
-                player_two_name: '选手二',
-                player_two_score: '5',
-            },
-        ],
+        groupList: [],
         // 淘汰赛
-        eliminatelist: [
-            {
-                match_id_name: '赛事名称',
-                group_id_name: '赛事组别',
-                project_id_name: '组内项目',
-                address_id_name: '场地名称',
-                player_one_name: '选手一',
-                player_one_score: '10',
-                match_time: '2022-02-02 01:00:00',
-                player_two_name: '选手二',
-                player_two_score: '5',
-            }
-        ],
+        eliminateList: [],
         total: 0,
         page: 0,
         skip: 0,
@@ -62,20 +25,20 @@ Page({
     tabsChange: function (e) {
         const that = this;
         that.setData({ 'tabs.active': e.detail.active });
-        that.setData({ skip: 0, page: 0, list: [] });
+        that.setData({ skip: 0, page: 0, groupList: [], eliminateList: [], });
         that.watchLogin();
     },
     //通用添加 详细信息
     toCommon: function (e) {
         const that = this;
         const { item, route } = e.currentTarget.dataset;
-        that.setData({ skip: 0, page: 0, list: [] });
+        that.setData({ skip: 0, page: 0, groupList: [], eliminateList: [], });
         wx.navigateTo({ url: `/pagesMatch/${route}?id=${item && item._id ? item._id : ''}` })
     },
     // 分页
     toPage: function () {
         const that = this;
-        let list = that.data.list;
+        let list = that.data.groupList;
         let limit = that.data.limit;
         if (that.data.total > list.length) {
             wx.showLoading({ title: '加载中', mask: true })
@@ -111,7 +74,7 @@ Page({
             key: 'user',
             success: async res => {
                 if (tabs.active == 'a') {
-                    let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
+                    let info = { skip: that.data.skip, limit: that.data.limit };
                     let arr = await app.$get(`/msgs`, { ...info }, 'race');
                     if (arr.errcode == '0') {
                         let groupList = [...that.data.groupList, ...arr.data]
@@ -132,7 +95,8 @@ Page({
      * 生命周期函数--监听页面隐藏
      */
     onHide: function () {
-
+        const that = this;
+        that.setData({ skip: 0, page: 0, groupList: [], eliminatelist: [], });
     },
 
     /**

+ 16 - 13
pagesMatch/userAdmin/schedule/sinfo.js

@@ -4,6 +4,7 @@ Page({
         frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
         id: '',
         info: {},
+        statusList: []
     },
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
@@ -13,9 +14,17 @@ Page({
     onLoad: async function (options) {
         const that = this;
         await that.setData({ id: options.id || null })
+        // 查询其他信息
+        await that.searchOther();
         // 监听用户是否登录
         await that.watchLogin();
     },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        arr = await app.$get(`/dict`, { code: "schedule_status" });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
@@ -26,19 +35,6 @@ Page({
                     const arr = await app.$get(`/msgs/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                         arr.data.zhStatus = that.searchStatus(arr.data.status);
-                        let aee;
-                        // 比赛
-                        aee = await app.$get(`/match/${arr.data.match_id}`, {}, 'race');
-                        if (aee.errcode == '0') arr.data.match_id_name = aee.data.name;
-                        // 组别
-                        aee = await app.$get(`/matchGroup/${arr.data.group_id}`, {}, 'race');
-                        if (aee.errcode == '0') arr.data.project_id_name = aee.data.name;
-                        // 项目
-                        aee = await app.$get(`/matchProject/${arr.data.project_id}`, {}, 'race');
-                        if (aee.errcode == '0') arr.data.group_id_name = aee.data.name
-                        // 场地
-                        aee = await app.$get(`/matchAddress/${arr.data.address_id}`, {}, 'race');
-                        if (aee.errcode == '0') arr.data.address_id_name = aee.data.name
                         that.setData({ info: arr.data })
                     } else {
                         wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
@@ -50,6 +46,13 @@ Page({
             }
         })
     },
+    // 查询状态
+    searchStatus: function (e) {
+        const that = this;
+        let data = that.data.statusList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无';
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 3 - 3
pagesMatch/userAdmin/schedule/sinfo.wxml

@@ -31,11 +31,11 @@
             </view>
             <view class="one_1">
                 <text>选手类型:</text>
-                <text>{{info.player_type=='0'?'单打':info.player_type=='1'?'双打':'暂无'}}</text>
+                <text>{{info.player_type=='User'?'单打':info.player_type=='TeamApply'?'双打':'暂无'}}</text>
             </view>
             <view class="one_1">
                 <text>选手一:</text>
-                <text>{{info.player_one||'暂无'}}</text>
+                <text>{{info.player_one_name||'暂无'}}</text>
             </view>
             <view class="one_1">
                 <text>选手一比分:</text>
@@ -43,7 +43,7 @@
             </view>
             <view class="one_1">
                 <text>选手二:</text>
-                <text>{{info.player_two||'暂无'}}</text>
+                <text>{{info.player_two_name||'暂无'}}</text>
             </view>
             <view class="one_1">
                 <text>选手二比分:</text>