zs 2 years ago
parent
commit
5f3fa1b02a

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

@@ -49,29 +49,22 @@ Page({
         that.setData({ id: options.id || '' })
         //验证规则函数
         that.initValidate();
-        // 查询其他信息
-        await that.searchOther();
         // 监听用户是否登录
         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 () {
         const that = this;
-        let matchList = that.data.matchList;
         wx.getStorage({
             key: 'raceuser',
             success: async res => {
+                let arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
+                if (arr.errcode == '0') that.setData({ matchList: arr.data })
                 if (that.data.id) {
                     let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                         // 比赛名称
-                        let match = matchList.find(i => i._id == arr.data.match_id);
+                        let match = that.data.matchList.find(i => i._id == arr.data.match_id);
                         if (match) arr.data.match_name = match.name;
                         that.setData({ form: arr.data })
                     }

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

@@ -87,18 +87,19 @@ Page({
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
-        let matchList = that.data.matchList;
         let groupList = that.data.groupList;
         let typeList = that.data.typeList;
         let genderList = that.data.genderList;
         wx.getStorage({
             key: 'raceuser',
             success: async res => {
+                let arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
+                if (arr.errcode == '0') that.setData({ matchList: arr.data })
                 if (that.data.id) {
                     let arr = await app.$get(`/matchProject/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                         // 比赛名称
-                        let match = matchList.find(i => i._id == arr.data.match_id);
+                        let match = that.data.matchList.find(i => i._id == arr.data.match_id);
                         if (match) arr.data.match_name = match.name;
                         // 赛事组别
                         let group = groupList.find(i => i._id == arr.data.group_id);
@@ -128,9 +129,6 @@ Page({
         // 项目类别
         arr = await app.$get(`/dict`, { code: 'match_project_type' });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ typeList: arr.data[0].list });
-        // 比赛
-        arr = await app.$get(`/match`, {}, 'race');
-        if (arr.errcode == '0') that.setData({ matchList: arr.data })
         // 组别
         arr = await app.$get(`/matchGroup`, {}, 'race');
         if (arr.errcode == '0') that.setData({ groupList: arr.data })

+ 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 == arr.data.type);
+                    let btnData = match_menu.find((i) => i.type == '1');
                     that.setData({ list: [...btnData.menu, ...school_sysmenu] })
                 }
                 else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }

+ 71 - 28
pagesMatch/userAdmin/schedule/linfo.js

@@ -1,66 +1,109 @@
-// pagesMatch/userAdmin/schedule/linfo.js
+const app = getApp();
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
-
+        frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
+        id: '',
+        info: {},
+        statusList: []
     },
-
+    // 返回
+    back: function () { wx.navigateBack({ delta: 1 }) },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad(options) {
-
+    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: "examine_status" });
+        if (arr.errcode == '0' && arr.total > 0) { let statusList = arr.data[0].list; that.setData({ statusList }); }
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    const arr = await app.$get(`/mss/${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 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
+    },
+    // 查询状态
+    searchStatus: function (e) {
+        const that = this;
+        let data = that.data.statusList.find(i => i.value == e);
+        if (data) return data.label;
+        else return '暂无';
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady() {
-
-    },
-
+    onReady: function () { },
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow() {
-
+    onShow: function () {
     },
-
+    /**
+     * 页面上拉触底事件的处理函数
+     */
     /**
      * 生命周期函数--监听页面隐藏
      */
-    onHide() {
+    onHide: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面卸载
      */
-    onUnload() {
+    onUnload: function () {
 
     },
 
     /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+    onPullDownRefresh: function () {
 
     },
 
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage() {
+    onShareAppMessage: function () {
 
     }
 })

+ 5 - 2
pagesMatch/userAdmin/schedule/linfo.json

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

+ 33 - 0
pagesMatch/userAdmin/schedule/linfo.less

@@ -0,0 +1,33 @@
+@import (css) "/app.wxss";
+
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            text {
+                font-size: var(--font16Size);
+            }
+
+            text:first-child {
+                color: var(--f85Color);
+            }
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+            }
+        }
+    }
+}

+ 66 - 2
pagesMatch/userAdmin/schedule/linfo.wxml

@@ -1,2 +1,66 @@
-<!--pagesMatch/userAdmin/schedule/linfo.wxml-->
-<text>pagesMatch/userAdmin/schedule/linfo.wxml</text>
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <text>赛事名称:</text>
+                <text>{{info.match_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>赛事组别:</text>
+                <text>{{info.group_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>组别项目:</text>
+                <text>{{info.project_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>小组名称:</text>
+                <text>{{info.team_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>场地名称:</text>
+                <text>{{info.address_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>裁判名称:</text>
+                <text>{{info.referee_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>比赛时间:</text>
+                <text>{{info.match_time||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手类型:</text>
+                <text>{{info.player_type=='0'?'单打':info.player_type=='1'?'双打':'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手一:</text>
+                <text>{{info.player_one||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手一比分:</text>
+                <text>{{info.player_one_score||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手二:</text>
+                <text>{{info.player_two||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手二比分:</text>
+                <text>{{info.player_two_score||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>是否交换:</text>
+                <text>{{info.is_change=='0'?'未交换':info.is_change=='1'?'已交换':'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>赛程状态:</text>
+                <text>{{info.zhStatus||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>胜者:</text>
+                <text>{{info.winner||'暂无'}}</text>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 1
pagesMatch/userAdmin/schedule/linfo.wxss

@@ -1 +1,27 @@
-/* pagesMatch/userAdmin/schedule/linfo.wxss */
+@import "/app.wxss";
+.main {
+  background-color: var(--mainColor);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 text {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}

+ 41 - 1
pagesMatch/userAdmin/schedule/list.js

@@ -51,6 +51,10 @@ Page({
                 player_two_score: '5',
             }
         ],
+        total: 0,
+        page: 0,
+        skip: 0,
+        limit: 5,
     },
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
@@ -58,6 +62,30 @@ Page({
     tabsChange: function (e) {
         const that = this;
         that.setData({ 'tabs.active': e.detail.active });
+        that.setData({ skip: 0, page: 0, list: [] });
+        that.watchLogin();
+    },
+    //通用添加 详细信息
+    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 : ''}` })
+    },
+    // 分页
+    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 }) }
     },
     /**
      * 生命周期函数--监听页面加载
@@ -78,9 +106,21 @@ Page({
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        const tabs = that.data.tabs;
         wx.getStorage({
             key: 'user',
-            success: async res => { },
+            success: async res => {
+                if (tabs.active == 'a') {
+                    let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
+                    let arr = await app.$get(`/msgs`, { ...info }, 'race');
+                    if (arr.errcode == '0') {
+                        let groupList = [...that.data.groupList, ...arr.data]
+                        that.setData({ groupList })
+                        that.setData({ total: arr.total })
+
+                    } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
+                }
+            },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
             }

+ 2 - 2
pagesMatch/userAdmin/schedule/list.wxml

@@ -8,7 +8,7 @@
                 <scroll-view scroll-y="true" class="scroll-view">
                     <view class="list-scroll-view">
                         <view class="a_1">
-                            <view class="list" wx:for="{{groupList}}" wx:key="item" bindtap="toAchieve" data-item="{{item}}">
+                            <view class="list" wx:for="{{groupList}}" wx:key="item" bindtap="toCommon" data-route="userAdmin/schedule/sinfo" data-item="{{item}}">
                                 <view class="list_0">
                                     <view class="name">
                                         <text>{{item.match_id_name}}</text>
@@ -39,7 +39,7 @@
                 <scroll-view scroll-y="true" class="scroll-view">
                     <view class="list-scroll-view">
                         <view class="a_1">
-                            <view class="list" wx:for="{{eliminatelist}}" wx:key="item" bindtap="toAchieve" data-item="{{item}}">
+                            <view class="list" wx:for="{{eliminatelist}}" wx:key="item" bindtap="toCommon" data-route="userAdmin/schedule/linfo" data-item="{{item}}">
                                 <view class="list_0">
                                     <view class="name">
                                         <text>{{item.match_id_name}}</text>

+ 54 - 28
pagesMatch/userAdmin/schedule/sinfo.js

@@ -1,66 +1,92 @@
-// pagesMatch/userAdmin/schedule/sinfo.js
+const app = getApp();
 Page({
-
-    /**
-     * 页面的初始数据
-     */
     data: {
-
+        frameStyle: { useTop: true, name: '详细信息', leftArrow: true, useBar: false },
+        id: '',
+        info: {},
     },
-
+    // 返回
+    back: function () { wx.navigateBack({ delta: 1 }) },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad(options) {
-
+    onLoad: async function (options) {
+        const that = this;
+        await that.setData({ id: options.id || null })
+        // 监听用户是否登录
+        await that.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'user',
+            success: async res => {
+                if (that.data.id) {
+                    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 })
+                    }
+                }
+            },
+            fail: async res => {
+                wx.redirectTo({ url: '/pages/index/index' })
+            }
+        })
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady() {
-
-    },
-
+    onReady: function () { },
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow() {
-
+    onShow: function () {
     },
-
+    /**
+     * 页面上拉触底事件的处理函数
+     */
     /**
      * 生命周期函数--监听页面隐藏
      */
-    onHide() {
+    onHide: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面卸载
      */
-    onUnload() {
+    onUnload: function () {
 
     },
 
     /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
-    onPullDownRefresh() {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom() {
+    onPullDownRefresh: function () {
 
     },
 
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage() {
+    onShareAppMessage: function () {
 
     }
 })

+ 5 - 2
pagesMatch/userAdmin/schedule/sinfo.json

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

+ 33 - 0
pagesMatch/userAdmin/schedule/sinfo.less

@@ -0,0 +1,33 @@
+@import (css) "/app.wxss";
+
+.main {
+    background-color: var(--mainColor);
+
+    .one {
+        width: 96vw;
+        padding: 2vw;
+
+        .one_1 {
+            display: flex;
+            flex-direction: row;
+            justify-content: space-between;
+            border: 1px dashed var(--f85Color);
+            border-radius: 5px;
+            margin: 0 0 10px 0;
+            padding: 10px;
+
+            text {
+                font-size: var(--font16Size);
+            }
+
+            text:first-child {
+                color: var(--f85Color);
+            }
+
+            .image {
+                width: 15vw;
+                height: 15vw;
+            }
+        }
+    }
+}

+ 66 - 2
pagesMatch/userAdmin/schedule/sinfo.wxml

@@ -1,2 +1,66 @@
-<!--pagesMatch/userAdmin/schedule/sinfo.wxml-->
-<text>pagesMatch/userAdmin/schedule/sinfo.wxml</text>
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="container main">
+        <view class="one">
+            <view class="one_1">
+                <text>赛事名称:</text>
+                <text>{{info.match_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>赛事组别:</text>
+                <text>{{info.group_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>组别项目:</text>
+                <text>{{info.project_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>小组名称:</text>
+                <text>{{info.team_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>场地名称:</text>
+                <text>{{info.address_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>裁判名称:</text>
+                <text>{{info.referee_id_name||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>比赛时间:</text>
+                <text>{{info.match_time||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手类型:</text>
+                <text>{{info.player_type=='0'?'单打':info.player_type=='1'?'双打':'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手一:</text>
+                <text>{{info.player_one||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手一比分:</text>
+                <text>{{info.player_one_score||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手二:</text>
+                <text>{{info.player_two||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>选手二比分:</text>
+                <text>{{info.player_two_score||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>是否交换:</text>
+                <text>{{info.is_change=='0'?'未交换':info.is_change=='1'?'已交换':'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>赛程状态:</text>
+                <text>{{info.zhStatus||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text>胜者:</text>
+                <text>{{info.winner||'暂无'}}</text>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 27 - 1
pagesMatch/userAdmin/schedule/sinfo.wxss

@@ -1 +1,27 @@
-/* pagesMatch/userAdmin/schedule/sinfo.wxss */
+@import "/app.wxss";
+.main {
+  background-color: var(--mainColor);
+}
+.main .one {
+  width: 96vw;
+  padding: 2vw;
+}
+.main .one .one_1 {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  border: 1px dashed var(--f85Color);
+  border-radius: 5px;
+  margin: 0 0 10px 0;
+  padding: 10px;
+}
+.main .one .one_1 text {
+  font-size: var(--font16Size);
+}
+.main .one .one_1 text:first-child {
+  color: var(--f85Color);
+}
+.main .one .one_1 .image {
+  width: 15vw;
+  height: 15vw;
+}