import{aL as me,k as f,o as t,A as c,a,N as C,aJ as re,w as l,b as k,y as K,d as U,aB as W,e as V,aK as ve,c as d,s as x,af as de,t as p,ae as ne,F as P,W as q,G as D,j as be,r as Q,p as J,i as pe,v as ue,M as B,q as ye,z as fe,B as L,E as he,I as ge,X,Z,aM as ke,l as Ie,K as ee,O as Ce,aN as te,aO as ae,aP as le,f as $,ai as xe,V as A,aQ as Te}from"./index-CW_ph8U7.js";import{_ as Pe}from"./TitleBreadcrumb.vue_vue_type_style_index_0_lang-BxraGGjs.js";import{I as H}from"./images-CEcXj5Ys.js";import{T as we}from"./TagsItem-BqQEGLVH.js";import{p as M}from"./productApi-DlDyLUoc.js";import{e as ie}from"./blankProductTypeEnum-7RSz3x1u.js";import{_ as Se}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Ne={class:"card"},Ve={key:2,class:"image-container"},Oe={class:"text-h4 name",style:{height:"53px"}},_e={key:0},$e={class:"text-secondary text-h4"},Le={class:"text-decoration-line-through text-medium-emphasis ml-2 text-subtitle-2"},Me={key:1},De={class:"text-secondary text-h4"},Fe={class:"text-medium-emphasis text-subtitle-2 mt-1"},ze={class:"text-subtitle-2 mt-1"},Ae={key:0},Be={key:1},Ue={key:2},Ee={__name:"goodsItem",props:{item:Object},setup(e){me();const m=e,u=f("");function n(){let o=m.item;o.type==ie.DIY.value?u.value="products/diyDetail?id="+o.id:u.value="products/detail?id="+o.id}function h(){let o=m.item;o.type==ie.DIY.value?q.push("products/diyDetail?id="+o.id):q.push("products/detail?id="+o.id)}f(!1);let g=f(!1);function T(o){g.value=!0,M().blankProductFavorite(o).then(O=>{g.value=!1,m.item.isFavorite=!0})}function I(o){g.value=!0,M().blankProductUnFavorite(o).then(O=>{g.value=!1,m.item.isFavorite=!1})}return(o,b)=>{const O=D("HeartFilledIcon"),F=D("router-link");return t(),c(P,null,[a(re,{isShow:C(g)},null,8,["isShow"]),a(ne,{variant:"outlined",class:"productItem rounded white",border:0},{default:l(()=>[k("div",Ne,[a(we,{base:e.item},null,8,["base"]),e.item.isFavorite?(t(),c("div",{key:0,class:"collect",onClick:b[0]||(b[0]=K(S=>I(e.item.id),["stop"]))},[a(U,{size:"small",icon:"",class:"ml-auto"},{default:l(()=>[a(W,{activator:"parent",location:"top"},{default:l(()=>[V("Remove from My Favourite")]),_:1}),a(O,{color:"#EC407A"})]),_:1})])):(t(),c("div",{key:1,class:"collect",onClick:b[1]||(b[1]=K(S=>T(e.item.id),["stop"]))},[a(U,{size:"small",icon:"",class:"ml-auto"},{default:l(()=>[a(W,{activator:"parent",location:"top"},{default:l(()=>[V("Add to My Favourite")]),_:1}),a(C(ve),{color:"#828282"})]),_:1})])),e.item.suspendImageUrl?(t(),c("div",Ve,[a(F,{to:u.value,class:"product",onClick:h,onContextmenu:n},{default:l(()=>[a(H,{url:e.item.mainShowImageUrl,classes:"w-100 product-img position-relative d-block",style:{"z-index":"1"}},null,8,["url"]),e.item.suspendImageUrl?(t(),d(H,{key:0,url:e.item.suspendImageUrl,classes:"w-100 product-img d-block"},null,8,["url"])):x("",!0)]),_:1},8,["to"])])):(t(),d(F,{key:3,to:u.value,class:"product",onClick:h,onContextmenu:n},{default:l(()=>[a(H,{alt:"product",url:e.item.mainShowImageUrl,style:{"border-top-left-radius":"12px","border-top-right-radius":"12px"},classes:"w-100 d-block"},null,8,["url"])]),_:1},8,["to"])),a(de,null,{default:l(()=>[k("p",Oe,p(e.item.model),1),e.item.favorablePrice?(t(),c("p",_e,[k("span",$e,"$"+p(e.item.favorablePrice),1),k("span",Le,p(e.item.price),1)])):(t(),c("p",Me,[k("span",De,"$"+p(e.item.price),1)])),k("p",Fe,"Avg.production time "+p(e.item.productionTimeMin)+" "+p(e.item.productionTimeUnit==1?"Day":"Week"),1),k("p",ze,[e.item.skuOption1Num>0?(t(),c("span",Ae,p(e.item.skuOption1Num)+" "+p(e.item.skuOption1),1)):x("",!0),e.item.skuOption2Num>0?(t(),c("span",Be," · "+p(e.item.skuOption2Num)+" "+p(e.item.skuOption2),1)):x("",!0),e.item.skuOption3Num>0?(t(),c("span",Ue," · "+p(e.item.skuOption3Num)+" "+p(e.item.skuOption3),1)):x("",!0)])]),_:1})])]),_:1})],64)}}},Ge=Se(Ee,[["__scopeId","data-v-a07bc985"]]),He={__name:"NavGroup",props:{item:Object},setup(e){const m=e;return(u,n)=>(t(),d(be,{color:"darkText",class:"smallCap"},{default:l(()=>[V(p(u.$t(m.item.header)),1)]),_:1}))}},se=He,ce={__name:"IconSet",props:{item:Object,level:Number},setup(e){const m=e;return(u,n)=>m.level>0?(t(),d(Q(m.item),{key:0,size:"5",fill:"currentColor","stroke-width":"1.5",class:"iconClass"})):(t(),d(Q(m.item),{key:1,size:"20","stroke-width":"1.5",class:"iconClass"}))}},Je={__name:"NavItem",props:{item:Object,level:Number,breadcrumbTitle:String,breadcrumbId:Number},emits:["getChildren"],setup(e,{emit:m}){const u=e,n=m,h=g=>{n("getChildren",g)};return(g,T)=>(t(),c("div",null,[e.item.type=="line"?(t(),d(B,{key:0,class:"mt-4 mb-4"})):x("",!0),e.item.type=="title"?(t(),d(J,{key:1,class:"font-weight-medium mb-4"},{default:l(()=>[V(p(e.item.name),1)]),_:1})):x("",!0),e.item.type!="line"&&e.item.type!="title"?(t(),d(ue,{key:2,active:e.breadcrumbId==e.item.id,link:"",rounded:"",class:"mb-1 listitem",color:"secondary",disabled:e.item.disabled},{prepend:l(()=>[u.level>0?(t(),d(ce,{key:0,item:C(pe),level:u.level},null,8,["item","level"])):x("",!0)]),default:l(()=>[a(J,{onClick:T[0]||(T[0]=I=>h(e.item))},{default:l(()=>[V(p(e.item.name),1)]),_:1})]),_:1},8,["active","disabled"])):x("",!0)]))}},j=Je,je={__name:"NavCollapse",props:{item:Object,level:Number,breadcrumbTitle:String,breadcrumbId:Number},emits:["getChildren"],setup(e,{emit:m}){const u=e,n=m;function h(g){n("getChildren",g)}return(g,T)=>{const I=D("NavCollapse",!0);return t(),d(he,null,{activator:l(({props:o,isOpen:b})=>[a(ue,fe({active:e.breadcrumbTitle==e.item.name,isOpen:e.breadcrumbTitle==e.item.name},o,{value:e.item.name,rounded:"",class:"mb-1 listitem",color:"secondary"}),{prepend:l(()=>[a(ce,{item:e.item.icon,level:e.level},null,8,["item","level"])]),default:l(()=>[a(J,{class:"mr-auto"},{default:l(()=>[V(p(e.item.name),1)]),_:1}),e.item.subCaption?(t(),d(ye,{key:0,class:"text-caption mt-n1 hide-menu"})):x("",!0)]),_:2},1040,["active","isOpen","value"])]),default:l(()=>[(t(!0),c(P,null,L(e.item.children,(o,b)=>(t(),c(P,{key:b},[o.children?(t(),d(I,{key:0,item:o,level:u.level+1},null,8,["item","level"])):(t(),d(j,{key:1,item:o,level:u.level+1,breadcrumbTitle:u.breadcrumbTitle,breadcrumbId:e.breadcrumbId,onGetChildren:h},null,8,["item","level","breadcrumbTitle","breadcrumbId"]))],64))),128))]),_:1})}}},oe=je,N={DIY:{text:"DIY产品",value:2},SIMPLE:{text:"一般产品",value:1},SDS:{text:"SDS产品",value:3}},Ye={class:"d-flex align-center"},Re={class:"overflow-auto d-lg-block d-none"},Ke={class:"text-h3 ml-2"},We={class:"ml-auto d-flex align-center"},qe=k("h5",{class:"text-h5 mt-1"},"Sort by:",-1),Qe={class:"text-center overflow-auto"},st=ge({__name:"ProductCatalog",setup(e){let m=f([{title:"Products",disabled:!1,to:"#"},{title:"New Arrival",disabled:!0,to:"#"}]),u=f([]),n=f({}),h=X({current:1,size:20,total:1});const g=X([{label:"Latest",value:"1"},{label:"Price(Lowest to Highest)",value:"2"},{label:"Price(Highest to Lowest)",value:"3"}]),T=f("1"),I=f(!0),o=f(""),b=f("");function O(v){M().blankProductTypeTree(1).then(i=>{if(i.data.unshift({id:9999,type:"isIndexNew",level:"1",name:"New Arrival",pid:"1",sort:"1",blankProductTypeCategory:N.SIMPLE.value,types:[1,2,5]},{id:99999,type:"isIndexHot",level:"1",name:"Best Seller",pid:"1",sort:"1",blankProductTypeCategory:N.SIMPLE.value,types:[1,2,5]},{id:999999,type:"isPickFromJet",level:"1",name:"Picks from JetPrint",pid:"1",sort:"1"},{type:"line",level:"1",name:"",pid:"1",sort:"1",blankProductTypeCategory:N.SIMPLE.value,types:[1,2,5]}),i.data.forEach(y=>{y.blankProductTypeCategory=N.SIMPLE.value,y.types=[1,2,5]}),u.value=i.data,console.log("sidebarMenu....",u),sessionStorage.getItem("productsBreadcrumb")==null){n.value=i.data[0],o.value=i.data[0].name,b.value=i.data[0].id;const y={classItem:i.data[0],breadcrumbTitle:i.data[0].name,breadcrumbId:i.data[0].id};sessionStorage.setItem("productsBreadcrumb",JSON.stringify(y))}else{let y=JSON.parse(sessionStorage.getItem("productsBreadcrumb"));n.value=y.classItem,o.value=y.breadcrumbTitle,b.value=y.breadcrumbId,m.value[1]={title:y.breadcrumbTitle,disabled:!0,to:"/"}}F(),_()})}function F(v){M().blankProductTypeTree(2).then(i=>{console.log("blankProductTypeTree....",i.data),i.data.unshift({type:"line",level:"1",name:"",pid:"1",sort:"1"},{type:"title",level:"1",name:"Custom Gift",pid:"1",sort:"1"}),i.data.push({type:"line",level:"1",name:"",pid:"1",sort:"1",blankProductTypeCategory:N.SIMPLE.value,types:[1,2,5]},{id:9999999,type:"isFavorite",level:"1",name:"My Favourite",pid:"1",sort:"1"}),i.data.forEach(y=>{y.blankProductTypeCategory=N.DIY.value,y.types=[3]}),u.value.push(...i.data),_()})}const S=v=>{n.value=v,o.value=v.name,b.value=v.id,h.current=1,m.value[1]={title:v.name,disabled:!0,to:"/"},console.log("typeId....",v),_();const s={classItem:v,breadcrumbTitle:v.name,breadcrumbId:v.id};sessionStorage.setItem("productsBreadcrumb",JSON.stringify(s))};let Y=f([]);function _(){I.value=!0;const v=M(),s={typeId:n.value.id,current:h.current,size:h.size,blankProductTypeCategory:n.value.blankProductTypeCategory,types:n.value.types,sortType:T.value};(n.value.id==9999||n.value.id==99999||n.value.id==999999)&&(delete s.blankProductTypeCategory,delete s.types),n.value.type=="isIndexNew"&&(s.isIndexNew=!0,delete s.typeId),n.value.type=="isIndexHot"&&(s.isIndexHot=!0,delete s.typeId),n.value.type=="isPickFromJet"&&(s.isPickFromJet=!0,delete s.typeId),n.value.type=="isFavorite"&&(s.blankProductTypeCategory="",s.types="",s.isFavorite=!0,delete s.typeId),v.blankProductPage(s).then(i=>{h.total=i.data.total%i.data.size==0?i.data.total/i.data.size:Math.floor(i.data.total/i.data.size)+1,console.log("pages.total = res.total....",i),I.value=!1,console.log("blankProductPage...",i.data),Y.value=i.data.records,setTimeout(()=>{window.scrollTo({top:0,behavior:"smooth"})},50)}).catch(i=>{I.value=!1})}const E=f(1);Z(E,v=>{console.log("分页....",v),h.current=v,_()}),Z(T,v=>{console.log("sortType0...",v),_()});const{lgAndUp:R}=ke(),G=f(!1),z=f(!1);return Ie(()=>{console.log("触发加载...."),O()}),(v,s)=>{const i=D("perfect-scrollbar"),y=D("Menu2Icon");return t(),c(P,null,[a(re,{isShow:I.value},null,8,["isShow"]),a(Pe,{title:o.value,breadcrumbs:C(m)},null,8,["title","breadcrumbs"]),C(R)?x("",!0):(t(),d(Ce,{key:0,temporary:"",modelValue:z.value,"onUpdate:modelValue":s[0]||(s[0]=r=>z.value=r),width:"300",top:""},{default:l(()=>[a(i,{class:"scrollnavbar"},{default:l(()=>[a(ee,{class:"pa-4"},{default:l(()=>[(t(!0),c(P,null,L(C(u),(r,w)=>(t(),c(P,{key:w},[r.header?(t(),d(se,{item:r,key:r.name},null,8,["item"])):r.divider?(t(),d(B,{key:1,class:"my-3"})):r.children?(t(),d(oe,{key:2,class:"leftPadding",item:r,level:0,breadcrumbTitle:o.value,breadcrumbId:b.value,onGetChildren:S},null,8,["item","breadcrumbTitle","breadcrumbId"])):(t(),d(j,{key:3,item:r,breadcrumbTitle:o.value,breadcrumbId:b.value,onGetChildren:S,class:"leftPadding"},null,8,["item","breadcrumbTitle","breadcrumbId"]))],64))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])),a(A,{class:"products"},{default:l(()=>[!G.value&&C(R)?(t(),d($,{key:0,cols:"12",md:"2"},{default:l(()=>[te(a(le,{class:"mx-auto border","max-width":"300",type:"article,article,article,article,article"},null,512),[[ae,I.value]]),te(a(i,{class:"scrollnavbar"},{default:l(()=>[a(ee,{class:"pa-4"},{default:l(()=>[(t(!0),c(P,null,L(C(u),(r,w)=>(t(),c(P,{key:w},[r.header?(t(),d(se,{item:r,key:r.name},null,8,["item"])):r.divider?(t(),d(B,{key:1,class:"my-3"})):r.children?(t(),d(oe,{key:2,class:"leftPadding",item:r,level:0,breadcrumbTitle:o.value,breadcrumbId:b.value,onGetChildren:S},null,8,["item","breadcrumbTitle","breadcrumbId"])):(t(),d(j,{key:3,item:r,breadcrumbTitle:o.value,breadcrumbId:b.value,onGetChildren:S,class:"leftPadding"},null,8,["item","breadcrumbTitle","breadcrumbId"]))],64))),128))]),_:1})]),_:1},512),[[ae,!I.value]])]),_:1})):x("",!0),a($,{class:"d-flex align-stretch overflow-auto"},{default:l(()=>[a(ne,{variant:"outlined",style:{"background-color":"white"}},{default:l(()=>[a(de,{style:{padding:"20px"}},{default:l(()=>[k("div",Ye,[a(U,{class:"text-secondary d-lg-none d-md-flex d-sm-flex",color:"lightsecondary",icon:"",rounded:"sm",variant:"flat",onClick:s[1]||(s[1]=r=>z.value=!z.value),size:"small"},{default:l(()=>[a(y,{size:20,"stroke-width":1.5})]),_:1}),k("div",Re,[a(U,{class:"hidden-md-and-down",icon:"",variant:"flat",onClick:s[2]||(s[2]=r=>G.value=!G.value),size:"small"},{default:l(()=>[a(y,{size:20,"stroke-width":1.5})]),_:1})]),k("h3",Ke,p(C(n).name),1),k("div",We,[qe,a(xe,{style:{"max-width":"250px"},class:"ml-2",color:"primary",variant:"outlined","hide-details":"",modelValue:T.value,"onUpdate:modelValue":s[3]||(s[3]=r=>T.value=r),items:g,"item-title":"label","item-value":"value"},null,8,["modelValue","items"])])]),a(B,{class:"mt-5"}),I.value?(t(),d(A,{key:0,class:"mt-3"},{default:l(()=>[(t(),c(P,null,L(10,(r,w)=>a($,{cols:"12",sm:"6",lg:"3",key:w},{default:l(()=>[a(le,{class:"mx-auto border","max-width":"300",type:"image, article"})]),_:2},1024)),64))]),_:1})):(t(),d(A,{key:1,class:"mt-3"},{default:l(()=>[(t(!0),c(P,null,L(C(Y),(r,w)=>(t(),d($,{cols:"12",sm:"6",lg:"3",key:w},{default:l(()=>[a(Ge,{item:r},null,8,["item"])]),_:2},1024))),128))]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1}),a(A,null,{default:l(()=>[a($,{cols:"12",lg:"8"},{default:l(()=>[k("div",Qe,[a(Te,{"active-color":"primary",modelValue:E.value,"onUpdate:modelValue":s[4]||(s[4]=r=>E.value=r),length:C(h).total,"total-visible":7},null,8,["modelValue","length"])])]),_:1})]),_:1})],64)}}});export{st as default};