118 lines
1.9 KiB
JavaScript
118 lines
1.9 KiB
JavaScript
// pages/deposit/deposit.js
|
|
import bin from "../../utils/bin"
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
user_money:"0.00"
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
bin.request({
|
|
url:"User/getusercenter"
|
|
}).then((res)=>{
|
|
this.setData({
|
|
user_money:res.data.result.user_money
|
|
})
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
},
|
|
tixian(e){
|
|
var money=e.detail.value.money;
|
|
var wechat=e.detail.value.wechat;
|
|
var zhifubao=e.detail.value.zhifubao;
|
|
|
|
// console.log(money,wechat,zhifubao)
|
|
if(wechat== "" && zhifubao == ""){
|
|
wx.showToast({
|
|
title: "请填写微信或支付宝帐号",
|
|
icon: 'none',
|
|
duration: 1500
|
|
});
|
|
return ;
|
|
}
|
|
let xx = {}
|
|
|
|
if(wechat == ""){
|
|
xx.zhifubao = zhifubao
|
|
}else{
|
|
xx.wechat = wechat
|
|
}
|
|
if(wechat && zhifubao){
|
|
xx.zhifubao = zhifubao
|
|
xx.wechat = wechat
|
|
|
|
}
|
|
bin.getuserid().then((id)=>{
|
|
bin.request({
|
|
url:"User/withdrawals",
|
|
urldata:{
|
|
user_id:id,
|
|
money,
|
|
...xx
|
|
}
|
|
}).then((res)=>{
|
|
// console.log( )
|
|
wx.showToast({
|
|
title: res.data.result.message,
|
|
icon: 'success',
|
|
duration: 1500
|
|
});
|
|
|
|
})
|
|
})
|
|
}
|
|
}) |