pages-user-wallet-topupConsumptionPoints.aa8f791a.js 2.7 KB

1
  1. import{a as e,b as s,d as a}from"./phone-international-input.c0f6237b.js";import{c as t,z as o,o as r,f as n,g as l,w as i,bK as u,m as p,k as c,u as d,v as m,s as f,a1 as y,n as _,j as P,J as b}from"./index-79734155.js";import{_ as g}from"./s-layout.dc518571.js";import"./md5.1dd6d03f.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.e7e2bd8b.js";const h=x({__name:"topupConsumptionPoints",setup(x){t((()=>f.$store("user").userWallet));const h=t((()=>f.$store("user").userInfo)),v=o({model:{},payPrice:void 0,percentage:{consumptionMagnification:0,userTopUpConsumptionPoints:0}}),w=t((()=>{if(!v.payPrice)return 0;let e=parseFloat(v.percentage.consumptionMagnification)*v.payPrice;return e=Math.floor(100*e)/100,e})),j=async()=>{if(!v.payPrice)return void f.$helper.toast("请输入充值金额");if(parseFloat(v.payPrice)<v.percentage.userTopUpConsumptionPoints)return void f.$helper.toast(`充值金额不能少于${v.percentage.userTopUpConsumptionPoints}`);let{code:e,data:s}=await y.topupConsumptionPointsCreate({payPrice:v.payPrice,topUpConsumptionPoints:v.payPrice,userName:h.value.username});0===e&&f.$router.redirect("/pages/pay/index",{id:s.payOrderId,type:2})};return r((async e=>{await(async()=>{const{code:e,data:s}=await u.getWithdrawalPercentage();0===e&&(v.percentage=s)})()})),(t,o)=>{const r=p(_("uni-easyinput"),e),u=p(_("uni-forms-item"),s),f=P,y=p(_("uni-forms"),a),x=b,h=p(_("s-layout"),g);return n(),l(h,{title:"消费分充值"},{default:i((()=>[c(f,{class:"bg-white ss-modal-box ss-flex-col"},{default:i((()=>[c(f,{class:"modal-content ss-m-t-30"},{default:i((()=>[c(y,{model:v.model,rules:v.rules,validateTrigger:"bind",labelPosition:"left",border:"",class:"form-box",labelWidth:"200",ref:"FormRef"},{default:i((()=>[c(f,{class:"bg-white ss-p-x-30"},{default:i((()=>[c(u,{name:"quota",label:"充值金额",required:!0},{default:i((()=>[c(r,{modelValue:v.payPrice,"onUpdate:modelValue":o[0]||(o[0]=e=>v.payPrice=e),type:"number",placeholder:"请输入金额",inputBorder:!1,clearable:!1,onInput:t.validateInput,maxlength:9},null,8,["modelValue","onInput"])])),_:1}),c(u,{name:"quota",label:"实到消费分"},{default:i((()=>[c(f,{class:"ss-flex ss-h-100"},{default:i((()=>[d(m(w.value),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["model","rules"]),c(f,{class:"ss-flex ss-row-center ss-col-center ss-m-t-30 text-red text-center"},{default:i((()=>[d("备注:充值后请及时查看钱包,查收消费分是否到账")])),_:1})])),_:1}),c(f,{class:"modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40 ss-flex-5"},{default:i((()=>[c(x,{class:"ss-reset-button save-btn",onClick:j},{default:i((()=>[d(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-71f00493"]]);export{h as default};