Browse Source

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

YY 3 years ago
parent
commit
803064bbaa

+ 1 - 3
pages/administration/compete.js

@@ -14,7 +14,6 @@ Page({
     // 主体高度
     // 主体高度
     infoHeight: '',
     infoHeight: '',
     teamlist: [],
     teamlist: [],
-    from: [],
   },
   },
   back: function () {
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
     wx.navigateBack({ url: '/pages/home/index' })
@@ -111,9 +110,8 @@ Page({
           data: '',
           data: '',
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                teamlist: datas,
+                teamlist: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({

+ 1 - 1
pages/administration/compete.wxml

@@ -45,7 +45,7 @@
           <view class="thr-left">
           <view class="thr-left">
             <image class="img" src="{{item.icon[0].url}}"></image>
             <image class="img" src="{{item.icon[0].url}}"></image>
           </view>
           </view>
-          <view class="thr-right"><text class="name">{{item.nickname}}</text> </view>
+          <view class="thr-right textOver"><text class="name">{{item.nickname}}</text> </view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>

+ 1 - 1
pages/administration/compete.wxss

@@ -152,7 +152,7 @@
 }
 }
 
 
 .name {
 .name {
-  margin-left: 5px;
+  text-align: center;
   font-size: 13px;
   font-size: 13px;
   color: #727272;
   color: #727272;
 }
 }

+ 3 - 5
pages/administration/detail.js

@@ -14,7 +14,7 @@ Page({
     // 主体高度
     // 主体高度
     infoHeight: '',
     infoHeight: '',
     teamlist: [],
     teamlist: [],
-    from: [],
+    form: [],
   },
   },
   back: function () {
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
     wx.navigateBack({ url: '/pages/home/index' })
@@ -113,9 +113,8 @@ Page({
           data: '',
           data: '',
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                teamlist: datas,
+                teamlist: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({
@@ -133,9 +132,8 @@ Page({
           data: {},
           data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                from: datas,
+                form: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({

+ 3 - 3
pages/administration/detail.wxml

@@ -45,16 +45,16 @@
           <view class="thr-left">
           <view class="thr-left">
             <image class="img" src="{{item.icon[0].url}}"></image>
             <image class="img" src="{{item.icon[0].url}}"></image>
           </view>
           </view>
-          <view class="thr-right"><text class="name">{{item.nickname}}</text> </view>
+          <view class="thr-right textOver"><text class="name">{{item.nickname}}</text> </view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
     <view class="four">
     <view class="four">
       <view class="four-1">
       <view class="four-1">
-        <view class="four1" wx:if="{{from.status=='0'}}">
+        <view class="four1" wx:if="{{form.status=='0'}}">
           <button class="button" bindtap="hui">驳回</button>
           <button class="button" bindtap="hui">驳回</button>
         </view>
         </view>
-        <view class="four2" wx:if="{{from.status=='0'}}">
+        <view class="four2" wx:if="{{form.status=='0'}}">
           <button class="buttons" data-name="{{teamlist._id}}" bindtap='out'>通过</button>
           <button class="buttons" data-name="{{teamlist._id}}" bindtap='out'>通过</button>
         </view>
         </view>
       </view>
       </view>

+ 1 - 1
pages/administration/detail.wxss

@@ -152,7 +152,7 @@
 }
 }
 
 
 .name {
 .name {
-  margin-left: 5px;
+  text-align: center;
   font-size: 13px;
   font-size: 13px;
   color: #727272;
   color: #727272;
 }
 }

+ 1 - 2
pages/administration/details.js

@@ -40,9 +40,8 @@ Page({
           data: '',
           data: '',
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                teamlist: datas,
+                teamlist: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({

+ 1 - 1
pages/administration/details.wxml

@@ -45,7 +45,7 @@
           <view class="thr-left">
           <view class="thr-left">
             <image class="img" src="{{item.icon[0].url}}"></image>
             <image class="img" src="{{item.icon[0].url}}"></image>
           </view>
           </view>
-          <view class="thr-right"><text class="name">{{item.nickname}}</text> </view>
+          <view class="thr-right textOver"><text class="name">{{item.nickname}}</text> </view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>

+ 1 - 1
pages/administration/details.wxss

@@ -152,7 +152,7 @@
 }
 }
 
 
 .name {
 .name {
-  margin-left: 5px;
+  text-align: center;
   font-size: 13px;
   font-size: 13px;
   color: #727272;
   color: #727272;
 }
 }

+ 22 - 22
pages/competition/index.js

@@ -1,5 +1,6 @@
 // pages/login/login.js
 // pages/login/login.js
 import WxValidate from '../../utils/wxValidate'
 import WxValidate from '../../utils/wxValidate'
+const moment = require("../../utils/moment.min")
 const app = getApp()
 const app = getApp()
 Page({
 Page({
   /**
   /**
@@ -9,12 +10,12 @@ Page({
     frameStyle: { useTop: true, name: '创建比赛', leftArrow: true, useBar: false },
     frameStyle: { useTop: true, name: '创建比赛', leftArrow: true, useBar: false },
     // 主体高度
     // 主体高度
     infoHeight: '',
     infoHeight: '',
-    names: '',
-    address: '',
-    date: '2022-01-01',//默认起始时间  
-    date2: '2022-01-24',//默认结束时间 
-    singledate: '2022-01-01',
-    time: '12:01',
+    form:{
+      date: '2022-04-11',//默认起始时间  
+      date2: '2022-04-24',//默认结束时间 
+      singledate: '2022-04-11',
+      time: '12:01',
+    },
     // 赛制信息
     // 赛制信息
     // 默认值
     // 默认值
     szValue: [],
     szValue: [],
@@ -39,14 +40,6 @@ Page({
   back: function () {
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
     wx.navigateBack({ url: '/pages/home/index' })
   },
   },
-  //比赛名称改变值
-  onChangenames(e) {
-    this.data.names = e.detail
-  },
-  //地点改变值
-  onChangeaddress(e) {
-    this.data.address = e.detail
-  },
   // 确定选择
   // 确定选择
   szChange: function (e) {
   szChange: function (e) {
     const that = this;
     const that = this;
@@ -82,34 +75,35 @@ Page({
   //日期选择器
   //日期选择器
   bindDateChange3: function (e) {
   bindDateChange3: function (e) {
     this.setData({
     this.setData({
-      singledate: e.detail.value
+      ['form.singledate']: e.detail.value
     })
     })
   },
   },
   //时间选择器
   //时间选择器
   bindTimeChange: function (e) {
   bindTimeChange: function (e) {
     this.setData({
     this.setData({
-      time: e.detail.value
+      ['form.time']: e.detail.value
     })
     })
   },
   },
   // 时间段选择  
   // 时间段选择  
   bindDateChange(e) {
   bindDateChange(e) {
     let that = this;
     let that = this;
     that.setData({
     that.setData({
-      date: e.detail.value,
+      ['form.date']: e.detail.value,
     })
     })
   },
   },
   bindDateChange2(e) {
   bindDateChange2(e) {
     let that = this;
     let that = this;
     that.setData({
     that.setData({
-      date2: e.detail.value,
+      ['form.date2']: e.detail.value,
     })
     })
   },
   },
   // 提交创建
   // 提交创建
   onSubmit: function (e) {
   onSubmit: function (e) {
-    var name = this.data.names;
-    var match_time = this.data.date + ' - ' + this.data.date2;
-    var single_time = this.data.singledate + ' ' + this.data.time;
-    var address = this.data.address;
+    const param = e.detail.value;
+    var name = param.names;
+    var match_time = param.date + ' - ' + param.date2;
+    var single_time = param.singledate + ' ' + param.time;
+    var address = param.address;
     var format = this.data.szList;
     var format = this.data.szList;
     const params = {
     const params = {
       "name": name,
       "name": name,
@@ -146,6 +140,12 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    //获取当前时间
+    let date = moment().format('YYYY-MM-DD');
+    this.setData({
+      ['form.date']: date,
+      ['form.singledate']: date
+    });
     //验证规则函数
     //验证规则函数
     this.initValidate();
     this.initValidate();
     // 计算高度
     // 计算高度

+ 64 - 54
pages/competition/index.wxml

@@ -1,67 +1,77 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
   <view slot="info" class="main" style="height:{{infoHeight}}px;">
   <view slot="info" class="main" style="height:{{infoHeight}}px;">
     <view class="page">
     <view class="page">
-      <view class="name">
-        <van-cell-group>
-          <van-field value="{{ names }}" bind:change="onChangenames" label="比赛名称" placeholder="请输入比赛名称" input-align="right" />
-        </van-cell-group>
-      </view>
-      <view class="page1"><text>时间</text></view>
-      <view class="picker_group">
-        <picker mode="date" value="{{date}}" end="{{date2}}" bindchange="bindDateChange">
-          <view class="picker">
-            {{date}}
+      <form bindsubmit="onSubmit">
+        <view class="content">
+          <view class="page1"><text>比赛名称</text></view>
+          <view class="input">
+            <input name="names" value="{{form.names}}" maxlength="11" placeholder="请输入比赛名称"></input>
           </view>
           </view>
-        </picker>
-        <text>—</text>
-        <picker mode="date" value="{{date2}}" start="{{date}}" end="2050-01-01" bindchange="bindDateChange2">
-          <view class="picker">
-            {{date2}}
+        </view>
+        <view class="content">
+          <view class="page1"><text>时间</text></view>
+          <view class="picker_group">
+            <picker name="date" mode="date" value="{{form.date}}" end="{{form.date2}}" bindchange="bindDateChange">
+              <view class="picker">
+                {{form.date}}
+              </view>
+            </picker>
+            <text>—</text>
+            <picker name="date2" mode="date" value="{{form.date2}}" start="{{form.date}}" end="2050-01-01" bindchange="bindDateChange2">
+              <view class="picker">
+                {{form.date2}}
+              </view>
+            </picker>
           </view>
           </view>
-        </picker>
-      </view>
-      <view class="section">
-        <view class="section__title">单场时间</view>
-        <picker mode="date" value="{{singledate}}" start="2018-09-01" end="2150-09-01" bindchange="bindDateChange3">
-          <view class="picker1">
-            {{singledate}}
+        </view>
+        <view class="content">
+          <view class="section">
+            <view class="section__title">单场时间</view>
+            <picker name="singledate" mode="date" value="{{form.singledate}}" start="2018-09-01" end="2150-09-01" bindchange="bindDateChange3">
+              <view class="picker1">
+                {{form.singledate}}
+              </view>
+            </picker>
+            <picker name="time" mode="time" value="{{form.time}}" start="00:00" end="24:00" bindchange="bindTimeChange">
+              <view class="picker2">
+                {{form.time}}
+              </view>
+            </picker>
           </view>
           </view>
-        </picker>
-        <picker mode="time" value="{{time}}" start="00:00" end="24:00" bindchange="bindTimeChange">
-          <view class="picker2">
-            {{time}}
+        </view>
+        <view class="content contents">
+          <view class="page1"><text>地点</text></view>
+          <view class="input">
+            <input name="address" value="{{form.address}}" maxlength="11" placeholder="请输入地点"></input>
           </view>
           </view>
-        </picker>
-      </view>
-      <view class="adress">
-        <van-cell-group>
-          <van-field value="{{ address }}" bind:change="onChangeaddress" label="地点" placeholder="请输入地点" input-align="right" />
-        </van-cell-group>
-      </view>
-      <view class="multone">
-        <view class="mult1">
-          <view class="mult">选择赛制</view>
-          <picker mode="multiSelector" bindchange="szChange" bindcolumnchange="columnChange" value="{{szValue}}" range="{{valueList}}">
-            <view class="mults">{{szValue.length>0?szValue:'请选择'}}</view>
-          </picker>
         </view>
         </view>
-      </view>
-      <view class="multone">
-        <view class="mult1" wx:for="{{szList}}" wx:key="item">
-          <view class="mult00">赛制</view>
-          <view class="mult88">
-            <text>{{item.type}}-{{item.name}}</text>
-            <text class=" icon iconfont icon-jianhao" bindtap="toDel" data-index="{{index}}"></text>
+        <view class="content">
+          <view class="multone">
+            <view class="mult1">
+              <view class="mult">选择赛制</view>
+              <picker mode="multiSelector" bindchange="szChange" bindcolumnchange="columnChange" value="{{szValue}}" range="{{valueList}}">
+                <view class="mults">{{szValue.length>0?szValue:'请选择'}}</view>
+              </picker>
+            </view>
           </view>
           </view>
         </view>
         </view>
-      </view>
-      <view>
-      </view>
-    </view>
-    <view class="team">
-      <view class="two">
-        <button class="button" bindtap="onSubmit">创建比赛</button>
-      </view>
+        <view class="content">
+          <view class="multone">
+            <view class="mult1" wx:for="{{szList}}" wx:key="item">
+              <view class="mult00">赛制</view>
+              <view class="mult88" >
+                <text>{{item.type}}-{{item.name}}</text>
+                <text class=" icon iconfont icon-jianhao" bindtap="toDel" data-index="{{index}}"></text>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="team">
+          <view class="two">
+            <button class="button" size="mini" form-type="submit">创建比赛</button>
+          </view>
+        </view>
+      </form>
     </view>
     </view>
   </view>
   </view>
 </mobile-main>
 </mobile-main>

+ 16 - 8
pages/competition/index.wxss

@@ -12,6 +12,13 @@
   background-color: white;
   background-color: white;
   font-weight: 500;
   font-weight: 500;
 }
 }
+.input{
+  background-color: white;
+  height: 80rpx;
+  line-height: 80rpx;
+  text-align: right;
+  font-size: 14px;
+}
 
 
 /* 日期选择 */
 /* 日期选择 */
 .picker_group {
 .picker_group {
@@ -37,20 +44,22 @@
   color: #000 !important;
   color: #000 !important;
 }
 }
 
 
-.adress {
-  font-size: 14px;
-  font-weight: 600;
+.content {
+  border-bottom: 1px solid #f1f1;
 }
 }
-.name {
-  font-size: 14px;
-  font-weight: 600;
+.contents{
+  padding-bottom: 1px;
 }
 }
 
 
+.page .content input {
+  font-size: 14px;
+  padding-top: 3%;
+  padding-right: 4%;
+}
 .section {
 .section {
   font-size: 14px;
   font-size: 14px;
   font-weight: 500;
   font-weight: 500;
   width: 96%;
   width: 96%;
-  margin-top: 0.8px;
   padding-left: 13px;
   padding-left: 13px;
   line-height: 80rpx;
   line-height: 80rpx;
   background-color: white;
   background-color: white;
@@ -128,7 +137,6 @@
 }
 }
 
 
 .multone {
 .multone {
-  margin-bottom: 1.8px;
   font-size: 14px;
   font-size: 14px;
 }
 }
 
 

+ 5 - 8
pages/manage/index.js

@@ -80,7 +80,7 @@ Page({
           wx.request({
           wx.request({
             url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
             url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
             method: 'DELETE',
             method: 'DELETE',
-            data: '',
+            data: {},
             success(res) {
             success(res) {
               if (res.data.errcode == 0) {
               if (res.data.errcode == 0) {
                 wx.showToast({ title: `解散团队成功`, icon: 'success', duration: 2000 }) //创建成功提示
                 wx.showToast({ title: `解散团队成功`, icon: 'success', duration: 2000 }) //创建成功提示
@@ -120,9 +120,8 @@ Page({
           data: {},
           data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datasai = res.data.data
               that.setData({
               that.setData({
-                compete: datasai,
+                compete: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({
@@ -137,12 +136,11 @@ Page({
         wx.request({
         wx.request({
           url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
           url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
           method: 'get',
           method: 'get',
-          data: '',
+          data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                teamlist: datas,
+                teamlist: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({
@@ -160,9 +158,8 @@ Page({
           data: {},
           data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data
               that.setData({
               that.setData({
-                dissolution: datas,
+                dissolution: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({

+ 2 - 3
pages/ranking/index.js

@@ -34,12 +34,11 @@ Page({
         wx.request({
         wx.request({
           url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
           url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
           method: 'get',
           method: 'get',
-          data: '',
+          data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              let datacan = res.data.data
               that.setData({
               that.setData({
-                ranking: datacan,
+                ranking: res.data.data,
               });
               });
             } else {
             } else {
               wx.showToast({
               wx.showToast({