guhongwei 2 năm trước cách đây
mục cha
commit
2cdd9dc90c

+ 1 - 2
pagesMatch/matchAdmin/group/add.js

@@ -22,8 +22,7 @@ Page({
         const that = this;
         let data = that.data.matchList[e.detail.value];
         if (data) {
-            that.setData({ 'form.match_id': data._id })
-            that.setData({ 'form.match_name': data.name })
+            that.setData({ 'form.match_id': data._id, 'form.match_name': data.name })
         }
     },
     //提交

+ 7 - 13
pagesMatch/matchAdmin/group/add.less

@@ -7,33 +7,27 @@
         .content {
             display: flex;
             flex-direction: row;
-            padding: 2vw;
             border-bottom: 1px dashed var(--f1Color);
-
-            .label {
-                font-size: var(--font16Size);
-            }
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
 
             .value {
-                font-size: var(--font16Size);
-                width: 65vw;
+                flex-grow: 1;
+                color: var(--blackColor);
 
                 textarea {
-                    width: 100%;
-                    height: 120px;
+                    position: static;
+                    width: 72vw;
                 }
-
             }
         }
 
         .btn {
             text-align: center;
-            margin: 5vw 0 0 0;
+            margin: 3vw 0;
 
             button {
-                width: 40vw;
                 margin: 0 2vw;
-                padding: 1vw 0;
             }
         }
     }

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

@@ -25,7 +25,7 @@
                 <view class="content">
                     <view class="label">年龄限制:</view>
                     <view class="value">
-                        <input type="text" name="age" value="{{form.age}}" placeholder="请输入年龄限" />
+                        <input type="text" name="age" value="{{form.age}}" placeholder="请输入年龄区间,-线隔开/不限" />
                     </view>
                 </view>
                 <view class="content">

+ 7 - 11
pagesMatch/matchAdmin/group/add.wxss

@@ -5,26 +5,22 @@
 .main .one .content {
   display: flex;
   flex-direction: row;
-  padding: 2vw;
   border-bottom: 1px dashed var(--f1Color);
-}
-.main .one .content .label {
-  font-size: var(--font16Size);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
 }
 .main .one .content .value {
-  font-size: var(--font16Size);
-  width: 65vw;
+  flex-grow: 1;
+  color: var(--blackColor);
 }
 .main .one .content .value textarea {
-  width: 100%;
-  height: 120px;
+  position: static;
+  width: 72vw;
 }
 .main .one .btn {
   text-align: center;
-  margin: 5vw 0 0 0;
+  margin: 3vw 0;
 }
 .main .one .btn button {
-  width: 40vw;
   margin: 0 2vw;
-  padding: 1vw 0;
 }

+ 13 - 15
pagesMatch/matchAdmin/group/list.less

