第一次提交
This commit is contained in:
258
shopping/pages/withdrawal/withdrawal.js
Normal file
258
shopping/pages/withdrawal/withdrawal.js
Normal file
@@ -0,0 +1,258 @@
|
||||
// shopping/pages/withdrawal/withdrawal.js
|
||||
// 获取应用实例
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
pingtainame:'微信',
|
||||
pingtaiimage:'/shopping/image/WeChat.png',
|
||||
second:'',
|
||||
money:'',
|
||||
allmoney:'',
|
||||
show: false,
|
||||
type:1,//1为微信,2为支付宝
|
||||
name:'',
|
||||
alipay_no:'',
|
||||
is_ok_click:false,
|
||||
actions: [
|
||||
{ name: '支付宝',color: '#464646;',imagesrc:'/shopping/image/Alipay.png'},
|
||||
],
|
||||
},
|
||||
onClose() {
|
||||
// wx.showToast({ title: '点击成功', icon: 'none' });
|
||||
this.setData({ show: false });
|
||||
},
|
||||
onCancel(){
|
||||
// wx.showToast({ title: '点击成功', icon: 'none' });
|
||||
this.setData({ show: false });
|
||||
},
|
||||
openSelect(){
|
||||
// wx.showToast({ title: '点击成功', icon: 'none' });
|
||||
this.setData({ show: true });
|
||||
},
|
||||
|
||||
onSelect() {
|
||||
if(this.data.type==1){
|
||||
this.setData({
|
||||
show: false ,
|
||||
type:2,
|
||||
pingtainame:'支付宝',
|
||||
pingtaiimage:'/shopping/image/Alipay.png',
|
||||
actions: [
|
||||
{ name: '微信',color: '#464646;',imagesrc:'/shopping/image/WeChat.png'},
|
||||
],
|
||||
});
|
||||
}else{
|
||||
this.setData({
|
||||
show: false ,
|
||||
type:1,
|
||||
pingtainame:'微信',
|
||||
pingtaiimage:'/shopping/image/WeChat.png',
|
||||
actions: [
|
||||
{ name: '支付宝',color: '#464646;',imagesrc:'/shopping/image/Alipay.png'},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// wx.navigateTo({
|
||||
// url: '../payment/payment',
|
||||
// })
|
||||
},
|
||||
|
||||
|
||||
switch(){
|
||||
wx.navigateTo({
|
||||
url: '../payment/payment',
|
||||
})
|
||||
},
|
||||
cancel(){
|
||||
wx.switchTab({
|
||||
url: '/pages/my/my',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
console.log(options.money)
|
||||
this.setData({
|
||||
money:options.money
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
|
||||
// 提现
|
||||
confirm_pay: async function (){
|
||||
var that = this;
|
||||
if (!this.data.is_ok_click){
|
||||
that.setData({
|
||||
is_ok_click:true
|
||||
})
|
||||
|
||||
|
||||
//你要执行的操作
|
||||
this.tixian()
|
||||
setTimeout(function () {
|
||||
that.setData({
|
||||
is_ok_click: false
|
||||
})
|
||||
}, 10000) //阻止一秒点击多次
|
||||
}else{
|
||||
// wx.showToast({ title: '请勿重复操作!', icon: 'none' });
|
||||
}
|
||||
},
|
||||
|
||||
tixian:function(e){
|
||||
app.console(this.data.second+"================="+this.data.name+"==================="+this.data.alipay_no)
|
||||
if(this.data.type==1){
|
||||
this.wechatWithdrawal();
|
||||
}else{
|
||||
this.alipayWithdrawal()
|
||||
}
|
||||
|
||||
}
|
||||
//这个函数一定要写在标签上才能用e.detail.value获取到
|
||||
,
|
||||
moneyInput:function( e ){
|
||||
this.setData({
|
||||
second: e.detail.value
|
||||
});
|
||||
|
||||
} ,
|
||||
//支付宝账号
|
||||
zfzhanghao:function(e){
|
||||
this.setData({
|
||||
alipay_no: e.detail.value
|
||||
});
|
||||
},
|
||||
//收款人姓名
|
||||
zfname:function(e){
|
||||
this.setData({
|
||||
name: e.detail.value
|
||||
});
|
||||
},
|
||||
//点击全部
|
||||
allmoney:function(e){
|
||||
|
||||
app.console(this.data.money+"================="+222)
|
||||
this.setData({
|
||||
allmoney:this.data.money,
|
||||
second:this.data.money
|
||||
});
|
||||
},
|
||||
|
||||
//微信提现
|
||||
wechatWithdrawal: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.buildUrl("/app/Goddesswechat/wechatWithdrawal"),
|
||||
header: app.getRequestHeader(),
|
||||
method:'POST',
|
||||
data: {
|
||||
version_number: app.globalData.version_number,
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
money:this.data.second
|
||||
},
|
||||
success: (res)=> {
|
||||
var resp = res.data;
|
||||
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
|
||||
if(resp.erro==0){
|
||||
wx.showToast({ title: res.data.msg, icon: 'none' });
|
||||
setTimeout(function () {
|
||||
//要延时执行的代码
|
||||
wx.navigateBack()
|
||||
}, 2000) //延迟时间 这里是2秒
|
||||
|
||||
}else{
|
||||
wx.showToast({ title: res.data.msg, icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//支付宝提现
|
||||
alipayWithdrawal: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: app.buildUrl("app/Goddesswechat/alipayWithdrawal"),
|
||||
header: app.getRequestHeader(),
|
||||
method:'POST',
|
||||
data: {
|
||||
version_number: app.globalData.version_number,
|
||||
uid:wx.getStorageSync('uid'),
|
||||
token:wx.getStorageSync('token'),
|
||||
money:this.data.second,
|
||||
name:this.data.name,
|
||||
alipay_no:this.data.alipay_no
|
||||
},
|
||||
success: (res)=> {
|
||||
var resp = res.data;
|
||||
console.log(resp+"=================dddddddddddddddddddddddddddddddddddddddddddd")
|
||||
|
||||
if(resp.erro==0){
|
||||
wx.showToast({ title: res.data.msg, icon: 'none' });
|
||||
setTimeout(function () {
|
||||
//要延时执行的代码
|
||||
wx.navigateBack()
|
||||
}, 2000) //延迟时间 这里是2秒
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
||||
7
shopping/pages/withdrawal/withdrawal.json
Normal file
7
shopping/pages/withdrawal/withdrawal.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-action-sheet": "/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index"
|
||||
},
|
||||
"navigationBarTitleText": "提现"
|
||||
|
||||
}
|
||||
41
shopping/pages/withdrawal/withdrawal.wxml
Normal file
41
shopping/pages/withdrawal/withdrawal.wxml
Normal file
@@ -0,0 +1,41 @@
|
||||
<!--shopping/pages/withdrawal/withdrawal.wxml-->
|
||||
|
||||
<view class="direction" bindtap="openSelect" style="margin-top: 2rpx;">
|
||||
<text>提现至:</text>
|
||||
<image src="{{pingtaiimage}}" class="img1"></image>
|
||||
<text class="txt">{{pingtainame}}</text>
|
||||
<image src="/pages/image/right1.png" class="img2"></image>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="direction" wx:if="{{type==2}}" style="margin-top: 14rpx;display: flex;align-items: center;">
|
||||
<text style="font-size: 28rpx;">到账支付宝:</text>
|
||||
<input style="font-size: 28rpx;" type="text" name='moneynum' bindinput="zfzhanghao" placeholder="请输入支付宝账号" />
|
||||
</view>
|
||||
|
||||
<view class="direction" wx:if="{{type==2}}" style="margin-top: 4rpx;display: flex;align-items: center;">
|
||||
<text style="font-size: 28rpx;">姓名:</text>
|
||||
<input style="font-size: 28rpx; margin-left: 80rpx;" type="text" name='moneynum' bindinput="zfname" placeholder="请输入姓名"/>
|
||||
</view>
|
||||
|
||||
<view style="width: 100%;height: 189rpx;background-color: white;display: flex;flex-direction:column;margin-top: 14rpx;">
|
||||
<view class="disply" style="margin-top: 14rpx;">可提现金额: {{money}}元</view>
|
||||
<view class="entry" style="align-items: center;background-color: #FFFFFF;">
|
||||
<text>¥</text>
|
||||
<input style="font-size: 28rpx;" type="text" name='moneynum' bindinput="moneyInput" placeholder="请输入要提现的金额" value="{{allmoney}}"/>
|
||||
<text style="font-size: 28rpx;color: #FF4C00;margin:0rpx 0 0rpx 200rpx;" bindtap="allmoney">全部</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="words" style="margin-top: 16rpx;">最低提现金额10元</view>
|
||||
<view class="words" style="margin:9rpx 0 60rpx 42rpx">将提现到已绑定的微信中,提现金额将在2小时内到账</view>
|
||||
<button class="btn" bindtap="confirm_pay">提现</button>
|
||||
<van-action-sheet
|
||||
show="{{ show }}"
|
||||
actions="{{ actions }}"
|
||||
cancel-text="取消"
|
||||
bind:close="onClose"
|
||||
bind:cancel ="onCancel"
|
||||
bind:select="onSelect"
|
||||
/>
|
||||
97
shopping/pages/withdrawal/withdrawal.wxss
Normal file
97
shopping/pages/withdrawal/withdrawal.wxss
Normal file
@@ -0,0 +1,97 @@
|
||||
/* shopping/pages/withdrawal/withdrawal.wxss */
|
||||
|
||||
page{
|
||||
height: 100%;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
.direction {
|
||||
display: flex;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.direction text:nth-child(1) {
|
||||
margin: 30rpx 54rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #606060;
|
||||
}
|
||||
|
||||
.img1 {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
margin: 20rpx;
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.txt {
|
||||
font-size: 28rpx;
|
||||
color: #2D2D2D;
|
||||
margin: 30rpx;
|
||||
margin-left: 0rpx;
|
||||
}
|
||||
|
||||
.img2 {
|
||||
width: 15rpx;
|
||||
height: 28rpx;
|
||||
margin: 35rpx 0 35rpx 355rpx;
|
||||
}
|
||||
|
||||
.disply {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #3A3A3A;
|
||||
margin-left: 52rpx;
|
||||
}
|
||||
|
||||
.entry {
|
||||
display: flex;
|
||||
height: 189rpx;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.entry text:nth-child(1) {
|
||||
font-size: 64rpx;
|
||||
font-family: Alibaba PuHuiTi;
|
||||
color: #414141;
|
||||
margin: 23rpx 25rpx 35rpx 44rpx;
|
||||
}
|
||||
|
||||
.entry input {
|
||||
margin: 44rpx 0;
|
||||
}
|
||||
|
||||
.words {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #BCBCBC;
|
||||
margin-left: 42rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 600rpx !important;
|
||||
height: 85rpx;
|
||||
color: #ffffff;
|
||||
background: #FF4C00;
|
||||
opacity: 1;
|
||||
border-radius: 85rpx;
|
||||
font-size: 31rpx;
|
||||
}
|
||||
.mode{
|
||||
height: 240rpx;
|
||||
margin-top: 481rpx;
|
||||
}
|
||||
.mode .zhi{
|
||||
display: flex;
|
||||
margin: 37rpx 32rpx 68rpx 288rpx;
|
||||
}
|
||||
.mode .zhifubao{
|
||||
font-size: 28rpx;
|
||||
line-height: 55rpx;
|
||||
margin-left: 32rpx;
|
||||
color: #464646;
|
||||
}
|
||||
.mode text{
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #464646;
|
||||
}
|
||||
Reference in New Issue
Block a user