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

    let res = [{
      "id": 16118,
      "wechatAvatarUrl": null,
      "wechatNickName": null,
      "withdrawalScore": 50995.46,
      "withdrawalTime": "2025-08-15 09:48",
      "successTime": null,
      "status": 4,
      "type": 3,
      "bankUserName": "望周知",
      "bankName": "中国邮政储蓄银行",
      "bankNumber": "6555555555555555555",
      "bankPhone": "18955555555",
      "idCardNo": "341181199508252222",
      "exportStatus": 0,
      "failReason": null,
      "source": 1
    }, {
      "id": 16067,
      "wechatAvatarUrl": null,
      "wechatNickName": null,
      "withdrawalScore": 32.00,
      "withdrawalTime": "2024-11-08 17:17",
      "successTime": "2024-11-08 17:25",
      "status": 3,
      "type": 3,
      "bankUserName": "姚孝章",
      "bankName": "招商银行",
      "bankNumber": "6214830050900165",
      "bankPhone": "13650810420",
      "idCardNo": "440582199609153643",
      "exportStatus": 0,
      "failReason": null,
      "source": 1
    }, {
      "id": 16066,
      "wechatAvatarUrl": null,
      "wechatNickName": null,
      "withdrawalScore": 30.50,
      "withdrawalTime": "2024-11-08 15:55",
      "successTime": null,
      "status": 2,
      "type": 3,
      "bankUserName": "姚孝章",
      "bankName": "招商银行",
      "bankNumber": "6214830050900165",
      "bankPhone": "13650810420",
      "idCardNo": "440582199609153643",
      "exportStatus": 0,
      "failReason": null,
      "source": 1
    }]
    console.log(2222)
    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
    })
    // })
  },

  getScoreWithdrawalPage() {
    const {
      staffPhone,
      channelSource
    } = wx.p.storage.get('userInfo'),
    {pageNum,pageSize}=this.data;
    wx.p.api.withdrawalApi.getScoreWithdrawalPage({
      staffPhone,
      channelSource,
      pageNum,
      pageSize
    }).then(res => {
      if (res.code == 0) {
        res.list.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.list.length ? false : true
      this.setData({
        listData: res.list || [],
        isNoResult: flag
      })
    })
  }
})