import{y as e,o as a,z as t,e as i,f as o,w as s,_ as r,l as n,k as l,r as g,F as p,g as c,m as d,j as m,v as u,s as _,t as f,u as k,C as y,$ as b,a7 as P,i as M,G as h}from"./index-68dd960a.js";import{_ as j}from"./s-goods-item.e173a1d7.js";import{_ as x}from"./s-empty.fd15ca2f.js";import{_ as S}from"./uni-load-more.49bf8042.js";import{_ as v,f as C}from"./s-layout.454a15cd.js";import{S as w}from"./spu.556cee01.js";import{B as z}from"./brokerage.bca7adb6.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                     *//* empty css                                                                */import"./phone-international-input.471da4c0.js";const B=I({__name:"goods",setup(I){const B=e({pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",shareInfo:{}});async function N(){B.loadStatus="loading";let{code:e,data:a}=await w.getSpuPage({pageSize:B.pagination.pageSize,pageNo:B.pagination.pageNo});0===e&&(B.pagination.list=r.concat(B.pagination.list,a.list),B.pagination.total=a.total,B.loadStatus=B.pagination.list.length<B.pagination.total?"more":"noMore",a.list.forEach((e=>{z.getProductBrokeragePrice(e.id).then((a=>{e.brokerageMinPrice=a.data.brokerageMinPrice,e.brokerageMaxPrice=a.data.brokerageMaxPrice}))})))}function $(){"noMore"!==B.loadStatus&&(B.pagination.pageNo++,N())}return a((()=>{N()})),t((()=>{$()})),(e,a)=>{const t=M,r=h,w=n(d("s-goods-item"),j),z=n(d("s-empty"),x),I=n(d("uni-load-more"),S),N=n(d("s-layout"),v);return i(),o(N,{title:"推广商品",onShareAppMessage:B.shareInfo},{default:s((()=>[(i(!0),l(p,null,g(B.pagination.list,(e=>(i(),o(t,{class:"goods-item ss-m-20",key:e.id},{default:s((()=>[m(w,{size:"lg",img:e.picUrl,title:e.name,subTitle:e.introduction,price:e.price,originPrice:e.marketPrice,priceColor:"#333",onClick:a=>u(_).$router.go("/pages/goods/index",{id:e.id})},{rightBottom:s((()=>[m(t,{class:"ss-flex ss-row-between"},{default:s((()=>[void 0===e.brokerageMinPrice?(i(),o(t,{key:0,class:"commission-num"},{default:s((()=>[f("预计佣金：计算中")])),_:1})):e.brokerageMinPrice===e.brokerageMaxPrice?(i(),o(t,{key:1,class:"commission-num"},{default:s((()=>[f(" 预计佣金："+k(u(C)(e.brokerageMinPrice)),1)])),_:2},1024)):(i(),o(t,{key:2,class:"commission-num"},{default:s((()=>[f(" 预计佣金："+k(u(C)(e.brokerageMinPrice))+" ~ "+k(u(C)(e.brokerageMaxPrice)),1)])),_:2},1024)),m(r,{class:"ss-reset-button share-btn ui-BG-Main-Gradient",onClick:y((a=>{return t=e,B.shareInfo=b.getShareInfo({title:t.title,image:_.$url.cdn(t.image),desc:t.subtitle,params:{page:"2",query:t.id}},{type:"goods",title:t.title,image:_.$url.cdn(t.image),price:t.price[0],original_price:t.original_price}),void P();var t}),["stop"])},{default:s((()=>[f(" 分享赚 ")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["img","title","subTitle","price","originPrice","onClick"])])),_:2},1024)))),128)),0===B.pagination.total?(i(),o(z,{key:0,icon:"/static/goods-empty.png",text:"暂无推广商品"})):c("",!0),B.pagination.total>0?(i(),o(I,{key:1,status:B.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:$},null,8,["status"])):c("",!0)])),_:1},8,["onShareAppMessage"])}}},[["__scopeId","data-v-4b21ee3d"]]);export{B as default};
