withdrawalNote.js 1.24 KB
import {
  IMG_URL
} from '~/utils/constantData'
import MineApi from '~/api/mineApi/index'
Page({
  data: {
    IMGURL: IMG_URL,
    STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
    listData: [],
    isNoResult: false
  },
  toastError(e){
    const {
      reason
    } = e.currentTarget.dataset
    // wx.$api.showToast(reason);
    wx.showModal({
      title: '',
      content:String(reason) ,
      showCancel: false,
      confirmText: '我知道了',
      confirmColor: '#1B233D',
      success(res) {
      }
    })
  },

  onRoute(options) {
    MineApi.getWithdrawalListApi().then(res => {
      if (res && res.length) {
        res.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.length ? false : true
      this.setData({
        listData: res || [],
        isNoResult: flag
      })
    })
  }


})