import{B as e,o as a,C as t,f as i,g as o,w as s,S as r,_ as n,bS as l,q as p,p as g,r as c,F as d,i as u,u as m,n as _,z as f,s as k,m as b,t as y,I as P,$ as M,af as S,l as h,L as x}from"./index-007bf156.js";import{_ as j}from"./s-goods-item.8ceb696e.js";import{_ as v}from"./s-empty.df9577ad.js";import{_ as C}from"./uni-load-more.4c025ab2.js";import{_ as z}from"./s-layout.19bedb43.js";import{f as I}from"./useGoods.ac3bf93e.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css                                                                     *//* empty css                                                                */import"./phone-international-input.3617e4e0.js";const B=w({__name:"goods",setup(w){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 r.getSpuPage({pageSize:B.pagination.pageSize,pageNo:B.pagination.pageNo});0===e&&(B.pagination.list=n.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=>{l.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=h,r=x,n=p(m("s-goods-item"),j),l=p(m("s-empty"),v),w=p(m("uni-load-more"),C),N=p(m("s-layout"),z);return i(),o(N,{title:"推广商品",onShareAppMessage:B.shareInfo},{default:s((()=>[(i(!0),g(d,null,c(B.pagination.list,(e=>(i(),o(t,{class:"goods-item ss-m-20",key:e.id},{default:s((()=>[_(n,{size:"lg",img:e.picUrl,title:e.name,subTitle:e.introduction,price:e.price,originPrice:e.marketPrice,priceColor:"#333",onClick:a=>f(k).$router.go("/pages/goods/index",{id:e.id})},{rightBottom:s((()=>[_(t,{class:"ss-flex ss-row-between"},{default:s((()=>[void 0===e.brokerageMinPrice?(i(),o(t,{key:0,class:"commission-num"},{default:s((()=>[b("预计佣金：计算中")])),_:1})):e.brokerageMinPrice===e.brokerageMaxPrice?(i(),o(t,{key:1,class:"commission-num"},{default:s((()=>[b(" 预计佣金："+y(f(I)(e.brokerageMinPrice)),1)])),_:2},1024)):(i(),o(t,{key:2,class:"commission-num"},{default:s((()=>[b(" 预计佣金："+y(f(I)(e.brokerageMinPrice))+" ~ "+y(f(I)(e.brokerageMaxPrice)),1)])),_:2},1024)),_(r,{class:"ss-reset-button share-btn ui-BG-Main-Gradient",onClick:P((a=>{return t=e,B.shareInfo=M.getShareInfo({title:t.title,image:k.$url.cdn(t.image),desc:t.subtitle,params:{page:"2",query:t.id}},{type:"goods",title:t.title,image:k.$url.cdn(t.image),price:t.price[0],original_price:t.original_price}),void S();var t}),["stop"])},{default:s((()=>[b(" 分享赚 ")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["img","title","subTitle","price","originPrice","onClick"])])),_:2},1024)))),128)),0===B.pagination.total?(i(),o(l,{key:0,icon:"/static/goods-empty.png",text:"暂无推广商品"})):u("",!0),B.pagination.total>0?(i(),o(w,{key:1,status:B.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:$},null,8,["status"])):u("",!0)])),_:1},8,["onShareAppMessage"])}}},[["__scopeId","data-v-4b21ee3d"]]);export{B as default};
