瀏覽代碼

Merge branch 'master' of http://git.cc-lotus.info/ball-court/ball-applet

guhongwei 2 年之前
父節點
當前提交
a094378fa5
共有 4 個文件被更改,包括 33 次插入18 次删除
  1. 28 13
      pagesMatch/match/info.js
  2. 3 3
      pagesMatch/match/info.wxml
  3. 1 1
      pagesMatch/matchAdmin/sign/add.js
  4. 1 1
      pagesMatch/matchAdmin/sign/list.js

+ 28 - 13
pagesMatch/match/info.js

@@ -22,7 +22,11 @@ Page({
             ],
         },
         // 状态
-        statusList: []
+        statusList: [],
+        // 赛事类别
+        typeList: [],
+        // 赛制列表
+        formatList: [],
     },
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
@@ -38,18 +42,17 @@ Page({
     },
     // 手风琴1
     panel: function (e) {
+        const that = this;
         let index = e.currentTarget.dataset.index;
-        let showIndex = this.data.showIndex;
-        if (index != showIndex) this.setData({ showIndex: index })
-        else this.setData({ showIndex: 10000 })
+        if (index != that.data.showIndex) that.setData({ showIndex: index })
+        else that.setData({ showIndex: 10000 })
     },
     // 手风琴2
     panels: function (e) {
+        const that = this;
         let index = e.currentTarget.dataset.index;
-        let showIndexs = this.data.showIndexs;
-        if (index != showIndexs) this.setData({ showIndexs: index })
-        else this.setData({ showIndexs: 10000 })
-
+        if (index != that.data.showIndexs) that.setData({ showIndexs: index })
+        else that.setData({ showIndexs: 10000 })
     },
     /**
      * 生命周期函数--监听页面加载
@@ -65,9 +68,15 @@ Page({
     searchOther: async function () {
         const that = this;
         let arr;
-        // 状态
+        // 赛事状态
         arr = await app.$get(`/dict`, { code: "match_status" });
-        if (arr.errcode == '0' && arr.total > 0) { that.setData({ statusList: arr.data[0].list }); }
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ statusList: arr.data[0].list });
+        // 赛事类别
+        arr = await app.$get(`/dict`, { code: "match_type" });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ typeList: arr.data[0].list });
+        // 赛制列表
+        arr = await app.$get(`/dict`, { code: "match_format" });
+        if (arr.errcode == '0' && arr.total > 0) that.setData({ formatList: arr.data[0].list });
     },
     /**
      * 生命周期函数--监听页面初次渲染完成
@@ -90,16 +99,22 @@ Page({
                 // 比赛信息
                 arr = await app.$get(`/match/${that.data.id}`, {}, 'race');
                 if (arr.errcode == '0') {
+                    // 赛事状态
                     let status = statusList.find(i => i.value == arr.data.status)
                     if (status) arr.data.zhStatus = status.label;
+                    // 赛事类别
+                    let type = that.data.typeList.find(i => i.value == arr.data.type)
+                    if (type) arr.data.zhtype = type.label;
+                    // 赛事赛制
+                    let format = that.data.formatList.find(i => i.value == arr.data.format)
+                    if (format) arr.data.zhFormat = format.label;
                     let regular = arr.data.regular.replace(/\<img/gi, '<img style="width:100%;height:auto;margin: 5px 0"');
                     if (regular) arr.data.zhRegular = regular;
                     that.setData({ info: arr.data })
                 } else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
+                // 选手
                 arr = await app.$get(`/match/getAll/${that.data.id}`, {}, 'race');
-                if (arr.errcode == '0') {
-                    that.setData({ player: arr.data })
-                }
+                if (arr.errcode == '0') that.setData({ player: arr.data })
             },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })

+ 3 - 3
pagesMatch/match/info.wxml

@@ -16,15 +16,15 @@
                                     <view class="other">
                                         <view class="other_1">
                                             <text>赛事类别:</text>
-                                            <text>{{info.type||'暂无'}}</text>
+                                            <text>{{info.zhtype||'暂无'}}</text>
                                         </view>
                                         <view class="other_1">
                                             <text>比赛时间:</text>
-                                            <text>{{info.start_time||'暂无'}}-{{info.end_time||'暂无'}}</text>
+                                            <text>{{info.start_time||'暂无'}}{{info.end_time||'暂无'}}</text>
                                         </view>
                                         <view class="other_1">
                                             <text>赛事赛制:</text>
-                                            <text>{{info.format||'暂无'}}</text>
+                                            <text>{{info.zhFormat||'暂无'}}</text>
                                         </view>
                                         <view class="other_1">
                                             <text>报名截止时间:</text>

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

@@ -3,7 +3,7 @@ import { pay_status } from '../../../utils/dict';
 import WxValidate from '../../../utils/wxValidate';
 Page({
     data: {
-        frameStyle: { useTop: true, name: '信息维护', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '报名信息', leftArrow: true, useBar: false },
         form: {},
         //比赛列表
         matchList: [],

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

@@ -2,7 +2,7 @@ const app = getApp();
 import { pay_status } from "../../../utils/dict";
 Page({
     data: {
-        frameStyle: { useTop: true, name: '基本页面', leftArrow: true, useBar: false },
+        frameStyle: { useTop: true, name: '报名信息', leftArrow: true, useBar: false },
         // 赛事列表
         matchList: [],
         match: {},