guhongwei 2 gadi atpakaļ
vecāks
revīzija
90ce04a50f
52 mainītis faili ar 2731 papildinājumiem un 356 dzēšanām
  1. 12 4
      app.json
  2. 37 0
      commpents/tabs/index.js
  3. 4 0
      commpents/tabs/index.json
  4. 3 0
      commpents/tabs/index.wxml
  5. 0 0
      commpents/tabs/index.wxss
  6. 11 0
      commpents/tabs/read.md
  7. BIN
      image/jianshao.png
  8. BIN
      image/team_1.jpg
  9. 126 126
      pages/administration/index.js
  10. 181 0
      pages/exammembers/index.js
  11. 7 0
      pages/exammembers/index.json
  12. 63 0
      pages/exammembers/index.wxml
  13. 125 0
      pages/exammembers/index.wxss
  14. 84 0
      pages/match/info.js
  15. 6 0
      pages/match/info.json
  16. 5 0
      pages/match/info.wxml
  17. 4 0
      pages/match/info.wxss
  18. 47 35
      pages/me/index.js
  19. 5 4
      pages/me/index.json
  20. 12 5
      pages/me/index.wxml
  21. 122 98
      pages/team/index.js
  22. 5 5
      pages/team/index.json
  23. 17 16
      pages/team/index.wxml
  24. 58 57
      pages/team/index.wxss
  25. 215 0
      pages/teamInfo/index.js
  26. 8 0
      pages/teamInfo/index.json
  27. 82 0
      pages/teamInfo/index.wxml
  28. 136 0
      pages/teamInfo/index.wxss
  29. 158 0
      pages/teamInfo/info.js
  30. 6 0
      pages/teamInfo/info.json
  31. 33 0
      pages/teamInfo/info.wxml
  32. 141 0
      pages/teamInfo/info.wxss
  33. 100 0
      pages/teamapply/index.js
  34. 6 0
      pages/teamapply/index.json
  35. 14 0
      pages/teamapply/index.wxml
  36. 46 0
      pages/teamapply/index.wxss
  37. 158 0
      pages/teamdismissteam/index.js
  38. 7 0
      pages/teamdismissteam/index.json
  39. 59 0
      pages/teamdismissteam/index.wxml
  40. 98 0
      pages/teamdismissteam/index.wxss
  41. 187 0
      pages/teamexam/index.js
  42. 8 0
      pages/teamexam/index.json
  43. 58 0
      pages/teamexam/index.wxml
  44. 171 0
      pages/teamexam/index.wxss
  45. 66 0
      pages/uploadScore/index.js
  46. 3 0
      pages/uploadScore/index.json
  47. 2 0
      pages/uploadScore/index.wxml
  48. 1 0
      pages/uploadScore/index.wxss
  49. 22 3
      pages/user/detail.js
  50. 8 0
      pages/user/detail.wxml
  51. 1 1
      pages/user/index.js
  52. 3 2
      utils/dict.js

+ 12 - 4
app.json

@@ -4,18 +4,26 @@
         "pages/login/index",
         "pages/register/index",
         "pages/home/index",
+        "pages/match/info",
         "pages/search/index",
-        "pages/administration/index",
+        "pages/matchadmin/index",
+        "pages/matchadmin/edit",
+        "pages/matchadmin/layout",
+        "pages/teamexam/index",
         "pages/team/index",
+        "pages/teamInfo/index",
+        "pages/teamInfo/info",
         "pages/me/index",
         "pages/editBasic/index",
         "pages/uploadimg/index",
+        "pages/uploadScore/index",
         "pages/updatepd/index",
+        "pages/exammembers/index",
+        "pages/teamapply/index",
+        "pages/administration/index",
+        "pages/teamdismissteam/index",
         "pages/user/index",
         "pages/user/detail",
-        "pages/matchadmin/index",
-        "pages/matchadmin/edit",
-        "pages/matchadmin/layout",
         "pages/test/index",
         "pages/logs/logs"
     ],

+ 37 - 0
commpents/tabs/index.js

@@ -0,0 +1,37 @@
+// commpents/mobile-frame/mobile-main.js
+const app = getApp()
+Component({
+    /**
+     * 组件的属性列表
+     */
+    options: { multipleSlots: true },
+    properties: {
+        tabs: { type: Object },
+    },
+
+    // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
+    attached: function () { }, // 此处attached的声明会被lifetimes字段中的声明覆盖
+    ready: function () { },
+    pageLifetimes: {
+        // 组件所在页面的生命周期函数
+        show: function () { },
+        hide: function () { },
+        resize: function () { },
+    },
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        // 关闭弹框
+        tabsChange(e) {
+            this.triggerEvent('tabsChange', e.detail)
+        }
+    }
+})
+

+ 4 - 0
commpents/tabs/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 3 - 0
commpents/tabs/index.wxml

@@ -0,0 +1,3 @@
+<van-tabs active="{{tabs.active}}" bind:change="tabsChange" type="{{tabs.type||'line'}}" color="{{tabs.color||'#409eff'}}" duration="{{tabs.duration||'0.3'}}" line-width="{{tabs.linewidth||'40'}}" line-height="{{tabs.lineheight||'3'}}" swipeable="{{true}}" title-active-color="{{activeC||'#409eff'}}" title-inactive-color="{{inactiveC||'#666666'}}">
+    <van-tab wx:for="{{tabs.list}}" wx:key="item" title="{{item.title}}" name="{{item.name}}"></van-tab>
+</van-tabs>

+ 0 - 0
commpents/tabs/index.wxss


+ 11 - 0
commpents/tabs/read.md

@@ -0,0 +1,11 @@
+# 选项卡组件使用说明
+## 参数说明
+### active--当前选中标签的标识符
+### type--样式风格,默认值:line,可选值:card
+### color--标签主题色
+### duration--动画时间
+### linewidth--底部条宽度
+### lineheight--底部条高度
+### swipeable--是否开启手势左右滑动切换
+### title-active-color--标题选中态颜色
+

BIN
image/jianshao.png


BIN
image/team_1.jpg


+ 126 - 126
pages/administration/index.js

@@ -1,147 +1,147 @@
 const app = getApp()
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    frameStyle: { useTop: false, name: '比赛管理', leftArrow: false, useBar: true },
-    // 主体高度
-    infoHeight: '',
-    // 背景
-    bg_1: '/image/match_1.png',
-    bg_2: '/image/match_2.png',
-    bg_3: '/image/match_3.png',
-    pm_1: '/image/paiming.png',
-    sp_1: '/image/shenpi.png',
-    currentTab: 0,
-    list: []
-  },
-  back: function () {
-    wx.navigateBack({ url: '/pages/home/index' })
-  },
-  tabPath: function (e) {
-    let { route } = e.detail.detail;
-    if (route) wx.redirectTo({ url: `/${route}` })
-  },
-  // 公共路由跳转方法
-  toCommon: function (e) {
-    const { route } = e.currentTarget.dataset;
-    console.log(route);
-  },
-  //点击切换
-  clickTab: function (e) {
-    const that = this;
-    if (that.data.currentTab === e.target.dataset.current) return false;
-    else that.setData({ currentTab: e.target.dataset.current });
-    that.watchLogin();
-  },
-  // 开启左右滑动
-  bindchange: function (e) {
-    var that = this
-    const { current, source } = e.detail;
-    if (source) that.setData({ currentTab: current });
-    else return false;
-    that.watchLogin();
-  },
-  // 查看详情
-  toView: function (e) {
-    console.log(e);
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    // 计算高度
-    this.searchHeight();
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: false, name: '比赛管理', leftArrow: false, useBar: true },
+        // 主体高度
+        infoHeight: '',
+        // 背景
+        bg_1: '/image/match_1.png',
+        bg_2: '/image/match_2.png',
+        bg_3: '/image/match_3.png',
+        pm_1: '/image/paiming.png',
+        sp_1: '/image/shenpi.png',
+        currentTab: 0,
+        list: []
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/home/index' })
+    },
+    tabPath: function (e) {
+        let { route } = e.detail.detail;
+        if (route) wx.redirectTo({ url: `/${route}` })
+    },
+    // 公共路由跳转方法
+    toCommon: function (e) {
+        const { route } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/${route}/index` })
+    },
+    //点击切换
+    clickTab: function (e) {
+        const that = this;
+        if (that.data.currentTab === e.target.dataset.current) return false;
+        else that.setData({ currentTab: e.target.dataset.current });
+        that.watchLogin();
+    },
+    // 开启左右滑动
+    bindchange: function (e) {
+        var that = this
+        const { current, source } = e.detail;
+        if (source) that.setData({ currentTab: current });
+        else return false;
+        that.watchLogin();
+    },
+    // 查看详情
+    toView: function (e) {
+        console.log(e);
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
     // 监听用户是否登录
-    this.watchLogin();
-  },
-  // 监听用户是否登录
-  watchLogin: function () {
-    const that = this;
-    let type = that.data.currentTab;
-    let status = type == '0' ? 3 : type == '1' ? 2 : 4;
-    wx.getStorage({
-      key: 'token',
-      success: res => {
-        wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/match`, //接口地址
-          method: 'get',
-          // data: { status: status },
-          data: {},
-          success(res) {
-            if (res.data.errcode == 0) {
-              that.setData({ list: res.data.data })
-            } else {
-              wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
+    watchLogin: function () {
+        const that = this;
+        let type = that.data.currentTab;
+        let status = type == '0' ? 3 : type == '1' ? 2 : 4;
+        wx.getStorage({
+            key: 'token',
+            success: res => {
+                wx.request({
+                    url: `${app.globalData.publicUrl}/courtAdmin/api/match`, //接口地址
+                    method: 'get',
+                    // data: { status: status },
+                    data: {},
+                    success(res) {
+                        if (res.data.errcode == 0) {
+                            that.setData({ list: res.data.data })
+                        } else {
+                            wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
+                        }
+                    }
+                })
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
             }
-          }
         })
-      },
-      fail: res => {
-        wx.redirectTo({ url: '/pages/index/index', })
-      }
-    })
-  },
-  // 计算高度
-  searchHeight: function () {
-    let frameStyle = this.data.frameStyle;
-    let client = app.globalData.client;
-    let infoHeight = client.windowHeight;
-    // 是否去掉状态栏
-    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
-    // 是否减去底部菜单
-    if (frameStyle.useBar) infoHeight = infoHeight - 50;
-    if (infoHeight) this.setData({ infoHeight: infoHeight })
-  },
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
 
