import api from '../../api/api' Page({ data: { param: { "id": "20220920083901", "content": { nocache: true, "pageSize": 20, "pageNumber": 1, "where": { "condition": "", type: 17 } } }, list: [] }, 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('没有更多了!') } }, onSubmit(data) { this.data.param.content.where.condition = data.detail.value this.setData({ list: [] }) this.data.param.content.pageNumber = 1 this.listData() }, onClick(data) { let item = data.currentTarget.dataset.item let form = getApp().globalData.formData let index = form.data.formLayoutData.formInfo.findIndex(v => v.label == '经销商'); if (index == -1) { form.data.formLayoutData.formInfo.unshift({ label: '经销商', //标题 type: 'cell', //表单类型 text,upload,picker,datepicker id: 'enterprisename', //表单id placeholder: '', //设置文本框默认提示 inputValue: item.enterprisename, data: [], //填充表单的数据 例如下拉框 role: { type: 'reg', }, force: false, //是否必输入 }) } else { form.data.formLayoutData.formInfo[index].inputValue = item.enterprisename; } form.data.formLayoutData.formInfo.forEach(e => { if (e.id === 'sys_enterpriseid') { e.inputValue = item.sys_enterpriseid } }) form.setData({ formLayoutData: form.data.formLayoutData }) wx.navigateBack({ delta: 0 }) }, 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() }, })