1 |
- import{E as L,G as t,a0 as N,d as B,M as a,j as r,A as C,O as I}from"./ResizeObserver.es.39b48a47.js";import{T as _}from"./index.34ac729a.js";import{I as z}from"./index.fcbcb027.js";const[A,c]=L("card"),O={tag:String,num:t,desc:String,thumb:String,title:String,price:t,centered:Boolean,lazyLoad:Boolean,currency:N("\xA5"),thumbLink:String,originPrice:t};var $=B({name:A,props:O,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(_,{mark:!0,type:"danger"},{default:()=>[i.tag]})])},b=()=>e.thumb?e.thumb():r(z,{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]]),C("."),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=I($);export{E as C};
|