-  },
+    },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
 
-  },
+    },
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
 
-  },
+    },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
 
-  }
+    }
 })

+ 181 - 0
pages/exammembers/index.js

@@ -0,0 +1,181 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+        list: [],
+        // 团队信息
+        teamInfo: {},
+        // 弹框
+        dialog: { title: '详细信息', show: false, type: '1' },
+        form: {},
+        statusList: [{ label: '待审核', value: '0' }, { label: '审核通过', value: '1' }, { label: '审核拒绝', value: '-1' }],
+
+    },
+    initValidate() {
+        const rules = { status: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { status: { required: '请选择状态', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/me/index' })
+    },
+    // 查看
+    toView: async function (e) {
+        const that = this;
+        let { id } = e.currentTarget.dataset;
+        const arr = await app.$get(`/courtAdmin/api/user/${id}`);
+        if (arr.errcode == '0') {
+            that.setData({ form: arr.data })
+            that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
+        }
+    },
+    // 审核
+    toCheck: async function (e) {
+        const that = this;
+        let { id } = e.currentTarget.dataset;
+        const arr = await app.$get(`/courtAdmin/api/joinapply/${id}`);
+        if (arr.errcode == '0') {
+            that.setData({ form: arr.data })
+            that.setData({ dialog: { title: '信息审核', show: true, type: '2' } })
+        }
+    },
+    // 选择状态
+    statusChange: function (e) {
+        const that = this;
+        const { value } = e.detail;
+        that.setData({ 'form.status': value })
+    },
+    // 提交审核
+    onSubmit: async function (e) {
+        const that = this;
+        const data = that.data.form;
+        const teamInfo = that.data.teamInfo;
+        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 {
+            let arr;
+            arr = await app.$post(`/courtAdmin/api/joinapply/${data.id}`, params);
+            if (arr.errcode == '0') {
+                if (params.status == '1') {
+                    arr = await app.$get(`/courtAdmin/api/user/${data.apply_id}`);
+                    if (arr.errcode == '0') {
+                        teamInfo.members.push({ user_id: arr.data.id, nickname: arr.data.nickname, icon: arr.data.icon })
+                        arr = await app.$post(`/courtAdmin/api/team/${teamInfo._id}`, teamInfo);
+                        if (arr.errcode == '0') {
+                            wx.showToast({ title: `审核信息成功`, icon: 'error', duration: 2000 });
+                            that.toClose();
+                            that.watchLogin();
+                        } else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            } else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    // 关闭弹框
+    toClose: function () {
+        this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        //验证规则函数
+        this.initValidate();
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                let arr;
+                arr = await app.$get(`/courtAdmin/api/team`, { create_id: res.data._id });
+                if (arr.errcode == '0') {
+                    let teamInfo = arr.data[0];
+                    that.setData({ teamInfo: teamInfo })
+                    arr = await app.$get(`/courtAdmin/api/joinapply`, { team_id: teamInfo._id });
+                    if (arr.errcode == '0') that.setData({ list: arr.data })
+                }
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/login/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/exammembers/index.json

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

+ 63 - 0
pages/exammembers/index.wxml

@@ -0,0 +1,63 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <view class="list" wx:for="{{list}}" wx:key="item">
+                <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                <view class="other">
+                    <view class="otherInfo">申请团队:<text>{{item.team_name}}</text></view>
+                    <view class="otherInfo"> 申请人:<text>{{item.apply_user }}</text></view>
+                    <view class="otherInfo"> 申请时间:<text>{{item.apply_time }}</text></view>
+                </view>
+                <view class="btn">
+                    <button size="mini" type="default" bindtap="toView" data-id="{{item.apply_id}}">详情</button>
+                    <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" wx:if="{{item.status=='0'}}">审核</button>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>
+<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info">
+        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
+            <view class="one_1">
+                <text>头像:</text>
+                <image src="{{form.icon[0].url}}"></image>
+            </view>
+            <view class="one_1">
+                <text class="text">名称:</text>
+                <text class="text1">{{form.nickname||'暂无昵称'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">电话:</text>
+                <text class="text1">{{form.phone||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">性别:</text>
+                <text class="text1">{{form.gender||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">岗位:</text>
+                <text class="text1">{{form.work||'暂无'}}</text>
+            </view>
+            <view class="one_1">
+                <text class="text">邮箱:</text>
+                <text class="text1">{{form.email||'暂无'}}</text>
+            </view>
+        </view>
+        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
+            <form bindsubmit="onSubmit">
+                <view class="content">
+                    <view class="label textOver">状态</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="statusChange" name="status" value="{{form.status}}" range-key="label" range="{{statusList}}">
+                            <view class="input">{{form.status=='0'?'待审中':form.status=='1'?'审核通过':'审核拒绝'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交审核</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</e-dialog>

+ 125 - 0
pages/exammembers/index.wxss

@@ -0,0 +1,125 @@
+.main {
+    position: relative;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 95%;
+    padding: 0 10px;
+    overflow-x: hidden;
+    margin: 10px 0 0 0;
+}
+
+.main .one .list {
+    float: left;
+    width: 95%;
+    background-color: #fff;
+    border-radius: 5px;
+    padding: 10px;
+    margin: 0 0 10px 0;
+}
+
+.main .one .list .name {
+    float: left;
+    width: 100%;
+    font-size: 14px;
+    font-weight: bold;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other .otherInfo {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other .otherInfo text:nth-child(1) {
+    color: #666;
+}
+
+.main .one .list .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+}
+
+.main .one .list .btn button {
+    margin: 0 5px;
+    padding: 0 20px;
+    font-size: 14px;
+}
+
+.dialog_one {
+    float: left;
+    width: 100%;
+    margin: 10px 0 0 0;
+}
+
+.dialog_one .one_1 {
+    float: left;
+    width: 91%;
+    border: 1px solid #ccc;
+    border-radius: 5px;
+    margin: 0 0 10px 0;
+    padding: 10px;
+
+}
+
+.dialog_one .one_1 text {
+    color: #666;
+    font-size: 14px;
+}
+
+.dialog_one .one_1 text:nth-child(2) {
+    float: right;
+    color: #000;
+}
+
+.dialog_one .one_1 image {
+    float: right;
+    width: 60px;
+    height: 60px;
+}
+
+.dialog_two {
+    float: left;
+    width: 100%;
+}
+
+.dialog_two .content {
+    float: left;
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    padding: 10px 0;
+    margin: 0 0 10px 0;
+    font-size: 14px;
+}
+
+.dialog_two .content .label {
+    float: left;
+    width: 20%;
+}
+
+.dialog_two .content .value {
+    float: left;
+    width: 80%;
+    text-align: right;
+}
+
+.dialog_two .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+}
+
+.dialog_two .btn button {
+    font-size: 14px;
+}

+ 84 - 0
pages/match/info.js

@@ -0,0 +1,84 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '比赛信息', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/me/index' })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算高度
+        this.searchHeight()
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/match/info.json

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

+ 5 - 0
pages/match/info.wxml

@@ -0,0 +1,5 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+  <view slot="info" class="main" style="height:{{infoHeight}}px;">
+    模板
+  </view>
+</mobile-main>

+ 4 - 0
pages/match/info.wxss

@@ -0,0 +1,4 @@
+.main {
+    position: relative;
+    width: 100%;
+}

+ 47 - 35
pages/me/index.js

@@ -16,6 +16,7 @@ Page({
         ismatchList: [
             {
                 id: '1',
+                _id: '1',
                 status: '0',
                 match_time: '2020-11-11 10:11',
                 red_logo: [{
@@ -32,18 +33,35 @@ Page({
                     uri: "/files/court/elimg/20220331104915.jpg",
                     url: "http://broadcast.waityou24.cn/files/court/elimg/20220331104915.jpg",
                 }],
-            }
+            },
         ],
         ismatch_url: '/image/me_2.png',
         // 我的团队
         teamList: [],
         // 我的服务
-        btnList: []
+        btnList: [],
+        // 弹框
+        dialog: { title: '上传比分', show: false, type: '1' }
     },
     tabPath: function (e) {
         let { route } = e.detail.detail;
         if (route) wx.redirectTo({ url: `/${route}` })
     },
+    // 上传比分
+    toScore: function () {
+        const that = this;
+        that.setData({ dialog: { title: '上传比分', show: true, type: '1' } })
+    },
+    // 比赛信息
+    matchView: function (e) {
+        const { id } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/match/info?id=${id}` })
+    },
+    // 团队信息
+    teamView: function (e) {
+        const { id } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/teamInfo/info?id=${id}` })
+    },
     // 公共跳转路由方法
     toCommon: function (e) {
         let { route, method } = e.currentTarget.dataset;
@@ -66,6 +84,12 @@ Page({
             wx.navigateTo({ url: `/pages/${route}/index` })
         }
     },
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ dialog: { title: '上传比分', show: false, type: '1' } })
+        that.watchLogin()
+    },
     /**
      * 生命周期函数--监听页面加载
      */
@@ -80,12 +104,12 @@ Page({
         const that = this;
         wx.getStorage({
             key: 'token',
-            success: res => {
+            success: async res => {
                 wx.request({
                     url: `${app.globalData.publicUrl}/courtAdmin/api/user/${res.data.id}`, //接口地址
                     method: 'get',
                     data: {},
-                    success(res) {
+                    async success(res) {
                         if (res.data.errcode == 0) {
                             let user = res.data.data;
                             // 头像
@@ -97,39 +121,27 @@ Page({
                             if (user.type == '0') {
                                 that.setData({ userInfo: user })
                             } else if (user.type == '1') {
-                                wx.request({
-                                    url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
-                                    method: 'get',
-                                    data: { create_id: user._id },
-                                    success(arr) {
-                                        if (arr.data.errcode == 0) {
-                                            let team = arr.data.data;
-                                            that.setData({ teamList: team });
-                                            let teamInfo = team[0] ? team[0] : { name: '' };
-                                            user.team_name = teamInfo.name;
-                                            that.setData({ userInfo: user })
-                                        } else {
-                                            wx.showToast({ title: arr.data.errmsg, icon: 'error', duration: 2000 })
-                                        }
+                                let arr = await app.$get(`/courtAdmin/api/team`, { create_id: user._id, status: '1' });
+                                if (arr.errcode == '0') {
+                                    let team = arr.data;
+                                    that.setData({ teamList: team });
+                                    if (arr.total > 0) {
+                                        let teamInfo = team[0] ? team[0] : { name: '' };
+                                        user.team_name = teamInfo.name;
                                     }
-                                })
+                                    that.setData({ userInfo: user })
+                                } else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
                             } else if (user.type == '2') {
-                                wx.request({
-                                    url: `${app.globalData.publicUrl}/courtAdmin/api/team/userteams`, //接口地址
-                                    method: 'get',
-                                    data: { user_id: user._id },
-                                    success(arr) {
-                                        if (arr.data.errcode == 0) {
-                                            let team = arr.data.data;
-                                            that.setData({ teamList: team });
-                                            let teamInfo = team[0] ? team[0] : { name: '' };
-                                            user.team_name = teamInfo.name;
-                                            that.setData({ userInfo: user })
-                                        } else {
-                                            wx.showToast({ title: arr.data.errmsg, icon: 'error', duration: 2000 })
-                                        }
-                                    }
-                                })
+                                const arr = await app.$get(`/courtAdmin/api/team/userteams`, { user_id: user._id });
+                                if (arr.errcode == '0') {
+                                    let team = arr.data;
+                                    that.setData({ teamList: team });
+                                    let teamInfo = team[0] ? team[0] : { name: '' };
+                                    user.team_name = teamInfo.name;
+                                    that.setData({ userInfo: user })
+                                } else {
+                                    wx.showToast({ title: arr.data.errmsg, icon: 'error', duration: 2000 })
+                                }
                             }
                         } else {
                             wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })

+ 5 - 4
pages/me/index.json

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

+ 12 - 5
pages/me/index.wxml

@@ -29,10 +29,10 @@
             <view class="two_1" wx:if="{{userInfo.type=='1'}}">
                 <view class="two_1o">
                     <text>可对正在进行的比赛上传比分</text>
-                    <button size="mini" bindtap="toCommon" data-route="uploadScore">上传比分</button>
+                    <button size="mini" bindtap="toScore">上传比分</button>
                 </view>
                 <view class="two_1u">
-                    <view class="ismatchList" wx:for="{{ismatchList}}" wx:key="item">
+                    <view class="ismatchList" wx:for="{{ismatchList}}" wx:key="item" bindtap="matchView" data-id="{{item._id}}">
                         <view class="ismatch_1" style="background-image: url({{ismatch_url}});">
                             <text>{{item.status=='0'?'未开始':item.status=='1'?'已开始':'已结束'}}</text>
                             <text>{{item.match_time}}</text>
@@ -57,12 +57,12 @@
                 <view class="two_2_1">
                     <text>我的团队</text>
                     <text>共参加{{teamList.length}}个队伍</text>
-                    <button size="mini" bindtap="toCommon" data-route="createTeam" wx:if="{{userInfo.type=='1'}}">创建团队</button>
+                    <button size="mini" bindtap="toCommon" data-route="teamInfo" wx:if="{{userInfo.type=='1'&&teamList.length<=0}}">创建团队</button>
                 </view>
                 <view class="two_2_2">
                     <view wx:if="{{userInfo.type=='0'}}">暂无团队</view>
                     <view wx:else>
-                        <view class="teamList" wx:for="{{teamList}}" wx:key="item">
+                        <view class="teamList" wx:for="{{teamList}}" wx:key="item" bindtap="teamView" data-id="{{item._id}}">
                             <view class="team_l">
                                 <view class="team_l_1">
                                     <image src="{{item.logo[0].url}}"></image>
@@ -89,4 +89,11 @@
             </view>
         </view>
     </view>
-</mobile-main>
+</mobile-main>
+<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info">
+        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
+            上传比分
+        </view>
+    </view>
+</e-dialog>

+ 122 - 98
pages/team/index.js

@@ -1,119 +1,143 @@
 const app = getApp()
+const moment = require("../../utils/moment.min")
 Page({
 
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    frameStyle: { useTop: true, name: '查询团队', leftArrow: false, useBar: true },
-    // 主体高度
-    infoHeight: '',
-    list: []
-  },
-  back: function () {
-    wx.navigateBack({ url: '/pages/home/index' })
-  },
-  tabPath: function (e) {
-    let { route } = e.detail.detail;
-    if (route) wx.redirectTo({ url: `/${route}` })
-  },
-  // 公共跳转路由方法
-  toCommon: function (e) {
-    const { id, route } = e.currentTarget.dataset;
-    console.log(id);
-    console.log(route);
-  },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    // 计算高度
-    this.searchHeight();
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '查询团队', leftArrow: false, useBar: true },
+        // 主体高度
+        infoHeight: '',
+        // 用户
+        user: {},
+        list: [],
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/home/index' })
+    },
+    tabPath: function (e) {
+        let { route } = e.detail.detail;
+        if (route) wx.redirectTo({ url: `/${route}` })
+    },
+    // 系统团队查看详情
+    toView: function (e) {
+        let { id } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/teamInfo/info?id=${id}` })
+    },
+    // 申请加入队伍
+    toJoin: function (e) {
+        const that = this;
+        const user = that.data.user;
+        let { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '是否确认申请加入该支团队?',
+            async success(res) {
+                if (res.confirm) {
+                    let obj = { team_id: item._id, team_name: item.name, apply_time: moment().format('YYYY-MM-DD HH:mm:ss'), apply_user: user.nickname, apply_id: user._id }
+                    const arr = await app.$post(`/courtAdmin/api/joinapply`, obj)
+                    if (arr.errcode == '0') { wx.showToast({ title: `成功,等待审核`, icon: 'success', duration: 2000 }); that.watchLogin() }
+                    else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                } else if (res.cancel) {
+                }
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
     // 监听用户是否登录
-    this.watchLogin();
-  },
-  // 监听用户是否登录
-  watchLogin: function () {
-    const that = this;
-    wx.getStorage({
-      key: 'token',
-      success: res => {
-        wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
-          method: 'get',
-          data: {},
-          success(res) {
-            if (res.data.errcode == 0) {
-              that.setData({ list: res.data.data })
-            } else {
-              wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
+    watchLogin: async function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                that.setData({ user: res.data })
+                const arr = await app.$get(`/courtAdmin/api/team`, { status: '1' });
+                if (arr.errcode == '0') {
+                    let list = arr.data;
+                    // 个人用户判断当前用户是否为团队成员
+                    if (res.data.type == '2') {
+                        for (const val of list) {
+                            let is_membes = val.members.find((i) => i.user_id == res.data._id);
+                            if (is_membes) val.is_membes = false
+                            else val.is_membes = true;
+                        }
+                    }
+                    that.setData({ list: list })
+                } else {
+                    wx.showToast({ title: arr.errmsg, icon: 'error', duration: 2000 })
+                }
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
             }
-          }
         })
-      },
-      fail: res => {
-        wx.redirectTo({ url: '/pages/index/index', })
-      }
-    })
-  },
-  // 计算高度
-  searchHeight: function () {
-    let frameStyle = this.data.frameStyle;
-    let client = app.globalData.client;
-    let infoHeight = client.windowHeight;
-    // 是否去掉状态栏
-    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
-    // 是否减去底部菜单
-    if (frameStyle.useBar) infoHeight = infoHeight - 50;
-    if (infoHeight) this.setData({ infoHeight: infoHeight })
-  },
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
 
-  },
+    },
 
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
 
-  },
+    },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
 
-  },
+    },
 
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
 
-  },
+    },
 
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
 
-  }
+    }
 })

+ 5 - 5
pages/team/index.json

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

+ 17 - 16
pages/team/index.wxml

@@ -1,20 +1,21 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
-  <view slot="info" class="main" style="height:{{infoHeight}}px;">
-    <view class="one">
-      <view class="list" wx:for="{{list}}" wx:key="item">
-        <view class="list_l">
-          <view class="list_l_1">
-            <image src="{{item.logo[0].url}}"></image>
-            <text class="textOver">{{item.name}}</text>
-            <text>共{{item.members.length}}人</text>
-          </view>
-          <view class="list_l_2">创建人:{{item.create_user}}</view>
-          <view class="list_l_3">{{item.create_time}}创建</view>
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <view class="list" wx:for="{{list}}" wx:key="item">
+                <view class="name">
+                    <image src="{{item.logo[0].url}}"></image>
+                    <text class="textOver">{{item.name}}</text>
+                    <text>共{{item.members.length}}人</text>
+                </view>
+                <view class="other">
+                    <view class="other_1"><text>创建人:</text><text>{{item.create_user}}</text></view>
+                    <view class="other_1"><text>创建时间:</text><text>{{item.create_time}}</text></view>
+                </view>
+                <view class="btn">
+                    <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}">查看</button>
+                    <button size="mini" type="primary" bindtap="toJoin" data-item="{{item}}" wx:if="{{item.is_membes}}">申请加入</button>
+                </view>
+            </view>
         </view>
-        <view class="list_r">
-          <button size="mini" bindtap="toCommon" data-id="{{item._id}}" data-route="teamdetail">查看</button>
-        </view>
-      </view>
     </view>
-  </view>
 </mobile-main>

+ 58 - 57
pages/team/index.wxss

@@ -1,83 +1,84 @@
 .main {
-  position: relative;
-  width: 100%;
+    position: relative;
+    width: 100%;
 }
 
 .main .one {
-  float: left;
-  width: 95%;
-  margin: 10px 10px 0 10px;
+    float: left;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 95%;
+    padding: 10px;
 }
 
 .main .one .list {
-  float: left;
-  width: 95%;
-  background-color: #ffffff;
-  margin: 0 0 10px 0;
-  padding: 10px;
+    float: left;
+    width: 95%;
+    padding: 10px;
+    background-color: #ffffff;
+    border-radius: 5px;
+    margin: 0 0 10px 0;
 }
 
-.main .one .list .list_l {
-  float: left;
-  width: 70%;
+.main .one .list .name {
+    float: left;
+    width: 100%;
+    height: 50px;
+    line-height: 50px;
+    margin: 0 0 5px 0;
 }
 
-.main .one .list .list_l .list_l_1 {
-  float: left;
-  width: 100%;
+.main .one .list .name image {
+    float: left;
+    width: 15%;
+    height: 50px;
+    overflow: hidden;
+    border-radius: 90px;
 }
 
-.main .one .list .list_l .list_l_1 image {
-  width: 40px;
-  height: 40px;
-  border-radius: 90px;
+.main .one .list .name text:nth-child(2) {
+    float: left;
+    max-width: 63%;
+    padding: 0 0 0 10px;
+    font-size: 16px;
+    font-weight: bold;
 }
 
-.main .one .list .list_l .list_l_1 text:nth-child(2) {
-  display: inline-block;
-  font-size: 14px;
-  font-weight: bold;
-  position: relative;
-  top: -10px;
-  margin: 0 0 0 8px;
-  max-width: 60%;
+.main .one .list .name text:nth-child(3) {
+    float: left;
+    width: 15%;
+    padding: 0 0 0 10px;
+    font-size: 14px;
 }
 
-.main .one .list .list_l .list_l_1 text:nth-child(3) {
-  display: inline-block;
-  font-size: 14px;
-  position: relative;
-  top: -14px;
-  color: #666666;
-  margin: 0 0 0 5px;
+.main .one .list .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
 }
 
-.main .one .list .list_l .list_l_2 {
-  float: left;
-  width: 100%;
-  margin: 0 0 5px 0;
-  font-size: 12px;
-  color: #666;
+.main .one .list .other .other_1 {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
 }
 
-.main .one .list .list_l .list_l_3 {
-  float: left;
-  width: 100%;
-  font-size: 12px;
-  color: #666;
+.main .one .list .other .other_1 text:nth-child(1) {
+    color: #666;
 }
 
-.main .one .list .list_r {
-  float: left;
-  width: 30%;
-  text-align: center;
-  padding: 25px 0 0 0px;
+.main .one .list .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
 }
 
-.main .one .list .list_r button {
-  background-image: linear-gradient(to right, rgb(236, 75, 83), rgb(247, 41, 230));
-  color: #ffffff;
-  border-radius: 90px;
-  padding: 2px 25px;
-  font-size: 14px !important;
+.main .one .list .btn button {
+    margin: 0 10px;
+    padding: 0 10px;
+    font-size: 14px;
 }

+ 215 - 0
pages/teamInfo/index.js

@@ -0,0 +1,215 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '团队信息管理', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+        // LOGO
+        logo: [],
+        // 团队成员
+        members: [],
+        form: {},
+        // 团队类型
+        typeList: ['羽毛球'],
+        // 用户列表
+        userList: [],
+        // 弹框
+        dialog: { title: '选择成员', show: false, type: '1' }
+    },
+    //验证必填项
+    initValidate() {
+        const rules = { name: { required: true }, type: { required: true }, create_user: { required: true }, }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { name: { required: '团队名称' }, type: { required: '团队类型' }, create_user: { required: '团队创建人' }, };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/me/index' })
+    },
+    // 上傳圖片
+    imgUpload: function (e) {
+        const that = this;
+        let data = that.data.logo;
+        data.push(e.detail)
+        that.setData({ logo: data })
+    },
+    // 删除图片
+    imgDel: function (e) {
+        const that = this;
+        let list = that.data.logo;
+        let arr = list.filter((i, index) => index != e.detail.index)
+        that.setData({ logo: arr })
+    },
+    // 选择团队类型
+    typeChange: function (e) {
+        const that = this;
+        let data = that.data.typeList[e.detail.value];
+        if (data) that.setData({ 'form.type': data })
+    },
+    // 选择创建时间
+    dataChange: function (e) {
+        const that = this;
+        let value = e.detail.value;
+        that.setData({ 'form.create_time': value })
+    },
+    // 选择成员
+    memAdd() {
+        const that = this;
+        that.setData({ dialog: { title: '选择成员', show: true, type: '1' } })
+    },
+    // 选择成员
+    memChange: function (e) {
+        const that = this;
+        let data = e.detail.value;
+        let user = that.data.userList;
+        let members = [];
+        for (const val of data) {
+            let arr = user.find((i) => i._id == val);
+            if (arr) members.push({ user_id: arr._id, nickname: arr.nickname, icon: arr.icon })
+        }
+        that.setData({ members: members })
+    },
+    // 提交保存
+    memSubmit: function () {
+        const that = this;
+        that.toClose()
+    },
+    // 删除成员
+    memDel: function (e) {
+        const that = this;
+        const { user_id } = e.currentTarget.dataset;
+        var members = that.data.members;
+        for (var i = 0; i < members.length; i++) {
+            if (members[i].user_id == user_id) members.splice(i, 1)
+        }
+        this.setData({ members: members })
+    },
+    // 关闭弹框
+    toClose() {
+        const that = this;
+        that.setData({ dialog: { title: '选择成员', show: false, type: '1' } })
+    },
+    // 取消保存
+    toReset: function () {
+        const that = this;
+        that.back()
+    },
+    // 提交保存
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const data = this.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;
+            if (data._id) {
+                if (!params.logo) params.logo = that.data.logo;
+                if (!params.members) params.members = that.data.members;
+                arr = await app.$post(`/courtAdmin/api/team/${data._id}`, params);
+                if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+                else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            } else {
+                params.logo = that.data.logo;
+                params.members = that.data.members;
+                arr = await app.$post(`/courtAdmin/api/team`, params);
+                if (arr.errcode == '0') { wx.showToast({ title: `添加信息完成`, icon: 'success', duration: 2000 }); that.back(); }
+                else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            }
+        }
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算高度
+        this.searchHeight();
+        //验证规则函数
+        this.initValidate();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                that.setData({ form: { create_id: res.data._id, create_user: res.data.nickname } });
+                const arr = await app.$get(`/courtAdmin/api/user`, { status: '1', type: '2' });
+                if (arr.errcode == '0') that.setData({ userList: arr.data })
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/login/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 8 - 0
pages/teamInfo/index.json

@@ -0,0 +1,8 @@
+{
+    "component": true,
+    "usingComponents": {
+        "mobile-main": "/commpents/mobile-frame/mobile-main",
+        "vanupload": "/commpents/upload/index",
+        "e-dialog": "/commpents/dialog/index"
+    }
+}

+ 82 - 0
pages/teamInfo/index.wxml

@@ -0,0 +1,82 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <form catchsubmit="onSubmit" catchreset="toReset">
+                <view class="content">
+                    <view class="label textOver">团队LOGO</view>
+                    <view class="value">
+                        <vanupload list="{{logo}}" count="{{1}}" previewSize="{{50}}" bind:imgUpload="imgUpload" bind:imgDel="imgDel"></vanupload>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">团队名称</view>
+                    <view class="value">
+                        <input type="text" name="name" value="{{form.name}}" placeholder="请输入团队名称" />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label textOver">团队创建人id</view>
+                    <view class="value">
+                        <input type="text" name="create_id" value="{{form.create_id}}" placeholder="请输入团队创建人id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">团队创建人</view>
+                    <view class="value">
+                        <input type="text" name="create_user" value="{{form.create_user}}" placeholder="请输入团队创建人" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">团队类型</view>
+                    <view class="value">
+                        <picker name="type" bindchange="typeChange" value="{{form.type}}" range="{{typeList}}">
+                            <view class="input">{{form.type||'选择团队类型'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">创建时间</view>
+                    <view class="value">
+                        <picker mode="date" name="create_time" value="{{form.create_time}}" start="1022-01-01" end="2100-01-01" bindchange="dataChange">
+                            <view class="input"> {{form.create_time||'选择时间'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="members">
+                    <view class="members_1">
+                        <text>团队成员</text>
+                        <button type="default" size="mini" bindtap="memAdd">添加成员</button>
+                    </view>
+                    <view class="members_2">
+                        <view class="membersList" wx:for="{{members}}" wx:key="item" bindtap="memDel" data-user_id="{{item.user_id}}">
+                            <image class="iamge" src="{{item.icon&&item.icon.length>0?item.icon[0].url:'/image/wodexiao-01.png'}}"></image>
+                            <view class="nickname textOver">{{item.nickname}}</view>
+                            <image class="del" src="/image/jianshao.png"></image>
+                        </view>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="warn" size="mini" formType="reset">取消保存</button>
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</mobile-main>
+<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info">
+        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
+            <checkbox-group bindchange="memChange">
+                <view class="userList" wx:for="{{userList}}" wx:key="item">
+                    <label>
+                        <text>{{item.nickname}}--{{item.phone}}</text>
+                        <checkbox value="{{item._id}}" checked="{{item.checked}}" />
+                    </label>
+                </view>
+            </checkbox-group>
+            <!-- <view class="btn">
+                <button type="primary" size="mini" bindtap="memSubmit">提交保存</button>
+            </view> -->
+        </view>
+    </view>
+</e-dialog>

+ 136 - 0
pages/teamInfo/index.wxss

@@ -0,0 +1,136 @@
+.main {
+    position: relative;
+    width: 100%;
+    background-color: #ffffff;
+}
+
+.main .one {
+    float: left;
+    width: 95%;
+    padding: 0 10px;
+}
+
+.main .one .content {
+    float: left;
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    padding: 10px 0;
+}
+
+.main .one .content .label {
+    float: left;
+    width: 30%;
+}
+
+.main .one .content .value {
+    float: left;
+    width: 70%;
+    text-align: right;
+}
+
+.main .one .members {
+    float: left;
+    width: 100%;
+    margin: 5px 0;
+}
+
+.main .one .members .members_1 {
+    float: left;
+    width: 100%;
+}
+
+.main .one .members .members_1 text {
+    display: inline-block;
+    margin: 4px 0;
+}
+
+.main .one .members .members_1 button {
+    font-size: 14px;
+    float: right;
+}
+
+.members_2 {
+    float: left;
+    width: 100%;
+}
+
+.members_2 .membersList {
+    float: left;
+    width: 22%;
+    height: 80px;
+    border: 1px solid #ccc;
+    border-radius: 90px;
+    text-align: center;
+    margin: 0 10px 10px 0;
+    position: relative;
+}
+
+.members_2 .membersList:nth-child(4n) {
+    margin: 0 0 10px 0;
+}
+
+.members_2 .membersList .iamge {
+    width: 40px;
+    height: 40px;
+    overflow: hidden;
+    margin: 5px 0;
+    border-radius: 90px;
+}
+
+.members_2 .membersList .nickname {
+    font-size: 14px;
+}
+.members_2 .membersList .del{
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 20px;
+    height: 20px;
+}
+
+.main .one .btn {
+    position: absolute;
+    bottom: 10px;
+    width: 100%;
+    text-align: center;
+}
+
+.main .one .btn button {
+    margin: 0 10px;
+    font-size: 14px;
+}
+
+.dialog_one {
+    float: left;
+    width: 100%;
+}
+
+
+.dialog_one .userList {
+    float: left;
+    width: 93%;
+    padding: 10px;
+    border-bottom: 1px solid #ccc;
+}
+
+.dialog_one .userList text {
+    float: left;
+    text-align: left;
+    font-size: 14px;
+}
+
+.dialog_one .userList checkbox {
+    float: right;
+}
+
+.dialog_one .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+    margin: 5px 0;
+}
+
+.dialog_one .btn button {
+    padding: 0 10px;
+    font-size: 14px;
+}

+ 158 - 0
pages/teamInfo/info.js

@@ -0,0 +1,158 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '团队详细信息', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+        // 用户信息
+        user: {},
+        // 当前用户是否在团队成员列表里面
+        is_membes: false,
+        // 背景图片
+        bg_img: '/image/team_1.jpg',
+        id: '62985b80006dd062af49fdf9',
+        form: {},
+    },
+    back: function () {
+        wx.navigateBack({ delta: 1 })
+    },
+    // 删除成员
+    toDel: async function (e) {
+        const that = this;
+        const data = that.data.form;
+        const { id } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '是否删除该名队员',
+            async success(res) {
+                if (res.confirm) {
+                    let members = data.members.filter((i) => i.user_id != id);
+                    const arr = await app.$post(`/courtAdmin/api/team/${data.id}`, { members: members });
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除成员成功`, icon: 'error', duration: 2000 });
+                        that.watchLogin();
+                    } else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                } else if (res.cancel) { }
+            }
+        })
+    },
+    // 退出团队
+    delTeam: function () {
+        const that = this;
+        const data = that.data.form;
+        const user = that.data.user;
+        wx.showModal({
+            title: '是否确认退出团队?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$get(`/courtAdmin/api/team/leaves`, { user_id: user._id, team_id: data.id });
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `退出团队成功`, icon: 'error', duration: 2000 });
+                        that.watchLogin();
+                    } else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                } else if (res.cancel) {
+                }
+            }
+        })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const that = this;
+        if (options && options.id) that.setData({ id: options.id })
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                that.setData({ user: res.data })
+                let arr;
+                // 系统团队
+                arr = await app.$get(`/courtAdmin/api/team/${that.data.id}`);
+                if (arr.errcode == '0') {
+                    that.setData({ form: arr.data });
+                    // 个人用户判断当前用户是否为团队成员
+                    if (res.data.type == '2') {
+                        let is_membes = arr.data.members.find((i) => i.user_id == res.data._id);
+                        if (is_membes) that.setData({ is_membes: true })
+                    }
+                }
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/teamInfo/info.json

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

+ 33 - 0
pages/teamInfo/info.wxml

@@ -0,0 +1,33 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <view class="one_1">
+                <view class="bg">
+                    <image src="{{bg_img}}"></image>
+                </view>
+                <view class="info">
+                    <image class="logo" src="{{form.logo[0].url}}"></image>
+                    <view class="name textOver">{{form.name}}</view>
+                    <view class="num">共{{form.members.length}}人</view>
+                </view>
+            </view>
+            <view class="one_2">
+                <view class="otherinfo">创建人:<text>{{form.create_user}}</text></view>
+                <view class="otherinfo">创建时间:<text>{{form.create_time}}</text></view>
+            </view>
+            <view class="one_3">
+                <view class="txt">成员信息</view>
+                <view class="members">
+                    <view class="list" wx:for="{{form.members}}" wx:key="item">
+                        <image class="image" src="{{item.icon[0].url}}"></image>
+                        <view class="nickname textOver">{{item.nickname}}</view>
+                        <image class="del" src="/image/jianshao.png" bindtap="toDel" data-id="{{item.user_id}}" wx:if="{{form.create_id==user._id}}"></image>
+                    </view>
+                </view>
+            </view>
+            <view class="one_4" wx:if="{{is_membes}}">
+                <button type="warn" size="mini" bindtap='delTeam'>退出团队</button>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 141 - 0
pages/teamInfo/info.wxss

@@ -0,0 +1,141 @@
+.main {
+    position: relative;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 100%;
+}
+
+.main .one .one_1 {
+    position: relative;
+    width: 100%;
+    height: 290px;
+    text-align: center;
+    overflow: hidden;
+}
+
+.main .one .one_1 .bg {
+    position: relative;
+    width: 100%;
+}
+
+.main .one .one_1 .bg image {
+    float: left;
+    width: 100%;
+    height: 290px;
+    overflow: hidden;
+}
+
+.main .one .one_1 .info {
+    position: absolute;
+    width: 100%;
+    text-align: center;
+    padding: 100px 0 0 0;
+}
+
+.main .one .one_1 .info image {
+    width: 80px;
+    height: 80px;
+    border-radius: 90px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .one_1 .info .name {
+    font-size: 16px;
+    color: #fff;
+    margin: 0 0 5px 0;
+    padding: 0 10px;
+}
+
+.main .one .one_1 .info .num {
+    font-size: 16px;
+    color: #fff;
+}
+
+.main .one .one_2 {
+    float: left;
+    width: 95%;
+    padding: 10px;
+    background-color: #fff;
+    margin: 0 0 10px 0;
+}
+
+.main .one .one_2 .otherinfo {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+    font-size: 15px;
+    color: #666;
+}
+
+.main .one .one_2 .otherinfo text {
+    color: #000000;
+}
+
+.main .one .one_3 {
+    float: left;
+    width: 95%;
+    padding: 10px;
+    background-color: #fff;
+    margin: 0 0 10px 0;
+}
+
+.main .one .one_3 .txt {
+    float: left;
+    width: 100%;
+    font-size: 15px;
+    color: #000;
+    margin: 0 0 5px 0;
+}
+
+.main .one .one_3 .members {
+    float: left;
+    width: 100%;
+}
+
+.main .one .one_3 .members .list {
+    float: left;
+    width: 24%;
+    text-align: center;
+    margin: 0 0 5px 0;
+    position: relative;
+}
+
+.main .one .one_3 .members .list .image {
+    width: 60px;
+    height: 60px;
+    overflow: hidden;
+    border-radius: 90px;
+    background-color: #f1f1f1;
+}
+
+.main .one .one_3 .members .list .nickname {
+    font-size: 14px;
+}
+
+.main .one .one_3 .members .list .del {
+    position: absolute;
+    width: 20px;
+    height: 20px;
+    top: 0;
+    right: 0;
+    overflow: hidden;
+}
+
+.main .one .one_4 {
+    float: left;
+    width: 95%;
+    background-color: #fff;
+    padding: 10px;
+    text-align: center;
+}
+
+.main .one .one_4 button {
+    width: 80%;
+    color: #ffffff;
+    font-size: 13px;
+    background-color: rgba(243, 32, 162, 0.5);
+    background-image: linear-gradient(to right, rgb(247, 59, 69), rgb(223, 41, 247));
+}

+ 100 - 0
pages/teamapply/index.js

@@ -0,0 +1,100 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '团队申请', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/me/index' })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                const arr = await app.$get(`/courtAdmin/api/joinapply`, { apply_id: res.data._id });
+                if (arr.errcode == '0') that.setData({ list: arr.data })
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/login/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 6 - 0
pages/teamapply/index.json

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

+ 14 - 0
pages/teamapply/index.wxml

@@ -0,0 +1,14 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <view class="list" wx:for="{{list}}" wx:key="item">
+                <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                <view class="other">
+                    <view class="otherInfo">申请团队:<text>{{item.team_name}}</text></view>
+                    <view class="otherInfo"> 申请人:<text>{{item.apply_user }}</text></view>
+                    <view class="otherInfo"> 申请时间:<text>{{item.apply_time }}</text></view>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>

+ 46 - 0
pages/teamapply/index.wxss

@@ -0,0 +1,46 @@
+.main {
+    position: relative;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 95%;
+    padding: 0 10px;
+    overflow-x: hidden;
+    margin: 10px 0 0 0;
+}
+
+.main .one .list {
+    float: left;
+    width: 95%;
+    background-color: #fff;
+    border-radius: 5px;
+    padding: 10px;
+    margin: 0 0 10px 0;
+}
+
+.main .one .list .name {
+    float: left;
+    width: 100%;
+    font-size: 14px;
+    font-weight: bold;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other .otherInfo {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .list .other .otherInfo text:nth-child(1) {
+    color: #666;
+}

+ 158 - 0
pages/teamdismissteam/index.js

@@ -0,0 +1,158 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate';
+const moment = require("../../utils/moment.min");
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '解散团队', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+        // 用户列表
+        user: {},
+        // 团队列表
+        teamList: [],
+        list: [],
+        // 弹框
+        dialog: { title: '添加申请', show: false, type: '1' },
+        form: {}
+    },
+    initValidate() {
+        const rules = { team_id: { required: true }, resaon: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { team_id: { required: '请选择团队', }, resaon: { required: '请输入解散原因', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/me/index' })
+    },
+    // 添加
+    toAdd: function () {
+        const that = this;
+        const user = that.data.user;
+        that.setData({ form: { create_id: user._id, create_user: user.nickname } })
+        that.setData({ dialog: { title: '添加申请', show: true, type: '1' } })
+    },
+    // 选择团队
+    teamChange: function (e) {
+        const that = this;
+        const { value } = e.detail;
+        let data = that.data.teamList[value];
+        if (data) that.setData({ 'form.team_id': data._id });
+        that.setData({ 'form.team_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 {
+            params.apply_time = moment().format('YYYY-MM-DD HH:mm:ss');
+            const arr = await app.$post(`/courtAdmin/api/dismissapply`, params)
+            if (arr.errcode == '0') { wx.showToast({ title: `成功,等待审核`, icon: 'success', duration: 2000 }); that.toClose(); that.watchLogin() }
+            else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ dialog: { title: '添加申请', show: false, type: '1' } })
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        //验证规则函数
+        this.initValidate();
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                that.setData({ user: res.data });
+                let arr;
+                // 查询团队列表
+                arr = await app.$get(`/courtAdmin/api/team`, { create_id: res.data._id });
+                if (arr.errcode == '0') this.setData({ teamList: arr.data });
+                // 查询申请列表
+                arr = await app.$get(`/courtAdmin/api/dismissapply`, { create_id: res.data._id });
+                if (arr.errcode == '0') this.setData({ list: arr.data });
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/login/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 7 - 0
pages/teamdismissteam/index.json

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

+ 59 - 0
pages/teamdismissteam/index.wxml

@@ -0,0 +1,59 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <button type="primary" size="mini" bindtap="toAdd">添加</button>
+        </view>
+        <view class="two">
+            <view class="list" wx:for="{{list}}" wx:key="item">
+                <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                <view class="other">
+                    <view class="otherInfo">申请时间:<text>{{item.apply_time}}</text></view>
+                    <view class="otherInfo">解散原因:<text>{{item.resaon }}</text></view>
+                </view>
+            </view>
+        </view>
+    </view>
+</mobile-main>
+<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info">
+        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
+            <form bindsubmit="onSubmit">
+                <view class="content">
+                    <view class="label textOver">团队列表</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="teamChange" name="team_id" value="{{form.team_id}}" range-key="name" range="{{teamList}}">
+                            <view class="input">{{form.team_name||'选择团队'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">团队名称</view>
+                    <view class="value">
+                        <input type="text" name="team_name" value="{{form.team_name}}" placeholder="请输入团队名称" disabled />
+                    </view>
+                </view>
+                <view class="content" style="display: none;">
+                    <view class="label textOver">创建人id</view>
+                    <view class="value">
+                        <input type="text" name="create_id" value="{{form.create_id}}" placeholder="请输入团队创建人id" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">团队创建人</view>
+                    <view class="value">
+                        <input type="text" name="create_user" value="{{form.create_user}}" placeholder="请输入团队创建人" disabled />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label textOver">解散团队原因</view>
+                    <view class="value">
+                        <input type="text" name="resaon" value="{{form.resaon}}" placeholder="请输入解散团队原因" />
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交申请</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</e-dialog>

+ 98 - 0
pages/teamdismissteam/index.wxss

@@ -0,0 +1,98 @@
+.main {
+    position: relative;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 100%;
+    text-align: center;
+    background-color: #fff;
+    padding: 5px 0;
+    margin: 0 0 10px 0;
+    overflow-x: hidden;
+}
+
+.main .one button {
+    font-size: 14px;
+    background-color: #409eff;
+    color: #fff;
+}
+
+
+.main .two {
+    float: left;
+    width: 95%;
+    padding: 0 10px;
+    overflow-x: hidden;
+    margin: 10px 0 0 0;
+}
+
+.main .two .list {
+    float: left;
+    width: 95%;
+    background-color: #fff;
+    border-radius: 5px;
+    padding: 10px;
+    margin: 0 0 10px 0;
+}
+
+.main .two .list .name {
+    float: left;
+    width: 100%;
+    font-size: 14px;
+    font-weight: bold;
+    margin: 0 0 5px 0;
+}
+
+.main .two .list .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+}
+
+.main .two .list .other .otherInfo {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
+}
+
+.main .two .list .other .otherInfo text:nth-child(1) {
+    color: #666;
+}
+
+.dialog_one {
+    float: left;
+    width: 100%;
+}
+
+.dialog_one .content {
+    float: left;
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    padding: 10px 0;
+    font-size: 14px;
+}
+
+.dialog_one .content .label {
+    float: left;
+    width: 20%;
+}
+
+.dialog_one .content .value {
+    float: left;
+    width: 80%;
+    text-align: right;
+}
+
+.dialog_one .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+    margin: 10px 0 0 0;
+}
+
+.dialog_one .btn button {
+    font-size: 14px;
+}

+ 187 - 0
pages/teamexam/index.js

@@ -0,0 +1,187 @@
+// pages/login/login.js
+import WxValidate from '../../utils/wxValidate'
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        frameStyle: { useTop: true, name: '团队审核', leftArrow: true, useBar: false },
+        // 主体高度
+        infoHeight: '',
+        // 选项卡
+        tabs: {
+            active: 'a',
+            list: [
+                { title: '系统团队', name: 'a' },
+                { title: '解散团队', name: 'b' },
+                { title: '参赛团队', name: 'c' },
+            ],
+        },
+        // 全部团队
+        aList: [],
+        // 解散团队
+        bList: [],
+        // 弹框
+        dialog: { title: '信息审核', show: false, type: '1' },
+        form: {},
+        statusList: [{ label: '待审核', value: '0' }, { label: '审核通过', value: '1' }, { label: '审核拒绝', value: '-1' }]
+    },
+    initValidate() {
+        const rules = { status: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { status: { required: '请选择状态', } };
+        this.WxValidate = new WxValidate(rules, messages)
+    },
+    back: function () {
+        wx.navigateBack({ url: '/pages/administration/index' })
+    },
+    // 选项卡
+    tabsChange: function (e) {
+        const that = this;
+        that.setData({ 'tabs.active': e.detail.name })
+    },
+    // 系统团队查看详情
+    toView: function (e) {
+        let { id } = e.currentTarget.dataset;
+        wx.navigateTo({ url: `/pages/teamInfo/info?id=${id}` })
+    },
+    // 系统团队信息审核
+    toCheck: async function (e) {
+        const that = this;
+        let { id, type } = e.currentTarget.dataset;
+        let arr;
+        if (type == 'a') arr = await app.$get(`/courtAdmin/api/team/${id}`);
+        else if (type == 'b') arr = await app.$get(`/courtAdmin/api/dismissapply/${id}`);
+        if (arr.errcode == '0') {
+            let data = { tabs_type: type, ...arr.data };
+            that.setData({ form: data })
+            that.setData({ dialog: { title: '信息审核', show: true, type: '1' } })
+        }
+
+    },
+    // 选择状态
+    statusChange: function (e) {
+        const that = this;
+        const { value } = e.detail;
+        that.setData({ 'form.status': value })
+    },
+    // 提交审核
+    aSubmit: async function (e) {
+        const that = this;
+        const data = that.data.form;
+        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 {
+            let arr;
+            if (data.tabs_type == 'a') arr = await app.$post(`/courtAdmin/api/team/${data.id}`, params);
+            else if (data.tabs_type == 'b') {
+                arr = await app.$post(`/courtAdmin/api/dismissapply/${data.id}`, params);
+                if (arr.errcode == '0' && data.status == '1') arr = await app.$delete(`/courtAdmin/api/team/${data.team_id}`);
+            }
+            if (arr.errcode == '0') { wx.showToast({ title: `审核信息成功`, icon: 'error', duration: 2000 }); that.toClose(); }
+            else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+        }
+    },
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ dialog: { title: '信息审核', show: false, type: '1' } })
+        that.watchLogin();
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        //验证规则函数
+        this.initValidate();
+        // 计算高度
+        this.searchHeight();
+        // 监听用户是否登录
+        this.watchLogin();
+    },
+    // 监听用户是否登录
+    watchLogin: function () {
+        const that = this;
+        wx.getStorage({
+            key: 'token',
+            success: async res => {
+                let arr;
+                // 系统团队
+                arr = await app.$get(`/courtAdmin/api/team`);
+                if (arr.errcode == '0') that.setData({ aList: arr.data });
+                // 解散团队
+                arr = await app.$get(`/courtAdmin/api/dismissapply`);
+                if (arr.errcode == '0') that.setData({ bList: arr.data });
+
+            },
+            fail: res => {
+                wx.redirectTo({ url: '/pages/index/index', })
+            }
+        })
+    },
+    // 计算高度
+    searchHeight: function () {
+        let frameStyle = this.data.frameStyle;
+        let client = app.globalData.client;
+        let infoHeight = client.windowHeight;
+        // 是否去掉状态栏
+        if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+        // 是否减去底部菜单
+        if (frameStyle.useBar) infoHeight = infoHeight - 50;
+        if (infoHeight) this.setData({ infoHeight: infoHeight })
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 8 - 0
pages/teamexam/index.json

@@ -0,0 +1,8 @@
+{
+    "component": true,
+    "usingComponents": {
+        "mobile-main": "/commpents/mobile-frame/mobile-main",
+        "e-tabs": "/commpents/tabs/index",
+        "e-dialog": "/commpents/dialog/index"
+    }
+}

+ 58 - 0
pages/teamexam/index.wxml

@@ -0,0 +1,58 @@
+<mobile-main frameStyle="{{frameStyle}}" bind:back="back">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <e-tabs tabs="{{tabs}}" bind:tabsChange="tabsChange"></e-tabs>
+            <view wx:if="{{tabs.active=='a'}}" class="a">
+                <view class="alist" wx:for="{{aList}}" wx:key="item">
+                    <view class="name">
+                        <image src="{{item.logo[0].url}}"></image>
+                        <text class="textOver">{{item.name}}</text>
+                        <text>共{{item.members.length}}人</text>
+                    </view>
+                    <view class="other">
+                        <view class="other_1"><text>创建人:</text><text>{{item.create_user}}</text></view>
+                        <view class="other_1"><text>创建时间:</text><text>{{item.create_time}}</text></view>
+                        <view class="other_1"><text>状态:</text><text>{{item.status=='1'?'审核通过':item.status=='0'?'待审核':'拒绝审核'}}</text></view>
+                    </view>
+                    <view class="btn">
+                        <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}">详情</button>
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" data-type="a" wx:if="{{item.status=='0'}}">审核</button>
+                    </view>
+                </view>
+            </view>
+            <view wx:elif="{{tabs.active=='b'}}" class="b">
+                <view class="blist" wx:for="{{bList}}" wx:key="item">
+                    <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                    <view class="other">
+                        <view class="otherInfo">申请时间:<text>{{item.apply_time}}</text></view>
+                        <view class="otherInfo">解散原因:<text>{{item.resaon }}</text></view>
+                    </view>
+                    <view class="btn">
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" data-type="b" wx:if="{{item.status=='0'}}">审核</button>
+                    </view>
+                </view>
+            </view>
+            <view wx:elif="{{tabs.active=='c'}}">3</view>
+        </view>
+    </view>
+</mobile-main>
+<e-dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info">
+        <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
+            <form bindsubmit="aSubmit">
+                <view class="content">
+                    <view class="label textOver">状态</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="statusChange" name="status" value="{{form.status}}" range-key="label" range="{{statusList}}">
+                            <view class="input">{{form.status=='0'?'待审中':form.status=='1'?'审核通过':'审核拒绝'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交审核</button>
+                </view>
+            </form>
+        </view>
+
+    </view>
+</e-dialog>

+ 171 - 0
pages/teamexam/index.wxss

@@ -0,0 +1,171 @@
+.main {
+    position: relative;
+    width: 100%;
+}
+
+.main .one {
+    float: left;
+    width: 100%;
+}
+
+.main .one .a {
+    float: left;
+    width: 95%;
+    padding: 10px;
+}
+
+.main .one .a .alist {
+    float: left;
+    width: 95%;
+    padding: 10px;
+    background-color: #ffffff;
+    border-radius: 5px;
+    margin: 0 0 10px 0;
+}
+
+.main .one .a .alist .name {
+    float: left;
+    width: 100%;
+    height: 50px;
+    line-height: 50px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .a .alist .name image {
+    float: left;
+    width: 15%;
+    height: 50px;
+    overflow: hidden;
+    border-radius: 90px;
+}
+
+.main .one .a .alist .name text:nth-child(2) {
+    float: left;
+    max-width: 63%;
+    padding: 0 0 0 10px;
+    font-size: 16px;
+    font-weight: bold;
+}
+
+.main .one .a .alist .name text:nth-child(3) {
+    float: left;
+    width: 15%;
+    padding: 0 0 0 10px;
+    font-size: 14px;
+}
+
+.main .one .a .alist .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+}
+
+.main .one .a .alist .other .other_1 {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .a .alist .other .other_1 text:nth-child(1) {
+    color: #666;
+}
+
+.main .one .a .alist .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+}
+
+.main .one .a .alist .btn button {
+    margin: 0 10px;
+    padding: 0 10px;
+    font-size: 14px;
+}
+
+.main .one .b {
+    float: left;
+    width: 95%;
+    padding: 10px;
+}
+
+.main .one .b .blist {
+    float: left;
+    width: 95%;
+    background-color: #fff;
+    border-radius: 5px;
+    padding: 10px;
+    margin: 0 0 10px 0;
+}
+
+.main .one .b .blist .name {
+    float: left;
+    width: 100%;
+    font-size: 14px;
+    font-weight: bold;
+    margin: 0 0 5px 0;
+}
+
+.main .one .b .blist .other {
+    float: left;
+    width: 100%;
+    margin: 0 0 5px 0;
+}
+
+.main .one .b .blist .other .otherInfo {
+    float: left;
+    width: 100%;
+    font-size: 12px;
+    margin: 0 0 5px 0;
+}
+
+.main .one .b .blist .other .otherInfo text:nth-child(1) {
+    color: #666;
+}
+
+.main .one .b .blist .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+}
+
+.main .one .b .blist .btn button {
+    margin: 0 10px;
+    padding: 0 10px;
+    font-size: 14px;
+}
+
+.dialog_one {
+    float: left;
+    width: 100%;
+}
+
+.dialog_one .content {
+    float: left;
+    width: 100%;
+    border-bottom: 1px solid #ccc;
+    padding: 10px 0;
+    margin: 0 0 10px 0;
+    font-size: 14px;
+}
+
+.dialog_one .content .label {
+    float: left;
+    width: 20%;
+}
+
+.dialog_one .content .value {
+    float: left;
+    width: 80%;
+    text-align: right;
+}
+
+.dialog_one .btn {
+    float: left;
+    width: 100%;
+    text-align: center;
+}
+
+.dialog_one .btn button {
+    font-size: 14px;
+}

+ 66 - 0
pages/uploadScore/index.js

@@ -0,0 +1,66 @@
+// pages/uploadScore/index.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pages/uploadScore/index.json

@@ -0,0 +1,3 @@
+{
+    "usingComponents": {}
+}

+ 2 - 0
pages/uploadScore/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/uploadScore/index.wxml-->
+<text>pages/uploadScore/index.wxml</text>

+ 1 - 0
pages/uploadScore/index.wxss

@@ -0,0 +1 @@
+/* pages/uploadScore/index.wxss */

+ 22 - 3
pages/user/detail.js

@@ -17,6 +17,12 @@ Page({
         // 性别
         genderList: gender,
         statusList: [{ label: '待审核', value: '0' }, { label: '审核通过', value: '1' }, { label: '审核拒绝', value: '-1' }],
+        // 用户类别
+        typeList: [
+            // { label: '0', value: '管理用户' },
+            { label: '1', value: '团队创建人' },
+            { label: '2', value: '个人用户' }
+        ],
         // 用户id
         id: ''
     },
@@ -50,6 +56,14 @@ Page({
         let value = that.data.genderList[index];
         that.setData({ 'form.gender': value });
     },
+    // 选择用户类别
+    typeChange: function (e) {
+        const that = this;
+        let index = e.detail.value;
+        let data = that.data.typeList[index];
+        if (data) that.setData({ 'form.type': data.label });
+        that.setData({ 'form.type_name': data.value });
+    },
     // 选择状态
     statusChange: function (e) {
         const that = this;
@@ -68,15 +82,17 @@ Page({
         } else {
             let arr;
             if (data._id) {
+                if (!params.icon) params.icon = that.data.icon;
                 arr = await app.$post(`/courtAdmin/api/user/${data._id}`, params);
-                if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'error', duration: 2000 }); that.back(); }
+                if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
                 else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
             } else {
                 arr = await app.$get(`/courtAdmin/api/user`, { phone: params.phone });
                 if (arr.errcode == '0' && arr.total > 0) wx.showToast({ title: `该账号已有用户使用`, icon: 'error', duration: 2000 })
                 else {
+                    params.icon = that.data.icon;
                     arr = await app.$post(`/courtAdmin/api/user`, params);
-                    if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'error', duration: 2000 }); that.back(); }
+                    if (arr.errcode == '0') { wx.showToast({ title: `添加信息完成`, icon: 'success', duration: 2000 }); that.back(); }
                     else wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
                 }
             }
@@ -102,7 +118,10 @@ Page({
             key: 'token',
             success: async res => {
                 const arr = await app.$get(`/courtAdmin/api/user/${that.data.id}`);
-                if (arr.errcode == '0') that.setData({ form: arr.data })
+                if (arr.errcode == '0') {
+                    if (arr.data.icon) that.setData({ icon: arr.data.icon });
+                    that.setData({ form: arr.data });
+                }
             },
             fail: res => {
                 wx.redirectTo({ url: '/pages/index/index', })

+ 8 - 0
pages/user/detail.wxml

@@ -52,6 +52,14 @@
                         <input type="text" name="email" value="{{form.email}}" placeholder="请输入电子邮箱" />
                     </view>
                 </view>
+                <view class="content">
+                    <view class="label textOver">用户类型</view>
+                    <view class="value">
+                        <picker class="picker" mode="selector" bindchange="typeChange" name="type" range-key="value" range="{{typeList}}">
+                            <view class="input">{{form.type_name||'用户类别'}}</view>
+                        </picker>
+                    </view>
+                </view>
                 <view class="content">
                     <view class="label textOver">状态</view>
                     <view class="value">

+ 1 - 1
pages/user/index.js

@@ -91,7 +91,7 @@ Page({
     },
     // 关闭弹框
     toClose: function () {
-        this.setData({ dialog: { show: false } })
+        this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
     },
     /**
      * 生命周期函数--监听页面加载

+ 3 - 2
utils/dict.js

@@ -11,9 +11,10 @@ export const btn = [
     { title: '已上传图片', icon: 'icon-shangchuanzhaopian', route: 'uploadimg', type: '0|1|2' },
     { title: '用户管理', icon: 'icon-shenhe', route: 'user', type: '0' },
     { title: '比赛管理', icon: 'icon-bisaiguanli', route: 'matchadmin', type: '0' },
-    { title: '审核队员', icon: 'icon-shenhe', route: 'exammembers', type: '1' },
-    { title: '解散团队', icon: 'icon-ren_jiesantuandui_line', route: 'dismissteam', type: '1' },
     { title: '比赛管理', icon: 'icon-bisaiguanli', route: 'matchteam', type: '1' },
+    { title: '审核队员', icon: 'icon-shenhe', route: 'exammembers', type: '1' },
+    { title: '解散团队', icon: 'icon-ren_jiesantuandui_line', route: 'teamdismissteam', type: '1' },
+    { title: '团队申请', icon: 'icon-ren_jiesantuandui_line', route: 'teamapply', type: '2' },
     { title: '修改密码', icon: 'icon-xiugaimima', route: 'updatepd', type: '0|1|2' },
     { title: '退出登录', icon: 'icon-tuichudenglu', route: '', type: '0|1|2', method: 'signout' },
 ]