import{v as a,o as e,e as t,f as s,w as n,l as r,j as o,p as l,t as i,k as c,r as u,F as m,g as f,s as d,C as p,i as g,aY as _,m as y,z as k,u as w,q as h}from"./index-219abc09.js";import{_ as D}from"./s-layout.e3f07a22.js";import{B as b}from"./brokerage.39c4461a.js";import{f as j}from"./useGoods.f5223d84.js";import{_ as v}from"./_plugin-vue_export-helper.1b428a4d.js";import"./form.480ce5b4.js";const x=v({__name:"commission-ranking",setup(v){const x=["周排行","月排行"],C=a({currentTab:0,position:0,rankList:[]});async function F(){const{code:a,data:e}=await b.getBrokerageUserChildSummaryPageByPrice({pageNo:1,pageSize:10,"times[0]":C.times[0],"times[1]":C.times[1]});0===a&&(C.rankList=e.list)}async function T(){const{code:a,data:e}=await b.getRankByPrice({times:C.times});0===a&&(C.position=e)}function L(a){return d.$helper.timeFormat(a,"yyyy-mm-dd hh:MM:ss")}function M(){let a;a=0===C.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]}(),C.times=[L(a[0]),L(a[1])]}return e((function(){M(),F(),T()})),(a,e)=>{const d=p,b=g,v=h,L=_("emptyPage"),P=r(y("s-layout"),D);return t(),s(P,{title:"佣金排行榜"},{default:n((()=>[o(b,{class:"CommissionRank"},{default:n((()=>[o(b,{class:"header"},{default:n((()=>[C.position?(t(),s(b,{key:0,class:"rank"},{default:n((()=>[l(" 您目前的排名 "),o(d,{class:"num"},{default:n((()=>[l(i(C.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(x,((a,e)=>o(b,{class:k(["item",C.currentTab===e?"font-color":""]),key:e,onClick:a=>async function(a){C.currentTab=a,C.rankList=[],M(),F(),T()}(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(C.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(v,{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(v,{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!==C.rankList.length||1===C.page&&0!==C.active?f("",!0):(t(),s(b,{key:0,class:"noCommodity"},{default:n((()=>[o(L,{title:"暂无排行～"})])),_:1}))])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-3976bf4a"]]);export{x as default};
