123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- const _Http = getApp().globalData.http;
- Page({
- data: {
- ownertable: null,
- ownerid: null,
- active: 0,
- copyTeams: [], //用来本地搜索
- keyword: "", //搜索关键字
- },
- onLoad(options) {
- if (options.item) {
- let item = JSON.parse(options.item);
- this.setData({
- ...item
- });
- this.getList()
- }
- },
- onInput({
- detail
- }) {
- let list = this.data.copyTeams[this.data.active];
- if (detail.value) list = list.filter(v => v.position.includes(detail.value) || v.name.includes(detail.value));
- this.setData({
- [`teams[${this.data.active}].team`]: list
- })
- },
- /* 取消搜索 */
- cancelTheSearch() {
- this.setData({
- keyword: "",
- [`teams[${this.data.active}].team`]: this.data.copyTeams[this.data.active]
- })
- },
- /* 切换tabs */
- onChange({
- detail
- }) {
- this.setData({
- active: detail.index
- })
- },
- //获取列表
- 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"
- })
- this.setData({
- teams: res.data,
- copyTeams: res.data.map(v => v.team)
- })
- })
- },
- onReachBottom() {
- this.getList();
- }
- })
|