Browse Source

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

lrf 2 years ago
parent
commit
55f4316df8

+ 0 - 2
app.json

@@ -1,7 +1,5 @@
 {
     "pages": [
-
-      
         "pages/index/index",
         "pages/register/index",
         "pages/home/index",

+ 43 - 0
pages/eliminate/add.less

@@ -9,4 +9,47 @@
     .zero:last-child {
         margin: 0;
     }
+
+    .one {
+        width: 96vw;
+        text-align: center;
+
+        .race {
+            display: flex;
+            flex-direction: column;
+            height: 88.8vh;
+
+            .button {
+                display: flex;
+                flex-direction: row;
+                justify-content: space-around;
+                padding: 5px 0;
+            }
+
+            .list {
+                flex-grow: 1;
+                position: relative;
+                margin: 0 0 2vw 0;
+
+                .scroll-view {
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                    right: 0;
+                    bottom: 0;
+
+                    .list-scroll-view {
+                        display: flex;
+                        flex-direction: column;
+
+                        .name {
+                            text-align: center;
+                            margin: 2vw 0;
+                        }
+                    }
+                }
+            }
+        }
+
+    }
 }

+ 21 - 17
pages/eliminate/add.wxml

@@ -2,32 +2,36 @@
     <view slot="info" class="container main">
         <view class="zero one">
             <view wx:if="{{view==='graph'}}">
-                <view>
-                    <button bind:tap="toAutoInitData" wx:if="{{!arrangeData._id}}">自动生成</button>
-                    <button bind:tap="turnView" data-view="race">设置比赛</button>
+                <view class="button">
+                    <button type="primary" size="mini" bind:tap="toAutoInitData" wx:if="{{!arrangeData._id}}">自动生成</button>
+                    <button type="primary" size="mini" bind:tap="turnView" data-view="race">设置比赛</button>
                     <!-- <button>保存</button> -->
                 </view>
                 <f6-tree list="{{data}}" arrange="{{arrangeList}}" bind:tapNode="nodeTap"></f6-tree>
-                <view>
+                <view class="list">
                     <van-popup show="{{ show }}" bind:close="toClose" position="bottom" custom-style="height: 40%;">
                         <van-picker columns="{{ personList }}" bind:confirm="onChange" value-key="label" show-toolbar="{{true}}" bind:cancel="toClose" />
                     </van-popup>
                 </view>
             </view>
-            <view wx:if="{{view==='race'}}">
-                <view>
-                    <button bind:tap="turnView" data-view="graph">返回</button>
-                    <button bind:tap="toSubmit">保存</button>
+            <view wx:if="{{view==='race'}}" class="race">
+                <view class="button">
+                    <button type="primary" size="mini" bind:tap="turnView" data-view="graph">返回</button>
+                    <button type="primary" size="mini" bind:tap="toSubmit">保存</button>
                 </view>
-                <view>
-                    <view wx:for="{{raceList}}" wx:for-item="r" wx:key="node_one_id">
-                        {{r.player_name_one}} VS {{r.player_name_two}}
-                        <f-picker value="{{r.ground_id}}" label="场地" model="{{r.groundModelName}}" bind:selected="toSelected" columns="{{groundList}}" valueKey="_id" labelKey="name">
-                        </f-picker>
-                        <f-picker value="{{r.referee_id}}" label="裁判" model="{{r.refereeModelName}}" bind:selected="toSelected" columns="{{refereeList}}" valueKey="_id" labelKey="name">
-                        </f-picker>
-                        <f-time-picker label="比赛时间" model="{{r.timeModelName}}" value="{{r.match_time}}" bind:selected="toSelected" />
-                    </view>
+                <view class="list">
+                    <scroll-view scroll-y="true" class="scroll-view">
+                        <view class="list-scroll-view">
+                            <view wx:for="{{raceList}}" wx:for-item="r" wx:key="node_one_id">
+                                <view class="name"> {{r.player_name_one}} VS {{r.player_name_two}}</view>
+                                <f-picker value="{{r.ground_id}}" label="场地" model="{{r.groundModelName}}" bind:selected="toSelected" columns="{{groundList}}" valueKey="_id" labelKey="name">
+                                </f-picker>
+                                <f-picker value="{{r.referee_id}}" label="裁判" model="{{r.refereeModelName}}" bind:selected="toSelected" columns="{{refereeList}}" valueKey="_id" labelKey="name">
+                                </f-picker>
+                                <f-time-picker label="比赛时间" model="{{r.timeModelName}}" value="{{r.match_time}}" bind:selected="toSelected" />
+                            </view>
+                        </view>
+                    </scroll-view>
                 </view>
             </view>
         </view>

+ 35 - 0
pages/eliminate/add.wxss

@@ -8,3 +8,38 @@
 .main .zero:last-child {
   margin: 0;
 }
+.main .one {
+  width: 96vw;
+  text-align: center;
+}
+.main .one .race {
+  display: flex;
+  flex-direction: column;
+  height: 88.8vh;
+}
+.main .one .race .button {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  padding: 5px 0;
+}
+.main .one .race .list {
+  flex-grow: 1;
+  position: relative;
+  margin: 0 0 2vw 0;
+}
+.main .one .race .list .scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+.main .one .race .list .scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
+}
+.main .one .race .list .scroll-view .list-scroll-view .name {
+  text-align: center;
+  margin: 2vw 0;
+}

