"use strict";const e=require("../../common/vendor.js"),r=require("../../sheep/index.js"),i=require("../../sheep/platform/share.js"),o=require("../../sheep/hooks/useModal.js"),a=require("../../sheep/api/product/spu.js"),s=require("../../sheep/api/trade/brokerage.js"),t=require("../../sheep/hooks/useGoods.js");if(require("../../sheep/url/index.js"),require("../../sheep/store/index.js"),require("../../sheep/store/app.js"),require("../../sheep/api/promotion/diy.js"),require("../../sheep/request/index.js"),require("../../sheep/config/index.js"),require("../../sheep/platform/index.js"),require("../../sheep/platform/provider/wechat/index.js"),require("../../sheep/platform/provider/wechat/miniProgram.js"),require("../../sheep/api/member/auth.js"),require("../../sheep/api/member/social.js"),require("../../sheep/api/member/user.js"),require("../../sheep/platform/provider/apple/index.js"),require("../../sheep/platform/pay.js"),require("../../sheep/helper/index.js"),require("../../sheep/helper/test.js"),require("../../sheep/helper/digit.js"),require("../../sheep/api/pay/order.js"),require("../../sheep/router/index.js"),require("../../sheep/helper/throttle.js"),require("../../sheep/store/user.js"),require("../../sheep/store/cart.js"),require("../../sheep/api/trade/cart.js"),require("../../sheep/api/pay/wallet.js"),require("../../sheep/api/trade/order.js"),require("../../sheep/api/promotion/coupon.js"),require("../../sheep/store/sys.js"),require("../../sheep/store/modal.js"),require("../../sheep/config/zIndex.js"),require("../../sheep/api/member/signin.js"),require("../../sheep/util/index.js"),!Array){(e.resolveComponent("s-goods-item")+e.resolveComponent("s-empty")+e.resolveComponent("uni-load-more")+e.resolveComponent("s-layout"))()}Math||((()=>"../../sheep/components/s-goods-item/s-goods-item.js")+(()=>"../../sheep/components/s-empty/s-empty.js")+(()=>"../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const p={__name:"goods",setup(p){const n=e.reactive({pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",shareInfo:{}});async function u(){n.loadStatus="loading";let{code:r,data:i}=await a.SpuApi.getSpuPage({pageSize:n.pagination.pageSize,pageNo:n.pagination.pageNo});0===r&&(n.pagination.list=e._.concat(n.pagination.list,i.list),n.pagination.total=i.total,n.loadStatus=n.pagination.list.length<n.pagination.total?"more":"noMore",i.list.forEach((e=>{s.BrokerageApi.getProductBrokeragePrice(e.id).then((r=>{e.brokerageMinPrice=r.data.brokerageMinPrice,e.brokerageMaxPrice=r.data.brokerageMaxPrice}))})))}function d(){"noMore"!==n.loadStatus&&(n.pagination.pageNo++,u())}return e.onLoad((()=>{u()})),e.onReachBottom((()=>{d()})),(a,s)=>e.e({a:e.f(n.pagination.list,((a,s,p)=>e.e({a:void 0===a.brokerageMinPrice},void 0===a.brokerageMinPrice?{}:a.brokerageMinPrice===a.brokerageMaxPrice?{c:e.t(e.unref(t.fen2yuan)(a.brokerageMinPrice))}:{d:e.t(e.unref(t.fen2yuan)(a.brokerageMinPrice)),e:e.t(e.unref(t.fen2yuan)(a.brokerageMaxPrice))},{b:a.brokerageMinPrice===a.brokerageMaxPrice,f:e.o((e=>{return s=a,n.shareInfo=i.$share.getShareInfo({title:s.title,image:r.sheep.$url.cdn(s.image),desc:s.subtitle,params:{page:"2",query:s.id}},{type:"goods",title:s.title,image:r.sheep.$url.cdn(s.image),price:s.price[0],original_price:s.original_price}),void o.showShareModal();var s}),a.id),g:e.o((i=>e.unref(r.sheep).$router.go("/pages/goods/index",{id:a.id})),a.id),h:"4b21ee3d-1-"+p+",4b21ee3d-0",i:e.p({size:"lg",img:a.picUrl,title:a.name,subTitle:a.introduction,price:a.price,originPrice:a.marketPrice,priceColor:"#333"}),j:a.id}))),b:0===n.pagination.total},0===n.pagination.total?{c:e.p({icon:"/static/goods-empty.png",text:"暂无推广商品"})}:{},{d:n.pagination.total>0},n.pagination.total>0?{e:e.o(d),f:e.p({status:n.loadStatus,"content-text":{contentdown:"上拉加载更多"}})}:{},{g:e.p({title:"推广商品",onShareAppMessage:n.shareInfo})})}},n=e._export_sfc(p,[["__scopeId","data-v-4b21ee3d"]]);p.__runtimeHooks=2,wx.createPage(n);
