Commit 8ad6582b by 梁建民

js

parent 82540ce2
<template>
<div id="app">
<keep-alive exclude="newsDetail,wallet,walletRetrieve,walletDetail,walletRecord,walletStatus">
<keep-alive exclude="newsDetail,wallet,walletRetrieve,walletDetail,walletRecord,walletStatus,walletWithdraw">
<router-view class="router-view"></router-view>
</keep-alive>
</div>
......
......@@ -38,7 +38,7 @@ const state = {
//订单信息
orderInfoData: [],
//默认提现可点击(防多次点击)
amountWithdrawFlag: true
amountWithdrawFlag: false
}
const mutations = {
......@@ -79,9 +79,7 @@ const mutations = {
state.amountRechargeID = payload.data
},
walletWithdraw(state, payload) {
debugger
state.amountWithdrawID = payload.data,
state.amountWithdrawFlag = payload.amountWithdrawFlag
},
rechargeWithdrawOrderIfo(state, payload) {
state.rechargeWithdrawOrderDetail = payload.data
......@@ -91,7 +89,7 @@ const mutations = {
},
orderInfo(state, payload) {
state.orderInfoData = payload.data
},
}
}
const actions = {
......@@ -507,6 +505,8 @@ const actions = {
Toast.loading({
message: '处理中...'
});
state.amountWithdrawFlag = true;
Services.walletWithdraw(qs.stringify(params)).then((res) => {
let data = res.data;
if (data.err_code == 0) {
......@@ -514,24 +514,18 @@ const actions = {
message: '提现申请成功,预计1个工作日后到账,节假日顺延,请耐心等待',
duration: 2000
});
commit({
type: 'walletWithdraw',
data: data.data,
amountWithdrawFlag: false
});
setTimeout(function () {
setTimeout(() => {
state.amountWithdrawFlag = false;
window.location.href = "/h5/view/#/wallet/record";
}, 2000)
} else {
Toast({
message: data.err_msg,
duration: 3000
});
commit({
type: 'walletWithdraw',
data: data.data,
amountWithdrawFlag: true
duration: 2000
});
setTimeout(() => {
state.amountWithdrawFlag = false;
}, 2000)
}
}).catch(function (err) {
Toast.clear();
......@@ -636,7 +630,7 @@ const actions = {
}).catch(function (err) {
});
},
}
}
const getters = {}
......
......@@ -8,7 +8,8 @@
<p>手机号:{{walletInfoData.safe_mobile}}</p>
</div>
<p class="withdraw-tips">
<van-icon name="warning-o" class="tips va-m" style="font-size: 16px; margin-right: 0.1rem;"/>提现金额预计1个工作日之后到账,节假日顺延,请耐心等待。
<van-icon name="warning-o" class="tips va-m" style="font-size: 16px; margin-right: 0.1rem;"/>
提现金额预计1个工作日之后到账,节假日顺延,请耐心等待。
</p>
<div class="withdraw-amount">
<p><em>*</em> 提现金额</p>
......@@ -27,82 +28,82 @@
<van-icon v-if="showPassword" name="closed-eye" class="va-m f-r" @click="changeShow"/>
<van-icon v-else name="eye-o" class="va-m f-r" @click="changeShow"/>
</div>
<a href="javascript:;" class="submit" :class="withdrawNum == '' ? 'submitNO' : ''" @click="submit">提交</a>
<button :disabled="amountWithdrawFlag" class="submit" :class="withdrawNum == '' || amountWithdrawFlag ? 'submitNO' : ''" @click="submit">提交</button>
</div>
</section>
</template>
<script>
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import { Icon,Toast } from 'vant';
import Vue from 'vue';
import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue';
import {Icon, Toast} from 'vant';
Vue.use(Icon);
Vue.use(Icon);
export default {
name: 'WalletWithdraw',
data() {
return {
title: "钱包提现",
meaushow: true,
showPassword: true, //是否显示密码
amountNum: true,
password: '',
withdrawNum: '',
clickFlag: true
}
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData,
amountWithdrawFlag: state => state.wallet.amountWithdrawFlag
})
},
watch: {
withdrawNum: function(val){
if (val > this.walletInfoData.wallet_usable) {
this.amountNum = !this.amountNum;
}else{
this.amountNum = true;
}
}
},
created() {
export default {
name: 'walletWithdraw',
data() {
return {
title: "钱包提现",
meaushow: true,
showPassword: true, //是否显示密码
amountNum: true,
password: '',
withdrawNum: '',
clickFlag: true
}
},
computed: {
...mapState({
walletInfoData: state => state.wallet.walletInfoData,
amountWithdrawFlag: state => state.wallet.amountWithdrawFlag
})
},
watch: {
withdrawNum: function (val) {
if (val > this.walletInfoData.wallet_usable) {
this.amountNum = !this.amountNum;
} else {
this.amountNum = true;
}
}
},
created() {
this.$store.dispatch({
type: 'getWalletInfo'
});
},
methods: {
changeShow() {
this.showPassword = !this.showPassword;
},
withdraw() {
//全部提现
this.withdrawNum = this.walletInfoData.wallet_usable;
},
submit() {
if (this.withdrawNum !== '') {
if (this.password) {
//提现申请
this.$store.dispatch({
type: 'getWalletInfo'
});
},
methods: {
changeShow() {
this.showPassword = !this.showPassword;
},
withdraw() { //全部提现
this.withdrawNum = this.walletInfoData.wallet_usable;
},
submit() {
if(this.withdrawNum !== '' && this.clickFlag){
if(this.password){
this.clickFlag = false;
//提现申请
this.$store.dispatch({
type: 'walletWithdraw',
amount: this.withdrawNum,
pay_password: this.password
});
}else{
Toast({
message: '请输入提现密码'
});
}
}
}
},
components: {
Header
type: 'walletWithdraw',
amount: this.withdrawNum,
pay_password: this.password
});
} else {
Toast({
message: '请输入提现密码'
});
}
}
}
},
components: {
Header
}
}
</script>
<style scoped>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
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 sign in to comment