+ 1 - 1
pages/home/index.wxml

@@ -12,7 +12,7 @@
                         </view>
                         <view class="list_2">
                             <view class="name">
-                                <text class="status">{{item.status=='0'?'报名中':'暂无'}}</text>
+                                <text class="status">{{item.status=='0'?'报名中':item.status=='1'?'报名截止':item.status=='2'?'报名结束':item.status=='3'?'发布秩序册':item.status=='4'?'比赛中':item.status=='5'?'比赛结束':'暂无'}}</text>
                                 <text>{{item.name}}</text>
                             </view>
                             <view class="other">

+ 0 - 7
pages/index/index.js

@@ -11,13 +11,6 @@ Page({
         const that = this;
         // 监听用户是否登录
         that.watchLogin();
-        // const aee = await app.$get('/newCourt/api/enroll', { status: '-3' });
-        // let user = [];
-        // for (const val of aee.data) {
-        //     const arr = await app.$get(`/newCourt/api/user/${val.openid}`);
-        //     user.push({ name: arr.data.name, phone: arr.data.phone })
-        // }
-        // console.log(user);
     },
     // 监听用户是否登录
     watchLogin: async function () {

+ 0 - 1
pages/match/shteam.less

@@ -84,7 +84,6 @@
         padding: 10px;
 
         .text {
-            width: 46vw;
             color: #666;
             font-size: 16px;
         }

+ 0 - 1
pages/match/shteam.wxss

@@ -72,7 +72,6 @@
   padding: 10px;
 }
 .dialog_one .one_1 .text {
-  width: 46vw;
   color: #666;
   font-size: 16px;
 }

+ 1 - 3
pages/race/add.js

@@ -155,9 +155,7 @@ Page({
     statusChange: function (e) {
         const that = this;
         let data = that.data.statusList[e.detail.value];
-        if (data) {
-            that.setData({ 'form.status': data.value });
-        }
+        if (data) { that.setData({ 'form.status': data.value }); }
     },
     // 提交保存
     onSubmit: async function (e) {

+ 1 - 1
pages/race/add.wxml

@@ -108,7 +108,7 @@
                     <view class="label">比赛状态</view>
                     <view class="value">
                         <picker bindchange="statusChange" name="status" value="{{form.status}}" range-key='label' range="{{statusList}}">
-                            <view class="input">{{form.status=='0'?'已安排':item.status=='1'?'待开赛':item.status=='2'?'已开赛':item.status=='3'?'已结束':'请选择比赛状态'}}</view>
+                            <view class="input">{{form.status=='0'?'已安排':form.status=='1'?'待开赛':form.status=='2'?'已开赛':form.status=='3'?'已结束':'请选择'}}</view>
                         </picker>
                     </view>
                 </view>

+ 11 - 3
pages/race/index.js

@@ -43,8 +43,16 @@ Page({
         if (data) { that.setData({ 'form.status': data.value }) }
     },
     // 提交保存
-    onSubmit: function (e) {
-        console.log(e);
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const arr = await app.$post(`/newCourt/api/race/${params._id}`, params);
+        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 () {
@@ -106,7 +114,7 @@ Page({
             key: 'user',
             success: async (res) => {
                 let arr;
-                let info = { skip: 0, limit: 5 };
+                let info = { skip: 0, limit: 1000 };
                 // if (searchInfo && searchInfo.name) info.name = searchInfo.name;
                 arr = await app.$get(`/newCourt/api/race`, { ...info });
                 if (arr.errcode == '0') { that.setData({ raceList: arr.data }) }

+ 17 - 4
pages/race/index.wxml

@@ -39,30 +39,43 @@
     <view slot="info">
         <view class="dialog_one" wx:if="{{dialog.type=='1'}}">
             <form catchsubmit="onSubmit">
+                <view class="content" style="display: none;">
+                    <view class="label">数据id</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
                 <view class="content">
                     <view class="label">比赛状态</view>
                     <view class="value">
                         <picker bindchange="statusChange" name="status" value="{{form.status}}" range-key='label' range="{{statusList}}">
-                            <view class="input">{{form.status=='0'?'已安排':item.status=='1'?'待开赛':item.status=='2'?'已开赛':item.status=='3'?'已结束':'请选择比赛状态'}}</view>
+                            <view class="input">{{form.status=='0'?'已安排':form.status=='1'?'待开赛':form.status=='2'?'已开赛':form.status=='3'?'已结束':'请选择'}}</view>
                         </picker>
                     </view>
                 </view>
                 <view class="content">
                     <view class="label">选手一比分</view>
                     <view class="value">
-                        <input type="number" name="score_one" value="{{form.score_one}}" placeholder="请输入选手一比分" />
+                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
                     </view>
                 </view>
                 <view class="content">
                     <view class="label">选手二比分</view>
                     <view class="value">
-                        <input type="number" name="score_two" value="{{form.score_two}}" placeholder="请输入选手二比分" />
+                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
                     </view>
                 </view>
                 <view class="content">
                     <view class="label">胜者</view>
                     <view class="value">
-                        <input type="text" name="winner" value="{{form.winner}}" placeholder="请输入胜者" />
+                        <radio-group name="winner">
+                            <label>
+                                <radio value="{{form.player_one}}" checked="{{form.player_one==form.winner?true:false}}" />{{form.player_one_name}}
+                            </label>
+                            <label>
+                                <radio value="{{form.player_two}}" checked="{{form.player_two==form.winner?true:false}}" />{{form.player_two_name}}
+                            </label>
+                        </radio-group>
                     </view>
                 </view>
                 <view class="btn">

+ 58 - 3
pages/referee/eliminate.js

@@ -1,4 +1,5 @@
 const app = getApp()
+import { race_status } from "../../utils/dict";
 Page({
 
     /**
@@ -10,6 +11,8 @@ Page({
         list: [],
         dialog: { title: '详细信息', show: false, type: '1' },
         info: {},
+        form: {},
+        statusList: race_status
     },
     // 跳转菜单
     back(e) {
@@ -19,9 +22,62 @@ Page({
     toView: async function (e) {
         const that = this;
         const { item } = e.currentTarget.dataset;
+        if (item.winner) {
+            const arr = await app.$get(`/newCourt/api/user/${item.winner}`);
+            if (arr.errcode == '0') {
+                item.winner_name = arr.data.name
+            }
+        }
         that.setData({ info: item })
         that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
     },
+    // 更换场地
+    toChange: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '您是否确定要更换场地吗?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$post(`/newCourt/api/eliminateRace/${item._id}`, { is_change: '1' });
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `更换场地完成`, icon: 'error', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+
+    },
+    // 赛事管理
+    toScore: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/newCourt/api/eliminateRace/${item._id}`);
+        if (arr.errcode == '0') { that.setData({ form: arr.data }) }
+        that.setData({ dialog: { title: '赛事管理', show: true, type: '2' } });
+    },
+    // 选择比赛状态
+    statusChange: function (e) {
+        const that = this;
+        let data = that.data.statusList[e.detail.value];
+        if (data) { that.setData({ 'form.status': data.value }) }
+    },
+    // 提交保存
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const arr = await app.$post(`/newCourt/api/eliminateRace/${params._id}`, params);
+        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;
@@ -54,9 +110,9 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async (res) => {
-                let info = { skip: 0, limit: 1000, referee_id: res.data.opneid || 'oH0y05QJCvBQQpoobbtHTkpL4z4I' };
+                let info = { skip: 0, limit: 1000, referee_id: res.data.openid, status: '2' };
                 // if (searchInfo && searchInfo.name) info.name = searchInfo.name;
-                const arr = await app.$get(`/newCourt/api/race`, { ...info });
+                const arr = await app.$get(`/newCourt/api/eliminateRace`, { ...info });
                 if (arr.errcode == '0') {
                     that.setData({ list: arr.data })
                 } else { wx.showToast({ title: `${res.errMsg}`, icon: 'fail', duration: 2000 }); }
@@ -66,7 +122,6 @@ Page({
             },
         });
     },
-
     /**
      * 生命周期函数--监听页面隐藏
      */

+ 36 - 0
pages/referee/eliminate.less

@@ -80,6 +80,7 @@
         }
     }
 }
+
 .dialog_one {
     margin: 10px 0 0 0;
 
@@ -103,4 +104,39 @@
             color: #000;
         }
     }
+}
+
+.dialog_two {
+    width: 80vw;
+
+    .content {
+        background-color: #ffffff;
+        border-bottom: 1px solid #cccccc;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        padding: 2vw;
+        width: 76vw;
+
+        .label {
+            width: 25vw;
+            text-align: left;
+            font-size: 14px;
+        }
+
+        .value {
+            width: 65vw;
+            text-align: right;
+            font-size: 14px;
+
+            textarea {
+                width: 65vw;
+            }
+        }
+    }
+
+    .btn {
+        margin: 2vw 0 0 0;
+        text-align: center;
+    }
 }

+ 61 - 2
pages/referee/eliminate.wxml

@@ -32,7 +32,8 @@
                         </view>
                         <view class="btn">
                             <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
-                            <button type="primary" size="mini">赛事比分</button>
+                            <button type="primary" size="mini" bindtap="toScore" data-item="{{item}}">赛事管理</button>
+                            <button type="primary" size="mini" bindtap="toChange" data-item="{{item}}" wx:if="{{item.score_one==16||item.score_two==16}}">更换场地</button>
                         </view>
                     </view>
                 </view>
@@ -85,7 +86,7 @@
             </view>
             <view class="one_1">
                 <text class="text">胜者:</text>
-                <text class="text1">{{info.winner||'暂无'}}</text>
+                <text class="text1">{{info.winner_name||'暂无'}}</text>
             </view>
             <view class="one_1">
                 <text class="text">比赛时间:</text>
@@ -96,5 +97,63 @@
                 <text class="text1">{{info.status=='0'?'已安排':info.status=='1'?'待开赛':info.status=='2'?'已开赛':info.status=='3'?'已结束':'暂无'}}</text>
             </view>
         </view>
+        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
+            <form catchsubmit="onSubmit">
+                <view class="content" style="display: none;">
+                    <view class="label">数据id</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">比赛状态</view>
+                    <view class="value">
+                        <picker bindchange="statusChange" name="status" value="{{form.status}}" range-key='label' range="{{statusList}}">
+                            <view class="input">{{form.status=='0'?'已安排':form.status=='1'?'待开赛':form.status=='2'?'已开赛':form.status=='3'?'已结束':'请选择'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='0'}}">
+                    <view class="label">选手一比分{{form.player_one_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='0'}}">
+                    <view class="label">选手二比分{{form.player_two_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='1'}}">
+                    <view class="label">选手二比分{{form.player_two_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='1'}}">
+                    <view class="label">选手一比分{{form.player_one_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">胜者</view>
+                    <view class="value">
+                        <radio-group name="winner">
+                            <label>
+                                <radio value="{{form.player_one}}" checked="{{form.player_one==form.winner?true:false}}" />{{form.player_one_name}}
+                            </label>
+                            <label>
+                                <radio value="{{form.player_two}}" checked="{{form.player_two==form.winner?true:false}}" />{{form.player_two_name}}
+                            </label>
+                        </radio-group>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" form-type="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
     </view>
 </e-dialog>

+ 29 - 0
pages/referee/eliminate.wxss

@@ -84,3 +84,32 @@
   font-size: 15px;
   color: #000;
 }
+.dialog_two {
+  width: 80vw;
+}
+.dialog_two .content {
+  background-color: #ffffff;
+  border-bottom: 1px solid #cccccc;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 2vw;
+  width: 76vw;
+}
+.dialog_two .content .label {
+  width: 25vw;
+  text-align: left;
+  font-size: 14px;
+}
+.dialog_two .content .value {
+  width: 65vw;
+  text-align: right;
+  font-size: 14px;
+}
+.dialog_two .content .value textarea {
+  width: 65vw;
+}
+.dialog_two .btn {
+  margin: 2vw 0 0 0;
+  text-align: center;
+}

+ 61 - 1
pages/referee/group.js

@@ -1,3 +1,4 @@
+import { race_status } from "../../utils/dict";
 const app = getApp()
 Page({
 
@@ -10,6 +11,8 @@ Page({
         list: [],
         dialog: { title: '详细信息', show: false, type: '1' },
         info: {},
+        form: {},
+        statusList: race_status
     },
     // 跳转菜单
     back(e) {
@@ -19,13 +22,70 @@ Page({
     toView: async function (e) {
         const that = this;
         const { item } = e.currentTarget.dataset;
+        if (item.winner) {
+            const arr = await app.$get(`/newCourt/api/user/${item.winner}`);
+            if (arr.errcode == '0') {
+                item.winner_name = arr.data.name
+            }
+        }
         that.setData({ info: item })
         that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
     },
+    // 更换场地
+    toChange: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '您是否确定要更换场地吗?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$post(`/newCourt/api/race/${item._id}`, { is_change: '1' });
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `更换场地完成`, icon: 'error', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+
+    },
+    // 赛事管理
+    toScore: async function (e) {
+        const that = this;
+        const { item } = e.currentTarget.dataset;
+        const arr = await app.$get(`/newCourt/api/race/${item._id}`);
+        if (arr.errcode == '0') { that.setData({ form: arr.data }) }
+        that.setData({ dialog: { title: '赛事管理', show: true, type: '2' } });
+    },
+    // 选择比赛状态
+    statusChange: function (e) {
+        const that = this;
+        let data = that.data.statusList[e.detail.value];
+        if (data) { that.setData({ 'form.status': data.value }) }
+    },
+    // 提交保存
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        const arr = await app.$post(`/newCourt/api/race/${params._id}`, params);
+        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({ info: {} })
+        that.setData({ form: {} })
         that.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
+        that.watchLogin();
     },
     /**
      * 生命周期函数--监听页面加载
@@ -54,7 +114,7 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async (res) => {
-                let info = { skip: 0, limit: 1000, referee_id: res.data.openid };
+                let info = { skip: 0, limit: 1000, referee_id: res.data.openid, status: '2' };
                 // if (searchInfo && searchInfo.name) info.name = searchInfo.name;
                 const arr = await app.$get(`/newCourt/api/race`, { ...info });
                 if (arr.errcode == '0') {

+ 34 - 0
pages/referee/group.less

@@ -104,4 +104,38 @@
             color: #000;
         }
     }
+}
+.dialog_two {
+    width: 80vw;
+
+    .content {
+        background-color: #ffffff;
+        border-bottom: 1px solid #cccccc;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        padding: 2vw;
+        width: 76vw;
+
+        .label {
+            width: 25vw;
+            text-align: left;
+            font-size: 14px;
+        }
+
+        .value {
+            width: 65vw;
+            text-align: right;
+            font-size: 14px;
+
+            textarea {
+                width: 65vw;
+            }
+        }
+    }
+
+    .btn {
+        margin: 2vw 0 0 0;
+        text-align: center;
+    }
 }

+ 61 - 2
pages/referee/group.wxml

@@ -32,7 +32,8 @@
                         </view>
                         <view class="btn">
                             <button type="primary" size="mini" bindtap="toView" data-item="{{item}}">详细信息</button>
-                            <button type="primary" size="mini">赛事比分</button>
+                            <button type="primary" size="mini" bindtap="toScore" data-item="{{item}}">赛事管理</button>
+                            <button type="primary" size="mini" bindtap="toChange" data-item="{{item}}" wx:if="{{item.score_one==16||item.score_two==16}}">更换场地</button>
                         </view>
                     </view>
                 </view>
@@ -85,7 +86,7 @@
             </view>
             <view class="one_1">
                 <text class="text">胜者:</text>
-                <text class="text1">{{info.winner||'暂无'}}</text>
+                <text class="text1">{{info.winner_name||'暂无'}}</text>
             </view>
             <view class="one_1">
                 <text class="text">比赛时间:</text>
@@ -96,5 +97,63 @@
                 <text class="text1">{{info.status=='0'?'已安排':info.status=='1'?'待开赛':info.status=='2'?'已开赛':info.status=='3'?'已结束':'暂无'}}</text>
             </view>
         </view>
+        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
+            <form catchsubmit="onSubmit">
+                <view class="content" style="display: none;">
+                    <view class="label">数据id</view>
+                    <view class="value">
+                        <input type="text" name="_id" value="{{form._id}}" placeholder="请输入数据id" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">比赛状态</view>
+                    <view class="value">
+                        <picker bindchange="statusChange" name="status" value="{{form.status}}" range-key='label' range="{{statusList}}">
+                            <view class="input">{{form.status=='0'?'已安排':form.status=='1'?'待开赛':form.status=='2'?'已开赛':form.status=='3'?'已结束':'请选择'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='0'}}">
+                    <view class="label">选手一比分{{form.player_one_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='0'}}">
+                    <view class="label">选手二比分{{form.player_two_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='1'}}">
+                    <view class="label">选手二比分{{form.player_two_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_two" maxlength="2" value="{{form.score_two}}" placeholder="请输入选手二比分" />
+                    </view>
+                </view>
+                <view class="content" wx:if="{{form.is_change=='1'}}">
+                    <view class="label">选手一比分{{form.player_one_name}}</view>
+                    <view class="value">
+                        <input type="number" name="score_one" maxlength="2" value="{{form.score_one}}" placeholder="请输入选手一比分" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">胜者</view>
+                    <view class="value">
+                        <radio-group name="winner">
+                            <label>
+                                <radio value="{{form.player_one}}" checked="{{form.player_one==form.winner?true:false}}" />{{form.player_one_name}}
+                            </label>
+                            <label>
+                                <radio value="{{form.player_two}}" checked="{{form.player_two==form.winner?true:false}}" />{{form.player_two_name}}
+                            </label>
+                        </radio-group>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" form-type="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
     </view>
 </e-dialog>

+ 29 - 0
pages/referee/group.wxss

@@ -84,3 +84,32 @@
   font-size: 15px;
   color: #000;
 }
+.dialog_two {
+  width: 80vw;
+}
+.dialog_two .content {
+  background-color: #ffffff;
+  border-bottom: 1px solid #cccccc;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 2vw;
+  width: 76vw;
+}
+.dialog_two .content .label {
+  width: 25vw;
+  text-align: left;
+  font-size: 14px;
+}
+.dialog_two .content .value {
+  width: 65vw;
+  text-align: right;
+  font-size: 14px;
+}
+.dialog_two .content .value textarea {
+  width: 65vw;
+}
+.dialog_two .btn {
+  margin: 2vw 0 0 0;
+  text-align: center;
+}

+ 1 - 1
pages/user/index.less

@@ -4,7 +4,7 @@
     .one {
         width: 92vw;
         margin: 0 0 2vw 0;
-        background-color: #cccccc;
+        background-color: #f1f1f1;
         padding: 2vw;
 
     }

+ 1 - 1
pages/user/index.wxss

@@ -4,7 +4,7 @@
 .main .one {
   width: 92vw;
   margin: 0 0 2vw 0;
-  background-color: #cccccc;
+  background-color: #f1f1f1;
   padding: 2vw;
 }
 .main .two {

+ 1 - 1
utils/httpUtil.js

@@ -1,4 +1,4 @@
-let serverUrl = "https://broadcast.waityou24.cn";//http://127.0.0.1:15000
+let serverUrl = "http://broadcast.waityou24.cn";//http://127.0.0.1:15000
 let wechatUrl = 'https://broadcast.waityou24.cn';
 
 const getDomain = (uri) => {