YY 2 年之前
父節點
當前提交
751386d0e7

+ 1 - 1
pagesMatch/matchAdmin/address/add.js

@@ -4,7 +4,7 @@ import { is_use } from '../../../utils/dict';
 
 
 Page({
 Page({
     data: {
     data: {
-        frameStyle: { useTop: true, name: '基本页面', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '场地信息', leftArrow: true, useBar: false },
         id: '',
         id: '',
         // 所属id
         // 所属id
         belong_id: '',
         belong_id: '',

+ 80 - 5
pagesMatch/matchAdmin/mtgroup/add.js

@@ -1,11 +1,62 @@
 const app = getApp();
 const app = getApp();
 Page({
 Page({
     data: {
     data: {
-        frameStyle: { useTop: true, name: '基本页面', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '赛组信息', leftArrow: true, useBar: false },
+        // 赛事列表
+        matchList: [],
+        // 组别列表
+        groupList: [],
+        // 组内项目列表
+        projectList: [],
+        // 人员列表
+        signList: [],
+        form: {}
     },
     },
     // 返回
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
     back: function () { wx.navigateBack({ delta: 1 }) },
-
+    // 选择赛事
+    matchChange: async function (e) {
+        const that = this;
+        let data = that.data.matchList[e.detail.value];
+        if (data) {
+            that.setData({
+                'form.match_id': data._id, 'form.zhMatch': data.name,
+                'form.group_id': '', 'form.group_name': '', 'form.project_id': '', 'form.project_name': ''
+            });
+        }
+        that.watchLogin();
+    },
+    // 选择组别
+    groupChange: function (e) {
+        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, 'form.project_id': '', 'form.project_name': '' })
+        }
+        that.watchLogin();
+    },
+    // 选择组内项目
+    projectChange: function (e) {
+        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, 'form.person_type': data.type })
+        }
+        that.searchUser();
+    },
+    searchUser: async function (e) {
+        const that = this;
+        const form = that.data.form;
+        const arr = await app.$get(`/matchSign`, { match_id: form.match_id, group_id: form.group_id, project_id: form.project_id, pay_status: '1' }, 'race');
+        if (arr.errcode == '0') that.setData({ signList: arr.data });
+    },
+    signChange:function (e) {
+        
+    },
+    onSubmit: function (e) {
+        let params = e.detail.value
+        console.log(params);
+    },
     /**
     /**
      * 生命周期函数--监听页面加载
      * 生命周期函数--监听页面加载
      */
      */
@@ -17,17 +68,41 @@ Page({
     /**
     /**
      * 生命周期函数--监听页面显示
      * 生命周期函数--监听页面显示
      */
      */
-    onShow: function () {
+    onShow: async function () {
         const that = this;
         const that = this;
+        // 查询其他信息
+        //    await that.searchOther();
         // 监听用户是否登录
         // 监听用户是否登录
-        that.watchLogin();
+        await that.watchLogin();
     },
     },
+    //    searchOther: async function () {
+    //        const that = this;
+    //        let arr;
+    //        arr = await app.$get(`/match`, {}, 'race');
+    //        if (arr.errcode == '0') that.setData({ matchList: arr.data })
+    //    },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
         wx.getStorage({
         wx.getStorage({
             key: 'raceuser',
             key: 'raceuser',
-            success: async res => { },
+            success: async res => {
+                let arr;
+                // 赛事
+                const match = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
+                if (match.errcode == '0') that.setData({ matchList: match.data });
+                // 已选赛事下的赛事组别
+                if (that.data.form.match_id) {
+                    const group = await app.$get(`/matchGroup`, { match_id: that.data.form.match_id }, 'race');
+                    if (group.errcode == '0') that.setData({ groupList: group.data });
+                }
+                // 已选赛事组别下的组别项目
+                if (that.data.form.group_id) {
+                    const project = await app.$get(`/matchProject`, { group_id: that.data.form.group_id }, 'race');
+                    if (project.errcode == '0') that.setData({ projectList: project.data });
+                }
+
+            },
             fail: async res => {
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
                 wx.redirectTo({ url: '/pages/index/index' })
             }
             }

+ 24 - 12
pagesMatch/matchAdmin/mtgroup/add.less

@@ -5,19 +5,31 @@
     background-color: var(--mainColor);
     background-color: var(--mainColor);
 
 
     .one {
     .one {
-        width: 100vw;
-    }
-}
+        .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);
+
+                textarea {
+                    position: static;
+                    width: 72vw;
+                }
+            }
+        }
 
 
-.scroll-view {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
+        .btn {
+            text-align: center;
+            margin: 3vw 0;
 
 
-    .list-scroll-view {
-        display: flex;
-        flex-direction: column;
+            button {
+                margin: 0 2vw;
+            }
+        }
     }
     }
 }
 }

+ 66 - 1
pagesMatch/matchAdmin/mtgroup/add.wxml

@@ -1,7 +1,72 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
     <view slot="info" class="container main">
         <view class="one">
         <view class="one">
-            基本页面
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <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.zhMatch||'请选择赛事'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <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>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <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>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">分组名称:</view>
+                    <view class="value">
+                        <input name="name" value="{{form.name}}" placeholder="请输入分组名称" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label">人员类型:</view>
+                    <view class="value">
+                        <input name="person_type" value="{{form.person_type}}" placeholder="请输入人员类型" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">组内人员:</view>
+                    <view class="value">
+                        <checkbox-group bindchange="signChange">
+                            <label class="weui-cell weui-check__label" wx:for="{{signList}}" wx:key="{{item.value}}">
+                                <view class="weui-cell__hd">
+                                    <checkbox value="{{item.id}}" checked="{{item.checked}}" />
+                                </view>
+                                <view class="weui-cell__bd">{{item.name}}</view>
+                            </label>
+                        </checkbox-group>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">备注:</view>
+                    <view class="value">
+                        <textarea maxlength="500" name="remark" value="{{form.remark}}" placeholder="请输入备注" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">取前几:</view>
+                    <view class="value">
+                        <input type="number" name="rise" value="{{form.rise}}" placeholder="请输入取前几" />
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
         </view>
         </view>
     </view>
     </view>
 </mobile-main>
 </mobile-main>

+ 19 - 11
pagesMatch/matchAdmin/mtgroup/add.wxss

@@ -3,17 +3,25 @@
   height: var(--twoHeight);
   height: var(--twoHeight);
   background-color: var(--mainColor);
   background-color: var(--mainColor);
 }
 }
-.main .one {
-  width: 100vw;
+.main .one .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
 }
 }
-.scroll-view {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
+.main .one .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
 }
 }
