zs 3 tahun lalu
induk
melakukan
398142b148

+ 5 - 4
pages/add/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */
@@ -66,12 +65,14 @@ Page({
       }
     })
   },
+  //日期选择器
   bindDateChange3: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
       singledate: e.detail.value
     })
   },
+  //时间选择器
   bindTimeChange: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({
@@ -92,9 +93,11 @@ Page({
       date2: e.detail.value,
     })
   },
+  //返回
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
+  //跳转页面
   backup: function () {
     let form = this.data.form;
     var team_id = form.team_id;
@@ -108,15 +111,13 @@ Page({
     this.watchLogin();
     // 计算高度
     this.searchHeight()
-    
     var myObject = JSON.parse(decodeURIComponent(options.obj));
     let forms = {
       team_id: myObject.id,
       team_name: myObject.name,
       apply_time: '2022-03-22',
       apply_user: myObject.user,
-      apply_id: '1'
-      // apply_id: myObject.cid
+      apply_id: myObject.cid
     }
     this.setData({
       form: forms

+ 83 - 9
pages/administration/detail.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */
@@ -16,10 +15,13 @@ Page({
     infoHeight: '',
     list: [],
     lists: [],
+    from: [],
   },
+  //验证用户是否登录
   watchLogin: function () {
     var that = this;
-    let id = that.ids
+    let id = that.ids;
+    let ids = that.idjie;
     wx.getStorage({
       key: 'token',
       success: res => {
@@ -31,7 +33,7 @@ Page({
           success(res) {
             if (res.data.errcode == 0) {
               let datas = res.data.data
-              console.log('单', datas);
+              console.log('单解散', datas);
               that.setData({
                 list: datas,
               });
@@ -44,6 +46,27 @@ Page({
             }
           }
         })
+        //解散团队数据
+        wx.request({
+          url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + ids, //接口地址
+          method: 'get',
+          data: {},
+          success(res) {
+            console.log('resdis', res.data);
+            if (res.data.errcode == 0) {
+              let datas = res.data.data
+              that.setData({
+                from: datas,
+              });
+            } else {
+              wx.showToast({
+                title: res.data.errmsg,
+                icon: 'none',
+                duration: 2000
+              })
+            }
+          }
+        })
       },
       fail: res => {
         return wx.redirectTo({ url: '/pages/login/index', })
@@ -53,13 +76,55 @@ Page({
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
+  //点击驳回
   hui: function () {
-    wx.navigateBack({ url: '/pages/manage/index' })
+    var that = this;
+    let id = that.idjie
+    var from = that.data.from;
+    var team_id =from.team_id;
+    var team_name =from.team_name;
+    var create_user =from.create_user;
+    var create_id =from.create_id;
+    var apply_time =from.apply_time;
+    var resaon =from.resaon;
+    wx.request({
+      url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
+      method: 'post',
+      data: {
+        "id": id,
+        "team_id": team_id,
+        "team_name": team_name,
+        "create_user": create_user,
+        "create_id": create_id,
+        "apply_time": apply_time,
+        "resaon": resaon,
+        "status": "-1"
+      },
+      success(res) {
+        if (res.data.errcode == 0) {
+          wx.showToast({ title: `修改团队状态拒绝成功`, icon: 'success', duration: 2000 }) //创建成功提示
+          // return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
+        } else {
+          wx.showToast({
+            title: res.data.errmsg,
+            icon: 'none',
+            duration: 2000
+          })
+        }
+      }
+    })
   },
+  //点击通过
   out: function () {
     var that = this;
     let id = that.idjie
-    debugger
+    var from = that.data.from;
+    var team_id =from.team_id;
+    var team_name =from.team_name;
+    var create_user =from.create_user;
+    var create_id =from.create_id;
+    var apply_time =from.apply_time;
+    var resaon =from.resaon;
     wx.showModal({
       title: '',
       content: '是否确认解散团队',
@@ -67,12 +132,21 @@ Page({
         if (res.confirm) {
           wx.request({
             url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
-            method: 'DELETE',
-            data: '',
+            method: 'post',
+            data: {
+              "id": id,
+              "team_id": team_id,
+              "team_name": team_name,
+              "create_user": create_user,
+              "create_id": create_id,
+              "apply_time": apply_time,
+              "resaon": resaon,
+              "status": "1"
+            },
             success(res) {
               if (res.data.errcode == 0) {
-                wx.showToast({ title: `解散团队成功`, icon: 'success', duration: 2000 }) //创建成功提示
-                return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
+                wx.showToast({ title: `修改团队状态通过成功`, icon: 'success', duration: 2000 }) //创建成功提示
+                // return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
               } else {
                 wx.showToast({
                   title: res.data.errmsg,

+ 1 - 1
pages/administration/details.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */
@@ -16,6 +15,7 @@ Page({
     list: [],
     lists: [],
   },
+  //验证用户是否登录
   watchLogin: function () {
     var that = this;
     let id = that.ids

+ 0 - 1
pages/administration/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */

+ 1 - 4
pages/competition/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */
@@ -16,7 +15,6 @@ Page({
     date2: '2018-01-24',//默认结束时间 
     singledate: '2018-09-01',
     time: '12:01',
-
     // 赛制信息
     // 默认值
     szValue: [],
@@ -31,6 +29,7 @@ Page({
     // 赛制储存信息
     szList: [],
   },
+  //验证是否输入
   initValidate() {
     const rules = { name: { required: true }, match_time: { required: true, }, single_time: { required: true }, address: { required: true, }, format: { required: true } }
     // 验证字段的提示信息,若不传则调用默认的信息
@@ -162,8 +161,6 @@ Page({
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
-
-
   /**
    * 生命周期函数--监听页面加载
    */

+ 0 - 1
pages/home/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */

+ 0 - 1
pages/list/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */

+ 0 - 1
pages/login/index.js

@@ -2,7 +2,6 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */

+ 10 - 10
pages/manage/index.js

@@ -2,12 +2,11 @@
 import WxValidate from '../../utils/wxValidate'
 const app = getApp()
 Page({
-
   /**
    * 页面的初始数据
    */
   data: {
-    logo:'',
+    logo: '',
     ids: '',
     frameStyle: { useTop: true, name: '团队管理', leftArrow: true, useBar: false },
     // 主体高度
@@ -26,7 +25,7 @@ Page({
         var list = that.data.list;
         var match_id = that.ids;
         var match_name = list.name;
-        var match_time=list.match_time;
+        var match_time = list.match_time;
         wx.request({
           url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
           method: 'get',
@@ -38,7 +37,7 @@ Page({
           success(res) {
             if (res.data.errcode == 0) {
               let datasai = res.data.data
-              console.log('datasai',datasai);
+              console.log('datasai', datasai);
               that.setData({
                 listbisai: datasai,
               });
@@ -129,27 +128,28 @@ Page({
     wx.navigateBack({ url: '/pages/home/index' })
   },
   shen: function (e) {
-    let obj= e.currentTarget.dataset;
+    let obj = e.currentTarget.dataset;
     wx.navigateTo({
       url: '/pages/administration/detail?obj=' + decodeURIComponent(JSON.stringify(obj)),
     })
   },
   shens: function (e) {
-    let id= e.currentTarget.dataset.name;
+    let id = e.currentTarget.dataset.name;
     console.log(id);
     wx.navigateTo({
-      url: '/pages/administration/details?id='+id,
+      url: '/pages/administration/details?id=' + id,
     })
   },
-  out: function (e){
-    let id= e.currentTarget.dataset.name;
+  //点击通过
+  out: function (e) {
+    let id = e.currentTarget.dataset.name;
     wx.showModal({
       title: '',
       content: '是否确认解散团队',
       success(res) {
         if (res.confirm) {
           wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/`+id, //接口地址
+            url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
             method: 'DELETE',
             data: '',
             success(res) {

+ 1 - 0
pages/me/index.js

@@ -165,6 +165,7 @@ Page({
       }
     })
   },
+  //退出登录
   tui() {
     wx.showModal({
       title: '',

+ 1 - 1
pages/me/index.wxss

@@ -51,7 +51,7 @@
 .name {
   margin-top: 10px;
   float: left;
-  width: 17%;
+  width: 20%;
   font-size: 16px;
   font-weight: 600;
   text-align: center;

+ 0 - 3
pages/ranking/index.js

@@ -68,9 +68,6 @@ Page({
       key: 'token',
       success: res => {
         var that = this;
-        // var list = that.data.list;
-        // var match_id = that.ids;
-        // var match_name = list.name;
         wx.request({
           url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
           method: 'get',

+ 8 - 6
pages/team/apply.js

@@ -8,8 +8,8 @@ Page({
    * 页面的初始数据
    */
   data: {
-    user_id:'',
-    apply_time:'',
+    user_id: '',
+    apply_time: '',
     ids: '',
     src: '/image/adimges.jpg',
     src1: '/image/head1.png',
@@ -60,6 +60,7 @@ Page({
     let query = e.detail.detail;
     if (query) wx.redirectTo({ url: `/pages/${query}/index` })
   },
+  //点击申请加入
   add: function (e) {
     let obj = e.currentTarget.dataset;
     let forms = {
@@ -100,20 +101,21 @@ Page({
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
+  //点击退出团队
   out() {
     wx.showModal({
       title: '',
       content: '是否确认退出团队',
       success(res) {
         if (res.confirm) {
-          var team_id =this.data.list.id;
-          var user_id =this.data.user_id;
+          var team_id = this.data.list.id;
+          var user_id = this.data.user_id;
           wx.request({
             url: `${app.globalData.publicUrl}/courtAdmin/api/team/leaves`, //接口地址
             method: 'get',
             data: {
-              "team_id":team_id,
-              "user_id":user_id
+              "team_id": team_id,
+              "user_id": user_id
             },
             success(res) {
               if (res.data.errcode == 0) {

+ 1 - 1
pages/team/examine.wxml

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

+ 4 - 1
pages/team/examine.wxss

@@ -109,6 +109,9 @@
   background-color: #eeeeee;
   border-radius: 24.5px;
 }
+.thr-right{
+  margin-left: 3px;
+}
 
 .img {
   width: 100%;
@@ -146,7 +149,7 @@
 }
 
 .name {
-  margin-left: 10px;
+  text-align: center;
   font-size: 13px;
   color: #727272;
 }

+ 5 - 5
pages/team/index.js

@@ -7,7 +7,7 @@ Page({
    * 页面的初始数据
    */
   data: {
-    status:'',
+    status: '',
     src: '/image/team.png',
     frameStyle: { useTop: true, name: '我的团队', leftArrow: false, useBar: true },
     // 主体高度
@@ -19,15 +19,15 @@ Page({
     if (query) wx.redirectTo({ url: `/pages/${query}/index` })
   },
   tiao: function (e) {
-    let id= e.currentTarget.dataset.name;
+    let id = e.currentTarget.dataset.name;
     wx.navigateTo({
-      url: '/pages/team/examine?id='+id,
+      url: '/pages/team/examine?id=' + id,
     })
   },
   jump: function (e) {
-    let id= e.currentTarget.dataset.name;
+    let id = e.currentTarget.dataset.name;
     wx.navigateTo({
-      url: '/pages/team/apply?id='+id,
+      url: '/pages/team/apply?id=' + id,
     })
   },
   // 监听用户是否登录

+ 1 - 1
pages/team/index.wxml

@@ -23,7 +23,7 @@
           <view class="time"><text class="date">{{item.create_time}}创建</text></view>
         </view>
         <view class="right">
-          <button class="button" wx:if="{{status== 2}}" form-type="submit" bindtap="jump" data-name="{{item._id}}" >加入</button>
+          <button class="button" wx:if="{{type== 2}}" form-type="submit" bindtap="jump" data-name="{{item._id}}" >加入</button>
           <button class="button"  wx:if="{{status!= 2}}" bindtap="tiao" data-name="{{item._id}}">查看</button>
         </view>
       </view>

+ 2 - 1
pages/team/index.wxss

@@ -18,6 +18,7 @@
 .thr1 {
   position: absolute;
   top: 35%;
+  margin-top: 50%;
   width: 100%;
   text-align: center;
 }
@@ -28,7 +29,7 @@
 }
 .th1{
   position: absolute;
-  margin-top: 13%;
+  margin-top: 73%;
   text-align: center;
   font-weight: 500;
   width: 100%;