123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- const _Http = getApp().globalData.http;
- Component({
- properties: {
- add: Boolean, //是否允许新增
- ownertable: String,
- ownerid: String
- },
- data: {
- list: [],
- },
- methods: {
- getList() {
- _Http.basic({
- "id": 20220930103501,
- "content": {
- ownertable: this.data.ownertable,
- ownerid: this.data.ownerid
- }
- }).then(res => {
- console.log("团队列表", res)
- if (res.msg != '成功') return wx.showToast({
- title: res.data,
- icon: "none"
- });
- if (res.data.length == 0) return;
- let list = res.data.map(v => v.team);
- const newArr = function (arr) {
- return arr.reduce((pre, cur) => pre.concat(Array.isArray(cur) ? newArr(cur) : cur), [])
- }
- list = newArr(list).slice(0, 5);
- this.setData({
- list
- })
- });
- },
- addUser() {
- wx.navigateTo({
- url: '/packageA/group/index?item=' + JSON.stringify({
- ownertable: this.data.ownertable,
- ownerid: this.data.ownerid
- })
- })
- },
- }
- })
|