138 lines
2.5 KiB
JavaScript
138 lines
2.5 KiB
JavaScript
// pages/wallet/withdrawList.js
|
|
const app = getApp();
|
|
import { withdrawlList } from "../../utils/withdraw"
|
|
const http = require("../../utils/http");
|
|
|
|
const statusArr = [
|
|
{ code: 1, name: "待处理", color: 'w-2', label:'提现时间' , key:'created'},
|
|
{ code: 2, name: "交易处理中", color: 'w-2' ,label:'审核时间' ,key:'examineDate'},
|
|
{ code: 3, name: "交易成功", color: 'w-1',label:'到账时间' , key:'accountDate'},
|
|
{ code: 4, name: "交易失败", color: 'w-3' ,label:'审核时间' ,key:'examineDate'},
|
|
{ code: 5, name: "待审核", color: 'w-2' ,label:'提现时间', key:'created' },
|
|
{ code: 6, name: "审核未通过", color: 'w-3' ,label:'审核时间' ,key:'examineDate' }
|
|
]
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
picImg:http.picImg,
|
|
params: {
|
|
limit: 10,
|
|
page: 1,
|
|
},
|
|
total: '',
|
|
nomore: false,
|
|
listData: []
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
this.getList()
|
|
},
|
|
|
|
getList() {
|
|
let {
|
|
params,
|
|
listData,
|
|
} = this.data
|
|
withdrawlList({ userId: wx.getStorageSync("cooperation").id, ...params }).then(res => {
|
|
let {
|
|
data
|
|
} = res
|
|
if (data.list) {
|
|
data.list.forEach(item => {
|
|
item.color = statusArr.filter(os => os.code === item.state)[0]?.color
|
|
item.stateName = statusArr.filter(os => os.code === item.state)[0]?.name
|
|
item.label = statusArr.filter(os => os.code === item.state)[0]?.label
|
|
item.time = item[statusArr.filter(os => os.code === item.state)[0].key]
|
|
})
|
|
listData.push(...data.list)
|
|
}
|
|
this.setData({
|
|
listData,
|
|
total: data.size
|
|
})
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
let {
|
|
params,
|
|
total,
|
|
listData,
|
|
} = this.data
|
|
params.page = 1
|
|
total = 0
|
|
listData = []
|
|
this.setData({
|
|
params,
|
|
total,
|
|
listData
|
|
})
|
|
this.getList()
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
let {
|
|
params,
|
|
total,
|
|
listData,
|
|
} = this.data
|
|
if (listData.length < total) {
|
|
params.page = params.page + 1
|
|
this.setData({
|
|
params
|
|
})
|
|
this.getList()
|
|
} else {
|
|
this.setData({
|
|
nomore: true
|
|
})
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |