import api from '../api/api' Page({ data: { param: { "id": "20220923140602", "version": 1, "content": { "pageSize": 20, "pageNumber": 1, "where": { "condition": "", "isservice": 1 } } }, value: '', list: [], selection: [] }, search(data) { this.data.param.content.where.condition = data.detail.value this.data.list = [] this.data.param.content.pageNumber = 1 this.listData() }, clear() { this.data.param.content.where.condition = '' this.data.list = [] this.data.param.content.pageNumber = 1 }, async listData() { const res = await api._post(this.data.param) if (res.data.length > 0) { this.setData({ list: this.data.list.concat(res.data) }) } else { getApp().globalData.Language.showToast('没有更多了!') } }, handleGroupChange(event) { this.setData({ selection: event.detail.value, }); }, refresh() { this.setData({ selection: [] }) }, onConfirm() { let pages = getCurrentPages(); let prePage = pages[pages.length - 2]; let arr = [] this.data.selection.forEach(e => { this.data.list.forEach(item => { if (e == item.itemid) { arr.push(item) } }) }); prePage.getAdd(arr) wx.navigateBack() }, onLoad(options) { this.listData() this.setData({ loadingTexts: ['下拉刷新', '松手刷新', '正在刷新', '刷新完成'].map(v => getApp().globalData.Language.getMapText(v)) }) getApp().globalData.Language.getLanguagePackage(this, 'E-订单'); }, onPullDownRefresh() { this.data.list = [] this.data.param.content.pageNumber = 1 this.listData() }, onReachBottom() { this.data.param.content.pageNumber++ this.listData() }, })