let _Http = getApp().globalData.http,
  content = {
    pageNumber: 1,
    pageTotal: 1,
    pageSize: 10,
    "where": {
      "condition": "",
      "status": "",
      isnotxinjian: 1
    }
  },
  currency = require("../../../../../utils/currency"),
  CNY = value => currency(value, {
    symbol: "",
    precision: 2
  }).format();

Component({
  lifetimes: {
    attached: function () {
      this.getList(true)
    },
  },
  data: {
    list: []
  },
  methods: {
    getList(init = false) {
      if (init) {
        content.pageNumber = 1;
        content.pageTotal = 1;
      }
      if (content.pageNumber > content.pageTotal) return;
      _Http.basic({
        "id": 20231025160203,
        content
      }).then(res => {
        console.log("获取最新订单", res)
        if (res.msg != '成功') return;
        let list = res.data.map(v => {
          return {
            agentnum: v.agentnum,
            amount: CNY(v.amount),
            billdate: v.billdate,
            sonum: v.sonum,
            status: v.status,
            qty: v.qty
          }
        });
        this.setData({
          list: res.pageNumber == 1 ? list : this.data.list.concat(list)
        });
        content.pageNumber = res.pageNumber + 1;
        content.pageTotal = res.pageTotal;
      })
    }
  }
})