-.scroll-view .list-scroll-view {
-  display: flex;
-  flex-direction: column;
+.main .one .content .value textarea {
+  position: static;
+  width: 72vw;
+}
+.main .one .btn {
+  text-align: center;
+  margin: 3vw 0;
+}
+.main .one .btn button {
+  margin: 0 2vw;
 }
 }

+ 9 - 2
pagesMatch/matchAdmin/mtgroup/list.js

@@ -1,11 +1,18 @@
 const app = getApp();
 const app = getApp();
 Page({
 Page({
     data: {
     data: {
-        frameStyle: { useTop: true, name: '基本页面', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '小组赛组设置', leftArrow: true, useBar: false },
+        list:[{}],
     },
     },
     // 返回
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
     back: function () { wx.navigateBack({ delta: 1 }) },
-
+    //添加信息,信息维护
+    toCommon: function (e) {
+        const that = this;
+        const { item, route } = e.currentTarget.dataset;
+        that.setData({ skip: 0, page: 0, list: [] });
+        wx.navigateTo({ url: `/pagesMatch/${route}?id=${item && item._id ? item._id : ''}` })
+    },
     /**
     /**
      * 生命周期函数--监听页面加载
      * 生命周期函数--监听页面加载
      */
      */

+ 68 - 1
pagesMatch/matchAdmin/mtgroup/list.less

@@ -4,8 +4,75 @@
     height: var(--twoHeight);
     height: var(--twoHeight);
     background-color: var(--mainColor);
     background-color: var(--mainColor);
 
 
+   
     .one {
     .one {
-        width: 100vw;
+        display: flex;
+        flex-direction: row;
+        padding: 2vw;
+        border-bottom: 1px solid var(--f1Color);
+
+        .one_1 {
+            flex-grow: 1;
+
+            input {
+                padding: 1vw 0 2vw 2vw;
+                background-color: var(--f1Color);
+                border-radius: 5px;
+            }
+        }
+
+        .one_2 {
+            width: 20vw;
+
+            button {
+                width: 100%;
+                padding: 2vw;
+                font-size: var(--font14Size);
+            }
+        }
+    }
+
+    .two {
+        position: relative;
+        flex-grow: 1;
+        background-color: var(--whiteColor);
+        padding: 0 2vw;
+
+        .list {
+            background-color: var(--f9Color);
+            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;
+            }
+
+            .other {
+                margin: 0 0 1vw 0;
+
+                .other_1 {
+                    margin: 0 0 1vw 0;
+                    font-size: var(--font14Size);
+
+                    text:first-child {
+                        color: var(--f85Color);
+                    }
+                }
+            }
+
+            .btn {
+                text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                    font-size: var(--font14Size);
+                }
+            }
+        }
     }
     }
 }
 }
 
 

