1 |
- import{A as v,$ as u,aa as B,G as S,d as y,j as t,M as T,B as A,N as I}from"./index.e6d6174e.js";const[C,e,N]=v("submit-bar"),P={tip:String,label:String,price:Number,tipIcon:String,loading:Boolean,currency:u("\xA5"),disabled:Boolean,textAlign:String,buttonText:String,buttonType:u("danger"),buttonColor:String,suffixLabel:String,decimalLength:B(2),safeAreaInsetBottom:S};var h=y({name:C,props:P,emits:["submit"],setup(n,{emit:d,slots:a}){const b=()=>{const{price:i,label:r,currency:l,textAlign:g,suffixLabel:o,decimalLength:c}=n;if(typeof i=="number"){const s=(i/100).toFixed(+c).split("."),x=c?`.${s[1]}`:"";return t("div",{class:e("text"),style:{textAlign:g}},[t("span",null,[r||N("label")]),t("span",{class:e("price")},[l,t("span",{class:e("price-integer")},[s[0]]),x]),o&&t("span",{class:e("suffix-label")},[o])])}},m=()=>{var i;const{tip:r,tipIcon:l}=n;if(a.tip||r)return t("div",{class:e("tip")},[l&&t(T,{class:e("tip-icon"),name:l},null),r&&t("span",{class:e("tip-text")},[r]),(i=a.tip)==null?void 0:i.call(a)])},p=()=>d("submit"),f=()=>a.button?a.button():t(A,{round:!0,type:n.buttonType,text:n.buttonText,class:e("button",n.buttonType),color:n.buttonColor,loading:n.loading,disabled:n.disabled,onClick:p},null);return()=>{var i,r;return t("div",{class:[e(),{"van-safe-area-bottom":n.safeAreaInsetBottom}]},[(i=a.top)==null?void 0:i.call(a),m(),t("div",{class:e("bar")},[(r=a.default)==null?void 0:r.call(a),b(),f()])])}}});const L=I(h);export{L as S};
|