pages-commission-goods.c4c6b679.js 3.2 KB

1
  1. import{z as e,o as a,A as t,f as i,g as o,w as s,S as r,_ as n,bL as l,m as p,l as g,r as c,F as d,i as m,n as u,k as _,x as f,s as k,u as b,v as y,G as P,$ as M,ad as x,j as h,J as j}from"./index-ba48620e.js";import{_ as S}from"./s-goods-item.32271aab.js";import{_ as v}from"./s-empty.a75760f9.js";import{_ as C}from"./uni-load-more.966faf1b.js";import{_ as w}from"./s-layout.04b95866.js";import{f as z}from"./useGoods.edb8879f.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css *//* empty css */import"./phone-international-input.dd3ca29e.js";const G=I({__name:"goods",setup(I){const G=e({pagination:{list:[],total:0,pageNo:1,pageSize:1},loadStatus:"",shareInfo:{}});async function N(){G.loadStatus="loading";let{code:e,data:a}=await r.getSpuPage({pageSize:G.pagination.pageSize,pageNo:G.pagination.pageNo});0===e&&(G.pagination.list=n.concat(G.pagination.list,a.list),G.pagination.total=a.total,G.loadStatus=G.pagination.list.length<G.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"!==G.loadStatus&&(G.pagination.pageNo++,N())}return a((()=>{N()})),t((()=>{$()})),(e,a)=>{const t=h,r=j,n=p(u("s-goods-item"),S),l=p(u("s-empty"),v),I=p(u("uni-load-more"),C),N=p(u("s-layout"),w);return i(),o(N,{title:"推广商品",onShareAppMessage:G.shareInfo},{default:s((()=>[(i(!0),g(d,null,c(G.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(z)(e.brokerageMinPrice)),1)])),_:2},1024)):(i(),o(t,{key:2,class:"commission-num"},{default:s((()=>[b(" 预计佣金:"+y(f(z)(e.brokerageMinPrice))+" ~ "+y(f(z)(e.brokerageMaxPrice)),1)])),_:2},1024)),_(r,{class:"ss-reset-button share-btn ui-BG-Main-Gradient",onClick:P((a=>{return t=e,G.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 x();var t}),["stop"])},{default:s((()=>[b(" 分享赚 ")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["img","title","subTitle","price","originPrice","onClick"])])),_:2},1024)))),128)),0===G.pagination.total?(i(),o(l,{key:0,icon:"/static/goods-empty.png",text:"暂无推广商品"})):m("",!0),G.pagination.total>0?(i(),o(I,{key:1,status:G.loadStatus,"content-text":{contentdown:"上拉加载更多"},onClick:$},null,8,["status"])):m("",!0)])),_:1},8,["onShareAppMessage"])}}},[["__scopeId","data-v-4b21ee3d"]]);export{G as default};