浏览代码

团队列表

zhaoxiaohai 2 年之前
父节点
当前提交
8841938992
共有 2 个文件被更改,包括 48 次插入1 次删除
  1. 47 0
      packageA/group/index.js
  2. 1 1
      packageA/group/index.wxml

+ 47 - 0
packageA/group/index.js

@@ -7,6 +7,43 @@ Page({
         copyTeams: [], //用来本地搜索
         keyword: "", //搜索关键字
     },
+    handelSubmit(userids) {
+        wx.showModal({
+            title: '提示',
+            content: '是否确认添加成员',
+            success: ({
+                confirm
+            }) => {
+                if (confirm) _Http.basic({
+                    "id": 20220930103601,
+                    "content": {
+                        "ownertable": this.data.ownertable,
+                        "ownerid": this.data.ownerid,
+                        userids
+                    }
+                }).then(res => {
+                    console.log("添加团队成员", res)
+                    if (res.msg != '成功') return wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    });
+                    this.getList();
+                    wx.showToast({
+                        title: '添加成功',
+                        icon: "none"
+                    })
+                    getCurrentPages().forEach(v => {
+                        switch (v.__route__) {
+                            case "packageA/setclient/detail":
+                                v.getGroup();
+                                break;
+                        }
+                    })
+                    setTimeout(wx.navigateBack, 300);
+                })
+            }
+        })
+    },
     onLoad(options) {
         if (options.item) {
             let item = JSON.parse(options.item);
@@ -25,6 +62,16 @@ Page({
             [`teams[${this.data.active}].team`]: list
         })
     },
+    toAdd() {
+        wx.navigateTo({
+            url: `/packageA/group/select?data=${
+              JSON.stringify({
+                ownertable:this.data.ownertable,
+                ownerid:this.data.ownerid
+              })
+          }`,
+        })
+    },
     /* 取消搜索 */
     cancelTheSearch() {
         this.setData({

+ 1 - 1
packageA/group/index.wxml

@@ -9,7 +9,7 @@
                 <input type="text" placeholder="搜索关键字" bindinput='onInput' value="{{keyword}}" />
                 <van-icon name="close" bindtap="cancelTheSearch" />
             </view>
-            <navigator url="#" class="add">
+            <navigator url="#" class="add" bindtap="toAdd">
                 <van-icon name="plus" />
             </navigator>
         </view>