index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { fetchOrderDetail } from '../../../services/order/orderDetail';
  2. Page({
  3. data: {
  4. invoice: {},
  5. },
  6. onLoad({ orderNo }) {
  7. this.orderNo = orderNo;
  8. this.init();
  9. },
  10. init() {
  11. this.getDetail();
  12. },
  13. getDetail() {
  14. const params = {
  15. parameter: this.orderNo,
  16. };
  17. return fetchOrderDetail(params).then((res) => {
  18. const order = res.data;
  19. const invoice = {
  20. buyerName: order?.invoiceVO?.buyerName, //个人或公司名称
  21. buyerTaxNo: order?.invoiceVO?.buyerTaxNo, //税号
  22. buyerPhone: order?.invoiceVO?.buyerPhone, //手机
  23. email: order?.invoiceVO?.email, //邮箱
  24. titleType: order?.invoiceVO?.titleType === 1 ? '个人' : '公司', //发票抬头 1-个人 2-公司
  25. ontentType: order?.invoiceVO?.ontentType === 1 ? '商品明细' : '2类别', //发票内容 1-明细 2类别
  26. invoiceType:
  27. order?.invoiceVO?.invoiceType === 5 ? '电子普通发票' : '不开发票', //是否开票 0-不开 5-电子发票
  28. isInvoice: order?.invoiceVO?.buyerName ? '已开票' : '未开票',
  29. money: order?.invoiceVO?.money,
  30. };
  31. this.setData({
  32. invoice,
  33. });
  34. });
  35. },
  36. });