import{_ as e,a as t,b as a}from"./phone-international-input.CCPqViBY.js";import{c as s,v as o,o as r,a as n,b as i,d as l,w as p,u,s as c,bT as m,e as d,f as _,t as f,g,j as y,a5 as P,a4 as b,i as h,O as x}from"./index-DNuNVpwk.js";import{_ as v}from"./s-layout.D9p6eCz-.js";import"./md5.8ipUGBeh.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.BwI1_kKT.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.CZSqjCi7.js";import"./s-menu-tools.CEs7fo1o.js";import"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.nx0iNK_l.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.C_5j2fBR.js";import"./s-search-block.DtORRFbA.js";import"./useGoods.CrGbmvFq.js";const j=w({__name:"topupConsumptionPoints",setup(w){s((()=>c.$store("user").userWallet));const j=s((()=>c.$store("user").userInfo)),C=o({model:{},payPrice:void 0,percentage:{consumptionMagnification:0,userTopUpConsumptionPoints:0,triggerMagnificationPoints:0}}),F=s((()=>{if(!C.payPrice)return 0;let e;return e=C.payPrice>=parseFloat(C.percentage.triggerMagnificationPoints)?(parseFloat(C.percentage.consumptionMagnification)*C.payPrice).toFixed(2):C.payPrice,e}));async function M(e){const t=e.toString(),[a,s]=t.split(".");s&&P((()=>{}))}const T=async()=>{if(!C.payPrice)return void c.$helper.toast(f("wallet.enter_recharge_amount"));if(parseFloat(C.payPrice){await(async()=>{const{code:e,data:t}=await m.getWithdrawalPercentage();0===e&&(C.percentage=t)})()})),(s,o)=>{const r=n(i("uni-easyinput"),e),c=n(i("uni-forms-item"),t),m=h,P=n(i("uni-forms"),a),b=x,w=n(i("s-layout"),v);return d(),l(w,{title:u(f)("wallet.points_recharge")},{default:p((()=>[_(m,{class:"bg-white ss-modal-box ss-flex-col"},{default:p((()=>[_(m,{class:"modal-content ss-m-t-30"},{default:p((()=>[_(P,{model:C.model,rules:C.rules,validateTrigger:"bind",labelPosition:"left",border:"",class:"form-box",labelWidth:"200",ref:"FormRef"},{default:p((()=>[_(m,{class:"bg-white ss-p-x-30"},{default:p((()=>[_(c,{name:"quota",label:u(f)("wallet.recharge_amount"),required:!0},{default:p((()=>[_(r,{modelValue:C.payPrice,"onUpdate:modelValue":o[0]||(o[0]=e=>C.payPrice=e),type:"number",placeholder:u(f)("wallet.enter_recharge_amount"),inputBorder:!1,clearable:!1,onInput:M,maxlength:9},null,8,["modelValue","placeholder"])])),_:1},8,["label"]),_(c,{name:"quota",label:u(f)("wallet.actual_points_received")},{default:p((()=>[_(m,{class:"ss-flex ss-h-100"},{default:p((()=>[g(y(F.value),1)])),_:1})])),_:1},8,["label"])])),_:1})])),_:1},8,["model","rules"]),_(m,{class:"ss-flex ss-row-center ss-col-center ss-m-t-30 text-red text-center"},{default:p((()=>[g(y(u(f)("wallet.note_recharge_bonus",{amount:C.percentage.triggerMagnificationPoints,multiplier:parseFloat(C.percentage.consumptionMagnification)})),1)])),_:1})])),_:1}),_(m,{class:"modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40 ss-flex-5"},{default:p((()=>[_(b,{class:"ss-reset-button save-btn",onClick:T},{default:p((()=>[g(y(u(f)("common.confirm")),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-d19377a0"]]);export{j as default};