Commit 0a990e99 by 林翔

lx

parent c45bae19
...@@ -165,9 +165,9 @@ const actions = { ...@@ -165,9 +165,9 @@ const actions = {
message: data.err_msg, message: data.err_msg,
duration: 2000 duration: 2000
}); });
if (payload.rereferer) { if (payload.referer) {
setTimeout(function () { setTimeout(function () {
window.location.href = decodeURIComponent(payload.rereferer); window.location.href = payload.referer;
}, 2000) }, 2000)
}else{ }else{
setTimeout(function () { setTimeout(function () {
......
...@@ -4854,7 +4854,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_ ...@@ -4854,7 +4854,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
/***/ (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 core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_0__ = __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_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.6.0@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_2__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"]);\nvar state = {\n //钱包信息\n walletInfoData: {},\n //验证安全手机——图形验证码和开始倒计时标记\n verifyShowImgCode: false,\n verifyCountDownFlag: false,\n //激活钱包——图形验证码和开始倒计时标记\n activateShowImgCode: false,\n activateCountDownFlag: false,\n //找回密码——图形验证码和开始倒计时标记\n retieveShowImgCode: false,\n retieveCountDownFlag: false,\n passwordToken: '',\n //钱包明细\n walletListData: [],\n //提现充值明细\n walletRecordData: [],\n //绑定银行卡\n bankPasswordToken: '',\n bankCountDownFlag: false,\n bindBankKey: '',\n bindBankData: '',\n //充值单ID\n amountRechargeID: '',\n //提现单ID\n amountWithdrawID: '',\n //充值提现单据详细\n rechargeWithdrawOrderDetail: [],\n //订单信息\n orderInfoData: [],\n //默认提现可点击(防多次点击)\n amountWithdrawFlag: false\n};\nvar mutations = {\n getWalletInfo: function getWalletInfo(state, payload) {\n state.walletInfoData = payload.data;\n },\n sendSafesms: function sendSafesms(state, payload) {\n state.verifyShowImgCode = !payload.verifyCountDownFlag;\n state.verifyCountDownFlag = payload.verifyCountDownFlag;\n },\n smsVerifyActivate: function smsVerifyActivate(state, payload) {\n state.activateShowImgCode = !payload.activateCountDownFlag;\n state.activateCountDownFlag = payload.activateCountDownFlag;\n },\n smsVerifyRetrieve: function smsVerifyRetrieve(state, payload) {\n state.retieveShowImgCode = !payload.retieveCountDownFlag;\n state.retieveCountDownFlag = payload.retieveCountDownFlag;\n },\n verifyResetsms: function verifyResetsms(state, payload) {\n state.passwordToken = payload.data;\n },\n walletListLog: function walletListLog(state, payload) {\n state.walletListData = payload.data;\n },\n walletRecordList: function walletRecordList(state, payload) {\n state.walletRecordData = payload.data;\n },\n verifySafeMobile: function verifySafeMobile(state, payload) {\n state.bankPasswordToken = payload.data;\n _util__WEBPACK_IMPORTED_MODULE_5__[\"default\"].setCookie(\"bankPasswordToken\", payload.data, 1);\n },\n getBindBankmsg: function getBindBankmsg(state, payload) {\n state.bankCountDownFlag = payload.bankCountDownFlag;\n state.bindBankKey = payload.data.access_key;\n state.bindBankData = payload.data.access_data;\n },\n walletRecharge: function walletRecharge(state, payload) {\n state.amountRechargeID = payload.data;\n },\n walletWithdraw: function walletWithdraw(state, payload) {},\n rechargeWithdrawOrderIfo: function rechargeWithdrawOrderIfo(state, payload) {\n state.rechargeWithdrawOrderDetail = payload.data;\n },\n payTodo: function payTodo(state, payload) {\n state.rechargeWithdrawOrderDetail = payload.data;\n },\n orderInfo: function orderInfo(state, payload) {\n state.orderInfoData = payload.data;\n }\n};\nvar actions = {\n getWalletInfo: function getWalletInfo(_ref, payload) {\n var commit = _ref.commit;\n var params = {};\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].getWalletInfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getWalletInfo',\n data: data.data\n });\n }\n }).catch(function (err) {});\n },\n smsVerifyActivate: function smsVerifyActivate(_ref2, payload) {\n var commit = _ref2.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n mobile: payload.mobile,\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].smsVerify(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyActivate',\n activateCountDownFlag: true\n });\n } else if (data.err_code == 23019 || data.err_code == 11008 || data.err_code == 11011) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyActivate',\n activateCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n activateWallet: function activateWallet(_ref3, payload) {\n var commit = _ref3.commit;\n var params = {\n intl_code: '',\n safe_mobile: payload.mobile,\n verify_code: payload.verifyCode,\n pay_password: payload.password,\n reconfirm: payload.passwordConfirm\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].activateWallet(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n\n if (payload.rereferer) {\n setTimeout(function () {\n window.location.href = decodeURIComponent(payload.rereferer);\n }, 2000);\n } else {\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet/activate\";\n }, 2000);\n }\n }).catch(function (err) {});\n },\n sendSafesms: function sendSafesms(_ref4, payload) {\n var commit = _ref4.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].sendSafesms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'sendSafesms',\n verifyCountDownFlag: true\n });\n } else if (data.err_code == 23019) {\n //请确认图形验证码\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'sendSafesms',\n verifyCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n smsVerifyRetrieve: function smsVerifyRetrieve(_ref5, payload) {\n var commit = _ref5.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].sendSafesms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyRetrieve',\n retieveCountDownFlag: true\n });\n } else if (data.err_code == 23019) {\n //请确认图形验证码\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyRetrieve',\n retieveCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n verifyResetsms: function verifyResetsms(_ref6, payload) {\n var commit = _ref6.commit;\n var params = {\n verify_code: payload.verify_code\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].verifyResetsms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'verifyResetsms',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n changeWalletpwd: function changeWalletpwd(_ref7, payload) {\n var commit = _ref7.commit;\n var params = {\n token: payload.token,\n pay_password: payload.pay_password,\n reconfirm: payload.reconfirm,\n mode: payload.mode\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].changeWalletpwd(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletListLog: function walletListLog(_ref8, payload) {\n var commit = _ref8.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '加载中...'\n });\n var params = {\n log_type: payload.log_type,\n stime: payload.stime,\n etime: payload.etime\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletListLog(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletListLog',\n data: data.data.list\n });\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n walletRecordList: function walletRecordList(_ref9, payload) {\n var commit = _ref9.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '加载中...'\n });\n var params = {\n wallet_type: payload.wallet_type,\n stime: payload.stime,\n etime: payload.etime\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletRecordList(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletRecordList',\n data: data.data.list\n });\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n verifySafeMobile: function verifySafeMobile(_ref10, payload) {\n var commit = _ref10.commit;\n var params = {\n verify_code: payload.verify_code,\n pay_password: payload.pay_password\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].verifySafeMobile(qs.stringify(params)).then(function (res) {\n var data = res.data;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'verifySafeMobile',\n data: data.data\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet/bind\";\n }, 2000);\n } else if (data.err_code == 11030) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = '/h5/view/#/';\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n getBindBankmsg: function getBindBankmsg(_ref11, payload) {\n var commit = _ref11.commit;\n var params = {\n bank_user: payload.bank_user,\n bank_id: payload.bank_id,\n bank_account: payload.bank_account,\n id_type: payload.id_type,\n id_number: payload.id_number,\n account_type: payload.account_type,\n mobile: payload.mobile,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].getBindBankmsg(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'getBindBankmsg',\n bankCountDownFlag: true,\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n bindBankCard: function bindBankCard(_ref12, payload) {\n var commit = _ref12.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n token: payload.token,\n wallet_bank_id: payload.wallet_bank_id,\n sms_code: payload.sms_code,\n access_key: payload.access_key,\n access_data: payload.access_data\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].bindBankCard(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n walletRecharge: function walletRecharge(_ref13, payload) {\n var commit = _ref13.commit;\n var params = {\n amount: payload.amount\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletRecharge(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletRecharge',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletWithdraw: function walletWithdraw(_ref14, payload) {\n var commit = _ref14.commit;\n var params = {\n amount: payload.amount,\n pay_password: payload.pay_password\n };\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n state.amountWithdrawFlag = true;\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletWithdraw(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: '提现申请成功,预计1个工作日后到账,节假日顺延,请耐心等待',\n duration: 2000\n });\n setTimeout(function () {\n state.amountWithdrawFlag = false;\n window.location.href = \"/h5/view/#/wallet/record\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n state.amountWithdrawFlag = false;\n }, 2000);\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n rechargeWithdrawOrderIfo: function rechargeWithdrawOrderIfo(_ref15, payload) {\n var commit = _ref15.commit;\n var params = {\n wallet_id: payload.wallet_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].rechargeWithdrawOrderIfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'rechargeWithdrawOrderIfo',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n payTodo: function payTodo(_ref16, payload) {\n var commit = _ref16.commit;\n var params = {\n pay_code: payload.pay_code,\n rescue: payload.rescue,\n types: payload.types,\n site_type: payload.site_type,\n order_id: payload.order_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].payTodo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n if (is_miniProgram()) {\n //微信小程序\n wx.requestPayment(data.data);\n } else {\n window.location.href = data.data;\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n orderInfo: function orderInfo(_ref17, payload) {\n var commit = _ref17.commit;\n var params = {\n order_id: payload.order_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].orderInfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'orderInfo',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletPayTodo: function walletPayTodo(_ref18, payload) {\n var commit = _ref18.commit;\n var params = {\n pay_code: payload.pay_code,\n pay_password: payload.pay_password,\n types: payload.types,\n order_id: payload.order_id,\n site_type: payload.site_type\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].payTodo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n setTimeout(function () {\n window.location.href = \"/v3/pay/success?order_id=\" + payload.order_id + \"&types=\" + (payload.types || 0);\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/wallet/wallet.js?"); eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_0__ = __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_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_promise__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_symbol__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ \"./node_modules/_vue@2.6.6@vue/dist/vue.runtime.esm.js\");\n/* harmony import */ var vant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vant */ \"./node_modules/_vant@1.6.5@vant/es/index.js\");\n/* harmony import */ var _api_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../api/index */ \"./src/api/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../util */ \"./src/util/index.js\");\n\n\n\n\n\n\n\nvar qs = __webpack_require__(/*! qs */ \"./node_modules/_qs@6.6.0@qs/lib/index.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_2__[\"default\"].use(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"]);\nvar state = {\n //钱包信息\n walletInfoData: {},\n //验证安全手机——图形验证码和开始倒计时标记\n verifyShowImgCode: false,\n verifyCountDownFlag: false,\n //激活钱包——图形验证码和开始倒计时标记\n activateShowImgCode: false,\n activateCountDownFlag: false,\n //找回密码——图形验证码和开始倒计时标记\n retieveShowImgCode: false,\n retieveCountDownFlag: false,\n passwordToken: '',\n //钱包明细\n walletListData: [],\n //提现充值明细\n walletRecordData: [],\n //绑定银行卡\n bankPasswordToken: '',\n bankCountDownFlag: false,\n bindBankKey: '',\n bindBankData: '',\n //充值单ID\n amountRechargeID: '',\n //提现单ID\n amountWithdrawID: '',\n //充值提现单据详细\n rechargeWithdrawOrderDetail: [],\n //订单信息\n orderInfoData: [],\n //默认提现可点击(防多次点击)\n amountWithdrawFlag: false\n};\nvar mutations = {\n getWalletInfo: function getWalletInfo(state, payload) {\n state.walletInfoData = payload.data;\n },\n sendSafesms: function sendSafesms(state, payload) {\n state.verifyShowImgCode = !payload.verifyCountDownFlag;\n state.verifyCountDownFlag = payload.verifyCountDownFlag;\n },\n smsVerifyActivate: function smsVerifyActivate(state, payload) {\n state.activateShowImgCode = !payload.activateCountDownFlag;\n state.activateCountDownFlag = payload.activateCountDownFlag;\n },\n smsVerifyRetrieve: function smsVerifyRetrieve(state, payload) {\n state.retieveShowImgCode = !payload.retieveCountDownFlag;\n state.retieveCountDownFlag = payload.retieveCountDownFlag;\n },\n verifyResetsms: function verifyResetsms(state, payload) {\n state.passwordToken = payload.data;\n },\n walletListLog: function walletListLog(state, payload) {\n state.walletListData = payload.data;\n },\n walletRecordList: function walletRecordList(state, payload) {\n state.walletRecordData = payload.data;\n },\n verifySafeMobile: function verifySafeMobile(state, payload) {\n state.bankPasswordToken = payload.data;\n _util__WEBPACK_IMPORTED_MODULE_5__[\"default\"].setCookie(\"bankPasswordToken\", payload.data, 1);\n },\n getBindBankmsg: function getBindBankmsg(state, payload) {\n state.bankCountDownFlag = payload.bankCountDownFlag;\n state.bindBankKey = payload.data.access_key;\n state.bindBankData = payload.data.access_data;\n },\n walletRecharge: function walletRecharge(state, payload) {\n state.amountRechargeID = payload.data;\n },\n walletWithdraw: function walletWithdraw(state, payload) {},\n rechargeWithdrawOrderIfo: function rechargeWithdrawOrderIfo(state, payload) {\n state.rechargeWithdrawOrderDetail = payload.data;\n },\n payTodo: function payTodo(state, payload) {\n state.rechargeWithdrawOrderDetail = payload.data;\n },\n orderInfo: function orderInfo(state, payload) {\n state.orderInfoData = payload.data;\n }\n};\nvar actions = {\n getWalletInfo: function getWalletInfo(_ref, payload) {\n var commit = _ref.commit;\n var params = {};\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].getWalletInfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'getWalletInfo',\n data: data.data\n });\n }\n }).catch(function (err) {});\n },\n smsVerifyActivate: function smsVerifyActivate(_ref2, payload) {\n var commit = _ref2.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n mobile: payload.mobile,\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].smsVerify(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyActivate',\n activateCountDownFlag: true\n });\n } else if (data.err_code == 23019 || data.err_code == 11008 || data.err_code == 11011) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyActivate',\n activateCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n activateWallet: function activateWallet(_ref3, payload) {\n var commit = _ref3.commit;\n var params = {\n intl_code: '',\n safe_mobile: payload.mobile,\n verify_code: payload.verifyCode,\n pay_password: payload.password,\n reconfirm: payload.passwordConfirm\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].activateWallet(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n\n if (payload.referer) {\n setTimeout(function () {\n window.location.href = payload.referer;\n }, 2000);\n } else {\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet/activate\";\n }, 2000);\n }\n }).catch(function (err) {});\n },\n sendSafesms: function sendSafesms(_ref4, payload) {\n var commit = _ref4.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].sendSafesms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'sendSafesms',\n verifyCountDownFlag: true\n });\n } else if (data.err_code == 23019) {\n //请确认图形验证码\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'sendSafesms',\n verifyCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n smsVerifyRetrieve: function smsVerifyRetrieve(_ref5, payload) {\n var commit = _ref5.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n verify: payload.imgCode,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].sendSafesms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyRetrieve',\n retieveCountDownFlag: true\n });\n } else if (data.err_code == 23019) {\n //请确认图形验证码\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'smsVerifyRetrieve',\n retieveCountDownFlag: false\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n verifyResetsms: function verifyResetsms(_ref6, payload) {\n var commit = _ref6.commit;\n var params = {\n verify_code: payload.verify_code\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].verifyResetsms(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'verifyResetsms',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n changeWalletpwd: function changeWalletpwd(_ref7, payload) {\n var commit = _ref7.commit;\n var params = {\n token: payload.token,\n pay_password: payload.pay_password,\n reconfirm: payload.reconfirm,\n mode: payload.mode\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].changeWalletpwd(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletListLog: function walletListLog(_ref8, payload) {\n var commit = _ref8.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '加载中...'\n });\n var params = {\n log_type: payload.log_type,\n stime: payload.stime,\n etime: payload.etime\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletListLog(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletListLog',\n data: data.data.list\n });\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n walletRecordList: function walletRecordList(_ref9, payload) {\n var commit = _ref9.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '加载中...'\n });\n var params = {\n wallet_type: payload.wallet_type,\n stime: payload.stime,\n etime: payload.etime\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletRecordList(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletRecordList',\n data: data.data.list\n });\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n verifySafeMobile: function verifySafeMobile(_ref10, payload) {\n var commit = _ref10.commit;\n var params = {\n verify_code: payload.verify_code,\n pay_password: payload.pay_password\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].verifySafeMobile(qs.stringify(params)).then(function (res) {\n var data = res.data;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'verifySafeMobile',\n data: data.data\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet/bind\";\n }, 2000);\n } else if (data.err_code == 11030) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = '/h5/view/#/';\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n getBindBankmsg: function getBindBankmsg(_ref11, payload) {\n var commit = _ref11.commit;\n var params = {\n bank_user: payload.bank_user,\n bank_id: payload.bank_id,\n bank_account: payload.bank_account,\n id_type: payload.id_type,\n id_number: payload.id_number,\n account_type: payload.account_type,\n mobile: payload.mobile,\n channel: 3\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].getBindBankmsg(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'getBindBankmsg',\n bankCountDownFlag: true,\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n bindBankCard: function bindBankCard(_ref12, payload) {\n var commit = _ref12.commit;\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n var params = {\n token: payload.token,\n wallet_bank_id: payload.wallet_bank_id,\n sms_code: payload.sms_code,\n access_key: payload.access_key,\n access_data: payload.access_data\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].bindBankCard(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n window.location.href = \"/h5/view/#/wallet\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n walletRecharge: function walletRecharge(_ref13, payload) {\n var commit = _ref13.commit;\n var params = {\n amount: payload.amount\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletRecharge(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'walletRecharge',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletWithdraw: function walletWithdraw(_ref14, payload) {\n var commit = _ref14.commit;\n var params = {\n amount: payload.amount,\n pay_password: payload.pay_password\n };\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].loading({\n message: '处理中...'\n });\n state.amountWithdrawFlag = true;\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].walletWithdraw(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: '提现申请成功,预计1个工作日后到账,节假日顺延,请耐心等待',\n duration: 2000\n });\n setTimeout(function () {\n state.amountWithdrawFlag = false;\n window.location.href = \"/h5/view/#/wallet/record\";\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n setTimeout(function () {\n state.amountWithdrawFlag = false;\n }, 2000);\n }\n }).catch(function (err) {\n vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"].clear();\n });\n },\n rechargeWithdrawOrderIfo: function rechargeWithdrawOrderIfo(_ref15, payload) {\n var commit = _ref15.commit;\n var params = {\n wallet_id: payload.wallet_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].rechargeWithdrawOrderIfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 2000\n });\n commit({\n type: 'rechargeWithdrawOrderIfo',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n payTodo: function payTodo(_ref16, payload) {\n var commit = _ref16.commit;\n var params = {\n pay_code: payload.pay_code,\n rescue: payload.rescue,\n types: payload.types,\n site_type: payload.site_type,\n order_id: payload.order_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].payTodo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n if (is_miniProgram()) {\n //微信小程序\n wx.requestPayment(data.data);\n } else {\n window.location.href = data.data;\n }\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n orderInfo: function orderInfo(_ref17, payload) {\n var commit = _ref17.commit;\n var params = {\n order_id: payload.order_id\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].orderInfo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n commit({\n type: 'orderInfo',\n data: data.data\n });\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n },\n walletPayTodo: function walletPayTodo(_ref18, payload) {\n var commit = _ref18.commit;\n var params = {\n pay_code: payload.pay_code,\n pay_password: payload.pay_password,\n types: payload.types,\n order_id: payload.order_id,\n site_type: payload.site_type\n };\n _api_index__WEBPACK_IMPORTED_MODULE_4__[\"services\"].payTodo(qs.stringify(params)).then(function (res) {\n var data = res.data;\n\n if (data.err_code == 0) {\n setTimeout(function () {\n window.location.href = \"/v3/pay/success?order_id=\" + payload.order_id + \"&types=\" + (payload.types || 0);\n }, 2000);\n } else {\n Object(vant__WEBPACK_IMPORTED_MODULE_3__[\"Toast\"])({\n message: data.err_msg,\n duration: 3000\n });\n }\n }).catch(function (err) {});\n }\n};\nvar getters = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n state: state,\n mutations: mutations,\n actions: actions,\n getters: getters\n});\n\n//# sourceURL=webpack:///./src/store/modules/wallet/wallet.js?");
/***/ }), /***/ }),
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