Initial Commit
This commit is contained in:
224
pages/my/my_cash/my_cash.js
Normal file
224
pages/my/my_cash/my_cash.js
Normal file
@ -0,0 +1,224 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
cardNum: "",//银行卡号
|
||||
customerName: "",//姓名
|
||||
customerPhone: "",//手机号
|
||||
bankName: '',//开户行
|
||||
money: "",//提现金额
|
||||
moneyCan: "",//最大提现
|
||||
disabled: false,
|
||||
sys: [],
|
||||
roles:[],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
wx.showLoading({
|
||||
title: '加载中..',
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/user/getWithdrawalRole',
|
||||
method: 'GET',
|
||||
data: {},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
this.setData({
|
||||
roles:res.data.value
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
_this.setData({
|
||||
disabled: false,
|
||||
})
|
||||
}
|
||||
},fail:f=>{
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '请求异常',
|
||||
icon:"none",
|
||||
})
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
moneyCan: options.moneyCan,
|
||||
})
|
||||
},
|
||||
|
||||
cash1: function () {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '你当前的账户小于300不足以提现~',
|
||||
showCancel: false,
|
||||
success: s => {
|
||||
|
||||
},
|
||||
})
|
||||
},
|
||||
//申请提现
|
||||
cash: function () {
|
||||
var _this = this;
|
||||
var cardNum = _this.data.cardNum;
|
||||
var customerPhone = _this.data.customerPhone;
|
||||
var customerName = _this.data.customerName;
|
||||
var bankName = _this.data.bankName;
|
||||
var money = _this.data.money;
|
||||
if (cardNum == "" || customerName == "" || bankName == "" || money == "") {
|
||||
wx.showToast({
|
||||
title: '请完善信息~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (customerPhone.length != 11) {
|
||||
wx.showToast({
|
||||
title: '请填写正确手机号~',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
if (money > 100000 || money<this.data.roles.withdrawalMinimum) {
|
||||
wx.showToast({
|
||||
title: '提现金额需为'+this.data.roles.withdrawalMinimum+'~10万以内',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
_this.setData({
|
||||
disabled: true,
|
||||
})
|
||||
wx.showLoading({
|
||||
title: '申请中',
|
||||
mask: true,
|
||||
})
|
||||
wx.request({
|
||||
url: app.globalData.ip + '/wisdommining/api/user/addWisdWithdrawal',
|
||||
method: 'POST',
|
||||
data: {
|
||||
userId: app.globalData.userId,
|
||||
withdrawalUserPhone:customerPhone,
|
||||
withdrawalUserName: customerName,
|
||||
withdrawalCard: bankName,
|
||||
withdrawalCardNumber: cardNum,//银行卡号
|
||||
withdrawalMoney: money,
|
||||
},
|
||||
success: res => {
|
||||
console.log(res)
|
||||
wx.hideLoading()
|
||||
if (res.data.code == 1) {
|
||||
wx.showModal({
|
||||
title: '提现申请成功!',
|
||||
content: "稍后工作人员就会处理您的申请信息,请耐心等待",
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
wx.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
_this.setData({
|
||||
disabled: false,
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '申请失败!',
|
||||
content: res.data.message,
|
||||
showCancel: false,
|
||||
})
|
||||
_this.setData({
|
||||
disabled: false,
|
||||
})
|
||||
}
|
||||
},fail:f=>{
|
||||
wx.hideLoading()
|
||||
wx.showToast({
|
||||
title: '请求异常',
|
||||
icon:"none",
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//卡号
|
||||
cardNum: function (e) {
|
||||
this.setData({
|
||||
cardNum: e.detail.value
|
||||
})
|
||||
},
|
||||
//姓名
|
||||
customerName: function (e) {
|
||||
this.setData({
|
||||
customerName: e.detail.value
|
||||
})
|
||||
},
|
||||
//开户行
|
||||
bankName: function (e) {
|
||||
this.setData({
|
||||
bankName: e.detail.value
|
||||
})
|
||||
},
|
||||
//手机号
|
||||
customerPhone: function (e) {
|
||||
this.setData({
|
||||
customerPhone: e.detail.value
|
||||
})
|
||||
},
|
||||
//提现金额
|
||||
money: function (e) {
|
||||
this.setData({
|
||||
money: e.detail.value
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
})
|
4
pages/my/my_cash/my_cash.json
Normal file
4
pages/my/my_cash/my_cash.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "申请提现"
|
||||
}
|
31
pages/my/my_cash/my_cash.wxml
Normal file
31
pages/my/my_cash/my_cash.wxml
Normal file
@ -0,0 +1,31 @@
|
||||
<view class='input_all'>
|
||||
<view class='input'>
|
||||
<view class='name'>银行卡号</view>
|
||||
<input type='text' placeholder='请输入您的银行卡号' bindinput='cardNum' placeholder-style="text-align: right;color:#999;"></input>
|
||||
</view>
|
||||
<view class='input'>
|
||||
<view class='name'>开户行</view>
|
||||
<input type='text' placeholder='请输入您的开户行' bindinput='bankName' placeholder-style="text-align: right;color:#999;"></input>
|
||||
</view>
|
||||
<view class='input'>
|
||||
<view class='name'>手机号</view>
|
||||
<input type='number' placeholder='请输入您的手机号' bindinput='customerPhone' placeholder-style="text-align: right;color:#999;"></input>
|
||||
</view>
|
||||
<view class='input'>
|
||||
<view class='name'>姓名</view>
|
||||
<input type='text' placeholder='请输入姓名' bindinput='customerName' placeholder-style="text-align: right;color:#999;"></input>
|
||||
</view>
|
||||
<view class='input'>
|
||||
<view class='name'>提现金额</view>
|
||||
<input type='number' placeholder='可提现¥{{moneyCan}}' bindinput='money' placeholder-style="text-align: right;"></input>
|
||||
</view>
|
||||
<view class='tips'><text>*</text>提现收取<text>2%</text>的税用,将在转账过程中自动扣除,请注意!</view>
|
||||
</view>
|
||||
|
||||
<view class='tips_imp'>
|
||||
<view class='tips_title'>温馨提示</view>
|
||||
<view class='tipes_cont'><text>{{roles.withdrawalRoles}}</text></view>
|
||||
</view>
|
||||
|
||||
<view class='apply ' disabled='{{disabled}}' catchtap='cash'>立即申请</view>
|
||||
<view class="height100"></view>
|
100
pages/my/my_cash/my_cash.wxss
Normal file
100
pages/my/my_cash/my_cash.wxss
Normal file
@ -0,0 +1,100 @@
|
||||
page{
|
||||
background-color:#fff;
|
||||
}
|
||||
.class_all{
|
||||
width: 630rpx;
|
||||
height: 100rpx;
|
||||
padding: 0 60rpx;
|
||||
background-color:#fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
.class{
|
||||
height: 97rpx;
|
||||
line-height:97rpx;
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.class_xz{
|
||||
color: #c1a25f;
|
||||
border-bottom: 3rpx solid #c1a25f;
|
||||
}
|
||||
.input_all{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding-top: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.input{
|
||||
margin: 20rpx auto 0 auto;
|
||||
width: 640rpx;
|
||||
height: 30rpx;
|
||||
border-radius: 4rpx;
|
||||
border: solid 2rpx #e5e5e5;
|
||||
padding: 25rpx;
|
||||
}
|
||||
.name{
|
||||
width: 130rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
padding-right: 20rpx;
|
||||
border-right: 2rpx solid #333;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
float: left;
|
||||
text-align-last:justify;
|
||||
}
|
||||
.input input{
|
||||
width: 420rpx;
|
||||
padding: 0 20rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
float: right;
|
||||
border: none;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-top: -10rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.tips{
|
||||
font-size: 20rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #999999;
|
||||
padding-left: 30rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.tips text{
|
||||
color: #e62424;
|
||||
}
|
||||
|
||||
.apply{
|
||||
margin-top: 70rpx;
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
background-color: #ee7b1e;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 auto;
|
||||
font-size: 32rpx;
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 40px;
|
||||
/* opacity: 0.5; */
|
||||
}
|
||||
.tips_imp{
|
||||
background-color: #fff;
|
||||
padding: 45rpx 30rpx 100rpx 30rpx;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
.tips_title{
|
||||
font-size: 28rpx;
|
||||
color: #c82834;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
.tipes_cont text{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-top: 10rpx;
|
||||
}
|
Reference in New Issue
Block a user