record.js 1.21 KB
import MineApi from '../../../api'
Page({
  data: {
    STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
    listData: [],
    isNoResult: true
  },
  toastError(e){
    const {
      reason
    } = e.currentTarget.dataset
    console.log(reason)
    // wx.$util.showToast(reason);
    wx.showModal({
      title: '',
      content:String(reason) ,
      showCancel: false,
      confirmText: '我知道了',
      confirmColor: '#1B233D',
      success(res) {
      }
    })
  },

  onRoute(options) {
    MineApi.getWithdrawalListApi().then(res => {
      if (res.code==0 && res.data) {
        res.data.map(item => {
          if (item.status == 3) {
            item.iconType = 1
          } else if (item.status == 4) {
            item.iconType = 2
          } else {
            item.iconType = 0
          }
          if (item.type == 2) {
            item.iconType = 3
          }
          if (item.type == 3 && item.bankNumber) {
            item.bankNumber = item.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
          }
          return item
        })
      }
      let flag = res.data.length ? false : true
      this.setData({
        listData: res.data || [],
        isNoResult: flag
      })
    })
  }


})