pages-commission-goods.7d01d1e7.js 3.2 KB

1
  1. 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 p,F as g,g as c,m,j as d,v as u,s as _,t as f,u as k,C as b,$ as y,a5 as M,i as P,G as h}from"./index-b48a414d.js";import{_ as j}from"./s-goods-item.13120f93.js";import{_ as x}from"./s-empty.6d3471cc.js";import{_ as S}from"./uni-load-more.647920f4.js";import{_ as v,f as C}from"./s-layout.d6dcdc81.js";import{S as w}from"./spu.3911022d.js";import{B as z}from"./brokerage.e67d9a73.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css *//* empty css */import"./phone-international-input.feef99c7.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=P,r=h,w=n(m("s-goods-item"),j),z=n(m("s-empty"),x),I=n(m("uni-load-more"),S),N=n(m("s-layout"),v);return i(),o(N,{title:"推广商品",onShareAppMessage:B.shareInfo},{default:s((()=>[(i(!0),l(g,null,p(B.pagination.list,(e=>(i(),o(t,{class:"goods-item ss-m-20",key:e.id},{default:s((()=>[d(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((()=>[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(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)),d(r,{class:"ss-reset-button share-btn ui-BG-Main-Gradient",onClick:b((a=>{return t=e,B.shareInfo=y.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 M();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};