Commit 185396f9 by 林翔

lx

parent 7a8cfdd1
...@@ -36,7 +36,9 @@ const state = { ...@@ -36,7 +36,9 @@ const state = {
//充值提现单据详细 //充值提现单据详细
rechargeWithdrawOrderDetail: [], rechargeWithdrawOrderDetail: [],
//订单信息 //订单信息
orderInfoData: [] orderInfoData: [],
//默认提现可点击(防多次点击)
amountWithdrawFlag: true
} }
const mutations = { const mutations = {
...@@ -77,7 +79,9 @@ const mutations = { ...@@ -77,7 +79,9 @@ const mutations = {
state.amountRechargeID = payload.data state.amountRechargeID = payload.data
}, },
walletWithdraw(state, payload) { walletWithdraw(state, payload) {
state.amountWithdrawID = payload.data debugger
state.amountWithdrawID = payload.data,
state.amountWithdrawFlag = payload.amountWithdrawFlag
}, },
rechargeWithdrawOrderIfo(state, payload) { rechargeWithdrawOrderIfo(state, payload) {
state.rechargeWithdrawOrderDetail = payload.data state.rechargeWithdrawOrderDetail = payload.data
...@@ -512,7 +516,8 @@ const actions = { ...@@ -512,7 +516,8 @@ const actions = {
}); });
commit({ commit({
type: 'walletWithdraw', type: 'walletWithdraw',
data: data.data data: data.data,
amountWithdrawFlag: false
}); });
setTimeout(function () { setTimeout(function () {
window.location.href = "/h5/view/#/wallet/record"; window.location.href = "/h5/view/#/wallet/record";
...@@ -522,6 +527,11 @@ const actions = { ...@@ -522,6 +527,11 @@ const actions = {
message: data.err_msg, message: data.err_msg,
duration: 3000 duration: 3000
}); });
commit({
type: 'walletWithdraw',
data: data.data,
amountWithdrawFlag: true
});
} }
}).catch(function (err) { }).catch(function (err) {
Toast.clear(); Toast.clear();
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
import Vue from 'vue'; import Vue from 'vue';
import {mapState} from 'vuex' import {mapState} from 'vuex'
import Header from '@/views/common/Header.vue'; import Header from '@/views/common/Header.vue';
import {Popup} from 'vant'; import { Dialog } from 'vant';
Vue.use(Popup); Vue.use(Dialog);
export default { export default {
name: 'wallet', name: 'wallet',
...@@ -74,9 +74,18 @@ ...@@ -74,9 +74,18 @@
}, },
methods: { methods: {
withdraw() { withdraw() {
if (this.walletInfoData.wallet_status == 1) { if (this.walletInfoData.wallet_status == 1 && !(this.walletInfoData.bank_account === null)) {
//钱包状态:1启用,-1未启用,-2锁定 //钱包状态:1启用,-1未启用,-2锁定
this.$router.push({path: '/wallet/withdraw'}); this.$router.push({path: '/wallet/withdraw'});
}else{
Dialog.confirm({
title: '提醒',
message: '请先去绑卡'
}).then(() => {
this.$router.push({path: '/wallet/bind'});
}).catch(() => {
// on cancel
});
} }
}, },
activate() { activate() {
......
...@@ -50,17 +50,19 @@ ...@@ -50,17 +50,19 @@
showPassword: true, //是否显示密码 showPassword: true, //是否显示密码
amountNum: true, amountNum: true,
password: '', password: '',
withdrawNum: '' withdrawNum: '',
clickFlag: true
} }
}, },
computed: { computed: {
...mapState({ ...mapState({
walletInfoData: state => state.wallet.walletInfoData walletInfoData: state => state.wallet.walletInfoData,
amountWithdrawFlag: state => state.wallet.amountWithdrawFlag
}) })
}, },
watch: { watch: {
withdrawNum: function(val){ withdrawNum: function(val){
if (val>this.walletInfoData.wallet_usable) { if (val > this.walletInfoData.wallet_usable) {
this.amountNum = !this.amountNum; this.amountNum = !this.amountNum;
}else{ }else{
this.amountNum = true; this.amountNum = true;
...@@ -80,8 +82,9 @@ ...@@ -80,8 +82,9 @@
this.withdrawNum = this.walletInfoData.wallet_usable; this.withdrawNum = this.walletInfoData.wallet_usable;
}, },
submit() { submit() {
if(this.withdrawNum !== ''){ if(this.withdrawNum !== '' && this.clickFlag){
if(this.password){ if(this.password){
this.clickFlag = false;
//提现申请 //提现申请
this.$store.dispatch({ this.$store.dispatch({
type: 'walletWithdraw', type: 'walletWithdraw',
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime-corejs2/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime-corejs2@7.3.1@@babel/runtime-corejs2/helpers/esm/objectSpread.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_4__[\"Icon\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'WalletWithdraw',\n data: function data() {\n return {\n title: \"钱包提现\",\n meaushow: true,\n showPassword: true,\n //是否显示密码\n amountNum: true,\n password: '',\n withdrawNum: ''\n };\n },\n computed: Object(D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])({\n walletInfoData: function walletInfoData(state) {\n return state.wallet.walletInfoData;\n }\n })),\n watch: {\n withdrawNum: function withdrawNum(val) {\n if (val > this.walletInfoData.wallet_usable) {\n this.amountNum = !this.amountNum;\n } else {\n this.amountNum = true;\n }\n }\n },\n created: function created() {\n this.$store.dispatch({\n type: 'getWalletInfo'\n });\n },\n methods: {\n changeShow: function changeShow() {\n this.showPassword = !this.showPassword;\n },\n withdraw: function withdraw() {\n //全部提现\n this.withdrawNum = this.walletInfoData.wallet_usable;\n },\n submit: function submit() {\n if (this.withdrawNum !== '') {\n if (this.password) {\n //提现申请\n this.$store.dispatch({\n type: 'walletWithdraw',\n amount: this.withdrawNum,\n pay_password: this.password\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_4__[\"Toast\"])({\n message: '请输入提现密码'\n });\n }\n }\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/wallet/Withdraw.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.6.4@vue-loader/lib??vue-loader-options"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime-corejs2/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime-corejs2@7.3.1@@babel/runtime-corejs2/helpers/esm/objectSpread.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_4__[\"Icon\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'WalletWithdraw',\n data: function data() {\n return {\n title: \"钱包提现\",\n meaushow: true,\n showPassword: true,\n //是否显示密码\n amountNum: true,\n password: '',\n withdrawNum: '',\n clickFlag: true\n };\n },\n computed: Object(D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])({\n walletInfoData: function walletInfoData(state) {\n return state.wallet.walletInfoData;\n },\n amountWithdrawFlag: function amountWithdrawFlag(state) {\n return state.wallet.amountWithdrawFlag;\n }\n })),\n watch: {\n withdrawNum: function withdrawNum(val) {\n if (val > this.walletInfoData.wallet_usable) {\n this.amountNum = !this.amountNum;\n } else {\n this.amountNum = true;\n }\n }\n },\n created: function created() {\n this.$store.dispatch({\n type: 'getWalletInfo'\n });\n },\n methods: {\n changeShow: function changeShow() {\n this.showPassword = !this.showPassword;\n },\n withdraw: function withdraw() {\n //全部提现\n this.withdrawNum = this.walletInfoData.wallet_usable;\n },\n submit: function submit() {\n if (this.withdrawNum !== '' && this.clickFlag) {\n if (this.password) {\n this.clickFlag = false; //提现申请\n\n this.$store.dispatch({\n type: 'walletWithdraw',\n amount: this.withdrawNum,\n pay_password: this.password\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_4__[\"Toast\"])({\n message: '请输入提现密码'\n });\n }\n }\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/wallet/Withdraw.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.6.4@vue-loader/lib??vue-loader-options");
/***/ }), /***/ }),
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/***/ (function(module, __webpack_exports__, __webpack_require__) { /***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime-corejs2/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime-corejs2@7.3.1@@babel/runtime-corejs2/helpers/esm/objectSpread.js\");\n/* harmony import */ var core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es6.promise */ \"./node_modules/_core-js@2.6.5@core-js/modules/es6.promise.js\");\n/* harmony import */ var core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es6.symbol */ \"./node_modules/_core-js@2.6.5@core-js/modules/es6.symbol.js\");\n/* harmony import */ var core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_3__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_6__[\"Popup\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'wallet',\n data: function data() {\n return {\n title: \"我的钱包\",\n meaushow: true\n };\n },\n beforeRouteEnter: function beforeRouteEnter(to, from, next) {\n next(function (vm) {\n vm.$store.dispatch({\n type: 'loginCheck',\n is_jump: true\n });\n });\n },\n computed: Object(D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_4__[\"mapState\"])({\n walletInfoData: function walletInfoData(state) {\n return state.wallet.walletInfoData;\n }\n })),\n created: function created() {\n this.$store.dispatch({\n type: 'getWalletInfo'\n });\n },\n methods: {\n withdraw: function withdraw() {\n if (this.walletInfoData.wallet_status == 1) {\n //钱包状态:1启用,-1未启用,-2锁定\n this.$router.push({\n path: '/wallet/withdraw'\n });\n }\n },\n activate: function activate() {\n this.$router.push({\n path: '/wallet/activate'\n });\n },\n recharge: function recharge() {\n this.$router.push({\n path: '/wallet/recharge'\n });\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/wallet/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.6.4@vue-loader/lib??vue-loader-options"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime-corejs2/helpers/esm/objectSpread */ \"./node_modules/_@babel_runtime-corejs2@7.3.1@@babel/runtime-corejs2/helpers/esm/objectSpread.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ \"./node_modules/_vuex@3.1.0@vuex/dist/vuex.esm.js\");\n/* harmony import */ var _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/views/common/Header.vue */ \"./src/views/common/Header.vue\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_1__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_4__[\"Dialog\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'wallet',\n data: function data() {\n return {\n title: \"我的钱包\",\n meaushow: true\n };\n },\n beforeRouteEnter: function beforeRouteEnter(to, from, next) {\n next(function (vm) {\n vm.$store.dispatch({\n type: 'loginCheck',\n is_jump: true\n });\n });\n },\n computed: Object(D_svnData_h5_node_modules_babel_runtime_corejs2_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, Object(vuex__WEBPACK_IMPORTED_MODULE_2__[\"mapState\"])({\n walletInfoData: function walletInfoData(state) {\n return state.wallet.walletInfoData;\n }\n })),\n created: function created() {\n this.$store.dispatch({\n type: 'getWalletInfo'\n });\n },\n methods: {\n withdraw: function withdraw() {\n var _this = this;\n\n if (this.walletInfoData.wallet_status == 1 && !(this.walletInfoData.bank_account === null)) {\n //钱包状态:1启用,-1未启用,-2锁定\n this.$router.push({\n path: '/wallet/withdraw'\n });\n } else {\n vant__WEBPACK_IMPORTED_MODULE_4__[\"Dialog\"].confirm({\n title: '提醒',\n message: '请先去绑卡'\n }).then(function () {\n _this.$router.push({\n path: '/wallet/bind'\n });\n }).catch(function () {// on cancel\n });\n }\n },\n activate: function activate() {\n this.$router.push({\n path: '/wallet/activate'\n });\n },\n recharge: function recharge() {\n this.$router.push({\n path: '/wallet/recharge'\n });\n }\n },\n components: {\n Header: _views_common_Header_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n }\n});\n\n//# sourceURL=webpack:///./src/views/wallet/Index.vue?./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.6.4@vue-loader/lib??vue-loader-options");
/***/ }), /***/ }),
......
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