"use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const api_api = require("../../api/api.js"); if (!Array) { const _easycom_u_tag2 = common_vendor.resolveComponent("u-tag"); const _easycom_up_input2 = common_vendor.resolveComponent("up-input"); const _easycom_up_code2 = common_vendor.resolveComponent("up-code"); const _easycom_up_button2 = common_vendor.resolveComponent("up-button"); (_easycom_u_tag2 + _easycom_up_input2 + _easycom_up_code2 + _easycom_up_button2)(); } const _easycom_u_tag = () => "../../uni_modules/uview-plus/components/u-tag/u-tag.js"; const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js"; const _easycom_up_code = () => "../../uni_modules/uview-plus/components/u-code/u-code.js"; const _easycom_up_button = () => "../../uni_modules/uview-plus/components/u-button/u-button.js"; if (!Math) { (_easycom_u_tag + _easycom_up_input + _easycom_up_code + _easycom_up_button)(); } const _sfc_main = { __name: "withdraw", setup(__props) { common_vendor.ref(); let getInfo = common_vendor.ref({}); let appConfig = common_vendor.ref([]); let tips = common_vendor.ref(""); let uCode = common_vendor.ref(null); let dataFrom = common_vendor.reactive({ points: "", smsCode: "", bankCardId: "" }); let bank = common_vendor.ref(); common_vendor.onLoad(async () => { let _res = await api_api.userInfo(); getInfo.value = _res; const { configValue } = await api_api.getAppConfig({ configKey: "WITHDRAWAL" }); appConfig.value = JSON.parse(configValue); common_vendor.index.$on("bank", (e) => { bank.value = e; dataFrom.bankCardId = e.id; console.log(e); }); }); let toNav = () => { common_vendor.index.navigateTo({ url: "/pages/wallet/bankCard?type=xz" }); }; let codeChange2 = (text) => { tips.value = text; }; let getCode = () => { console.log(123456); if (!getInfo.value.phone) return common_vendor.index.showToast({ title: "请输入手机号", icon: "none" }); if (uCode.value.canGetCode) { common_vendor.index.showLoading({ title: "正在获取验证码" }); api_api.smsCode({ phone: getInfo.value.phone }).then((res) => { common_vendor.index.hideLoading(); common_vendor.index.$u.toast("验证码已发送"); uCode.value.start(); }); } else { common_vendor.index.$u.toast("倒计时结束后再发送"); } }; let payOrder = async () => { console.log(getInfo.value.points1, "getInfo.value.points1"); console.log(dataFrom.points, "dataFrom.points"); if (Number(getInfo.value.points1) < Number(dataFrom.points)) return common_vendor.index.showToast({ title: "可提现金额不足", icon: "none" }); if (!dataFrom.bankCardId) return common_vendor.index.showToast({ title: "请先选择提现银行卡", icon: "none" }); if (!dataFrom.points) return common_vendor.index.showToast({ title: "请输入提现金额", icon: "none" }); if (!dataFrom.smsCode) return common_vendor.index.showToast({ title: "请输入验证码", icon: "none" }); await api_api.userExtract(dataFrom); common_vendor.index.showModal({ title: "提示", content: "提交成功", showCancel: false, success() { common_vendor.index.navigateBack(); } }); }; return (_ctx, _cache) => { return common_vendor.e({ a: common_assets._imports_0$4, b: common_vendor.o((...args) => common_vendor.unref(toNav) && common_vendor.unref(toNav)(...args)), c: common_vendor.unref(bank) }, common_vendor.unref(bank) ? common_vendor.e({ d: common_vendor.p({ text: common_vendor.unref(bank).type == 1 ? "个人" : "企业", size: "mini", type: common_vendor.unref(bank).type == 1 ? "success" : "error", plain: true, plainFill: true }), e: common_vendor.t(common_vendor.unref(bank).name), f: common_vendor.t(common_vendor.unref(bank).phone || ""), g: common_vendor.unref(bank).type == 2 }, common_vendor.unref(bank).type == 2 ? { h: common_vendor.t(common_vendor.unref(bank).subbranchName) } : {}, { i: common_vendor.t(common_vendor.unref(bank).bankCard) }) : {}, { j: common_vendor.o(($event) => common_vendor.unref(dataFrom).points = $event), k: common_vendor.p({ fontSize: "36rpx", placeholder: "请输入金额", border: false, modelValue: common_vendor.unref(dataFrom).points }), l: common_vendor.o(($event) => common_vendor.unref(dataFrom).points = common_vendor.unref(getInfo).points1), m: common_vendor.o(($event) => common_vendor.unref(getInfo).phone = $event), n: common_vendor.p({ border: false, disabled: true, modelValue: common_vendor.unref(getInfo).phone }), o: common_vendor.o(($event) => common_vendor.unref(dataFrom).smsCode = $event), p: common_vendor.p({ placeholder: "请输入验证码", border: false, modelValue: common_vendor.unref(dataFrom).smsCode }), q: () => ({ r: uCode, k: "uCode" }), r: common_vendor.o(common_vendor.unref(codeChange2)), s: common_vendor.p({ ["keep-running"]: true, ["start-text"]: "点我获取验证码" }), t: common_vendor.t(common_vendor.unref(tips)), v: common_vendor.o(common_vendor.unref(getCode)), w: common_vendor.p({ color: "#4874e5" }), x: common_vendor.t(common_vendor.unref(getInfo).points1), y: common_vendor.t(common_vendor.unref(appConfig).minMoney), z: common_vendor.t(common_vendor.unref(appConfig).free), A: common_vendor.t(common_vendor.unref(appConfig).monthQuota), B: common_vendor.o((...args) => common_vendor.unref(payOrder) && common_vendor.unref(payOrder)(...args)) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9be921b8"]]); my.createPage(MiniProgramPage);