zs 2 anni fa
parent
commit
f5583d6eab

+ 5 - 5
pagesMy/team/index.js

@@ -34,19 +34,19 @@ Page({
      * 生命周期函数--监听页面加载
      */
     async onLoad(options) {
-        const that = this;
-        wx.showLoading({ title: '加载中', mask: true })
-        await that.searchUser()
-        await that.searchOther()
-        wx.hideLoading()
+
     },
     /**
     * 生命周期函数--监听页面显示
     */
     async onShow() {
         const that = this;
+        wx.showLoading({ title: '加载中', mask: true })
+        await that.searchUser()
+        await that.searchOther()
         await that.clearPage()
         await that.search()
+        wx.hideLoading()
     },
     async searchUser() {
         const that = this;

+ 10 - 2
pagesMy/teamCreate/index.js

@@ -40,11 +40,19 @@ Page({
             if (!res) {
                 memberList.push(data)
                 that.setData({ memberList })
-                const list = memberList.map(i => { return i.name })
-                that.setData({ member: list.join(',') })
+                that.setData({ member: data.name })
             }
         }
     },
+    // 删除成员
+    async toDel(e) {
+        const that = this;
+        let res = e.currentTarget.dataset.item
+        if (res) {
+            let memberList = that.data.memberList.filter(i => i._id != res._id);
+            that.setData({ memberList })
+        }
+    },
     //日期选择器
     bindDateChange: function (e) {
         const that = this;

+ 14 - 1
pagesMy/teamCreate/index.wxml

@@ -60,7 +60,7 @@
                 </view>
                 <view class="info_1">
                     <view class="label">
-                        团队成员:
+                        团队成员选择
                     </view>
                     <view class="value">
                         <picker bindchange="userChange" value="{{member}}" range="{{userList}}" range-key='name'>
@@ -70,6 +70,19 @@
                         </picker>
                     </view>
                 </view>
+                <view class="info_1">
+                    <view class="label">
+                        团队成员:
+                    </view>
+                    <view class="value">
+                        <view class="list">
+                            <view wx:for="{{memberList}}" wx:key="index" wx:for-item="item" class="name">
+                                <view>{{item.name}}</view>
+                                <icon class="icon-small icon" type="cancel" size="18" data-item="{{item}}" bindtap="toDel"></icon>
+                            </view>
+                        </view>
+                    </view>
+                </view>
                 <view class="info_1">
                     <view class="label">
                         团队Logo:

+ 14 - 0
pagesMy/teamCreate/index.wxss

@@ -33,6 +33,20 @@
     overflow: hidden;
 }
 
+.main .one .info .info_1 .value .list {
+    display: flex;
+    flex-wrap: wrap;
+}
+
+.main .one .info .info_1 .value .list .name {
+    display: flex;
+    align-items: center;
+    border: 1px solid var(--rgb8b8);
+    margin: 0 10rpx 0 0;
+    padding: 5rpx 8rpx;
+    border-radius: 15rpx;
+}
+
 .main .one .btn {
     display: flex;
     align-items: center;