"use strict";const e=require("../../../common/vendor.js");if(!Array){e.resolveComponent("su-popup")()}Math;const t={__name:"s-points-pop",props:{modelValue:{type:Object,default(){}},show:{type:Boolean,default:!1},currentMemberPoints:{type:Number,default:0},currentTotalPrice:{type:Number,default:0},currentDeliveryPrice:{type:Number,default:0}},emits:["confirm","close"],setup(t,{emit:o}){const r=t,a=o,s=e.reactive({points:0,disabled:!1}),u=e.computed((()=>parseFloat(r.currentMemberPoints))),n=e.computed((()=>parseFloat(r.currentTotalPrice))),l=e.computed((()=>parseFloat(r.currentDeliveryPrice))),i=e.computed((()=>n.value?(n.value-.01-l.value).toFixed(2):n.value));e.watchEffect((()=>{s.points>u.value&&e.nextTick$1((()=>{s.points=u.value})),s.points>i.value&&e.nextTick$1((()=>{s.points=i.value})),(0==i.value||i.value<0)&&(s.disabled=!0),i.value>0&&(s.disabled=!1)}));const c=()=>{a("confirm",s.points)};return(o,r)=>({a:s.disabled,b:s.points,c:e.o(e.m((e=>s.points=e.detail.value),{number:!0})),d:e.t(t.currentMemberPoints),e:e.t(n.value),f:e.t(i.value),g:e.o((e=>{s.points=0,a("confirm",s.points)})),h:e.o(c),i:e.o((e=>a("close"))),j:e.p({show:t.show,type:"bottom",round:"10",showClose:!0,backgroundColor:"#ffffff"})})}},o=e._export_sfc(t,[["__scopeId","data-v-797017b8"]]);wx.createComponent(o);
