You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.1 KiB

"use strict";const e=require("../../common/vendor.js"),u=require("../../sheep/index.js"),p=require("../../sheep/api/pay/wallet.js");require("../../sheep/url/index.js");require("../../sheep/store/index.js");require("../../sheep/store/app.js");require("../../sheep/platform/index.js");require("../../sheep/platform/provider/wechat/index.js");require("../../sheep/platform/provider/wechat/miniProgram.js");require("../../sheep/api/member/auth.js");require("../../sheep/request/index.js");require("../../sheep/config/index.js");require("../../sheep/helper/index.js");require("../../sheep/helper/test.js");require("../../sheep/helper/digit.js");require("../../sheep/api/member/social.js");require("../../sheep/api/member/user.js");require("../../sheep/platform/provider/apple/index.js");require("../../sheep/platform/share.js");require("../../sheep/router/index.js");require("../../sheep/hooks/useModal.js");require("../../sheep/helper/throttle.js");require("../../sheep/platform/pay.js");require("../../sheep/api/pay/order.js");require("../../sheep/store/user.js");require("../../sheep/store/cart.js");require("../../sheep/api/trade/cart.js");require("../../sheep/api/trade/order.js");require("../../sheep/store/sys.js");require("../../sheep/store/modal.js");require("../../sheep/config/zIndex.js");if(!Array){const o=e.resolveComponent("uni-easyinput"),i=e.resolveComponent("s-layout");(o+i)()}const d=()=>"../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js",h=()=>"../../sheep/components/s-layout/s-layout.js";Math||(d+h)();const q={__name:"recharge",setup(o){e.useCssVars(a=>({dd851cb6:e.unref(y)}));const i=e.computed(()=>u.sheep.$store("user").userWallet),t=u.sheep.$platform.device.statusBarHeight*2,y=u.sheep.$url.css("/static/img/shop/user/withdraw_bg.png"),n=e.reactive({recharge_money:"",packageList:[]});function g(a){n.recharge_money=fen2yuan(a)}async function _(){const{code:a,data:s}=await p.PayWalletApi.getWalletRechargePackageList();a===0&&(n.packageList=s)}async function l(){var r;const{code:a,data:s}=await p.PayWalletApi.createWalletRecharge({packageId:(r=n.packageList.find(c=>fen2yuan(c.payPrice)===n.recharge_money))==null?void 0:r.id,payPrice:n.recharge_money*100});a===0&&(u.sheep.$platform.useProvider("wechat").subscribeMessage("money_change"),u.sheep.$router.go("/pages/pay/index",{id:s.payOrderId,orderType:"recharge"}))}return e.onLoad(()=>{_()}),(a,s)=>({a:e.t(a.fen2yuan(i.value.balance)),b:e.o(r=>e.unref(u.sheep).$router.go("/pages/pay/recharge-log")),c:e.s({marginTop:"-"+Number(t+88)+"rpx",paddingTop:Number(t+108)+"rpx"}),d:e.o(r=>n.recharge_money=r),e:e.p({type:"digit",placeholder:"请输入充值金额",inputBorder:!1,modelValue:n.recharge_money}),f:e.f(n.packageList,(r,c,f)=>e.e({a:e.t(a.fen2yuan(r.payPrice)),b:r.bonusPrice},r.bonusPrice?{c:e.t(a.fen2yuan(r.bonusPrice))}:{},{d:r.money,e:e.n({"btn-active":n.recharge_money===a.fen2yuan(r.payPrice)}),f:e.o(b=>g(r.payPrice),r.money)})),g:e.o(l),h:e.s(a.__cssVars()),i:e.p({title:"充值",navbar:"inner"})})}},m=e._export_sfc(q,[["__scopeId","data-v-b0187d83"],["__file","D:/xiangmu/佰安出行/app/s-applet/pages/pay/recharge.vue"]]);wx.createPage(m);