瀏覽代碼

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

guhongwei 2 年之前
父節點
當前提交
e91698c9a4
共有 2 個文件被更改,包括 8 次插入25 次删除
  1. 6 11
      pagesMy/teamCreate/index.js
  2. 2 14
      pagesMy/teamCreate/index.wxml

+ 6 - 11
pagesMy/teamCreate/index.js

@@ -54,15 +54,10 @@ Page({
             that.setData({ memberList })
         }
     },
-    //日期选择器
+    //成立日期选择器
     bindDateChange: function (e) {
         const that = this;
-        that.setData({ "form.date": e.detail.value })
-    },
-    //时间选择器
-    bindTimeChange: function (e) {
-        const that = this;
-        that.setData({ "form.time": e.detail.value })
+        that.setData({ "form.create_time": e.detail.value })
     },
     // 提交保存
     async toSave(e) {
@@ -79,9 +74,6 @@ Page({
             parmas.member = that.data.memberList
             parmas.number = that.data.memberList.length.toString()
             parmas.logo = that.data.imgList
-            parmas.create_time = parmas.date + ' ' + parmas.time
-            delete parmas.date
-            delete parmas.time
             if (form._id) res = await app.$api(`team/${form._id}`, 'POST', parmas);
             else res = await app.$api('team', 'POST', parmas);
             if (res.errcode == '0') {
@@ -122,7 +114,10 @@ Page({
         if (res.errcode == '0') that.setData({ typeList: res.data })
         // 成员
         res = await app.$api('user', 'GET', { status: '1', type: '0' })
-        if (res.errcode == '0') that.setData({ userList: res.data })
+        if (res.errcode == '0') {
+            for (const val of res.data) if (!val.name) val.name = '暂无';
+            that.setData({ userList: res.data })
+        }
     },
     search() {
         const that = this;

+ 2 - 14
pagesMy/teamCreate/index.wxml

@@ -18,26 +18,14 @@
                         <input value="{{form.name}}" name="name" type="text" placeholder="" />
                     </view>
                 </view>
-                <view class="info_1">
-                    <view class="label">
-                        成立日期:
-                    </view>
-                    <view class="value">
-                        <picker mode="date" name="date" value="{{ form.date}}" start="2018-09-01" end="2150-09-01" bindchange="bindDateChange">
-                            <view class="picker">
-                                {{form.date}}
-                            </view>
-                        </picker>
-                    </view>
-                </view>
                 <view class="info_1">
                     <view class="label">
                         成立时间:
                     </view>
                     <view class="value">
-                        <picker mode="time" name="time" value="{{form.time}}" start="00:00" end="24:00" bindchange="bindTimeChange">
+                        <picker mode="date" name="create_time" value="{{form.create_time}}" start="2018-09-01" end="2150-09-01" bindchange="bindDateChange">
                             <view class="picker">
-                                {{form.time}}
+                                {{form.create_time}}
                             </view>
                         </picker>
                     </view>