import{A as L,E as t,$ as N,d as z,L as a,j as r,z as B,N as C}from"./index.3bfa6a0e.js";import{T as I}from"./index.c171ade0.js";import{I as _}from"./index.0fd5538f.js";const[$,c]=L("card"),A={tag:String,num:t,desc:String,thumb:String,title:String,price:t,centered:Boolean,lazyLoad:Boolean,currency:N("\xA5"),thumbLink:String,originPrice:t};var D=z({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(_,{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]]),B("."),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),T=m||l||o||e.bottom,y=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}`]),S=m&&r("div",{class:c("num")},[e.num?e.num():`x${i.num}`]),w=e.footer&&r("div",{class:c("footer")},[e.footer()]),x=T&&r("div",{class:c("bottom")},[(n=e["price-top"])==null?void 0:n.call(e),y,k,S,(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)]),x])]),w])}}});const E=C(D);export{E as C};
