1 |
- import{a as e,b as a,d as t}from"./phone-international-input.ddbe5a38.js";import{c as s,z as o,o as r,f as n,g as i,w as l,bK as p,n as u,l as c,k as d,t as m,s as f,a1 as g,p as P,j as y,J as _}from"./index-1adc4eda.js";import{_ as b}from"./s-layout.8152a9b3.js";import"./md5.4730aff8.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";import"./useGoods.19529cd4.js";const h=x({__name:"topupConsumptionPoints",setup(x){s((()=>f.$store("user").userWallet));const h=s((()=>f.$store("user").userInfo)),v=o({model:{},payPrice:void 0,percentage:{consumptionMagnification:0,userTopUpConsumptionPoints:0,triggerMagnificationPoints:0}}),w=s((()=>{if(!v.payPrice)return 0;let e;return e=v.payPrice>=parseFloat(v.percentage.triggerMagnificationPoints)?(parseFloat(v.percentage.consumptionMagnification)*v.payPrice).toFixed(2):v.payPrice,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:a}=await g.topupConsumptionPointsCreate({payPrice:v.payPrice,topUpConsumptionPoints:v.payPrice,userName:h.value.username});0===e&&f.$router.redirect("/pages/pay/index",{id:a.payOrderId,type:2})};return r((async e=>{await(async()=>{const{code:e,data:a}=await p.getWithdrawalPercentage();0===e&&(v.percentage=a)})()})),(s,o)=>{const r=u(P("uni-easyinput"),e),p=u(P("uni-forms-item"),a),f=y,g=u(P("uni-forms"),t),x=_,h=u(P("s-layout"),b);return n(),i(h,{title:"消费分充值"},{default:l((()=>[c(f,{class:"bg-white ss-modal-box ss-flex-col"},{default:l((()=>[c(f,{class:"modal-content ss-m-t-30"},{default:l((()=>[c(g,{model:v.model,rules:v.rules,validateTrigger:"bind",labelPosition:"left",border:"",class:"form-box",labelWidth:"200",ref:"FormRef"},{default:l((()=>[c(f,{class:"bg-white ss-p-x-30"},{default:l((()=>[c(p,{name:"quota",label:"充值金额",required:!0},{default:l((()=>[c(r,{modelValue:v.payPrice,"onUpdate:modelValue":o[0]||(o[0]=e=>v.payPrice=e),type:"number",placeholder:"请输入金额",inputBorder:!1,clearable:!1,onInput:s.validateInput,maxlength:9},null,8,["modelValue","onInput"])])),_:1}),c(p,{name:"quota",label:"实到消费分"},{default:l((()=>[c(f,{class:"ss-flex ss-h-100"},{default:l((()=>[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:l((()=>[d("备注:充值"+m(v.percentage.triggerMagnificationPoints)+"元及以上,可获得"+m(parseFloat(v.percentage.consumptionMagnification))+"倍消费分 ",1)])),_: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:l((()=>[c(x,{class:"ss-reset-button save-btn",onClick:j},{default:l((()=>[d(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-6781f58b"]]);export{h as default};
|