const _Http = getApp().globalData.http, currency = require("../../../../utils/currency"); let CNY = num => currency(num, { symbol: "¥", precision: 2 }).format(); Component({ data: { content: { nocache: true, pageNumber: 1, pageTotal: 1, total: null } }, methods: { /* 获取产品列表 */ getList(id, init) { let content = this.data.content; this.data.st_stockbillid = id; content.st_stockbillid = id || this.data.st_stockbillid; if (init) content.pageNumber = 1; _Http.basic({ "id": "20230719154303", content }).then(res => { console.log("产品信息列表", res) if (res.msg != '成功') return wx.showToast({ title: res.msg, icon: "none" }) res.data = res.data.map(v => { v.sum = CNY(v.sum) v.amount = CNY(v.amount) v.price = CNY(v.price) return v }) this.setData({ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data), "content.pageNumber": res.pageNumber + 1, "content.pageSize": res.pageSize, "content.pageTotal": res.pageTotal, "content.total": res.total, }) }) }, } })