kaqDetail.js 866 Bytes
Page({
  data: {},
  onLoad: function (options) {
    setTimeout(()=>{
      this.getOrderInfo(options.orderCode)
    },2*1000)
  },
  getOrderInfo(orderCode) {
    wx.p.wxApi.showLoading()
    wx.p.api.equityApi.orderDetailData({
      orderCode
    }).then(res => {
      wx.hideLoading();
      let richText = res.useNotes
      res.warrantyDate = res.warrantyDate ? new Date(res.warrantyDate).format('yyyy-MM-dd hh:mm:ss') : ''
      if (richText) {
        richText = decodeURIComponent(richText)
      }
      this.setData({
        order: res,
        richText
      })
    })
  },
  previewImage() {
    wx.p.wxApi.previewImage({
      current: this.data.order.qrcode,
      urls: [this.data.order.qrcode]
    })
  },
  setCopyData(e) {
    wx.p.wxApi.setCopyData(e.currentTarget.dataset.item, () => {
      wx.p.wxApi.showToast('复制成功')
    })
  }
})