37 changed files with 158 additions and 579 deletions
Split View
Diff Options
-
4app.json
-
1pages/article/article-item/index.wxml
-
134pages/bank/index/index.js
-
6pages/bank/index/index.json
-
30pages/bank/index/index.wxml
-
40pages/bank/index/index.wxss
-
11pages/mall/fragment/index.js
-
2pages/mall/fragment/index.json
-
19pages/mall/fragment/index.wxml
-
4pages/mall/fragment/index.wxss
-
0pages/mall/information-item/index.js
-
0pages/mall/information-item/index.json
-
0pages/mall/information-item/index.wxml
-
0pages/mall/information-item/index.wxss
-
4pages/morder/detail/index.js
-
213pages/withdrawal/checkout/index.js
-
8pages/withdrawal/checkout/index.json
-
31pages/withdrawal/checkout/index.wxml
-
1pages/withdrawal/checkout/index.wxss
-
83pages/withdrawal/detail/index.js
-
3pages/withdrawal/detail/index.json
-
46pages/withdrawal/detail/index.wxml
-
1pages/withdrawal/detail/index.wxss
-
59pages/withdrawal/index/index.js
-
3pages/withdrawal/index/index.json
-
24pages/withdrawal/index/index.wxml
-
2pages/withdrawal/index/index.wxss
-
6pages/withdrawal/payment/index.js
-
0pages/withdrawal/payment/index.json
-
0pages/withdrawal/payment/index.wxml
-
0pages/withdrawal/payment/index.wxss
-
2pages/ztbvip/index.js
-
BINpakageInfo/assets/image/ic_save_poster.png
-
BINpakageInfo/assets/image/img_poster_bg.png
-
BINpakageInfo/assets/image/img_poster_header_has_title.png
-
BINpakageInfo/assets/image/pyqicon.png
-
BINpakageInfo/assets/image/weixinicon.png
@ -1,134 +0,0 @@ |
|||
// pages/bank/index/index.js
|
|||
import { getBankCardList, deleteBankCard, checkPayPassword, bankCardDefault } from "../../../api/saas" |
|||
import { $wuxKeyBoard, $wuxDialog } from '../../../components/index' |
|||
const util = require('../../../utils/util') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
isSetPwd: 0, |
|||
nowIndex: -1, |
|||
bankList: [] |
|||
}, |
|||
onShow: function () { |
|||
checkPayPassword().then(res => { |
|||
this.data.isSetPwd = 1 |
|||
}).catch(err => { |
|||
this.data.isSetPwd = -1 |
|||
}) |
|||
this.fetchBankCardList() |
|||
}, |
|||
/** |
|||
* 获取用户银行卡列表 |
|||
*/ |
|||
fetchBankCardList: function () { |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
getBankCardList().then(result => { |
|||
this.setData({ bankList: result.data }) |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
showActionSheet(e) { |
|||
this.data.nowIndex = e.currentTarget.dataset.index |
|||
if (this.data.nowIndex < 0) { |
|||
if(!app.globalData.userInfo.isAuth){ |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '您还没有进行个人信息认证,无法绑定银行卡,现在去进行个人信息认证?', |
|||
buttons: [{ |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
wx.navigateTo({ url: '/pages/home/idcard/index' }) |
|||
} |
|||
}] |
|||
}) |
|||
return |
|||
} |
|||
wx.navigateTo({url: '/pages/bank/edit/index'}) |
|||
return |
|||
} |
|||
var that = this |
|||
wx.showActionSheet({ |
|||
itemList: ['设为默认', '解除绑定'], |
|||
success(res){ |
|||
if (res.tapIndex === 0){ |
|||
that.setDefault() |
|||
}else if (res.tapIndex === 1){ |
|||
that.unbindCard() |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
setDefault: function (id) { |
|||
var item = this.data.bankList[this.data.nowIndex] |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
bankCardDefault(item.id).then(res => { |
|||
for (let index = 0; index < this.data.bankList.length; index++) { |
|||
if(index == this.data.nowIndex){ |
|||
this.data.bankList[index].isDefault = 1 |
|||
} else { |
|||
this.data.bankList[index].isDefault = 0 |
|||
} |
|||
} |
|||
this.setData({ |
|||
bankList: this.data.bankList |
|||
}) |
|||
wx.hideLoading() |
|||
util.showToast('设置成功') |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
unbindCard: function () { |
|||
var that = this |
|||
if (this.data.isSetPwd == 1) { |
|||
$wuxKeyBoard().show({ |
|||
inputText: '输入支付密码', |
|||
callback(value) { |
|||
that.postUnbindCard(value) |
|||
return true |
|||
}, |
|||
}) |
|||
} else if (this.data.isSetPwd == -1) { |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '您还没有设置支付密码,请先设置支付密码', |
|||
buttons: [{ |
|||
text: '取消' |
|||
}, { |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
wx.navigateTo({ |
|||
url: '/pages/bank/password/index' |
|||
}) |
|||
} |
|||
}] |
|||
}) |
|||
} |
|||
}, |
|||
postUnbindCard: function (pwd) { |
|||
wx.showLoading({ title: '处理中', mask: true }) |
|||
var item = this.data.bankList[this.data.nowIndex] |
|||
deleteBankCard(item.id, { password: pwd }).then(res => { |
|||
wx.hideLoading() |
|||
util.showToast('解除成功') |
|||
this.data.bankList.splice(this.data.nowIndex, 1); |
|||
this.setData({ bankList: this.data.bankList }) |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
|
|||
}) |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"wux-dialog": "/components/dialog/index", |
|||
"wux-keyboard": "/components/keyboard/index" |
|||
} |
|||
} |
|||
@ -1,30 +0,0 @@ |
|||
<!--pages/bank/index/index.wxml--> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">我的银行卡</view> |
|||
</cu-custom> |
|||
|
|||
<scroll-view scroll-y style="height: {{height}}rpx;padding:0rpx 32rpx"> |
|||
<view wx:for="{{bankList}}" wx:key="index" class="item-bank" data-index="{{index}}" bindtap="showActionSheet"> |
|||
<view class="flex"> |
|||
<view class="cu-avatar slg round" style="background-image:url({{item.bankIcon}});"></view> |
|||
<view style="margin-left: 12rpx;flex: 1"> |
|||
<view class="bank-name">{{item.bankName ? item.bankName : item.cardName}}</view> |
|||
<view class="bank-type">{{item.cardType=='PC'?'"预付费卡':(item.cardType=='SCC'?'准贷记卡':(item.cardType=='CC'?'信用卡':'储蓄卡'))}}</view> |
|||
</view> |
|||
<image style="width:32rpx;height:32rpx;" src="/assets/image/icon_bank.png" wx:if="{{item.isDefault==1}}"></image> |
|||
</view> |
|||
<view style="margin-left: 72rpx;margin-top:24rpx"> |
|||
<text class="bank-suffix" style="margin-right: 12rpx">****</text> |
|||
<text class="bank-suffix" style="margin-right: 12rpx">****</text> |
|||
<text class="bank-suffix" style="margin-right: 12rpx">****</text> |
|||
<text class="bank-suffix">{{item.cardNoSuffix}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="flex flex-center add-bank" data-index="{{-1}}" bindtap="showActionSheet"> |
|||
<text class="cuIcon-add text-black" style="font-size:48rpx"></text> |
|||
<text class="text-black" style="font-size:28rpx;margin-left:12rpx">添加银行卡</text> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<wux-dialog id="wux-dialog" /> |
|||
<wux-keyboard id="wux-keyboard" /> |
|||
@ -1,40 +0,0 @@ |
|||
/* pages/bank/index/index.wxss */ |
|||
.add-bank { |
|||
height: 150rpx; |
|||
width: 100%; |
|||
margin-top: 32rpx; |
|||
margin-bottom: 32rpx; |
|||
background: rgba(255, 255, 255, 1); |
|||
box-shadow: 0px 0px 15px -6px rgba(0, 0, 0, 0.32); |
|||
border-radius: 6px; |
|||
} |
|||
|
|||
.item-bank { |
|||
margin-top: 32rpx; |
|||
padding: 32rpx; |
|||
background: rgba(198, 79, 85, 1); |
|||
border-radius: 4px; |
|||
} |
|||
|
|||
.bank-name { |
|||
font-size: 32rpx; |
|||
font-family: PingFang-SC-Medium, PingFang-SC; |
|||
font-weight: 500; |
|||
color: rgba(255, 255, 255, 1); |
|||
} |
|||
|
|||
.bank-type { |
|||
font-size: 24rpx; |
|||
font-family: PingFang-SC-Regular, PingFang-SC; |
|||
font-weight: 400; |
|||
color: rgba(255, 255, 255, 0.6); |
|||
} |
|||
|
|||
.bank-suffix { |
|||
font-size: 56rpx; |
|||
font-family: SFProDisplay-Regular, SFProDisplay; |
|||
font-weight: 400; |
|||
color: rgba(255, 255, 255, 1); |
|||
line-height: 34px; |
|||
letter-spacing: 1px; |
|||
} |
|||
@ -1,153 +1,66 @@ |
|||
// pages/withdrawal/checkout/index.js
|
|||
import { checkPayPassword, getBalanceInfo, getBankCardList, postWithdraw } from "../../../api/saas" |
|||
import { $wuxKeyBoard, $wuxDialog } from '../../../components/index' |
|||
const util = require('../../../utils/util') |
|||
// const md5 = require('../../../utils/md5')
|
|||
const math = require('../../../utils/math') |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
accountMoney: 0, //用户余额
|
|||
expendMoney: '', |
|||
xsaccountMoney: null, //显示余额
|
|||
banckCardList: [], //用户银行卡列表
|
|||
banckList: [], |
|||
isSetPwd: 0, |
|||
chooseBankCard: null |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.pickerView = this.pickerView || this.selectComponent('#picker-view') |
|||
this.getUserInfo() |
|||
}, |
|||
onShow: function () { |
|||
getBankCardList().then(res => { |
|||
var list = [] |
|||
for (let index = 0; index < res.data.length; index++) { |
|||
const element = res.data[index] |
|||
list.push({ |
|||
text: element.bankName + '(' + element.cardNoSuffix + ')', |
|||
value: element.id |
|||
}) |
|||
} |
|||
this.setData({ banckCardList: res.data, banckList: list }) |
|||
if (this.data.banckCardList[0] && this.data.banckCardList[0].cardName) { |
|||
const element = this.data.banckCardList[0] |
|||
var defaultCard = { cardId: element.id, cardName: element.bankName + '(' + element.cardNoSuffix + ')' } |
|||
this.setData({ chooseBankCard: defaultCard }) |
|||
} |
|||
}) |
|||
checkPayPassword().then(res => { |
|||
this.data.isSetPwd = 1 |
|||
}).catch(err => { |
|||
this.data.isSetPwd = -1 |
|||
}) |
|||
}, |
|||
/** |
|||
* 获取用户数据 |
|||
*/ |
|||
getUserInfo: function () { |
|||
getBalanceInfo().then(res => { |
|||
this.setData({ |
|||
accountMoney: res.data.accountMoney, |
|||
xsaccountMoney: math.minus(res.data.accountMoney, res.data.frozenMoney) |
|||
}) |
|||
}) |
|||
}, |
|||
bindAndSet(e) { |
|||
this.setData({ expendMoney: e.detail.value }) |
|||
}, |
|||
allExpend: function () { |
|||
this.setData({ expendMoney: this.data.xsaccountMoney }) |
|||
}, |
|||
chooseCard: function () { |
|||
if (this.data.chooseBankCard) { |
|||
this.pickerView.showPicker(this.data.banckList, this.data.chooseBankCard.cardId) |
|||
} else { |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '您还没有绑定银行卡,请先去绑定银行卡', |
|||
buttons: [{ |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
wx.navigateTo({ |
|||
url: '/pages/bank/edit/index' |
|||
}) |
|||
} |
|||
}] |
|||
}) |
|||
} |
|||
}, |
|||
onPickerChange: function (e) { |
|||
if(!e.detail){ |
|||
return |
|||
} |
|||
this.setData({ |
|||
['chooseBankCard.cardName']: e.detail.text, |
|||
['chooseBankCard.cardId']: e.detail.value |
|||
}) |
|||
}, |
|||
checkoutMoney: function () { |
|||
if (Number(this.data.expendMoney) <= 0) { |
|||
util.showToast('提现金额必须大于0') |
|||
return |
|||
} |
|||
if (this.data.xsaccountMoney != null) { |
|||
if (Number(this.data.xsaccountMoney) < Number(this.data.expendMoney)) { |
|||
util.showToast('账户余额不够') |
|||
return |
|||
} |
|||
} |
|||
if (!this.data.chooseBankCard || !this.data.chooseBankCard.cardId) { |
|||
util.showToast('请选择一张银行卡') |
|||
return |
|||
} |
|||
var that = this |
|||
if (this.data.isSetPwd == 1) { |
|||
$wuxKeyBoard().show({ |
|||
inputText: '输入支付密码', |
|||
callback(value) { |
|||
that.withdrawalMoney(value) |
|||
return true |
|||
}, |
|||
onForget(type) { |
|||
wx.navigateTo({ url: '/pages/bank/password/index' }) |
|||
} |
|||
}) |
|||
} else if (this.data.isSetPwd == -1) { |
|||
$wuxDialog().open({ |
|||
resetOnClose: true, |
|||
title: '温馨提示', |
|||
content: '您还没有设置支付密码,请先设置支付密码', |
|||
buttons: [{ |
|||
text: '取消' |
|||
}, { |
|||
text: '确定', |
|||
type: 'primary', |
|||
onTap(e) { |
|||
wx.navigateTo({ |
|||
url: '/pages/bank/password/index' |
|||
}) |
|||
} |
|||
}] |
|||
}) |
|||
} |
|||
}, |
|||
withdrawalMoney: function (pwd) { |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
postWithdraw({ bankId: this.data.chooseBankCard.cardId, money: this.data.expendMoney, password: pwd }).then(res => { |
|||
wx.hideLoading() |
|||
util.showBackToast('提现成功') |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -1,8 +0,0 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"select-view": "/components/select-view/index", |
|||
"wux-button": "/components/button/index", |
|||
"wux-dialog": "/components/dialog/index", |
|||
"wux-keyboard": "/components/keyboard/index" |
|||
} |
|||
} |
|||
@ -1,31 +1,2 @@ |
|||
<!--pages/withdrawal/checkout/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">申请提现</view> |
|||
</cu-custom> |
|||
|
|||
<view class=" bg-white padding" style="margin-top:24rpx"> |
|||
<text class="text-df text-bold text-black" bindtap="banlanceDetails">提现金额</text> |
|||
<view class="cu-form-group" style="border-bottom: 1px solid #f3f3f3;margin-top:24rpx;padding: 2rpx 0rpx"> |
|||
<view><text style="font-size:50rpx;font-weight: 600; color:black">¥</text></view> |
|||
<input type="digit" style="font-size:45rpx;" value="{{expendMoney}}" bindinput="bindAndSet" placeholder="请输入金额"></input> |
|||
</view> |
|||
<view style="margin-top:18rpx;margin-bottom:12rpx"> |
|||
<text class="text-sm" bindtap="banlanceDetails" >账户余额¥{{formate.numberFormat2(xsaccountMoney)}}</text> |
|||
<text class="text-sm text-blue" style="margin-left:30rpx" bindtap="allExpend">全部提现</text> |
|||
</view> |
|||
|
|||
<view class="flex flex-justify" style="margin-top:36rpx;margin-bottom:12rpx" bindtap="chooseCard"> |
|||
<view class="text-df text-bold">到账银行卡</view> |
|||
<view class="text-df text-bold">{{chooseBankCard ? chooseBankCard.cardName: '添加银行卡'}}</view> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<view class="flex flex-direction" style="padding: 48rpx 32rpx"> |
|||
<wux-button block type="positive" bind:click="checkoutMoney">提现</wux-button> |
|||
</view> |
|||
|
|||
<select-view id="picker-view" bindcustomevent="onPickerChange"></select-view> |
|||
<wux-keyboard id="wux-keyboard" /> |
|||
<wux-dialog id="wux-dialog" /> |
|||
<text>pages/withdrawal/checkout/index.wxml</text> |
|||
@ -1 +0,0 @@ |
|||
/* pages/withdrawal/checkout/index.wxss */ |
|||
@ -1,23 +1,66 @@ |
|||
// pages/withdrawal/detail/index.js
|
|||
import { getWithdrawInfo} from '../../../api/saas' |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
orderDetails: {} |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
getWithdrawInfo(options.id).then(result => { |
|||
this.setData({ orderDetails: result.data }) |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
wx.hideLoading() |
|||
}) |
|||
} |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -1,3 +0,0 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
} |
|||
@ -1,46 +1,2 @@ |
|||
<!--pages/withdrawal/detail/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">记录详情</view> |
|||
</cu-custom> |
|||
|
|||
<view class="cu-form-group" style="margin-top:24rpx"> |
|||
<view class="content"> |
|||
<text class="text-black ">流水号</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{orderDetails.tradeSn}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">状态</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{orderDetails.status==0?'正在处理':(orderDetails.status==1?'提现成功':'提现失败')}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">支出</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{formate.formateMoney(orderDetails.money)}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">时间</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{orderDetails.createTime}}</text> |
|||
</view> |
|||
</view> |
|||
<view class="cu-form-group"> |
|||
<view class="content"> |
|||
<text class="text-black ">余额</text> |
|||
</view> |
|||
<view class="action"> |
|||
<text class="text-grey text-sm">{{formate.formateMoney(orderDetails.remainMoney)}}元</text> |
|||
</view> |
|||
</view> |
|||
<text>pages/withdrawal/detail/index.wxml</text> |
|||
@ -1 +0,0 @@ |
|||
/* pages/withdrawal/detail/index.wxss */ |
|||
@ -1,59 +0,0 @@ |
|||
// pages/withdrawal/index/index.js
|
|||
import { getWithdrawList } from "../../../api/saas" |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
height: app.globalData.fragmentHeight, |
|||
finished: false, |
|||
requesting: false, |
|||
taskList: [], |
|||
form: { |
|||
pageSize: 10, |
|||
pageNum: 1, |
|||
pageSize:15 |
|||
} |
|||
}, |
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.setData({ height: app.globalData.fragmentHeight }) |
|||
this.fetchList() |
|||
}, |
|||
fetchList: function () { |
|||
if (this.data.requesting || this.data.finished) { |
|||
return |
|||
} |
|||
this.data.requesting = true |
|||
wx.showLoading({ title: '加载中', mask: true }) |
|||
getWithdrawList(this.data.form).then(result => { |
|||
this.setData({ requesting: false, loading: false }) |
|||
if (result.data.records.length) { |
|||
var respList = result.data.records |
|||
let nowList = `taskList[${this.data.taskList.length}]` |
|||
var num = this.data.form.pageNum |
|||
var finished = this.data.form.pageNum >= result.data.pages |
|||
this.setData({ |
|||
[nowList]: respList, |
|||
total: result.data.total, |
|||
['form.pageNum']: (num + 1), |
|||
finished |
|||
}) |
|||
} else { |
|||
this.setData({ finished: true }) |
|||
} |
|||
wx.hideLoading() |
|||
}).catch(err => { |
|||
this.setData({ requesting: false, loading: false }) |
|||
wx.hideLoading() |
|||
util.showToast(err) |
|||
}) |
|||
}, |
|||
lookItem: function(e){ |
|||
wx.navigateTo({ url: '/pages/withdrawal/detail/index?id=' + e.currentTarget.id }) |
|||
} |
|||
}) |
|||
@ -1,3 +0,0 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
<!--pages/withdrawal/index/index.wxml--> |
|||
<wxs module="formate" src="../../../pages/formate.wxs"></wxs> |
|||
<cu-custom bgColor="bg-white" isBack="{{true}}"> |
|||
<view slot="content">提现记录</view> |
|||
</cu-custom> |
|||
|
|||
<view class="list-empty" wx:if="{{!taskList.length}}" style="height:{{height}}rpx"> |
|||
<image class="img-empty" src="/assets/image/list_empty.png"></image> |
|||
<view class="text-empty">暂无数据</view> |
|||
</view> |
|||
<scroll-view wx:else scroll-y style="height: {{height}}rpx;" class="nav margin-top-sm" bindscrolltolower="fetchList"> |
|||
<view wx:for-item="pageItem" wx:for-index="pageIndex" wx:for="{{taskList}}" wx:key="pageIndex"> |
|||
<view class="bg-white padding" style="margin-bottom:18rpx" bindtap="lookItem" wx:for="{{pageItem}}" wx:key="index" id="{{item.id}}"> |
|||
<view class="flex flex-justify"> |
|||
<view class="text-sm text-black text-bold">{{formate.formateMoney(item.money)}}元</view> |
|||
<view> |
|||
<text wx:if="{{item.status==0}}" class="ft-right text-yellow text-sm">正在处理</text> |
|||
<text wx:if="{{item.status==1}}" class="ft-right text-blue text-sm">提现成功</text> |
|||
<text wx:if="{{item.status==2}}" class="ft-right text-black text-sm">提现失败</text> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
@ -1,2 +0,0 @@ |
|||
/* pages/withdrawal/index/index.wxss */ |
|||
|
|||
@ -1,6 +1,6 @@ |
|||
import { getTradeOrder, paymentFor } from "../../api/payment" |
|||
const util = require('../../utils/util') |
|||
const event = require('../../utils/event') |
|||
import { getTradeOrder, paymentFor } from "../../../api/payment" |
|||
const util = require('../../../utils/util') |
|||
const event = require('../../../utils/event') |
|||
const app = getApp() |
|||
|
|||
Page({ |
|||
Write
Preview
Loading…
Cancel
Save