| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | const _Http = getApp().globalData.http;Page({    data: {        active: 1,        loading: true,        amount: 0,        "content": {            "isExport": 0,            "pageNumber": 1,            "pageTotal": 1,            "pageSize": 20,            total: 0,            "where": {                "condition": "",                "status": "",                "brandname": "",                "tradefield": ""            },            sort: []        },    },    onLoad(options) {        this.getList()    },    /* 获取产品 */    getList(init = false) {        if (init.detail != undefined) init = init.detail;        let content = this.data.content;        if (init) content.pageNumber = 1;        if (content.pageNumber > content.pageTotal) return;        _Http.basic({            "id": 20221224180302,            content        }).then(res => {            console.log("订单列表", res)            this.selectComponent('#ListBox').RefreshToComplete();            this.setData({                list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),                "content.pageNumber": res.pageNumber + 1,                "content.pageTotal": res.pageTotal,                "content.sort": res.sort,                "content.total": res.total,                loading: false,                amount: res.tips.amount || 0            })        })    },    /* 搜索 */    onSearch({        detail    }) {        this.setData({            "content.where.condition": detail        });        this.getList(true)    },    /* 切换tabs */    tabsChange(e) {        let status = "";        switch (e.detail.title) {            case '全部':                status = "";                break;            case '待确认':                status = "交期待确认";                break;            default:                status = e.detail.title                break;        }        this.setData({            active: e.detail.index,            "content.where.status": status        });        this.getList(true);    },    onReady() {        this.setListHeight()    },    /* 设置页面高度 */    setListHeight() {        this.selectComponent("#ListBox").setHeight(".tips", this);    },    add() {        wx.navigateTo({            url: '/packageA/orderForm/add',        })    },})
 |