import{v as e,o as a,r as t,e as s,f as r,w as n,cD as l,s as o,j as c,k as u,l as i,m as f,F as d,af as m,ag as _,p as w,t as p,g as k,i as g,q as h,z as y}from"./index-CWyPMHxb.js";import{S as b}from"./s-layout.CUgh1tQ8.js";import{_ as D}from"./_plugin-vue_export-helper.BCo6x5W8.js";const v=D({__name:"promoter",setup(D){const v=["周排行","月排行"],C=e({currentTab:0,rankList:[],times:[],one:{},two:{},three:{}});async function L(){C.one={},C.two={},C.three={},C.rankList=[];const{code:e,data:a}=await l.getBrokerageUserRankPageByUserCount({pageNo:1,pageSize:10,"times[0]":C.times[0],"times[1]":C.times[1]});0===e&&(C.rankList=a.list,C.one=C.rankList.shift()||{},C.two=C.rankList.shift()||{},C.trhee=C.rankList.shift()||{})}function T(){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),r=new Date(a,t+1,1),n=new Date(r.getTime()-1);return[s,n]}(),C.times=[x(e[0]),x(e[1])]}function x(e){return o.$helper.timeFormat(e,"yyyy-mm-dd hh:MM:ss")}return a((function(){T(),L()})),(e,a)=>{const l=g,o=h,D=t(s("s-layout"),b);return c(),r(D,{title:"推广人排行榜"},{default:n((()=>[u(l,{class:"PromoterRank",style:{backgroundColor:"red"}},{default:n((()=>[u(l,{class:"redBg bg-color"},{default:n((()=>[u(l,{class:"header"},{default:n((()=>[u(l,{class:"nav acea-row row-center-wrapper",style:{display:"flex"}},{default:n((()=>[(c(),i(d,null,f(v,((e,a)=>u(l,{class:y(["item",C.currentTab===a?"font-color":""]),key:a,onClick:e=>function(e){C.currentTab!==e&&(C.currentTab=e,T(),L())}(a)},{default:n((()=>[w(p(e),1)])),_:2},1032,["class","onClick"]))),64))])),_:1}),u(l,{class:"rank acea-row row-bottom row-around"},{default:n((()=>[m(u(l,{class:"item"},{default:n((()=>[u(l,{class:"pictrue"},{default:n((()=>[u(o,{src:C.two.avatar},null,8,["src"])])),_:1}),u(l,{class:"name line1"},{default:n((()=>[w(p(C.two.nickname),1)])),_:1}),u(l,{class:"num"},{default:n((()=>[w(p(C.two.brokerageUserCount)+"人",1)])),_:1})])),_:1},512),[[_,C.two.id]]),m(u(l,{class:"item"},{default:n((()=>[u(l,{class:"pictrue"},{default:n((()=>[u(o,{src:C.one.avatar},null,8,["src"])])),_:1}),u(l,{class:"name line1"},{default:n((()=>[w(p(C.one.nickname),1)])),_:1}),u(l,{class:"num"},{default:n((()=>[w(p(C.one.brokerageUserCount)+"人",1)])),_:1})])),_:1},512),[[_,C.one.id]]),m(u(l,{class:"item"},{default:n((()=>[u(l,{class:"pictrue"},{default:n((()=>[u(o,{src:C.three.avatar},null,8,["src"])])),_:1}),u(l,{class:"name line1"},{default:n((()=>[w(p(C.three.nickname),1)])),_:1}),u(l,{class:"num"},{default:n((()=>[w(p(C.three.brokerageUserCount)+"人",1)])),_:1})])),_:1},512),[[_,C.three.id]])])),_:1})])),_:1})])),_:1}),C.rankList.length?(c(),r(l,{key:0,class:"list"},{default:n((()=>[(c(!0),i(d,null,f(C.rankList,((e,a)=>(c(),r(l,{class:"item acea-row row-between-wrapper",key:a},{default:n((()=>[u(l,{class:"num"},{default:n((()=>[w(p(a+4),1)])),_:2},1024),u(l,{class:"picTxt acea-row row-between-wrapper"},{default:n((()=>[u(l,{class:"pictrue"},{default:n((()=>[u(o,{src:e.avatar},null,8,["src"])])),_:2},1024),u(l,{class:"text line1"},{default:n((()=>[w(p(e.nickname),1)])),_:2},1024)])),_:2},1024),u(l,{class:"people font-color"},{default:n((()=>[w(p(e.brokerageUserCount)+"人",1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})):k("",!0)])),_:1})])),_:1})}}},[["__scopeId","data-v-f5686422"]]);export{v as default};
