"use strict"; const common_vendor = require("../../common/vendor.js"); const api_api = require("../../api/api.js"); if (!Array) { const _easycom_up_checkbox2 = common_vendor.resolveComponent("up-checkbox"); const _easycom_up_button2 = common_vendor.resolveComponent("up-button"); (_easycom_up_checkbox2 + _easycom_up_button2)(); } const _easycom_up_checkbox = () => "../../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js"; const _easycom_up_button = () => "../../uni_modules/uview-plus/components/u-button/u-button.js"; if (!Math) { (_easycom_up_checkbox + _easycom_up_button)(); } const _sfc_main = { __name: "recharge", setup(__props) { let info = common_vendor.ref({}); let money = common_vendor.ref(30); let moneyNum = common_vendor.ref(""); let num = common_vendor.ref(0); let aloneChecked = common_vendor.ref(false); let list = common_vendor.ref([ { number: "¥30", money: "30" }, { number: "¥50", money: "50" }, { number: "¥80", money: "80" }, { number: "¥100", money: "100" }, { number: "¥200", money: "200" }, { number: "¥300", money: "300" }, { number: "¥400", money: "400" }, { number: "¥500", money: "500" } ]); const pick = (item, index) => { if (item != "input") { money.value = item.money; moneyNum.value = ""; } num.value = index; }; const change = (e) => { aloneChecked.value = e; common_vendor.index.__f__("log", "at pages/money/recharge.vue:111", e); }; const toUp = () => { api_api.adaPay({ amount: money.value }).then((res) => { let data = res; common_vendor.index.requestPayment({ provider: "wxpay", timeStamp: data.timeStamp, nonceStr: data.nonceStr, package: data.package, signType: data.signType, paySign: data.paySign, success: function(r) { common_vendor.index.showModal({ title: "提示", content: "充值成功", showCancel: false, success: function(res2) { if (res2.confirm) { common_vendor.index.navigateBack(); } else if (res2.cancel) { common_vendor.index.__f__("log", "at pages/money/recharge.vue:135", "用户点击取消"); } } }); }, fail: function(err) { common_vendor.index.__f__("log", "at pages/money/recharge.vue:141", "fail:" + JSON.stringify(err)); } }); }); }; common_vendor.onShow(async () => { let _res = await api_api.userInfo(); info.value = _res; }); const inputChange = (e) => { money.value = e.detail.value; }; return (_ctx, _cache) => { return { a: common_vendor.t(common_vendor.unref(info).balance), b: common_vendor.f(common_vendor.unref(list), (item, index, i0) => { return { a: common_vendor.t(item.number), b: common_vendor.n(common_vendor.unref(num) == index ? "item real" : "item"), c: index, d: common_vendor.o(($event) => pick(item, index), index) }; }), c: common_vendor.o(inputChange), d: common_vendor.unref(moneyNum), e: common_vendor.o(($event) => common_vendor.isRef(moneyNum) ? moneyNum.value = $event.detail.value : moneyNum = $event.detail.value), f: common_vendor.n(common_vendor.unref(num) == "input" ? "item real" : "item"), g: common_vendor.o(($event) => pick("input", "input")), h: common_vendor.o(change), i: common_vendor.p({ shape: "circle", name: "agree", usedAlone: true }), j: common_vendor.t(common_vendor.unref(money)), k: common_vendor.o(toUp), l: common_vendor.p({ color: "#4879e6", text: "充值", shape: "circle", disabled: !common_vendor.unref(aloneChecked) }) }; }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2cb4e33c"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/money/recharge.js.map