@@ -32,32 +32,30 @@
     }
 
     .two {
-        flex-grow: 1;
         position: relative;
-        width: 96vw;
-        margin: 2vw;
-        background-color: var(--mainColor);
+        flex-grow: 1;
+        background-color: var(--whiteColor);
+        padding: 0 2vw;
 
         .list {
-            display: flex;
-            flex-direction: column;
-            border: 2px dashed var(--f1Color);
-            padding: 2vw;
+            background-color: var(--f9Color);
             margin: 0 0 2vw 0;
-            border-radius: 10px;
+            padding: 2vw;
+            margin: 0 2vw 2vw 2vw;
+            border-radius: 5px;
 
             .name {
-                font-size: var(--font20Szie);
+                font-size: var(--font16Szie);
                 font-weight: bold;
-                margin: 0 0 2vw 0;
+                margin: 0 0 1vw 0;
             }
 
             .other {
-                margin: 0 0 2vw 0;
+                margin: 0 0 1vw 0;
 
                 .other_1 {
-                    font-size: var(--font16Szie);
                     margin: 0 0 1vw 0;
+                    font-size: var(--font14Size);
 
                     text:first-child {
                         color: var(--f85Color);
@@ -66,14 +64,14 @@
             }
 
             .btn {
-                margin: 2vw 0 0 0;
                 text-align: center;
+
                 button {
                     margin: 0 2vw;
+                    font-size: var(--font14Size);
                 }
             }
         }
-
     }
 }
 

+ 12 - 14
pagesMatch/matchAdmin/group/list.wxss

@@ -26,41 +26,39 @@
   font-size: var(--font14Size);
 }
 .main .two {
-  flex-grow: 1;
   position: relative;
-  width: 96vw;
-  margin: 2vw;
-  background-color: var(--mainColor);
+  flex-grow: 1;
+  background-color: var(--whiteColor);
+  padding: 0 2vw;
 }
 .main .two .list {
-  display: flex;
-  flex-direction: column;
-  border: 2px dashed var(--f1Color);
-  padding: 2vw;
+  background-color: var(--f9Color);
   margin: 0 0 2vw 0;
-  border-radius: 10px;
+  padding: 2vw;
+  margin: 0 2vw 2vw 2vw;
+  border-radius: 5px;
 }
 .main .two .list .name {
-  font-size: var(--font20Szie);
+  font-size: var(--font16Szie);
   font-weight: bold;
-  margin: 0 0 2vw 0;
+  margin: 0 0 1vw 0;
 }
 .main .two .list .other {
-  margin: 0 0 2vw 0;
+  margin: 0 0 1vw 0;
 }
 .main .two .list .other .other_1 {
-  font-size: var(--font16Szie);
   margin: 0 0 1vw 0;
+  font-size: var(--font14Size);
 }
 .main .two .list .other .other_1 text:first-child {
   color: var(--f85Color);
 }
 .main .two .list .btn {
-  margin: 2vw 0 0 0;
   text-align: center;
 }
 .main .two .list .btn button {
   margin: 0 2vw;
+  font-size: var(--font14Size);
 }
 .scroll-view {
   position: absolute;

+ 14 - 18
pagesMatch/matchAdmin/project/add.js

@@ -4,19 +4,19 @@ Page({
     data: {
         frameStyle: { useTop: true, name: '信息维护', leftArrow: true, useBar: false },
         form: {},
+        // 比赛列表
+        matchList: [],
+        // 赛事分组
+        groupList: [],
         //项目类别
         typeList: [],
-        //性别
+        //性别限制
         genderList: [],
-        // 比赛
-        matchList: [],
-        // 赛事分组
-        groupList: []
     },
     initValidate() {
-        const rules = { name: { required: true }, type: { required: true }, match_id: { required: false }, group_id: { required: true }, age: { required: false }, gender: { required: false }, num: { required: false }, explain: { required: false } }
+        const rules = { match_id: { required: false }, group_id: { required: true }, name: { required: true }, type: { required: true }, age: { required: false }, gender: { required: true }, num: { required: true }, explain: { required: false } }
         // 验证字段的提示信息,若不传则调用默认的信息
-        const messages = { name: { required: '项目名称' }, match_id: { required: '比赛赛事' }, group_id: { required: '赛事分组' }, type: { required: '项目类别' }, age: { required: '人数限制' }, gender: { required: '性别限制' }, num: { required: '人数限制' }, explain: { required: '说明' } };
+        const messages = { match_id: { required: '比赛赛事' }, group_id: { required: '赛事分组' }, name: { required: '项目名称' }, type: { required: '项目类别' }, age: { required: '人数限制' }, gender: { required: '性别限制' }, num: { required: '人数限制' }, explain: { required: '说明' } };
         this.WxValidate = new WxValidate(rules, messages)
     },
     // 返回
@@ -28,8 +28,7 @@ Page({
         const that = this;
         let data = that.data.genderList[e.detail.value];
         if (data) {
-            that.setData({ 'form.gender': data.value });
-            that.setData({ 'form.zhGender': data.label });
+            that.setData({ 'form.gender': data.value, 'form.zhGender': data.label });
         }
     },
     // 项目类别
@@ -37,8 +36,7 @@ Page({
         const that = this;
         let data = that.data.typeList[e.detail.value];
         if (data) {
-            that.setData({ 'form.type': data.value })
-            that.setData({ 'form.zhType': data.label })
+            that.setData({ 'form.type': data.value, 'form.zhType': data.label })
         }
     },
     // 比赛名称
@@ -46,8 +44,7 @@ Page({
         const that = this;
         let data = that.data.matchList[e.detail.value];
         if (data) {
-            that.setData({ 'form.match_id': data._id })
-            that.setData({ 'form.match_name': data.name })
+            that.setData({ 'form.match_id': data._id, 'form.match_name': data.name })
         }
     },
     // 赛事分组
@@ -55,8 +52,7 @@ Page({
         const that = this;
         let data = that.data.groupList[e.detail.value];
         if (data) {
-            that.setData({ 'form.group_id': data._id })
-            that.setData({ 'form.group_name': data.name })
+            that.setData({ 'form.group_id': data._id, 'form.group_name': data.name })
         }
     },
     //提交
@@ -91,10 +87,10 @@ Page({
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
-        let genderList = that.data.genderList;
-        let typeList = that.data.typeList;
         let matchList = that.data.matchList;
         let groupList = that.data.groupList;
+        let typeList = that.data.typeList;
+        let genderList = that.data.genderList;
         wx.getStorage({
             key: 'user',
             success: async res => {
@@ -110,7 +106,7 @@ Page({
                         // 项目类别
                         let type = typeList.find(i => i.value == arr.data.type);
                         if (type) arr.data.zhType = type.label;
-                        // 性别
+                        // 性别限制
                         let gender = genderList.find(i => i.value == arr.data.gender);
                         if (gender) arr.data.zhGender = gender.label;
                         that.setData({ form: arr.data })

+ 7 - 13
pagesMatch/matchAdmin/project/add.less

@@ -7,33 +7,27 @@
         .content {
             display: flex;
             flex-direction: row;
-            padding: 2vw;
             border-bottom: 1px dashed var(--f1Color);
-
-            .label {
-                font-size: var(--font16Size);
-            }
+            padding: 2vw 0;
+            margin: 0 2vw 2vw 2vw;
 
             .value {
-                font-size: var(--font16Size);
-                width: 65vw;
+                flex-grow: 1;
+                color: var(--blackColor);
 
                 textarea {
-                    width: 100%;
-                    height: 120px;
+                    position: static;
+                    width: 72vw;
                 }
-
             }
         }
 
         .btn {
             text-align: center;
-            margin: 5vw 0 0 0;
+            margin: 3vw 0;
 
             button {
-                width: 40vw;
                 margin: 0 2vw;
-                padding: 1vw 0;
             }
         }
     }

+ 1 - 1
pagesMatch/matchAdmin/project/add.wxml

@@ -41,7 +41,7 @@
                 <view class="content">
                     <view class="label">年龄限制:</view>
                     <view class="value">
-                        <input type="text" name="age" value="{{form.age}}" placeholder="请输入年龄限" />
+                        <input type="text" name="age" value="{{form.age}}" placeholder="请输入年龄区间,-线隔开/不限" />
                     </view>
                 </view>
                 <view class="content">

+ 7 - 11
pagesMatch/matchAdmin/project/add.wxss

@@ -5,26 +5,22 @@
 .main .one .content {
   display: flex;
   flex-direction: row;
-  padding: 2vw;
   border-bottom: 1px dashed var(--f1Color);
-}
-.main .one .content .label {
-  font-size: var(--font16Size);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
 }
 .main .one .content .value {
-  font-size: var(--font16Size);
-  width: 65vw;
+  flex-grow: 1;
+  color: var(--blackColor);
 }
 .main .one .content .value textarea {
-  width: 100%;
-  height: 120px;
+  position: static;
+  width: 72vw;
 }
 .main .one .btn {
   text-align: center;
-  margin: 5vw 0 0 0;
+  margin: 3vw 0;
 }
 .main .one .btn button {
-  width: 40vw;
   margin: 0 2vw;
-  padding: 1vw 0;
 }

+ 5 - 5
pagesMatch/matchAdmin/project/list.js

@@ -7,7 +7,7 @@ Page({
         page: 0,
         skip: 0,
         limit: 5,
-        //性别
+        //性别限制
         genderList: [],
         //项目类别
         typeList: []
@@ -68,17 +68,17 @@ Page({
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow: function () {
+    onShow: async function () {
         const that = this;
         // 查询其他信息
-        that.searchOther();
+        await that.searchOther();
         // 监听用户是否登录
-        that.watchLogin();
+        await that.watchLogin();
     },
     searchOther: async function () {
         const that = this;
         let arr;
-        // 性别
+        // 性别限制
         arr = await app.$get(`/dict`, { code: 'match_project_gender' });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ genderList: arr.data[0].list });
         // 项目类别

+ 12 - 15
pagesMatch/matchAdmin/project/list.less

@@ -32,32 +32,30 @@
     }
 
     .two {
-        flex-grow: 1;
         position: relative;
-        width: 96vw;
-        margin: 2vw;
-        background-color: var(--mainColor);
+        flex-grow: 1;
+        background-color: var(--whiteColor);
+        padding: 0 2vw;
 
         .list {
-            display: flex;
-            flex-direction: column;
-            border: 2px dashed var(--f1Color);
-            padding: 2vw;
+            background-color: var(--f9Color);
             margin: 0 0 2vw 0;
-            border-radius: 10px;
+            padding: 2vw;
+            margin: 0 2vw 2vw 2vw;
+            border-radius: 5px;
 
             .name {
-                font-size: var(--font20Szie);
+                font-size: var(--font16Szie);
                 font-weight: bold;
-                margin: 0 0 2vw 0;
+                margin: 0 0 1vw 0;
             }
 
             .other {
-                margin: 0 0 2vw 0;
+                margin: 0 0 1vw 0;
 
                 .other_1 {
-                    font-size: var(--font16Szie);
                     margin: 0 0 1vw 0;
+                    font-size: var(--font14Size);
 
                     text:first-child {
                         color: var(--f85Color);
@@ -66,15 +64,14 @@
             }
 
             .btn {
-                margin: 2vw 0 0 0;
                 text-align: center;
 
                 button {
                     margin: 0 2vw;
+                    font-size: var(--font14Size);
                 }
             }
         }
-
     }
 }
 

+ 0 - 4
pagesMatch/matchAdmin/project/list.wxml

@@ -30,10 +30,6 @@
                                 <text>人数限制:</text>
                                 <text>{{item.num||'0'}}人</text>
                             </view>
-                            <view class="other_1">
-                                <text>项目类别:</text>
-                                <text>{{item.zhType||'暂无'}}</text>
-                            </view>
                         </view>
                         <view class="btn">
                             <button type="primary" size="mini" bindtap="toCommon" data-route="matchAdmin/project/add" data-item="{{item}}">信息维护</button>

+ 12 - 14
pagesMatch/matchAdmin/project/list.wxss

@@ -26,41 +26,39 @@
   font-size: var(--font14Size);
 }
 .main .two {
-  flex-grow: 1;
   position: relative;
-  width: 96vw;
-  margin: 2vw;
-  background-color: var(--mainColor);
+  flex-grow: 1;
+  background-color: var(--whiteColor);
+  padding: 0 2vw;
 }
 .main .two .list {
-  display: flex;
-  flex-direction: column;
-  border: 2px dashed var(--f1Color);
-  padding: 2vw;
+  background-color: var(--f9Color);
   margin: 0 0 2vw 0;
-  border-radius: 10px;
+  padding: 2vw;
+  margin: 0 2vw 2vw 2vw;
+  border-radius: 5px;
 }
 .main .two .list .name {
-  font-size: var(--font20Szie);
+  font-size: var(--font16Szie);
   font-weight: bold;
-  margin: 0 0 2vw 0;
+  margin: 0 0 1vw 0;
 }
 .main .two .list .other {
-  margin: 0 0 2vw 0;
+  margin: 0 0 1vw 0;
 }
 .main .two .list .other .other_1 {
-  font-size: var(--font16Szie);
   margin: 0 0 1vw 0;
+  font-size: var(--font14Size);
 }
 .main .two .list .other .other_1 text:first-child {
   color: var(--f85Color);
 }
 .main .two .list .btn {
-  margin: 2vw 0 0 0;
   text-align: center;
 }
 .main .two .list .btn button {
   margin: 0 2vw;
+  font-size: var(--font14Size);
 }
 .scroll-view {
   position: absolute;