let _Http = getApp().globalData.http, currency = require("../../../../../utils/currency"), CNY = num => currency(num, { symbol: "¥", precision: 2 }).format(); Component({ options: { addGlobalClass: true }, properties: { }, lifetimes: { attached: function () { this.getDetail() }, }, data: { }, methods: { getDetail() { _Http.basic({ id: "20230729103203", "content": { "datetype": "日", date: Date.now(), "where": { "begindate": "", "enddate": "" } }, }).then(res => { console.log("获取本日回款信息", res) if (res.msg == '成功') { let sell = res.data.find(v => v.type == '订货额'), returnedMoney = res.data.find(v => v.type == '回款'); sell.value = CNY(sell.currentData) sell.label = "今日销售" returnedMoney.value = CNY(returnedMoney.currentData) returnedMoney.label = "今日回款" this.setData({ sell, returnedMoney }) } }) } } })