1 |
- import{_ as e,a as t,b as a}from"./phone-international-input.pCSce8vH.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,bX as m,e as d,f as _,t as f,g,j as y,a5 as b,a4 as P,i as h,O as x}from"./index-Dhufwzns.js";import{_ as v}from"./s-layout.UkBM_zOd.js";import"./md5.CMn9RPJZ.js";import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.CqGKW-3y.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_87b92f91_lang.E5-DcFQJ.js";import"./s-menu-tools.BxnijmDR.js";import"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.DInbba3a.js";import"./s-layout.vue_vue_type_style_index_0_scoped_05ef8b08_lang.DrO-exW9.js";import"./s-search-block.o4Jo1XRm.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&&b((()=>{}))}const U=async()=>{if(!C.payPrice)return void c.$helper.toast(f("wallet.enter_recharge_amount"));if(parseFloat(C.payPrice)<C.percentage.userTopUpConsumptionPoints)return void c.$helper.toast(f("wallet.recharge_amount_less_than",{point:C.percentage.userTopUpConsumptionPoints}));let{code:e,data:t}=await P.topupConsumptionPointsCreate({payPrice:C.payPrice,topUpConsumptionPoints:C.payPrice,userName:j.value.username});0===e&&c.$router.redirect("/pages/pay/index",{id:t.payOrderId,type:2})};return r((async e=>{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,b=n(i("uni-forms"),a),P=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((()=>[_(b,{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((()=>[_(P,{class:"ss-reset-button save-btn",onClick:U},{default:p((()=>[g(y(u(f)("common.confirm")),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["title"])}}},[["__scopeId","data-v-d19377a0"]]);export{j as default};
|