2 lines
2.3 KiB
JavaScript
2 lines
2.3 KiB
JavaScript
"use strict";var e=(e,a,r)=>new Promise(((n,s)=>{var t=e=>{try{u(r.next(e))}catch(a){s(a)}},o=e=>{try{u(r.throw(e))}catch(a){s(a)}},u=e=>e.done?n(e.value):Promise.resolve(e.value).then(t,o);u((r=r.apply(e,a)).next())}));const a=require("../../../common/vendor.js"),r=require("../sheep/index.js"),n=require("../sheep/hooks/useGoods.js"),s=require("../sheep/api/pay/wallet.js"),t=require("../sheep/util/const.js");if(!Array){(a.resolveComponent("uni-easyinput")+a.resolveComponent("s-layout")+a.resolveComponent("layout-default-uni"))()}Math||((()=>"../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../sheep/components/s-layout/s-layout.js"))();const o={__name:"recharge",setup(o){a.useCssVars((e=>({"679205ea":a.unref(c)})));const u=a.computed((()=>r.sheep.$store("user").userWallet)),i=2*r.sheep.$platform.device.statusBarHeight,c=r.sheep.$url.css("/static/img/shop/user/withdraw_bg.png"),p=a.reactive({recharge_money:"",packageList:[]});function l(){return e(this,null,(function*(){var e;const{code:a,data:o}=yield s.PayWalletApi.createWalletRecharge({packageId:null==(e=p.packageList.find((e=>n.fen2yuan(e.payPrice)===p.recharge_money)))?void 0:e.id,payPrice:100*p.recharge_money});0===a&&(r.sheep.$platform.useProvider("wechat").subscribeMessage(t.WxaSubscribeTemplate.PAY_WALLET_RECHARGER_SUCCESS),r.sheep.$router.go("/modules/mall/pay/index",{id:o.payOrderId,orderType:"recharge"}))}))}return a.onLoad((()=>{!function(){e(this,null,(function*(){const{code:e,data:a}=yield s.PayWalletApi.getWalletRechargePackageList();0===e&&(p.packageList=a)}))}()})),(e,s)=>({a:a.t(a.unref(n.fen2yuan)(u.value.balance)),b:a.o((e=>a.unref(r.sheep).$router.go("/modules/mall/pay/recharge-log"))),c:a.s({marginTop:"-"+Number(i+88)+"rpx",paddingTop:Number(i+108)+"rpx"}),d:a.o((e=>p.recharge_money=e)),e:a.p({type:"digit",placeholder:"请输入充值金额",inputBorder:!1,modelValue:p.recharge_money}),f:a.f(p.packageList,((e,r,s)=>a.e({a:a.t(a.unref(n.fen2yuan)(e.payPrice)),b:e.bonusPrice},e.bonusPrice?{c:a.t(a.unref(n.fen2yuan)(e.bonusPrice))}:{},{d:e.money,e:a.n({"btn-active":p.recharge_money===a.unref(n.fen2yuan)(e.payPrice)}),f:a.o((a=>{return r=e.payPrice,void(p.recharge_money=n.fen2yuan(r));var r}),e.money)}))),g:a.o(l),h:a.p({title:"充值",navbar:"inner"}),i:a.s(e.__cssVars())})}},u=a._export_sfc(o,[["__scopeId","data-v-d810b3ed"]]);wx.createPage(u);
|