import{_ as a,bx as t,Z as e,r as s,a2 as i,c as l,d,e as c,h as n,am as r,an as o,F as p,l as m,a7 as u,al as y,f as g,g as _,k as v,p as f,t as h,v as b}from"./index.286e9b79.js";import{E as x}from"./image-viewer.b538fe01.js";import{g as k}from"./http.f588794f.js";import"./debounce.caafe00b.js";import"./index.ed3ed02e.js";import"./position.1bd00850.js";import"./scroll.a50153b5.js";const j=a=>(h("data-v-51ea84ed"),a=a(),b(),a),w={key:0,class:"lucency-title"},C={class:"content-item-photo"},L={class:"content-item-image"},R={class:"content-item-cover"},z={key:0,class:"content-item-detail"},A={key:0,class:"content-item-title"},E={class:"content-item-info"},F={class:"content-item-price"},I={key:0},O=j((()=>n("span",{class:"content-item-price__tag"},"¥",-1))),S={class:"content-item-price__val"},Z={key:0,class:"content-item-button"},q=j((()=>n("div",{class:"clear"},null,-1))),B=a({__name:"widget",props:{data:{type:[Object,Array],default:{}}},setup(a){const h=t.base_url.replace("/adminapi",""),b=a,j=e((()=>3===b.data.list_style||!!b.data.is_title));let B=s([]),D=[];for(let t=0;t<10;t++)D.push({name:"商品名称",sell_price:999});B.value=D,i((()=>b.data),(async(a,t)=>{if(B.value=[],1==b.data.type&&b.data.list&&b.data.list.length>0)B.value=b.data.list;else if(2==b.data.type){let a=await(async()=>{let a=await k("diy.common/shop_category",{id:b.data.group.id,limit:b.data.group.limit});return a.code?a.data:[]})();B.value=a}else B.value=b.data.list;let e=[];if(B.value.length<=0){for(let a=0;a<10;a++)e.push({name:"商品名称",sell_price:999});B.value=e}}),{deep:!0,immediate:!0});return(a,t)=>{const e=x,s=l("ShoppingCart"),i=f;return d(),c("div",{class:u(["content",{"lucency-content":4==b.data.list_style&&5==b.data.card_style}]),style:y({backgroundColor:b.data.background_color,padding:b.data.margin+"px 0","border-radius":5==b.data.card_style?b.data.layout_radius+"px":0})},[5==b.data.card_style?(d(),c("div",w,[n("div",null,r(b.data.title||"标题"),1),n("div",null,r(b.data.ctitle||"更多 >"),1)])):o("",!0),n("div",{class:u(["content-layout",{larger:1==b.data.list_style,small:2==b.data.list_style,list:3==b.data.list_style,swipe:4==b.data.list_style}]),style:y({paddingLeft:b.data.padding+"px",paddingRight:b.data.padding+"px",marginLeft:-b.data.spacing/2+"px",marginRight:-b.data.spacing/2+"px"})},[(d(!0),c(p,null,m(_(B),((a,t)=>{return d(),c("div",{class:u(["content-wrapper",{white:1==b.data.card_style,card:2==b.data.card_style,stroke:3==b.data.card_style,lucency:4==b.data.card_style,chamfer:b.data.chamfer_style}]),key:t},[n("div",{class:"content-item",style:y({margin:b.data.spacing/2+"px"})},[n("div",C,[n("div",L,[n("div",R,[g(e,{style:{width:"100%",height:"100%"},src:(l=a,null!=l.image?l.image:h+"/static/images/menu/empty.png"),fit:"cover"},null,8,["src"])])])]),_(j)?(d(),c("div",z,[b.data.is_title?(d(),c("div",A,r(a.name),1)):o("",!0),n("div",E,[n("div",F,[b.data.is_price?(d(),c("div",I,[O,n("span",S,r(a.sell_price),1)])):o("",!0)]),b.data.is_button?(d(),c("div",Z,[g(i,{style:{"vertical-align":"0"},size:16,color:"#e60b30"},{default:v((()=>[g(s)])),_:1})])):o("",!0)])])):o("",!0)],4)],2);var l})),128)),q],6)],6)}}},[["__scopeId","data-v-51ea84ed"]]);export{B as default};
