pages-shop-allproduct.VoOhqvi7.js 5.4 KB

1
  1. import{a as t,b as o}from"./s-menu-tools.BMeJ3OqU.js";import{r as s,t as a,s as e,v as i,o as l,m as r,a as n,b as c,y as d,f as p,d as u,w as m,x as g,F as _,S as h,_ as y,i as f,e as x,z as v,u as b,M as I}from"./index-D3w8LAvI.js";import{_ as S}from"./s-goods-column._WBnP7h6.js";import{_ as k}from"./uni-load-more.DaPmu9bg.js";import{_ as j}from"./s-empty.DzKz0P7k.js";import{_ as $}from"./s-tabbar.BQW-v2c-.js";/* empty css */import{_ as w}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.CGUMMVst.js";import"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.C0EP7bxj.js";import"./points.DDTOnulC.js";import"./useGoods.CDjvlrJc.js";/* empty css *//* empty css *//* empty css */const C=w({__name:"allproduct",setup(w){const C=s({theme:"red",style:{bgType:"color",bgColor:"#ffffff",color:"#3c3c3c",activeColor:"#1fa380"},items:[{text:a("common.shop_index"),url:"/pages/shop/index",iconUrl:e.$url.static("/static/shopIndex/shopIndex.svg"),activeIconUrl:e.$url.static("/static/shopIndex/shopIndex-active.svg")},{text:a("common.shop_category"),url:"/pages/shop/category",iconUrl:e.$url.static("/static/shopIndex/category.svg"),activeIconUrl:e.$url.static("/static/shopIndex/category-active.svg")},{text:a("common.all_product"),url:"/pages/shop/allproduct",iconUrl:e.$url.static("/static/shopIndex/allProduct.svg"),activeIconUrl:e.$url.static("/static/shopIndex/allProduct-active.svg")}]}),G=i({pagination:{list:[],total:0,pageNo:1,pageSize:6},currentSort:void 0,currentOrder:void 0,currentTab:0,curFilter:0,showFilter:!1,iconStatus:!1,keyword:"",categoryId:0,tabList:[{name:a("common.recommended"),list:[{label:a("common.recommended")},{label:a("common.price_asc"),sort:"price",order:!0},{label:a("common.price_desc"),sort:"price",order:!1}]},{name:a("common.sales"),sort:"salesCount",order:!1},{name:a("common.newest"),value:"createTime",order:!1}],loadStatus:"",leftGoodsList:[],rightGoodsList:[]});let U=0,N=0,z=0;function L(t=0,o="left"){G.pagination.list[U]&&("left"===o?N+=t:z+=t,N<=z?G.leftGoodsList.push(G.pagination.list[U]):G.rightGoodsList.push(G.pagination.list[U]),U++)}async function R(){G.loadStatus="loading";const{code:t,data:o}=await h.getSpuPage({pageNo:G.pagination.pageNo,pageSize:G.pagination.pageSize,sortField:G.currentSort,sortAsc:G.currentOrder,categoryId:G.categoryId,keyword:G.keyword,shopId:G.shopId,merchantId:G.merchantId});0===t&&(G.pagination.list=y.concat(G.pagination.list,o.list),G.pagination.total=o.total,G.loadStatus=G.pagination.list.length<G.pagination.total?"more":"noMore",L())}function F(){"noMore"!==G.loadStatus&&(G.pagination.pageNo++,R(G.currentSort,G.currentOrder))}return l((async t=>{G.merchantId=t.merchantId,G.shopId=t.shopId,G.shopName=t.shopName,G.categoryId=t.categoryId,G.keyword=t.keyword,C.value.items=C.value.items.map((t=>(t.url=`${t.url}?shopId=${G.shopId}&shopName=${encodeURIComponent(G.shopName)}&merchantId=${G.merchantId}`,t))),R(G.currentSort,G.currentOrder)})),r((()=>{F()})),(s,a)=>{const i=n(c("su-navbar"),t),l=n(c("s-goods-column"),S),r=f,h=I,y=n(c("uni-load-more"),k),w=n(c("s-empty"),j),U=n(c("s-tabbar"),$),N=n(c("s-menu-tools"),o);return x(),d(_,null,[p(i,{title:G.shopName,statusBar:"",color:s.color,tools:s.tools,opacityBgUi:s.opacityBgUi,onSearch:a[0]||(a[0]=t=>s.emits("search",t)),defaultSearch:s.defaultSearch},null,8,["title","color","tools","opacityBgUi","defaultSearch"]),G.iconStatus&&G.pagination.total>0?(x(),u(r,{key:0,class:"goods-list ss-m-t-20"},{default:m((()=>[(x(!0),d(_,null,v(G.pagination.list,(t=>(x(),u(r,{class:"ss-p-l-20 ss-p-r-20 ss-m-b-20",key:t.id},{default:m((()=>[p(l,{class:"",size:"lg",data:t,topRadius:10,bottomRadius:10,onClick:o=>b(e).$router.go("/pages/goods/index",{id:t.id})},null,8,["data","onClick"])])),_:2},1024)))),128))])),_:1})):g("",!0),!G.iconStatus&&G.pagination.total>0?(x(),u(r,{key:1,class:"ss-flex ss-flex-wrap ss-p-x-20 ss-m-t-20 ss-col-top"},{default:m((()=>[p(r,{class:"goods-list-box"},{default:m((()=>[(x(!0),d(_,null,v(G.leftGoodsList,(t=>(x(),u(r,{class:"left-list",key:t.id},{default:m((()=>[p(l,{class:"goods-md-box",size:"md",data:t,topRadius:10,bottomRadius:10,onClick:o=>b(e).$router.go("/pages/goods/index",{id:t.id}),onGetHeight:a[1]||(a[1]=t=>L(t,"left"))},{cart:m((()=>[p(h,{class:"ss-reset-button cart-btn"})])),_:2},1032,["data","onClick"])])),_:2},1024)))),128))])),_:1}),p(r,{class:"goods-list-box"},{default:m((()=>[(x(!0),d(_,null,v(G.rightGoodsList,(t=>(x(),u(r,{class:"right-list",key:t.id},{default:m((()=>[p(l,{class:"goods-md-box",size:"md",topRadius:10,bottomRadius:10,data:t,onClick:o=>b(e).$router.go("/pages/goods/index",{id:t.id}),onGetHeight:a[2]||(a[2]=t=>L(t,"right"))},{cart:m((()=>[p(h,{class:"ss-reset-button cart-btn"})])),_:2},1032,["data","onClick"])])),_:2},1024)))),128))])),_:1})])),_:1})):g("",!0),G.pagination.total>0?(x(),u(y,{key:2,status:G.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:F},null,8,["status"])):g("",!0),0===G.pagination.total?(x(),u(w,{key:3,icon:"/static/soldout-empty.png",text:"暂无商品"})):g("",!0),p(U,{path:"/pages/shop/allproduct",tabbar:C.value},null,8,["tabbar"]),p(N)],64)}}},[["__scopeId","data-v-fc4c9623"]]);export{C as default};