"use strict";const e=require("../../common/vendor.js"),n=require("../../api/api.js");if(!Array){(e.resolveComponent("up-checkbox")+e.resolveComponent("up-button"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js")+(()=>"../../uni_modules/uview-plus/components/u-button/u-button.js"))();const o={__name:"recharge",setup(o){let u=e.ref({}),a=e.ref(30),t=e.ref(""),r=e.ref(0),c=e.ref(!1),i=e.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 l=(e,n)=>{"input"!=e&&(a.value=e.money,t.value=""),r.value=n},s=e=>{c.value=e,console.log(e)},m=()=>{n.adaPay({amount:a.value}).then((n=>{let o=n;e.index.requestPayment({provider:"wxpay",timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(n){e.index.showModal({title:"提示",content:"充值成功",showCancel:!1,success:function(n){n.confirm?e.index.navigateBack():n.cancel&&console.log("用户点击取消")}})},fail:function(e){console.log("fail:"+JSON.stringify(e))}})}))};e.onShow((async()=>{let e=await n.userInfo();u.value=e}));const p=e=>{a.value=e.detail.value};return(n,o)=>({a:e.t(e.unref(u).balance),b:e.f(e.unref(i),((n,o,u)=>({a:e.t(n.number),b:e.n(e.unref(r)==o?"item real":"item"),c:o,d:e.o((e=>l(n,o)),o)}))),c:e.o(p),d:e.unref(t),e:e.o((n=>e.isRef(t)?t.value=n.detail.value:t=n.detail.value)),f:e.n("input"==e.unref(r)?"item real":"item"),g:e.o((e=>l("input","input"))),h:e.o(s),i:e.p({shape:"circle",name:"agree",usedAlone:!0}),j:e.t(e.unref(a)),k:e.o(m),l:e.p({color:"#4879e6",text:"充值",shape:"circle",disabled:!e.unref(c)})})}},u=e._export_sfc(o,[["__scopeId","data-v-f4a9697d"]]);wx.createPage(u);
