"use strict";const e=require("../../../common/vendor.js"),t=require("../../../sheep/index.js"),n=require("../../../sheep/api/trade/brokerage.js");if(!Array){(e.resolveComponent("s-layout")+e.resolveComponent("layout-default-uni"))()}Math;const r={__name:"promoter",setup(r){const a=["周排行","月排行"],o=e.reactive({currentTab:0,rankList:[],times:[],one:{},two:{},three:{}});function i(){return e=this,t=null,r=function*(){o.one={},o.two={},o.three={},o.rankList=[];const{code:e,data:t}=yield n.BrokerageApi.getBrokerageUserRankPageByUserCount({pageNo:1,pageSize:10,"times[0]":o.times[0],"times[1]":o.times[1]});0===e&&(o.rankList=t.list,o.one=o.rankList.shift()||{},o.two=o.rankList.shift()||{},o.trhee=o.rankList.shift()||{})},new Promise(((n,a)=>{var o=e=>{try{s(r.next(e))}catch(t){a(t)}},i=e=>{try{s(r.throw(e))}catch(t){a(t)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,i);s((r=r.apply(e,t)).next())}));var e,t,r}function s(){let e;e=0===o.currentTab?function(){const e=new Date,t=e.getDay();return[new Date(e.getFullYear(),e.getMonth(),e.getDate()-t,0,0,0),new Date(e.getFullYear(),e.getMonth(),e.getDate()+(6-t),23,59,59)]}():function(){const e=new Date,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n,1,0,0,0),a=new Date(t,n+1,1),o=new Date(a.getTime()-1);return[r,o]}(),o.times=[c(e[0]),c(e[1])]}function c(e){return t.sheep.$helper.timeFormat(e,"yyyy-mm-dd hh:MM:ss")}return e.onLoad((function(){s(),i()})),(t,n)=>e.e({a:e.f(a,((t,n,r)=>({a:e.t(t),b:e.n(o.currentTab===n?"font-color":""),c:n,d:e.o((e=>function(e){o.currentTab!==e&&(o.currentTab=e,s(),i())}(n)),n)}))),b:o.two.avatar,c:e.t(o.two.nickname),d:e.t(o.two.brokerageUserCount),e:o.two.id,f:o.one.avatar,g:e.t(o.one.nickname),h:e.t(o.one.brokerageUserCount),i:o.one.id,j:o.three.avatar,k:e.t(o.three.nickname),l:e.t(o.three.brokerageUserCount),m:o.three.id,n:o.rankList.length},o.rankList.length?{o:e.f(o.rankList,((t,n,r)=>({a:e.t(n+4),b:t.avatar,c:e.t(t.nickname),d:e.t(t.brokerageUserCount),e:n})))}:{},{p:e.p({title:"推广人排行榜"})})}},a=e._export_sfc(r,[["__scopeId","data-v-85142312"]]);wx.createPage(a);