import{t as a,o as e,j as s,w as l,h as t,i as u,I as o,l as r,e as i,F as n,k as c,p as f,A as d,B as m,a8 as _,a as p,O as b,m as v}from"./index-9bec188e.js";import{H as y}from"./index.bdca3eba.js";import{u as j}from"./useScroll.c0a86152.js";import{h as x}from"./moment.dc0d6ca6.js";import{_ as g}from"./_plugin-vue_export-helper.1b428a4d.js";import{u as w}from"./usePaging.83057129.js";import{p as k,g as h,b as C}from"./index.a57c544a.js";import{E as I}from"./index.036a38bb.js";import{v as D}from"./images.52fc6216.js";import"./uv-icon.27c7246d.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./utils.3f9740a5.js";const Y=[{label:"商品金额（元）",field:"productAmount"},{label:"订单数",field:"orderCount"},{label:"佣金收入（元）",field:"wages"}],P=g({__name:"DistributorInfoItem",props:{data:{type:Object,required:!0}},setup(_){const p=_,{data:b}=a(p);return(a,_)=>{const p=f,v=d,y=m;return e(),s(y,{class:"user-item"},{default:l((()=>[t(y,{class:"userinfo-row flex flex-jc__start"},{default:l((()=>[t(p,{src:u(b).avatar},null,8,["src"]),t(y,{class:"userinfo flex flex-column flex-jc__sb"},{default:l((()=>[t(y,{class:"username"},{default:l((()=>[o(r(u(b).nickname)+" ",1),t(v,{class:"tag"},{default:l((()=>[o(r(0===u(b).isDistributor?"客户":"分销商"),1)])),_:1})])),_:1}),t(y,{class:"time"},{default:l((()=>[o("加入时间："+r(u(x)(u(b).createTime).format("YYYY-MM-DD")),1)])),_:1})])),_:1})])),_:1}),t(y,{class:"distribution-info-row"},{default:l((()=>[(e(!0),i(n,null,c(u(Y),(a=>(e(),s(y,{class:"info-item",key:a.label},{default:l((()=>[t(y,{class:"title"},{default:l((()=>[o(r(a.label),1)])),_:2},1024),t(y,{class:"count"},{default:l((()=>[o(r(u(b)[a.field]||"0"),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})}}},[["__scopeId","data-v-c26c7208"]]),q=g({__name:"index",setup(a){const{scrollTop:f}=j();_((()=>{}));const x=[{label:"一级",filed:"p1Count",value:1},{label:"二级",filed:"p2Count",value:2}],g=p(1);const{loading:Y,otherParams:q,list:A,refreshPage:M}=w({request:k}),O=p(0);async function T(){O.value=await h({type:q.value.type})}const B=p({p1Count:0,p2Count:0});return b((async()=>{q.value.type=1,await M(),await T(),await async function(){B.value=await C()}()})),(a,_)=>{const p=m,b=d;return e(),s(p,{class:"team"},{default:l((()=>[t(y,{"scroll-top":u(f),"system-bar-area-bg":"#fff","header-area-bg":"#fff"},{default:l((()=>[o(" 我的团队 ")])),_:1},8,["scroll-top"]),t(p,{class:"tab-content"},{default:l((()=>[t(p,{class:"tab-inner"},{default:l((()=>[(e(),i(n,null,c(x,(a=>t(p,{class:v(["tab-item",{current:g.value===a.value}]),key:a.value,onClick:e=>async function(a){g.value=a,q.value.type=a,await M(),await T()}(a.value)},{default:l((()=>[o(r(a.label)+"（"+r(B.value[a.filed])+"） ",1)])),_:2},1032,["class","onClick"]))),64))])),_:1})])),_:1}),t(p,{class:"main"},{default:l((()=>[t(p,{class:"user-num-box"},{default:l((()=>[t(p,{class:"title"},{default:l((()=>[o("今日新增： "),t(b,{class:"num primary-color"},{default:l((()=>[o(r(O.value)+"人",1)])),_:1})])),_:1})])),_:1}),u(A).length>0?(e(),s(p,{key:0,class:"user-list-box"},{default:l((()=>[(e(!0),i(n,null,c(u(A),(a=>(e(),s(P,{key:a.id,data:a},null,8,["data"])))),128))])),_:1})):(e(),s(p,{key:1,class:"user-list-box"},{default:l((()=>[t(I,{"icon-src":u(D)},null,8,["icon-src"])])),_:1}))])),_:1})])),_:1})}}},[["__scopeId","data-v-41b7e24f"]]);export{q as default};
