import{c as e,e as t}from"./vendor-BJZ6tUoe.js";import{_ as s}from"./vendor-DJUGQ7Dr.js";import{_ as o}from"./vendor-DKh56KT7.js";import{d as a}from"./vendor-CB_mu4eO.js";import{R as l,j as r,E as n,f as i}from"./souav-BTAG2baT.js";import{r as d,ag as c,q as f,x,a4 as v,a5 as u,bf as p,v as m,a3 as h,a2 as g,bH as j,ad as b,K as y,b1 as w,aW as k}from"./vendor-BXdGExd0.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DN37M9Hi.js";import"./vendor-DBhUxCDU.js";import"./vendor-BCo6x5W8.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-bo_0oRCG.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";const R=a("promoteRecord",()=>{const e=d([]),t=d(l.loading),s=d(!1),o=d(!1),a=d(!1),i=d(0);async function c(d=!1){var c;const f={pageNo:i.value,pageSize:20};try{const s=await r.queryInviteRecord(f);if(s.code===n.Success){const o=(null==(c=s.data)?void 0:c.inviteRecordList)??[];d?(e.value.push(...o),o.length<20&&(a.value=!0)):(e.value=o,t.value=0===o.length?l.EmptyData:l.success,a.value=o.length<20)}else d||(t.value=l.NetError),a.value=!0}catch(x){d||(t.value=l.NetError),a.value=!0}finally{s.value=!1,o.value=!1}}async function f(){s.value=!0,a.value=!1,i.value=1,await c()}return{records:e,refreshStatus:t,refreshing:s,loading:o,finished:a,init:function(){0===e.value.length&&f()},onRefresh:f,onLoadMore:async function(){o.value||a.value||(o.value=!0,i.value++,await c(!0))},reset:function(){e.value=[],i.value=1,a.value=!1,t.value=l.loading,o.value=!1,s.value=!1}}}),E={class:"min-h-dvh bg-[#0E0F12] flex flex-col"},_={class:"sticky top-0 z-50 flex items-center justify-center h-12 border-b border-[#1D1E22]"},F={class:"flex-1 flex flex-col px-[16px] pt-[5px] pb-[16px] overflow-hidden"},L={class:"mb-[15px]"},N={class:"text-[16px] font-bold text-[#F2C94C]"},S={class:"flex-1 bg-[#1D1E22] rounded-[13px] pt-[16px] flex flex-col overflow-hidden"},B={class:"flex-1 flex flex-col overflow-hidden"},C={key:0,class:"flex items-center justify-center flex-1"},D={class:"flex-1 text-center text-[#6B6F80] text-[12px]"},I={class:"flex-1 text-center text-[#6B6F80] text-[12px] truncate px-1"},V={class:"flex-1 text-center text-[#6B6F80] text-[12px]"},q=c({__name:"PromotionRecord",emits:["ppw-close"],setup(a){const r=R(),n=i();return f(()=>{r.init()}),x(()=>{r.reset()}),(a,i)=>{var d;const c=o,f=s,x=t,R=e;return k(),v("div",E,[u("header",_,[u("button",{onClick:i[0]||(i[0]=e=>a.$emit("ppw-close")),class:"absolute left-4 p-2 -ml-2"},[...i[4]||(i[4]=[u("i",{class:"icon-sprite icon-back"},null,-1)])]),i[5]||(i[5]=u("h1",{class:"text-lg font-medium text-white font-sans"},"推广记录",-1))]),u("main",F,[u("div",L,[i[6]||(i[6]=u("span",{class:"text-[16px] font-bold text-white"},"累计推广 ",-1)),u("span",N,p((null==(d=m(n).userInfo)?void 0:d.inviteNum)??0),1),i[7]||(i[7]=u("span",{class:"text-[16px] font-bold text-white"}," 人",-1))]),u("div",S,[i[8]||(i[8]=u("div",{class:"flex pb-[12px] border-b border-[#292B32]"},[u("div",{class:"flex-1 text-center text-white text-[14px] font-medium"},"注册时间"),u("div",{class:"flex-1 text-center text-white text-[14px] font-medium"},"用户名"),u("div",{class:"flex-1 text-center text-white text-[14px] font-medium"},"ID")],-1)),u("div",B,[0===m(r).records.length?(k(),v("div",C,[m(r).refreshStatus==m(l).loading?(k(),g(c,{key:0})):(k(),g(f,{key:1}))])):m(r).refreshStatus===m(l).NetError?(k(),v("div",{key:1,class:"flex items-center justify-center flex-1 text-gray-500",onClick:i[1]||(i[1]=(...e)=>m(r).onRefresh&&m(r).onRefresh(...e))}," 加载失败，点击重试 ")):h("",!0),0!==m(r).records.length?(k(),g(R,{key:2,modelValue:m(r).refreshing,"onUpdate:modelValue":i[3]||(i[3]=e=>m(r).refreshing=e),onRefresh:m(r).onRefresh,class:"h-full overflow-y-auto"},{default:j(()=>[b(x,{loading:m(r).loading,"onUpdate:loading":i[2]||(i[2]=e=>m(r).loading=e),finished:m(r).finished,onLoad:m(r).onLoadMore},{default:j(()=>[(k(!0),v(y,null,w(m(r).records,(e,t)=>(k(),v("div",{key:t,class:"flex pb-[12px] pt-[12px]"},[u("div",D,p(e.createdAt),1),u("div",I,p(e.nickname),1),u("div",V,p(e.userId),1)]))),128))]),_:1},8,["loading","finished","onLoad"])]),_:1},8,["modelValue","onRefresh"])):h("",!0)])])])])}}});export{q as default};
