import{C as a,p as t,D as s,o as e,e as o,w as i,s as n,_ as r,b as l,f as p,h as d,F as c,k as g,d as u,i as m,u as _,y as f,z as y,j as b,$ as h,W as j,m as k,B as x}from"./index-520dfaee.js";import{_ as S}from"./s-goods-item.cceb2670.js";import{_ as v}from"./s-empty.b6c95127.js";import{_ as C}from"./uni-load-more.ba4f287c.js";import{a as w}from"./s-layout.5146c957.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css                                                                     *//* empty css                                                                */const M=I({__name:"goods",setup(I){const M=a({pagination:{data:[],current_page:1,total:1,last_page:1},loadStatus:"",shareInfo:{}});async function $(a=1,t=8){M.loadStatus="loading";let s=await n.$api.commission.goods({list_rows:t,page:a});if(1===s.code){let a=r.concat(M.pagination.data,s.data.data);M.pagination={...s.data,data:a},M.pagination.current_page<M.pagination.last_page?M.loadStatus="more":M.loadStatus="noMore"}}function B(){"noMore"!==M.loadStatus&&$(M.pagination.current_page+1)}return t((async()=>{$()})),s((()=>{B()})),(a,t)=>{const s=k,r=x,I=l(u("s-goods-item"),S),$=l(u("s-empty"),v),z=l(u("uni-load-more"),C),A=l(u("s-layout"),w);return e(),o(A,{title:"推广商品",onShareAppMessage:M.shareInfo},{default:i((()=>[(e(!0),p(c,null,d(M.pagination.data,(a=>(e(),o(s,{class:"goods-item ss-m-20",key:a.id},{default:i((()=>[m(I,{size:"lg",img:a.image,title:a.title,subTitle:a.subtitle,price:a.price[0],originPrice:a.original_price,priceColor:"#333",onClick:t=>_(n).$router.go("/pages/goods/index",{id:a.id})},{rightBottom:i((()=>[m(s,{class:"ss-flex ss-row-between"},{default:i((()=>[m(s,{class:"commission-num"},{default:i((()=>[f("预计佣金：￥"+y(a.commission),1)])),_:2},1024),m(r,{class:"ss-reset-button share-btn ui-BG-Main-Gradient",onClick:b((t=>{return s=a,M.shareInfo=h.getShareInfo({title:s.title,image:n.$url.cdn(s.image),desc:s.subtitle,params:{page:"2",query:s.id}},{type:"goods",title:s.title,image:n.$url.cdn(s.image),price:s.price[0],original_price:s.original_price}),void j();var s}),["stop"])},{default:i((()=>[f(" 分享赚 ")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["img","title","subTitle","price","originPrice","onClick"])])),_:2},1024)))),128)),0===M.pagination.total?(e(),o($,{key:0,icon:"/static/goods-empty.png",text:"暂无推广商品"})):g("",!0),M.pagination.total>0?(e(),o(z,{key:1,status:M.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:B},null,8,["status"])):g("",!0)])),_:1},8,["onShareAppMessage"])}}},[["__scopeId","data-v-7d47a90e"]]);export{M as default};
