1 |
- import{a as e,b as a,d as s}from"./phone-international-input.b9f6c8e6.js";import{c as t,z as o,o as r,f as n,g as i,w as l,s as p,bO as c,m as u,k as d,u as m,v as f,a2 as g,a1 as y,n as P,j as _,J as b}from"./index-a116b7fa.js";import{_ as x}from"./s-layout.4ae51839.js";import"./md5.09e73eca.js";import{_ as h}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.6b315a78.js";const v=h({__name:"topupConsumptionPoints",setup(h){t((()=>p.$store("user").userWallet));const v=t((()=>p.$store("user").userInfo)),w=o({model:{},payPrice:void 0,percentage:{consumptionMagnification:0,userTopUpConsumptionPoints:0,triggerMagnificationPoints:0}}),j=t((()=>{if(!w.payPrice)return 0;let e;return e=w.payPrice>=parseFloat(w.percentage.triggerMagnificationPoints)?(parseFloat(w.percentage.consumptionMagnification)*w.payPrice).toFixed(2):w.payPrice,e}));async function C(e){const a=e.toString(),[s,t]=a.split(".");t&&g((()=>{w.payPrice=s}))}const F=async()=>{if(!w.payPrice)return void p.$helper.toast("请输入充值金额");if(parseFloat(w.payPrice)<w.percentage.userTopUpConsumptionPoints)return void p.$helper.toast(`充值金额不能少于${w.percentage.userTopUpConsumptionPoints}`);let{code:e,data:a}=await y.topupConsumptionPointsCreate({payPrice:w.payPrice,topUpConsumptionPoints:w.payPrice,userName:v.value.username});0===e&&p.$router.redirect("/pages/pay/index",{id:a.payOrderId,type:2})};return r((async e=>{await(async()=>{const{code:e,data:a}=await c.getWithdrawalPercentage();0===e&&(w.percentage=a)})()})),(t,o)=>{const r=u(P("uni-easyinput"),e),p=u(P("uni-forms-item"),a),c=_,g=u(P("uni-forms"),s),y=b,h=u(P("s-layout"),x);return n(),i(h,{title:"消费分充值"},{default:l((()=>[d(c,{class:"bg-white ss-modal-box ss-flex-col"},{default:l((()=>[d(c,{class:"modal-content ss-m-t-30"},{default:l((()=>[d(g,{model:w.model,rules:w.rules,validateTrigger:"bind",labelPosition:"left",border:"",class:"form-box",labelWidth:"200",ref:"FormRef"},{default:l((()=>[d(c,{class:"bg-white ss-p-x-30"},{default:l((()=>[d(p,{name:"quota",label:"充值金额",required:!0},{default:l((()=>[d(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}),d(p,{name:"quota",label:"实到消费分"},{default:l((()=>[d(c,{class:"ss-flex ss-h-100"},{default:l((()=>[m(f(j.value),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["model","rules"]),d(c,{class:"ss-flex ss-row-center ss-col-center ss-m-t-30 text-red text-center"},{default:l((()=>[m("备注:充值"+f(w.percentage.triggerMagnificationPoints)+"元及以上,可获得"+f(parseFloat(w.percentage.consumptionMagnification))+"倍消费分 ",1)])),_:1})])),_:1}),d(c,{class:"modal-footer ss-flex ss-row-center ss-col-center ss-m-t-80 ss-m-b-40 ss-flex-5"},{default:l((()=>[d(y,{class:"ss-reset-button save-btn",onClick:F},{default:l((()=>[m(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-c92d9663"]]);export{v as default};
|