1 |
- import{a as e,b as s,d as a}from"./phone-international-input.a60c1c3d.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,a2 as y,a1 as P,n as _,j as b,J as g}from"./index-8c839130.js";import{_ as x}from"./s-layout.8d369813.js";import"./md5.77345265.js";import{_ as h}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.77887027.js";const v=h({__name:"topupConsumptionPoints",setup(h){t((()=>f.$store("user").userWallet));const v=t((()=>f.$store("user").userInfo)),w=o({model:{},payPrice:void 0,percentage:{consumptionMagnification:0,userTopUpConsumptionPoints:0}}),j=t((()=>{if(!w.payPrice)return 0;let e=parseFloat(w.percentage.consumptionMagnification)*w.payPrice;return e=Math.floor(100*e)/100,e}));async function C(e){const s=e.toString(),[a,t]=s.split(".");t&&y((()=>{w.payPrice=a}))}const $=async()=>{if(!w.payPrice)return void f.$helper.toast("请输入充值金额");if(parseFloat(w.payPrice)<w.percentage.userTopUpConsumptionPoints)return void f.$helper.toast(`充值金额不能少于${w.percentage.userTopUpConsumptionPoints}`);let{code:e,data:s}=await P.topupConsumptionPointsCreate({payPrice:w.payPrice,topUpConsumptionPoints:w.payPrice,userName:v.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&&(w.percentage=s)})()})),(t,o)=>{const r=p(_("uni-easyinput"),e),u=p(_("uni-forms-item"),s),f=b,y=p(_("uni-forms"),a),P=g,h=p(_("s-layout"),x);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:w.model,rules:w.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:w.payPrice,"onUpdate:modelValue":o[0]||(o[0]=e=>w.payPrice=e),type:"number",placeholder:"请输入金额",inputBorder:!1,clearable:!1,onInput:C,maxlength:9},null,8,["modelValue"])])),_:1}),c(u,{name:"quota",label:"实到消费分"},{default:i((()=>[c(f,{class:"ss-flex ss-h-100"},{default:i((()=>[d(m(j.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(P,{class:"ss-reset-button save-btn",onClick:$},{default:i((()=>[d(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-7939b4c0"]]);export{v as default};
|