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