1 |
- import{v as e,o as a,x 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,j as d,u,s as _,p as f,t as k,A as y,$ as b,a4 as x,i as P,D as M}from"./index-9880b451.js";import{_ as j}from"./s-goods-item.f5d79fd7.js";import{_ as S}from"./s-empty.74111684.js";import{_ as h}from"./uni-load-more.aac4524a.js";import{_ as v}from"./s-layout.dfc5b0b5.js";import{S as C}from"./spu.3137f763.js";import{B as w}from"./brokerage.b6c9045b.js";import{f as I}from"./useGoods.bdd1c2ea.js";import{_ as z}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css *//* empty css */import"./index.df38848e.js";const B=z({__name:"goods",setup(z){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 C.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=>{w.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=P,r=M,C=n(m("s-goods-item"),j),w=n(m("s-empty"),S),z=n(m("uni-load-more"),h),N=n(m("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((()=>[d(C,{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((()=>[d(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(I)(e.brokerageMinPrice)),1)])),_:2},1024)):(i(),o(t,{key:2,class:"commission-num"},{default:s((()=>[f(" 预计佣金:"+k(u(I)(e.brokerageMinPrice))+" ~ "+k(u(I)(e.brokerageMaxPrice)),1)])),_:2},1024)),d(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 x();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(w,{key:0,icon:"/static/goods-empty.png",text:"暂无推广商品"})):c("",!0),B.pagination.total>0?(i(),o(z,{key:1,status:B.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:$},null,8,["status"])):c("",!0)])),_:1},8,["onShareAppMessage"])}}},[["__scopeId","data-v-40ff75e7"]]);export{B as default};
|