2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
var u=(i,s,n)=>new Promise((o,c)=>{var r=t=>{try{a(n.next(t))}catch(l){c(l)}},e=t=>{try{a(n.throw(t))}catch(l){c(l)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(r,e);a((n=n.apply(i,s)).next())});import{aq as f,ar as b,a9 as h,$ as g,au as _}from"./bootstrap-DmcuvVZS.js";import{_ as w}from"./page.vue_vue_type_script_setup_true_lang-D_L6nEGY.js";import{m as P,b9 as N,dP as T,v as C,ab as D,b2 as v,bJ as m,j as d,u as p,d1 as x}from"../jse/index-index-B6J4axeY.js";function F(){return f.get("/member/config/get")}function I(i){return f.put("/member/config/save",i)}const U=[{component:"Input",fieldName:"id",dependencies:{triggerFields:[""],show:()=>!1}},{component:"Switch",fieldName:"pointTradeDeductEnable",label:"积分抵扣",help:"下单积分是否抵用订单金额"},{component:"InputNumber",fieldName:"pointTradeDeductUnitPrice",label:"积分抵扣",help:"积分抵用比例(1 积分抵多少金额),单位:元",componentProps:{min:0,precision:2,class:"w-full",placeholder:"请输入积分抵扣单价"}},{component:"InputNumber",fieldName:"pointTradeDeductMaxPrice",label:"积分抵扣最大值",help:"单次下单积分使用上限,0 不限制",componentProps:{min:0,class:"w-full",placeholder:"请输入积分抵扣最大值"}},{component:"InputNumber",fieldName:"pointTradeGivePoint",label:"1 元赠送多少分",help:"下单支付金额按比例赠送积分(实际支付 1 元赠送多少积分)",componentProps:{min:0,class:"w-full",placeholder:"请输入赠送积分比例"}}],$=P({__name:"index",setup(i){const s=N(),[n,o]=b({commonConfig:{labelWidth:120},layout:"horizontal",schema:U,handleSubmit:c});function c(){return u(this,null,function*(){const{valid:e}=yield o.validate();if(!e)return;const a=yield o.getValues();a.pointTradeDeductUnitPrice=T(a.pointTradeDeductUnitPrice),yield I(a),h.success(g("ui.actionMessage.operationSuccess"))})}function r(){return u(this,null,function*(){const e=yield F();s.value=e,e.pointTradeDeductUnitPrice=Number.parseFloat(x(e.pointTradeDeductUnitPrice)),yield o.setValues(e)})}return C(()=>{r()}),(e,a)=>(v(),D(p(w),{"auto-content-height":""},{default:m(()=>[d(p(_),{title:"积分设置"},{default:m(()=>[d(p(n),{class:"w-1/4"})]),_:1})]),_:1}))}});export{$ as default};
|