YY 3 年之前
父節點
當前提交
5ee56f910a

+ 7 - 2
pages/createTeam/index.js

@@ -24,7 +24,7 @@ Page({
     },
     //验证必填项
     initValidate() {
-        const rules = { name: { required: true }, type: { required: true }, create_user: { required: true }, }
+        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)
@@ -102,6 +102,11 @@ Page({
     formSubmit: function (e) {
         const that = this;
         const value = e.detail.value;
+        let length = this.data.logo.length;
+        if (length == 0) {
+            value.rules = [{ logo: { required: true } }];
+            value.message = [{ logo: { required: '请上传团队Logo' } }]
+        }
         if (!this.WxValidate.checkForm(value)) {
             const error = this.WxValidate.errorList[0];
             wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
@@ -116,7 +121,7 @@ Page({
                 success: res => {
                     if (res.data.errcode == 0) {
                         wx.showToast({ title: '创建团队成功', icon: 'success', duration: 2000 })
-                        wx.redirectTo({ url: '/pages/me/index' })// 跳转页面
+                        wx.redirectTo({ url: '/pages/me/index' })
                     } else {
                         wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
                     }

+ 2 - 2
pages/createTeam/index.wxml

@@ -4,7 +4,7 @@
             <view class="form">
                 <view class="top">
                     <view class="zero">
-                        <view class="text">团队LOGO</view>
+                        <view class="text" >团队LOGO</view>
                         <upload class="tou" list="{{logo}}" count="{{1}}" bind:imgUpload="imgUpload" bind:imgDel="imgDel"></upload>
                     </view>
                     <view class="one">
@@ -30,7 +30,7 @@
                     </view>
                     <view class="one">
                         <view class="text">创建时间</view>
-                        <picker mode="date" name="create_time" value="{{form.create_time}}" start="2022-01-01" end="2100-01-01" bindchange="dataChange">
+                        <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||'选择时间'}}
                                 <image class="back" src="/image/back.png"></image>

+ 1 - 1
pages/me/index.js

@@ -117,7 +117,7 @@ Page({
         let type = res.data.data.type;
         let icon = res.data.data.icon[0];
         if (icon) this.setData({ icon: icon.url })
-        else this.setData({ icon: '/image/tou.png' });
+        else this.setData({ icon: '' });
         // 判断用户身份显示不同功能按钮
         let jump = btn.filter((i) => i.type.includes(type));
         if (jump) that.setData({ jumpList: jump });

+ 3 - 2
pages/me/index.wxml

@@ -90,7 +90,8 @@
         <view class="onther">
           <text class="tuan">我的团队</text>
           <text class="total" wx:if="{{item1.type=='2' || item1.type=='1'}}">共参加{{list.length||0}}个队伍</text>
-          <text class="chuang" bindtap="create" wx:if="{{list.length<1 && item1.type=='1'}}">创建团队</text>
+          <!-- <text class="chuang" bindtap="create" wx:if="{{list.length<1 && item1.type=='1'}}">创建团队</text> -->
+            <text class="chuang" bindtap="create">创建团队</text>
         </view>
         <view class="weui-cells mgt-0 {{!showMore? 'hiddenmore' : 'showmore'}}">
           <view wx:key="item" wx:for="{{list}}" wx:for-index="idx" wx:key="key" class="list3 {{idx>1 ? 'more-item' : ''}}">
@@ -101,7 +102,7 @@
               <view class="dui-right1 ">
                 <text class="group" bindtap="ToDetails" data-id="{{item._id}}">{{item.name}}</text>
               </view>
-              <button class="color{{item.type=='乒乓球'?'0':item.type=='篮球'?'1':'足球'}}" size="mini">{{item.type}}</button>
+              <button class="color{{item.type=='乒乓球'?'0':item.type=='篮球'?'1':'2'}}" size="mini">{{item.type}}</button>
             </view>
             <view class="dui-right"><text class="person">
                 共{{item.members.length||0}}人

+ 5 - 21
pages/me/index.wxss

@@ -41,7 +41,7 @@
   width: 93%;
   border-radius: 15px;
   background-color: #fff;
-  margin: -36px 0 0 12px;
+  margin: -36px 13px 0 ;
 }
 
 .button {
@@ -68,6 +68,7 @@
   height: 80px;
   margin-left: 66%;
   margin-top: -80px;
+  background: #ccc;
 }
 
 .text1 {
@@ -203,7 +204,7 @@
 }
 
 .four-zan {
-  margin: 10px 20px;
+  margin: 10px 17px;
   width: 91%;
   text-align: center;
   height: 70px;
@@ -321,7 +322,7 @@
 
 .five {
   position: relative;
-  margin: 13px 0 0 20px;
+  margin: 13px 20px 0;
   width: 90%;
   border-radius: 5px;
   background-color: #fff;
@@ -345,7 +346,7 @@
 .total {
   font-size: 13px;
   color: rgb(160, 160, 160);
-  margin-right: 85px;
+  margin-right: 65px;
 }
 
 .total1 {
@@ -513,23 +514,6 @@
   margin-bottom: 5px;
 }
 
-.six-3 {
-  float: left;
-  width: 24%;
-  margin-bottom: 5px;
-}
-
-.six-4 {
-
-  float: left;
-  width: 24%;
-}
-
-.six-5 {
-  margin-bottom: 5px;
-  float: left;
-  width: 24%;
-}
 
 
 .six-left {

+ 0 - 2
pages/teamDetails/detail.js

@@ -71,13 +71,11 @@ Page({
               error: err => {
               }
             })
-
           } else if (res.cancel) {
           }
         }
       })
     }
-
   },
   /**
    * 生命周期函数--监听页面加载

+ 1 - 1
pages/teamDetails/detail.wxml

@@ -46,7 +46,7 @@
             <image class="img" src="{{item.icon[0].url}}"></image>
             <image bindtap='delList' wx:if="{{type=='1'}}" data-id="{{item.id}}" class="two_jian" src="/image/jianshao.png"></image>
           </view>
-          <view class="thr-right"><text class="name textOver">{{item.nickname}}</text> </view>
+          <view class="thr-right textOver"><text class="name textOver">{{item.nickname}}</text> </view>
         </view>
       </view>
     </view>

+ 10 - 11
pages/teamDetails/detail.wxss

@@ -28,8 +28,8 @@
 
 .one-2 {
   position: absolute;
-  top: 18%;
-  left: 41%;
+  top: 17%;
+  left: 40%;
   width: 18%;
   height: 63.78px;
   border-radius: 50%;
@@ -37,15 +37,13 @@
 
 .one-3 {
   position: absolute;
-  top: 29%;
-  left: 37.5%;
-  width: 43%;
-  height: 63.78px;
+  top: 25%;
+  width: 100%;
 }
 
 .imgs {
   border-radius: 50%;
-  margin-top: 4px;
+  margin-top: -25px;
   margin-left: 2px;
   width: 70px;
   height: 70px;
@@ -110,10 +108,11 @@
   height: 49px;
   background-color: #eeeeee;
   border-radius: 24.5px;
+  margin: 0 10px;
 }
 
 .thr-right {
-  margin-left: 3px;
+  text-align: center;
 }
 
 .img {
@@ -174,12 +173,12 @@
 
 .group {
   color: #ffffff;
-  margin-top: 10%;
-  margin-bottom: 10%;
+  text-align: center;
+  margin: 10px 0;
 }
 
 .person {
-  margin-left: 20%;
+  text-align: center;
   font-size: 13px;
   color: #ffffff;
   font-weight: 300;