import{y as a,o as e,e as t,f as s,w as n,l as r,j as o,t as l,u as i,k as c,r as u,F as m,g as f,s as d,E as p,i as g,aY as y,m as _,B as k,v as w,x as h}from"./index-9aa72eed.js";import{_ as D}from"./s-layout.bffb18b8.js";import{B as b}from"./brokerage.3a814b62.js";import{f as j}from"./useGoods.ce02ada2.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";import"./form.c66b5271.js";const v=x({__name:"commission-ranking",setup(x){const v=["周排行","月排行"],T=a({currentTab:0,position:0,rankList:[]});async function B(){const{code:a,data:e}=await b.getBrokerageUserChildSummaryPageByPrice({pageNo:1,pageSize:10,"times[0]":T.times[0],"times[1]":T.times[1]});0===a&&(T.rankList=e.list)}async function C(){const{code:a,data:e}=await b.getRankByPrice({times:T.times});0===a&&(T.position=e)}function F(a){return d.$helper.timeFormat(a,"yyyy-mm-dd hh:MM:ss")}function L(){let a;a=0===T.currentTab?function(){const a=new Date,e=a.getDay();return[new Date(a.getFullYear(),a.getMonth(),a.getDate()-e,0,0,0),new Date(a.getFullYear(),a.getMonth(),a.getDate()+(6-e),23,59,59)]}():function(){const a=new Date,e=a.getFullYear(),t=a.getMonth(),s=new Date(e,t,1,0,0,0),n=new Date(e,t+1,1),r=new Date(n.getTime()-1);return[s,r]}(),T.times=[F(a[0]),F(a[1])]}return e((function(){L(),B(),C()})),(a,e)=>{const d=p,b=g,x=h,F=y("emptyPage"),M=r(_("s-layout"),D);return t(),s(M,{title:"佣金排行榜"},{default:n((()=>[o(b,{class:"CommissionRank"},{default:n((()=>[o(b,{class:"header"},{default:n((()=>[T.position?(t(),s(b,{key:0,class:"rank"},{default:n((()=>[l(" 您目前的排名 "),o(d,{class:"num"},{default:n((()=>[l(i(T.position),1)])),_:1}),l(" 名 ")])),_:1})):(t(),s(b,{key:1,class:"rank"},{default:n((()=>[l("您目前暂无排名")])),_:1}))])),_:1}),o(b,{class:"wrapper"},{default:n((()=>[o(b,{class:"nav acea-row row-around",style:{"justify-content":"space-around",display:"flex"}},{default:n((()=>[(t(),c(m,null,u(v,((a,e)=>o(b,{class:k(["item",T.currentTab===e?"font-color":""]),key:e,onClick:a=>async function(a){T.currentTab=a,T.rankList=[],L(),B(),C()}(e)},{default:n((()=>[l(i(a),1)])),_:2},1032,["class","onClick"]))),64))])),_:1}),o(b,{class:"list"},{default:n((()=>[(t(!0),c(m,null,u(T.rankList,((a,e)=>(t(),s(b,{class:"item acea-row row-between-wrapper",key:e},{default:n((()=>[e<=2?(t(),s(b,{key:0,class:"num"},{default:n((()=>[o(x,{src:"/static/images/medal0"+(e+1)+".png"},null,8,["src"])])),_:2},1024)):(t(),s(b,{key:1,class:"num"},{default:n((()=>[l(i(e+1),1)])),_:2},1024)),o(b,{class:"picTxt acea-row row-between-wrapper"},{default:n((()=>[o(b,{class:"pictrue"},{default:n((()=>[o(x,{src:a.avatar},null,8,["src"])])),_:2},1024),o(b,{class:"text line1"},{default:n((()=>[l(i(a.nickname),1)])),_:2},1024)])),_:2},1024),o(b,{class:"people font-color"},{default:n((()=>[l("￥"+i(w(j)(a.brokeragePrice)),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1}),0!==T.rankList.length||1===T.page&&0!==T.active?f("",!0):(t(),s(b,{key:0,class:"noCommodity"},{default:n((()=>[o(F,{title:"暂无排行～"})])),_:1}))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-3976bf4a"]]);export{v as default};