+ 35 - 1
pagesMatch/matchAdmin/mtgroup/list.wxml

@@ -1,7 +1,41 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
     <view slot="info" class="container main">
         <view class="one">
         <view class="one">
-            基本页面
+            <view class="one_1">
+                <input type="text" placeholder="请输入关键词" />
+            </view>
+            <view class="one_2">
+                <button type="primary" bindtap="toCommon" >选择赛事</button>
+                <button type="primary" bindtap="toCommon" data-route="matchAdmin/mtgroup/add">手动建组</button>
+                <button type="primary" bindtap="toCommon" data-route="matchAdmin/mtgroup/auto">被动建组</button>
+            </view>
+        </view>
+        <view class="two">
+            <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.name||'赛事名称'}}</text>
+                            </view>
+                            <view class="other_1">
+                                <text>组别项目:</text>
+                                <text>{{item.group_id||'暂无'}}-{{item.project_id||'暂无'}}</text>
+                            </view>
+                            <view class="other_1">
+                                <text>备注:</text>
+                                <text>{{item.remark||'暂无'}}</text>
+                            </view>
+                        </view>
+                        <view class="btn">
+                            <button type="primary" size="mini" bindtap="toCommon" data-route="matchAdmin/mtgroup/add" data-item="{{item}}">信息维护</button>
+                            <button type="warn" size="mini" bindtap="toDel" data-item="{{item}}">信息删除</button>
+                        </view>
+                    </view>
+                </view>
+            </scroll-view>
         </view>
         </view>
     </view>
     </view>
 </mobile-main>
 </mobile-main>

+ 55 - 1
pagesMatch/matchAdmin/mtgroup/list.wxss

@@ -4,7 +4,61 @@
   background-color: var(--mainColor);
   background-color: var(--mainColor);
 }
 }
 .main .one {
 .main .one {
-  width: 100vw;
+  display: flex;
+  flex-direction: row;
+  padding: 2vw;
+  border-bottom: 1px solid var(--f1Color);
+}
+.main .one .one_1 {
+  flex-grow: 1;
+}
+.main .one .one_1 input {
+  padding: 1vw 0 2vw 2vw;
+  background-color: var(--f1Color);
+  border-radius: 5px;
+}
+.main .one .one_2 {
+  width: 20vw;
+}
+.main .one .one_2 button {
+  width: 100%;
+  padding: 2vw;
+  font-size: var(--font14Size);
+}
+.main .two {
+  position: relative;
+  flex-grow: 1;
+  background-color: var(--whiteColor);
+  padding: 0 2vw;
+}
+.main .two .list {
+  background-color: var(--f9Color);
+  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;
+  margin: 0 0 1vw 0;
+}
+.main .two .list .other {
+  margin: 0 0 1vw 0;
+}
+.main .two .list .other .other_1 {
+  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 {
+  text-align: center;
+}
+.main .two .list .btn button {
+  margin: 0 2vw;
+  font-size: var(--font14Size);
 }
 }
 .scroll-view {
 .scroll-view {
   position: absolute;
   position: absolute;

+ 1 - 1
pagesMatch/matchAdmin/sign/add.js

@@ -103,7 +103,7 @@ Page({
             key: 'raceuser',
             key: 'raceuser',
             success: async res => {
             success: async res => {
                 let arr;
                 let arr;
-                arr = await app.$get(`/match`, { belong_id: '630ec0480a92b0a015ccfbe1' }, '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 });
                 // 用户列表
                 // 用户列表
                 arr = await app.$get(`/user`, { type: '0' }, 'race');
                 arr = await app.$get(`/user`, { type: '0' }, 'race');

+ 1 - 1
pagesMatch/matchAdmin/sign/info.js

@@ -23,7 +23,7 @@ Page({
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
         wx.getStorage({
         wx.getStorage({
-            key: 'user',
+            key: 'raceuser',
             success: async res => {
             success: async res => {
                 if (that.data.id) {
                 if (that.data.id) {
                     const arr = await app.$get(`/matchSign/${that.data.id}`, {}, 'race');
                     const arr = await app.$get(`/matchSign/${that.data.id}`, {}, 'race');

+ 2 - 2
pagesMatch/matchAdmin/sign/list.js

@@ -103,10 +103,10 @@ Page({
     watchLogin: async function () {
     watchLogin: async function () {
         const that = this;
         const that = this;
         wx.getStorage({
         wx.getStorage({
-            key: 'user',
+            key: 'raceuser',
             success: async res => {
             success: async res => {
                 let arr;
                 let arr;
-                arr = await app.$get(`/match`, { belong_id: '630ec0480a92b0a015ccfbe1' }, '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 })
             },
             },
             fail: async res => {
             fail: async res => {