Commit 7a9e218b by wangyalan-git

提交

parent 2e175de0
// pages/newly/redpacket.js // pages/newly/redpacket.js
var http = require("../../utils/http.js"); var http = require("../../utils/http.js");
var util = require("../../utils/util.js")
var app = getApp() var app = getApp()
Page({ Page({
...@@ -13,6 +14,7 @@ Page({ ...@@ -13,6 +14,7 @@ Page({
name: '', name: '',
actualAmount: '', actualAmount: '',
orderIncome: '', orderIncome: '',
buttonClicked: false,
how: false,//是否显示如何上传收款码提示框 how: false,//是否显示如何上传收款码提示框
}, },
/** /**
...@@ -40,7 +42,7 @@ Page({ ...@@ -40,7 +42,7 @@ Page({
defaultAmount: this.options.amount, defaultAmount: this.options.amount,
orderIncome: JSON.parse(this.options.orderIncome) orderIncome: JSON.parse(this.options.orderIncome)
}) })
console.log('list',this.data.type,this.data.ordernum) console.log('list', this.data.type, this.data.ordernum)
this.getData(); this.getData();
}, },
...@@ -140,14 +142,16 @@ Page({ ...@@ -140,14 +142,16 @@ Page({
}, },
//最新提现做法 //最新提现做法
inputimg: function () { inputimg: function () {
console.log('点击事件')
util.buttonClicked(this);
let that = this; let that = this;
var stockAmount = /^\d{1,}$/ var stockAmount = /^\d{1,}$/
if (!stockAmount.test(that.data.amount)) { if (!stockAmount.test(that.data.amount)) {
wx.showToast({ title: '请填写提现金额', icon: 'none' }) wx.showToast({ title: '请填写金额', icon: 'none' })
return return
} }
if (parseInt(that.data.amount) > parseInt(that.data.defaultAmount)) { if ((parseInt(that.data.amount) <= 0) || (parseInt(that.data.amount) > parseInt(that.data.defaultAmount))) {
wx.showToast({ title: '提现金额错误', icon: 'none' }) wx.showToast({ title: '金额不能小于0且不能大于可操作金额', icon: 'none' })
return return
} }
wx.showLoading() wx.showLoading()
...@@ -167,7 +171,15 @@ Page({ ...@@ -167,7 +171,15 @@ Page({
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
title: '操作成功,我们将尽快为您提现', title: '操作成功,我们将尽快为您提现',
icon: 'none' icon: 'none',
duration: 3000,
success: function () {
setTimeout(function () {
wx.navigateBack({
delta: 0,
})
}, 3000);
}
}) })
}, },
errBack: (res) => { errBack: (res) => {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<view class="botton-container"> <view class="botton-container">
<!-- <view class='inputimg' type="default" bindtap="gotoShow">点击上传您的收款码</view> --> <!-- <view class='inputimg' type="default" bindtap="gotoShow">点击上传您的收款码</view> -->
<view class='inputimg' type="default" bindtap="inputimg">48小时内到账,{{type == 2? '确认退单': '确认提现'}}</view> <view class="{{!buttonClicked?'inputimg':'disabledBtn'}}" type="default" bindtap="{{!buttonClicked?'inputimg':''}}">48小时内到账,{{type == 2? '确认退单': '确认提现'}}</view>
<!-- <view class='how-container' bindtap="showHow"> <!-- <view class='how-container' bindtap="showHow">
<image class='how-img' src="/images/newly/notice.png"></image> <image class='how-img' src="/images/newly/notice.png"></image>
<text class='how-txt'>如何上传收款码?</text> <text class='how-txt'>如何上传收款码?</text>
......
...@@ -251,3 +251,14 @@ page { ...@@ -251,3 +251,14 @@ page {
font-size: 34rpx; font-size: 34rpx;
color: white; color: white;
} }
.disabledBtn{
width: 95%;
font-size: 30rpx;
height: 76rpx;
line-height: 76rpx;
margin-top: 10rpx;
background-color: #ccc;
text-align: center;
border-radius: 15rpx;
color: rgb(83, 37, 3);
}
\ No newline at end of file
// pages/newly/redpacket.js // pages/newly/redpacket.js
var http = require("../../../utils/http.js"); var http = require("../../../utils/http.js");
var util = require("../../../utils/util.js")
var app = getApp() var app = getApp()
Page({ Page({
...@@ -12,6 +13,7 @@ Page({ ...@@ -12,6 +13,7 @@ Page({
amount: '', amount: '',
name: '', name: '',
actualAmount: '', actualAmount: '',
buttonClicked: false,
how: false,//是否显示如何上传收款码提示框 how: false,//是否显示如何上传收款码提示框
}, },
getRate() { getRate() {
...@@ -23,10 +25,13 @@ Page({ ...@@ -23,10 +25,13 @@ Page({
}, },
callBack: (res) => { callBack: (res) => {
let rate = JSON.parse(res.result.paramValue).rate let rate = JSON.parse(res.result.paramValue).rate
let actualAmount = (this.data.amount * (1 - (rate / 100))).toFixed(2);
console.log('rate', JSON.parse(res.result.paramValue)) console.log('rate', JSON.parse(res.result.paramValue))
this.setData({ this.setData({
rate: rate rate: rate,
actualAmount: actualAmount
}); });
} }
}; };
http.request(params); http.request(params);
...@@ -170,6 +175,8 @@ Page({ ...@@ -170,6 +175,8 @@ Page({
}, },
//最新提现做法 //最新提现做法
inputimg: function () { inputimg: function () {
console.log('点击事件')
util.buttonClicked(this);
let that = this; let that = this;
if (!that.data.name) { if (!that.data.name) {
wx.showToast({ title: '请填写收款人', icon: 'none' }) wx.showToast({ title: '请填写收款人', icon: 'none' })
...@@ -209,7 +216,15 @@ Page({ ...@@ -209,7 +216,15 @@ Page({
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
title: '操作成功,我们将尽快为您提现', title: '操作成功,我们将尽快为您提现',
icon: 'none' icon: 'none',
duration: 3000,
success: function () {
setTimeout(function () {
wx.navigateBack({
delta: 0,
})
}, 3000);
}
}) })
}, },
errBack: (res) => { errBack: (res) => {
......
...@@ -39,18 +39,19 @@ ...@@ -39,18 +39,19 @@
</view> </view>
<view class="botton-container"> <view class="botton-container">
<view class='inputimg' type="default" bindtap="inputimg">48小时内到账,确认提现</view> <view class="{{!buttonClicked?'inputimg':'disabledBtn'}}" type="default" bindtap="{{!buttonClicked?'inputimg':''}}">48小时内到账,确认提现</view>
<view class='how-container' bindtap="showHow"> <view class='how-container' bindtap="showHow">
<image class='how-img' src="/images/newly/notice.png"></image> <image class='how-img' src="/images/newly/notice.png"></image>
<text class='how-txt'>如何上传收款码?</text> <text class='how-txt'>如何上传收款码?</text>
</view> </view>
</view> </view>
<!-- <view class="notice-container"> <view class="notice-container">
<text class='txt-notice-title'>【温馨提醒】</text> <text class='txt-notice-title'>【温馨提醒】</text>
<text class='txt-notice'></text> <text class='txt-notice'></text>
<text class='txt-notice'>1、金额满100元方可提现;\n2、提现收{{rate}}%手续费;\n3、购物可全额抵扣;</text> <text class='txt-notice'>
</view> --> 1、单次提现申请需满¥100\n2、申请提现需要扣除6%的手续费</text>
</view>
<view class="coupon-notice-window" wx:if="{{how}}"> <view class="coupon-notice-window" wx:if="{{how}}">
<view class="container"> <view class="container">
......
...@@ -99,7 +99,17 @@ page { ...@@ -99,7 +99,17 @@ page {
border-radius: 15rpx; border-radius: 15rpx;
color: rgb(83, 37, 3); color: rgb(83, 37, 3);
} }
.disabledBtn{
width: 95%;
font-size: 30rpx;
height: 76rpx;
line-height: 76rpx;
margin-top: 10rpx;
background-color: #ccc;
text-align: center;
border-radius: 15rpx;
color: rgb(83, 37, 3);
}
.botton-container .inputimg2 { .botton-container .inputimg2 {
width: 95%; width: 95%;
font-size: 30rpx; font-size: 30rpx;
......
...@@ -46,6 +46,7 @@ function request(params, isGetTonken) { ...@@ -46,6 +46,7 @@ function request(params, isGetTonken) {
icon: "none" icon: "none"
}); });
} else if (res.statusCode == 401) { } else if (res.statusCode == 401) {
wx.setStorageSync('token', '')
// 添加到请求队列 // 添加到请求队列
globalData.requestQueue.push(params); globalData.requestQueue.push(params);
// 是否正在登陆 // 是否正在登陆
......
...@@ -22,8 +22,19 @@ const formatHtml = content => { ...@@ -22,8 +22,19 @@ const formatHtml = content => {
content = content.replace(/ \/\>/gi, ' style="max-width:100% !important;height:auto !important;margin:0;display:block;" \/\>'); content = content.replace(/ \/\>/gi, ' style="max-width:100% !important;height:auto !important;margin:0;display:block;" \/\>');
return content; return content;
} }
const buttonClicked = self=>{
self.setData({
buttonClicked: true
})
setTimeout(function () {
self.setData({
buttonClicked: false
})
}, 5000)
}
module.exports = { module.exports = {
formatTime: formatTime, formatTime: formatTime,
formatHtml: formatHtml formatHtml: formatHtml,
buttonClicked: buttonClicked
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment