withdrawalNote.js 1.82 KB
// import MineApi from '~/api/mineApi/index'
Page({
  data: {
    STATUSICON: ['waiteing', 'comlpete', 'fail', 'ht'],
    STATUSTEXT: ['处理中', '提现成功', '提现失败', '后台核销'],
    pageSize: 9999,
    pageNum: 1,
    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) {}
    })
  },

  onLoad(options) {
    this.getScoreWithdrawalPage()
  },

  getScoreWithdrawalPage() {
    const {
      phone,
      channelSource,
      merchantId
    } = wx.p.storage.get('userInfo'), {
      pageNum,
      pageSize
    } = this.data;
    wx.p.api.withdrawalApi.getScoreWithdrawalPage({
      staffPhone:phone,
      channelSource,
      merchantId,
      // staffPhone: 15626599735,
      // channelSource: 1,
      pageNum,
      pageSize
    }).then(res => {
      console.log(res)
      if (res.code == 0) {
        res.data.list.map((item)=>{
         item.list.map(item2 => {
            if (item2.status == 3) {
              item2.iconType = 1
            } else if (item2.status == 4) {
              item2.iconType = 2
            } else {
              item2.iconType = 0
            }
            if (item2.type == 2) {
              item2.iconType = 3
            }
            if (item2.type == 3 && item2.bankNumber) {
              item2.bankNumber = item2.bankNumber.replace(/^(?:\d+)(.{4})$/, '**** **** **** $1')
            }
            return item2
          })
        })
      
      }

      // }
      let flag = res.data.list.length ? false : true
      this.setData({
        listData: res.data.list || [],
        isNoResult: flag
      })
    })
  }
})