import{T as I}from"./index.30fb9a6a.js";import{I as L}from"./index.637c8eb4.js";import{x as N,y as t,W as B,d as C,I as a,i as r,w as _,K as z}from"./index.afa1b71c.js";const[$,c]=N("card"),A={tag:String,num:t,desc:String,thumb:String,title:String,price:t,centered:Boolean,lazyLoad:Boolean,currency:B("\xA5"),thumbLink:String,originPrice:t};var D=C({name:$,props:A,emits:["click-thumb"],setup(i,{slots:e,emit:g}){const h=()=>{if(e.title)return e.title();if(i.title)return r("div",{class:[c("title"),"van-multi-ellipsis--l2"]},[i.title])},v=()=>{if(e.tag||i.tag)return r("div",{class:c("tag")},[e.tag?e.tag():r(I,{mark:!0,type:"danger"},{default:()=>[i.tag]})])},b=()=>e.thumb?e.thumb():r(L,{src:i.thumb,fit:"cover",width:"100%",height:"100%",lazyLoad:i.lazyLoad},null),f=()=>{if(e.thumb||i.thumb)return r("a",{href:i.thumbLink,class:c("thumb"),onClick:n=>g("click-thumb",n)},[b(),v()])},s=()=>{if(e.desc)return e.desc();if(i.desc)return r("div",{class:[c("desc"),"van-ellipsis"]},[i.desc])},P=()=>{const n=i.price.toString().split(".");return r("div",null,[r("span",{class:c("price-currency")},[i.currency]),r("span",{class:c("price-integer")},[n[0]]),_("."),r("span",{class:c("price-decimal")},[n[1]])])};return()=>{var n,u,d;const m=e.num||a(i.num),l=e.price||a(i.price),o=e["origin-price"]||a(i.originPrice),y=m||l||o||e.bottom,T=l&&r("div",{class:c("price")},[e.price?e.price():P()]),k=o&&r("div",{class:c("origin-price")},[e["origin-price"]?e["origin-price"]():`${i.currency} ${i.originPrice}`]),w=m&&r("div",{class:c("num")},[e.num?e.num():`x${i.num}`]),x=e.footer&&r("div",{class:c("footer")},[e.footer()]),S=y&&r("div",{class:c("bottom")},[(n=e["price-top"])==null?void 0:n.call(e),T,k,w,(u=e.bottom)==null?void 0:u.call(e)]);return r("div",{class:c()},[r("div",{class:c("header")},[f(),r("div",{class:c("content",{centered:i.centered})},[r("div",null,[h(),s(),(d=e.tags)==null?void 0:d.call(e)]),S])]),x])}}});const K=z(D);export{K as C};
