guhongwei 2 tahun lalu
induk
melakukan
fd8735d0f9
5 mengubah file dengan 217 tambahan dan 239 penghapusan
  1. 1 1
      app.json
  2. 48 77
      pages/match/sign.js
  3. 99 62
      pages/match/sign.less
  4. 36 46
      pages/match/sign.wxml
  5. 33 53
      pages/match/sign.wxss

+ 1 - 1
app.json

@@ -26,8 +26,8 @@
         "pages/match/projectadd",
         "pages/match/matchgroup",
         "pages/match/shteam",
+        
         "pages/match/sign",
-
         "pages/matchInfo/index",
         "pages/matchInfo/sign",
       

+ 48 - 77
pages/match/sign.js

@@ -8,14 +8,12 @@ Page({
      */
     data: {
         frameStyle: { useTop: true, name: '报名管理', leftArrow: true, useBar: false },
-        //查询条件
-        searchName: '',
+        searchInfo: {},
         list: [],
         dialog: { title: '详细信息', show: false, type: '1' },
         info: {},
-        statusList: examine_status,
-        projectList: [],
-        form: {}
+        // projectList: [],
+        // form: {}
     },
     initValidate() {
         const rules = { grouping_id: { required: true }, project_id: { required: true } }
@@ -27,80 +25,57 @@ Page({
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
-    // 查询信息
-    onSearch: function (e) {
-        const that = this;
-        that.setData({ searchName: e.detail });
-        that.watchLogin();
-    },
+    // 查询
+    search: function (e) { console.log('查询'); },
     // 查看
     toView: async function (e) {
         const that = this;
-        const { id } = e.currentTarget.dataset;
-        const arr = await app.$get(`/newCourt/api/enroll/${id}`);
+        const { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/newCourt/api/enroll/${item._id}`);
         if (arr.errcode == '0') {
-            const aee = await app.$get(`/newCourt/api/user/${arr.data.openid}`);
-            if (aee.errcode == '0') arr.data.name = aee.data.name
-            const ass = await app.$get(`/newCourt/api/match/${arr.data.match_id}`);
-            if (ass.errcode == '0') arr.data.title = ass.data.name
+            // 用户信息
+            const user = await app.$get(`/newCourt/api/user/${arr.data.openid}`);
+            if (user.errcode = '0') { arr.data.user_name = user.data.name };
+            // 赛事信息
+            const match = await app.$get(`/newCourt/api/match/${arr.data.match_id}`);
+            if (match.errcode = '0') { arr.data.match_name = match.data.name };
+            // 赛事组别
+            let group = match.data.grouping.find((i) => i._id == arr.data.grouping_id);
+            if (group) { arr.data.grouping_name = group.name; }
+            // 赛事项目
+            const project = await app.$get(`/newCourt/api/matchProject/${arr.data.project_id}`)
+            if (project.errcode = '0') { arr.data.project_name = project.data.name };
             that.setData({ info: arr.data })
             that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
         }
     },
-    // 审核
-    toCheck: async function (e) {
+    // 修改
+    toEdit: async function (e) {
         const that = this;
-        let { id } = e.currentTarget.dataset;
-        const arr = await app.$get(`/newCourt/api/enroll/${id}`);
+        const { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/newCourt/api/enroll/${item._id}`);
         if (arr.errcode == '0') {
-            const ass = await app.$get(`/newCourt/api/match/${arr.data.match_id}`);
-            if (ass.errcode == '0') {
-                that.setData({ info: ass.data })
-                let data = { openid: ass.data.openid, match_id: ass.data._id, match_name: ass.data.name }
-                that.setData({ form: data })
-            }
-            that.setData({ dialog: { title: '信息审核', show: true, type: '2' } })
-        }
-    },
-    // 赛事分组
-    groupingChange: async function (e) {
-        const that = this;
-        let data = that.data.info.grouping[e.detail.value];
-        that.setData({ 'form.grouping_id': data._id });
-        that.setData({ 'form.grouping_name': data.name });
-        let project = [];
-        for (const val of data.project) {
-            const arr = await app.$get(`/newCourt/api/matchProject/${val}`);
-            if (arr.errcode == '0') {
-                project.push(arr.data)
-            }
+            // 用户信息
+            const user = await app.$get(`/newCourt/api/user/${arr.data.openid}`);
+            if (user.errcode = '0') { arr.data.user_name = user.data.name };
+            // 赛事信息
+            const match = await app.$get(`/newCourt/api/match/${arr.data.match_id}`);
+            if (match.errcode = '0') { arr.data.match_name = match.data.name };
+            // 赛事组别
+            let group = match.data.grouping.find((i) => i._id == arr.data.grouping_id);
+            if (group) { arr.data.grouping_name = group.name; }
+            // 赛事项目
+            const project = await app.$get(`/newCourt/api/matchProject/${arr.data.project_id}`)
+            if (project.errcode = '0') { arr.data.project_name = project.data.name };
+            that.setData({ info: arr.data })
+            that.setData({ dialog: { title: '信息维护', show: true, type: '2' } })
         }
-        that.setData({ projectList: project });
     },
-    // 选择组内项目
-    projectChange: function (e) {
+    // 退款
+    toRefund: function (e) {
         const that = this;
-        let data = that.data.projectList[e.detail.value];
-        that.setData({ 'form.project_id': data._id });
-        that.setData({ 'form.project_name': data.name });
-    },
-    onSubmit: async function (e) {
-        const that = this;
-        const params = e.detail.value;
-        if (!this.WxValidate.checkForm(params)) {
-            const error = this.WxValidate.errorList[0];
-            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
-            return false
-        } else {
-            const arr = await app.$post(`/newCourt/api/enroll`, params);
-            if (arr.errcode == '0') {
-                wx.showToast({ title: `报名成功`, icon: 'success', duration: 2000 });
-                that.setData({ dialog: { title: '信息审核', show: false, type: '2' } })
-                that.watchLogin();
-            } else {
-                wx.showToast({ title: `${res.errMsg}`, icon: 'fail', duration: 2000 });
-            }
-        }
+        const { item } = e.currentTarget.dataset;
+        console.log(item);
     },
     // 关闭弹框
     toClose: function () {
@@ -125,18 +100,14 @@ Page({
                 const arr = await app.$get(`/newCourt/api/enroll/`);
                 if (arr.errcode == '0') {
                     for (const val of arr.data) {
-                        const aee = await app.$get(`/newCourt/api/user/${val.openid}`);
-                        if (aee.errcode == '0') val.name = aee.data.name
-                        aee = await app.$get(`/newCourt/api/match/${val.match_id}`);
-                        if (aee.errcode == '0') val.title = aee.data.name
-                    }
-                    if (that.data.searchName) {
-                        let list = arr.data.filter((i) => i.name == that.data.searchName);
-                        if (list) that.setData({ list: list })
-                        else that.setData({ list: [] })
-                    } else {
-                        that.setData({ list: arr.data })
+                        // 用户信息
+                        const user = await app.$get(`/newCourt/api/user/${val.openid}`);
+                        if (user.errcode = '0') { val.user_name = user.data.name };
+                        // 赛事信息
+                        const match = await app.$get(`/newCourt/api/match/${val.match_id}`);
+                        if (match.errcode = '0') { val.match_name = match.data.name };
                     }
+                    that.setData({ list: arr.data })
                 }
             },
             fail: res => {

+ 99 - 62
pages/match/sign.less

@@ -1,10 +1,24 @@
 .main {
-    height: 88vh;
+    height: 88.8vh;
 
-    .one {
+    .zero {
         width: 96vw;
+
         margin: 0 0 2vw 0;
-        background-color: #fff;
+    }
+
+    .zero:nth-child(2) {
+        margin: 0;
+    }
+
+    .one {
+        width: 92vw;
+        padding: 2vw;
+        background-color: #f1f1f1;
+
+        input {
+            font-size: 14px;
+        }
     }
 
     .two {
@@ -26,29 +40,30 @@
                 justify-content: space-between;
 
                 .list {
+                    background-color: #ffffff;
+                    margin: 0 0 2vw 0;
+                    padding: 2vw;
                     display: flex;
                     flex-direction: column;
                     width: 96vw;
-                    padding: 2vw;
-                    background-color: #ffffff;
-                    margin: 0 0 2vw 0;
 
                     .name {
-                        font-size: 14px;
+                        font-size: 16px;
                         font-weight: bold;
                         margin: 0 0 1vw 0;
                     }
 
                     .other {
-                        font-size: 12px;
                         margin: 0 0 1vw 0;
 
                         .other_1 {
-                            padding: 0 0 1vw 0;
-                        }
+                            color: #858585;
+                            font-size: 12px;
+                            margin: 0 0 1vw 0;
 
-                        .other_1 text:nth-child(1) {
-                            color: #666;
+                            text:nth-child(1) {
+                                color: #000000;
+                            }
                         }
                     }
 
@@ -56,73 +71,95 @@
                         text-align: center;
 
                         button {
-                            color: #ffffff;
-                            font-size: 14px;
                             margin: 0 2vw;
+                            font-size: 14px;
                         }
                     }
                 }
+
+                .list:last-child {
+                    margin: 0;
+                }
             }
         }
     }
 }
 
 .dialog_one {
-    margin: 10px 0 0 0;
+    display: flex;
+    flex-direction: column;
 
     .one_1 {
-        display: flex;
-        flex-direction: row;
-        justify-content: space-between;
-        border: 1px solid #ccc;
-        border-radius: 5px;
-        margin: 0 0 10px 0;
-        padding: 10px;
-
-        .text {
-            width: 20vw;
-            color: #666;
-            font-size: 14px;
-        }
+        border-bottom: 1px solid #ccc;
+        padding: 2vw 0;
 
-        .text1 {
+        text {
             font-size: 14px;
-            color: #000;
-            max-width: 50vw;
+            color: #858585;
         }
 
-        .image {
-            width: 15vw;
-            height: 15vw;
+        text:nth-child(1) {
+            color: #000000;
         }
     }
 }
 
-.dialog_two {
-    margin: 10px 0 0 0;
-
-    .content {
-        display: flex;
-        flex-direction: row;
-        justify-content: space-between;
-        border-bottom: 1px solid #ccc;
-        padding: 10px 0;
-        margin: 0 0 10px 0;
-        font-size: 14px;
-        color: #000;
-
-        .value {
-            .input {
-                text-align: right;
-            }
-        }
-    }
-
-    .btn {
-        text-align: center;
-
-        button {
-            font-size: 14px;
-        }
-    }
-}
+// .dialog_one {
+//     margin: 10px 0 0 0;
+
+//     .one_1 {
+//         display: flex;
+//         flex-direction: row;
+//         justify-content: space-between;
+//         border: 1px solid #ccc;
+//         border-radius: 5px;
+//         margin: 0 0 10px 0;
+//         padding: 10px;
+
+//         .text {
+//             width: 20vw;
+//             color: #666;
+//             font-size: 14px;
+//         }
+
+//         .text1 {
+//             font-size: 14px;
+//             color: #000;
+//             max-width: 50vw;
+//         }
+
+//         .image {
+//             width: 15vw;
+//             height: 15vw;
+//         }
+//     }
+// }
+
+// .dialog_two {
+//     margin: 10px 0 0 0;
+
+//     .content {
+//         display: flex;
+//         flex-direction: row;
+//         justify-content: space-between;
+//         border-bottom: 1px solid #ccc;
+//         padding: 10px 0;
+//         margin: 0 0 10px 0;
+//         font-size: 14px;
+//         color: #000;
+
+//         .value {
+//             .input {
+//                 text-align: right;
+//             }
+//         }
+//     }
+
+//     .btn {
+//         text-align: center;
+
+//         button {
+//             font-size: 14px;
+//         }
+//     }
+// }

+ 36 - 46
pages/match/sign.wxml

@@ -1,21 +1,31 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
-        <view class="one">
-            <van-search value="{{ searchName }}" bind:search="onSearch" placeholder="请输入用户姓名" />
+        <view class="zero one">
+            <input type="text" value="{{searchInfo.name}}" bindconfirm="search" placeholder="请输入关键词" />
         </view>
-        <view class="two">
+        <view class="zero two">
             <scroll-view scroll-y="true" class="scroll-view">
                 <view class="list-scroll-view">
                     <view class="list" wx:for="{{list}}" wx:key="item">
-                        <view class="name ">{{item.name||'暂无'}}</view>
+                        <view class="name">{{item.user_name}}</view>
                         <view class="other">
-                            <view class="other_1 textOver"><text>赛事名称:</text><text>{{item.title}}</text></view>
-                            <view class="other_1"><text>是否转发了朋友圈:</text><text>{{item.has_turn=='0'?'未转发':'已转发'}}</text></view>
-                            <view class="other_1"><text>支付状态:</text><text>{{item.pay_status=='0'?'待支付':item.pay_status=='1'?'已支付':'支付失败'}}</text></view>
+                            <view class="other_1">
+                                <text>赛事名称:</text>
+                                <text>{{item.match_name}}</text>
+                            </view>
+                            <view class="other_1">
+                                <text>是否支付报名费:</text>
+                                <text>{{item.pay_status=='0'?'待支付':item.pay_status=='1'?'已支付':'支付失败'}}</text>
+                            </view>
+                            <view class="other_1">
+                                <text>是否转发朋友圈:</text>
+                                <text>{{item.has_turn=='0'?'未转发':'已转发'}}</text>
+                            </view>
                         </view>
                         <view class="btn">
-                            <button size="mini" type="primary" bindtap="toView" data-id="{{item._id}}">详情</button>
-                            <button size="mini" type="primary" bindtap="toCheck" data-id="{{item._id}}">维护</button>
+                            <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
+                            <button type="primary" size="mini" bindtap="toEdit" data-item="{{item}}">信息维护</button>
+                            <button type="warn" size="mini" bindtap="toRefund" data-item="{{item}}">退款</button>
                         </view>
                     </view>
                 </view>
@@ -27,52 +37,32 @@
     <view slot="info">
         <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
             <view class="one_1">
-                <text class="text">报名用户:</text>
-                <text class="text1">{{info.name||'暂无昵称'}}</text>
+                <text>报名用户:</text>
+                <text>{{info.user_name||'暂无昵称'}}</text>
             </view>
             <view class="one_1">
-                <text class="text">赛事名称:</text>
-                <text class="text1">{{info.title||'暂无'}}</text>
+                <text>赛事名称:</text>
+                <text>{{info.match_name||'暂无'}}</text>
             </view>
             <view class="one_1">
-                <text class="text">是否转发了朋友圈:</text>
-                <text class="text1">{{info.has_turn=='0'?'未转发':'已转发'}}</text>
+                <text>赛事组别:</text>
+                <text>{{info.grouping_name||'暂无'}}</text>
             </view>
             <view class="one_1">
-                <text class="text">支付状态:</text>
-                <text class="text1">{{info.pay_status=='0'?'待支付':info.pay_status=='1'?'已支付':'支付失败'}}</text>
+                <text>组别项目:</text>
+                <text>{{info.project_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>是否转发了朋友圈:</text>
+                <text>{{info.has_turn=='0'?'未转发':'已转发'}}</text>
+            </view>
+            <view class="one_1">
+                <text>支付状态:</text>
+                <text>{{info.pay_status=='0'?'待支付':info.pay_status=='1'?'已支付':'支付失败'}}</text>
             </view>
         </view>
         <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
-            <form bindsubmit="onSubmit">
-                <view class="content">
-                    <view class="label">赛事分组</view>
-                    <view class="value">
-                        <picker mode="selector" bindchange="groupingChange" value="{{form.grouping_id}}" name="grouping_id" range-key='name' range="{{info.grouping}}">
-                            <view class="input">{{form.grouping_name||'请选择赛事分组'}}</view>
-                        </picker>
-                    </view>
-                </view>
-                <view class="content">
-                    <view class="label">赛事分组名称</view>
-                    <view class="value"><input name="grouping_name" value="{{form.grouping_name}}" placeholder="请输入赛事分组名称" disabled /></view>
-                </view>
-                <view class="content">
-                    <view class="label">组内项目</view>
-                    <view class="value">
-                        <picker mode="selector" bindchange="projectChange" value="{{form.project_id}}" name="project_id" range-key='name' range="{{projectList}}">
-                            <view class="input">{{form.project_name||'请选择组内项目'}}</view>
-                        </picker>
-                    </view>
-                </view>
-                <view class="content">
-                    <view class="label">组内项目名称</view>
-                    <view class="value"><input name="project_name" value="{{form.project_name}}" placeholder="请输入组内项目名称" disabled /></view>
-                </view>
-                <view class="btn">
-                    <button type="primary" size="mini" formType="submit">提交审核</button>
-                </view>
-            </form>
+            {{form}}
         </view>
     </view>
 </e-dialog>

+ 33 - 53
pages/match/sign.wxss

@@ -1,10 +1,20 @@
 .main {
-  height: 88vh;
+  height: 88.8vh;
 }
-.main .one {
+.main .zero {
   width: 96vw;
   margin: 0 0 2vw 0;
-  background-color: #fff;
+}
+.main .zero:nth-child(2) {
+  margin: 0;
+}
+.main .one {
+  width: 92vw;
+  padding: 2vw;
+  background-color: #f1f1f1;
+}
+.main .one input {
+  font-size: 14px;
 }
 .main .two {
   flex-grow: 1;
@@ -25,81 +35,51 @@
   justify-content: space-between;
 }
 .main .two .scroll-view .list-scroll-view .list {
+  background-color: #ffffff;
+  margin: 0 0 2vw 0;
+  padding: 2vw;
   display: flex;
   flex-direction: column;
   width: 96vw;
-  padding: 2vw;
-  background-color: #ffffff;
-  margin: 0 0 2vw 0;
 }
 .main .two .scroll-view .list-scroll-view .list .name {
-  font-size: 14px;
+  font-size: 16px;
   font-weight: bold;
   margin: 0 0 1vw 0;
 }
 .main .two .scroll-view .list-scroll-view .list .other {
-  font-size: 12px;
   margin: 0 0 1vw 0;
 }
 .main .two .scroll-view .list-scroll-view .list .other .other_1 {
-  padding: 0 0 1vw 0;
+  color: #858585;
+  font-size: 12px;
+  margin: 0 0 1vw 0;
 }
 .main .two .scroll-view .list-scroll-view .list .other .other_1 text:nth-child(1) {
-  color: #666;
+  color: #000000;
 }
 .main .two .scroll-view .list-scroll-view .list .btn {
   text-align: center;
 }
 .main .two .scroll-view .list-scroll-view .list .btn button {
-  color: #ffffff;
-  font-size: 14px;
   margin: 0 2vw;
-}
-.dialog_one {
-  margin: 10px 0 0 0;
-}
-.dialog_one .one_1 {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  border: 1px solid #ccc;
-  border-radius: 5px;
-  margin: 0 0 10px 0;
-  padding: 10px;
-}
-.dialog_one .one_1 .text {
-  width: 20vw;
-  color: #666;
   font-size: 14px;
 }
-.dialog_one .one_1 .text1 {
-  font-size: 14px;
-  color: #000;
-  max-width: 50vw;
-}
-.dialog_one .one_1 .image {
-  width: 15vw;
-  height: 15vw;
+.main .two .scroll-view .list-scroll-view .list:last-child {
+  margin: 0;
 }
-.dialog_two {
-  margin: 10px 0 0 0;
-}
-.dialog_two .content {
+.dialog_one {
   display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  border-bottom: 1px solid #ccc;
-  padding: 10px 0;
-  margin: 0 0 10px 0;
-  font-size: 14px;
-  color: #000;
-}
-.dialog_two .content .value .input {
-  text-align: right;
+  flex-direction: column;
 }
-.dialog_two .btn {
-  text-align: center;
+.dialog_one .one_1 {
+  border-bottom: 1px solid #ccc;
+  padding: 2vw 0;
 }
-.dialog_two .btn button {
+.dialog_one .one_1 text {
   font-size: 14px;
+  color: #858585;
+}
+.dialog_one .one_1 text:nth-child(1) {
+  color: #000000;
 }