PageSourceSearch

https://nickz.ai/assets/js/index-HKgSHq8g.js

js nickz.ai collected 2026-10-05 14:20:22 UTC 33,344 bytes, 1 lines download raw bytes

1import{u as e,r as t,R as a,j as s}from"./vendor-react-DejgYtBM.js";import{i as n,j as i,f as l,r,B as d,G as o,m as c,T as h,a as p,y as u,E as x,k as y,F as m,x as g,p as j,M as _,W as S,o as w}from"./vendor-semi-D8d7bTtM.js";import{u as v,S as f,$ as k,a1 as C,a0 as I,J as b,ad as z,s as T,A as $,v as O,w as P}from"./index-BeIIFw6E.js";import{al as D,C as B,am as K,T as W,R,X as F,x as U,an as L,ao as N,w as E,U as A}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";const{Title:J,Text:M}=l,q=()=>{const{t:q}=v(),V=e(),[H]=t.useContext(f),G=k()||C()||I()||b()||z(),[X,Y]=t.useState([]),[Q,Z]=t.useState(!1),[ee,te]=t.useState(null),[ae,se]=t.useState(!1),[ne,ie]=t.useState(null),[le,re]=t.useState("channels"),[de,oe]=t.useState([]),[ce,he]=t.useState(!1),[pe,ue]=t.useState(""),[xe,ye]=t.useState([]),[me,ge]=t.useState(null),[je,_e]=t.useState(!1),[Se,we]=t.useState([]),[ve,fe]=t.useState(!1),[ke,Ce]=t.useState(1),[Ie,be]=t.useState(10),[ze,Te]=t.useState(0),[$e,Oe]=t.useState(0),[Pe,De]=t.useState(0),[Be,Ke]=t.useState(""),[We,Re]=t.useState(""),[Fe,Ue]=t.useState(""),[Le,Ne]=t.useState(""),[Ee,Ae]=t.useState(""),[Je,Me]=t.useState(""),qe=t.useMemo(()=>H?.status?.currency_type||"USD",[H]),Ve=t.useMemo(()=>H?.status?.custom_currency_symbol||"¤",[H]),He=t.useMemo(()=>parseFloat(H?.status?.custom_currency_exchange_rate)||1,[H]),Ge=t.useMemo(()=>parseFloat(H?.status?.usd_exchange_rate)||7.3,[H]),Xe=e=>{if(null==e)return"-";if("TOKENS"===qe)return e.toFixed(2);let t="$",a=e;return"CNY"===qe?(a=e*Ge,t="¥"):"CUSTOM"===qe&&(a=e*He,t=Ve),`${t}${a.toFixed(2)}`},Ye=(e,t,a,s,n)=>{const i=e||[];return!t&&!a||0===i.length?i:[{id:"__topup_summary__",__isSummary:!0,amount:s,money:n},...i]},[Qe,Ze]=t.useState([]),[et,tt]=t.useState("topups"),[at,st]=t.useState([]),[nt,it]=t.useState(!1),[lt,rt]=t.useState(1),[dt,ot]=t.useState(10),[ct,ht]=t.useState(0),[pt,ut]=t.useState(0),[xt,yt]=t.useState(0),[mt,gt]=t.useState(""),[jt,_t]=t.useState(""),[St,wt]=t.useState(""),[vt,ft]=t.useState(""),[kt,Ct]=t.useState(""),[It,bt]=t.useState([]),[zt,Tt]=t.useState(!1),[$t,Ot]=t.useState(1),[Pt,Dt]=t.useState(10),[Bt,Kt]=t.useState(0),[Wt,Rt]=t.useState(""),[Ft,Ut]=t.useState(""),[Lt,Nt]=t.useState(""),[Et,At]=t.useState(0),[Jt,Mt]=t.useState([]),[qt,Vt]=t.useState(null),[Ht,Gt]=t.useState(!1),[Xt,Yt]=t.useState(1),[Qt,Zt]=t.useState(10),[ea,ta]=t.useState(0),[aa,sa]=t.useState(""),[na,ia]=t.useState(""),[la,ra]=t.useState("desc"),[da,oa]=t.useState([]),[ca,ha]=t.useState([]),[pa,ua]=t.useState(!1),[xa,ya]=t.useState(1),[ma,ga]=t.useState(20),[ja,_a]=t.useState(0),[Sa,wa]=t.useState(null),[va,fa]=t.useState(0),[ka,Ca]=t.useState(""),[Ia,ba]=t.useState(""),[za,Ta]=t.useState(""),[$a,Oa]=t.useState(!1),[Pa,Da]=t.useState(null),[Ba,Ka]=t.useState([]),[Wa,Ra]=t.useState(!1),[Fa,Ua]=t.useState(1),[La,Na]=t.useState(20),[Ea,Aa]=t.useState(0),[Ja,Ma]=t.useState(""),[qa,Va]=t.useState(""),[Ha,Ga]=t.useState(""),[Xa,Ya]=t.useState(""),Qa=a.useRef();t.useEffect(()=>{const e=localStorage.getItem("user");if(!e)return T(q("请先登录")),void V("/login");try{JSON.parse(e)}catch(t){return T(q("用户信息错误")),void V("/login")}G?(as(),ss()):Za()},[V,q]);const Za=async()=>{_e(!0);try{const e=await $.get("/api/invite-channels/my");e.data.success?(ye(e.data.data.channels||[]),ge(e.data.data.summary||null)):T(e.data.message||q("加载失败"))}catch(e){T(q("加载渠道数据失败"))}finally{_e(!1)}},es=async(e,t,a,s,n,i)=>{fe(!0);try{const l={page:t,page_size:a,keyword:s||"",channel_key:e||""};n&&(l.start_date=n),i&&(l.end_date=i);const r=await $.get("/api/invite-channels/my/topups",{params:l});r.data.success?(we(r.data.data.records||[]),Te(r.data.data.total||0),Oe(r.data.data.amount_sum||0),De(r.data.data.money_sum||0),Ke(n||""),Re(i||"")):T(r.data.message)}catch(l){T(q("加载充值记录失败"))}finally{fe(!1)}},ts=t.useCallback(async e=>{if(e){he(!0);try{const t=await $.get("/api/user/search",{params:{keyword:e,page_size:20}});if(t.data.success){const e=t.data.data?.items||[];oe(e.map(e=>({value:e.id,label:`${e.username}${e.display_name?` (${e.display_name})`:""} #${e.id}`})))}}catch(t){}finally{he(!1)}}else oe([])},[]),as=async()=>{Z(!0);try{const e=await $.get("/api/invite-channels/",{params:{page:1,page_size:100}});e.data.success?Y(e.data.data.channels||[]):T(e.data.message||q("加载失败"))}catch(e){T(q("加载渠道列表失败"))}finally{Z(!1)}},ss=async(e,t)=>{try{const e={},t=await $.get("/api/invite-channels/stats",{params:e});t.data.success&&te(t.data.data)}catch(a){console.error("加载统计数据失败:",a)}},ns=async(e,t,a,s,n="",i="")=>{it(!0);try{const l={page:t,page_size:a,keyword:s,channel_key:Array.isArray(e)?e.join(","):e||""};
1n&&(l.start_date=n),i&&(l.end_date=i);const r=await $.get("/api/invite-channels/topups",{params:l});r.data.success?(st(r.data.data.records),ht(r.data.data.total),ut(r.data.data.amount_sum||0),yt(r.data.data.money_sum||0),gt(n||""),_t(i||"")):T(r.data.message)}catch(l){T(q("加载充值记录失败"))}finally{it(!1)}},is=async(e,t,a,s,n="",i="")=>{Tt(!0);try{const l={page:t,page_size:a,keyword:s,channel_key:Array.isArray(e)?e.join(","):e||""};n&&(l.start_date=n),i&&(l.end_date=i);const r=await $.get("/api/invite-channels/users",{params:l});r.data.success?(bt(r.data.data.records),Kt(r.data.data.total),At(r.data.data.topup_sum||0)):T(r.data.message)}catch(l){T(q("加载注册用户失败"))}finally{Tt(!1)}},ls=async(e,t,a,s="",n="",i="desc")=>{Gt(!0);try{const l={page:t,page_size:a,channel_key:Array.isArray(e)?e.join(","):e||"",order:i};s&&(l.start_date=s),n&&(l.end_date=n);const r=await $.get("/api/invite-channels/reg-date-stats",{params:l});r.data.success?(Mt(r.data.data.records||[]),ta(r.data.data.total||0),Vt(r.data.data.summary||null)):T(r.data.message)}catch(l){T(q("加载注册日期统计失败"))}finally{Gt(!1)}},rs=async(e,t,a,s,n,i,l)=>{Ra(!0);try{const r={page:t,page_size:a};e&&e.length>0&&(r.channel_key=e.join?e.join(","):e),s&&(r.start_date=s),n&&(r.end_date=n),i&&(r.longtail=i),l&&(r.plan_id=l);const d=await $.get("/api/invite-channels/baidu-clicks",{params:r});d.data.success?(Ka(d.data.data.records||[]),Aa(d.data.data.total||0)):T(d.data.message)}catch(r){T(q("加载百度点击记录失败"))}finally{Ra(!1)}},ds=async(e,t,a,s,n,i)=>{ua(!0);try{const l={page:e,page_size:t};a>0&&(l.new_type=a),""!==s&&(l.success=s),n&&(l.start_date=n),i&&(l.end_date=i);const r=await $.get("/api/invite-channels/ocpc-logs",{params:l});r.data.success?(ha(r.data.data.data||[]),_a(r.data.data.total||0),wa(r.data.data.summary||null)):T(r.data.message)}catch(l){T(q("加载上报日志失败"))}finally{ua(!1)}};t.useEffect(()=>{"stats"===le&&("topups"===et?ns(Qe,lt,dt,St,vt,kt):"users"===et?is(Qe,$t,Pt,Wt,Ft,Lt):"reg-date"===et?ls(Qe,Xt,Qt,aa,na,la):"ocpc-logs"===et?ds(xa,ma,va,ka,Ia,za):"baidu-clicks"===et&&rs(Qe,Fa,La,Ja,qa,Ha,Xa))},[le,Qe,lt,dt,et,$t,Pt,Xt,Qt,la,xa,ma,Fa,La]);const os=[{title:q("渠道名称"),dataIndex:"channel_name",key:"channel_name"},{title:q("渠道标识"),dataIndex:"channel_key",key:"channel_key",render:e=>s.jsx(n,{children:e})},{title:q("负责人"),key:"owner",render:(e,t)=>s.jsxs(i,{vertical:!0,align:"start",children:[s.jsxs(M,{type:"tertiary",children:["ID: ",t.user_id]}),s.jsx(M,{children:t.username||"-"})]})},{title:q("状态"),dataIndex:"status",key:"status",render:(e,t)=>s.jsx(r,{checked:1===e,onChange:e=>(async(e,t)=>{const a=t?1:2;Y(t=>t.map(t=>t.id===e?{...t,status:a}:t));try{const s=await $.post(`/api/invite-channels/${e}/status`,{status:a});s.data.success?P(q("状态更新成功")):(Y(a=>a.map(a=>a.id===e?{...a,status:t?2:1}:a)),T(s.data.message||q("更新失败")))}catch(s){Y(a=>a.map(a=>a.id===e?{...a,status:t?2:1}:a)),T(q("更新失败"))}})(t.id,e)})},{title:q("统计数据"),key:"stats",render:(e,t)=>{const a=t.stats||{};return s.jsxs(i,{vertical:!0,align:"start",children:[s.jsxs(M,{type:"tertiary",children:[q("注册"),": ",a.total_registers||0]}),s.jsxs(M,{type:"tertiary",children:[q("充值人数"),": ",a.total_topups||0]}),s.jsxs(M,{type:"tertiary",children:[q("充值金额"),": ",Xe(a.total_amount||0)]})]})}},{title:q("创建时间"),dataIndex:"created_at",key:"created_at",render:e=>new Date(1e3*e).toLocaleString()},{title:q("操作"),key:"action",render:(e,t)=>s.jsxs(i,{children:[s.jsx(d,{icon:s.jsx(D,{size:16}),size:"small",onClick:()=>{Ze([t.channel_key]),rt(1),wt(""),re("stats")},children:q("详情")}),s.jsx(d,{icon:s.jsx(B,{size:16}),size:"small",onClick:()=>(e=>{const t=`${window.location.origin}/register?channel=${e.channel_key}`;O(t)?P(q("渠道链接已复制到剪贴板")):T(q("复制失败"))})(t),children:q("复制链接")}),s.jsx(d,{icon:s.jsx(K,{size:16}),size:"small",onClick:()=>{ie(t),ue(""),oe([]),se(!0)},children:q("编辑")}),s.jsx(o,{title:q("确定删除此渠道吗?"),onConfirm:()=>(async e=>{try{const t=await $.delete(`/api/invite-channels/${e}`);t.data.success?(P(q("删除成功")),as()):T(t.data.message||q("删除失败"))}catch(t){T(q("删除失败"))}})(t.id),children:s.jsx(d,{icon:s.jsx(W,{size:16}),size:14,type:"danger",children:q("删除")})})]})}],cs=({title:e,value:t,subValue:a})=>s.jsxs(c,{bodyStyle:{padding:"20px"}
1,children:[s.jsx(M,{type:"tertiary",style:{fontSize:14},children:e}),s.jsx(J,{heading:3,style:{margin:"8px 0"},children:t}),a&&s.jsx(M,{type:"tertiary",children:a})]});return G?s.jsxs("div",{className:"px-2",children:[s.jsxs(c,{style:{marginBottom:16},children:[s.jsx(J,{heading:3,children:q("推广渠道管理")}),s.jsxs(M,{type:"tertiary",children:[q("管理多渠道邀请链接,追踪推广效果"),k()&&s.jsxs("span",{children:[" ","- ",s.jsx(M,{type:"warning",children:q("主站")})]}),b()&&s.jsxs("span",{children:[" ","- ",s.jsx(M,{type:"success",children:q("代理站")})]})]})]}),ee&&s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:16,marginBottom:16},children:[s.jsx(cs,{title:q("总注册数"),value:ee.summary?.total_registers||0}),s.jsx(cs,{title:q("总充值人数"),value:ee.summary?.total_topups||0}),s.jsx(cs,{title:q("充值总额"),value:Xe(ee.summary?.total_amount||0)})]}),s.jsx(c,{children:s.jsxs(h,{type:"line",activeKey:le,onChange:e=>re(e),children:[s.jsxs(p,{tab:q("渠道管理"),itemKey:"channels",children:[s.jsxs("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between",marginTop:10},children:[s.jsx(d,{icon:s.jsx(U,{size:16}),theme:"solid",onClick:()=>{ie(null),ue(""),oe([]),se(!0)},children:q("创建渠道")}),s.jsx(d,{icon:s.jsx(R,{size:16}),onClick:()=>{as(),ss()},children:q("刷新")})]}),s.jsx(u,{columns:os,dataSource:X,loading:Q,pagination:!1,rowKey:"id",empty:s.jsx(x,{description:q("暂无数据")})})]}),s.jsxs(p,{tab:q("统计详情"),itemKey:"stats",children:[s.jsxs("div",{style:{marginBottom:12,marginTop:10,display:"flex",gap:8,alignItems:"flex-start",flexWrap:"wrap"},children:[s.jsx(m,{placeholder:q("输入关键字批量选中渠道"),style:{width:200},onEnterPress:e=>{const t=e.target.value.trim();if(!t)return;const a=X.filter(e=>e.channel_name.includes(t)||e.channel_key.includes(t)).map(e=>e.channel_key);if(a.length>0){const e=[...new Set([...Qe,...a])];Ze(e),rt(1),Ot(1),Yt(1)}},suffix:s.jsx(F,{size:16})}),s.jsx(y,{placeholder:q("选择渠道(不选则查全部)"),style:{minWidth:300,maxWidth:"100%"},value:Qe,onChange:e=>{Ze(e||[]),rt(1),Ot(1),Yt(1)},multiple:!0,filter:!0,showClear:!0,maxTagCount:3,children:X.map(e=>s.jsxs(y.Option,{value:e.channel_key,children:[e.channel_name," (",e.channel_key,")"]},e.id))})]}),s.jsxs(h,{type:"button",activeKey:et,onChange:e=>tt(e),size:"small",tabBarExtraContent:(()=>{const e=encodeURIComponent(Qe.join(",")),t={topups:{label:q("导出充值记录"),url:`/api/invite-channels/export/topups?channel_key=${e}&keyword=${encodeURIComponent(St)}&start_date=${vt}&end_date=${kt}`},users:{label:q("导出注册用户"),url:`/api/invite-channels/export/users?channel_key=${e}&keyword=${encodeURIComponent(Wt)}&start_date=${Ft}&end_date=${Lt}`},"reg-date":{label:q("导出日期统计"),url:`/api/invite-channels/export/reg-date-stats?channel_key=${e}&start_date=${aa}&end_date=${na}&order=${la}`},"ocpc-logs":{label:q("导出上报日志"),url:`/api/invite-channels/export/ocpc-logs?new_type=${va}&success=${ka}&start_date=${Ia}&end_date=${za}`},"baidu-clicks":{label:q("导出广告效果"),url:`/api/invite-channels/export/baidu-clicks?channel_key=${e}&start_date=${Ja}&end_date=${qa}&longtail=${encodeURIComponent(Ha)}&plan_id=${encodeURIComponent(Xa)}`}}[et];return t?s.jsx(d,{size:"small",theme:"light",type:"primary",icon:s.jsx(E,{size:16}),onClick:()=>(async(e,t)=>{try{const a=await $.get(e,{responseType:"blob"}),s=a.headers?.["content-disposition"]||"";let n=t;const i=s.match(/filename\*?=(?:UTF-8'')?([^;"\n]+)/i);if(i)try{n=decodeURIComponent(i[1].replace(/"/g,""))}catch{}const l=new Blob([a.data],{type:a.headers?.["content-type"]||"application/octet-stream"}),r=document.createElement("a");r.href=URL.createObjectURL(l),r.download=n,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href)}catch(a){T(q("导出失败,请稍后重试"))}})(t.url,t.label+".xlsx"),children:t.label}):null})(),children:[s.jsxs(p,{tab:q("充值记录"),itemKey:"topups",children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsx(m,{prefix:s.jsx(F,{size:16}),placeholder:q("搜索用户ID/用户名/渠道标识"),value:St,onChange:e=>wt(e),onEnterPress:()=>{rt(1),ns(Qe,1,dt,St,vt,kt)},style:{width:220}}),s.jsx(g,{type:"date",placeholder:q("开始日期"),value:vt,onChange:(e,t)=>
1ft(t),style:{width:150}}),s.jsx(g,{type:"date",placeholder:q("结束日期"),value:kt,onChange:(e,t)=>Ct(t),style:{width:150}}),s.jsx(d,{onClick:()=>{rt(1),ns(Qe,1,dt,St,vt,kt)},children:q("搜索")}),s.jsx(d,{onClick:()=>{wt(""),ft(""),Ct(""),rt(1),ns(Qe,1,dt,"","","")},children:q("重置")})]}),s.jsx(u,{columns:[{title:"ID",dataIndex:"id",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:q("总计")}):e},{title:q("用户"),render:(e,t)=>t.__isSummary?null:s.jsxs("div",{children:[s.jsx("div",{children:t.username}),s.jsx("div",{style:{fontSize:12,color:"gray"},children:t.display_name})]})},{title:q("渠道"),dataIndex:"invite_channel",render:(e,t)=>t.__isSummary?null:s.jsx(n,{children:e})},{title:q("金额"),dataIndex:"amount",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:Xe(e)}):Xe(e)},{title:q("实付金额"),dataIndex:"money",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:`¥${Number(e).toFixed(2)}`}):`¥${e}`},{title:q("时间"),dataIndex:"create_time",render:(e,t)=>t.__isSummary?null:new Date(1e3*e).toLocaleString()},{title:q("状态"),dataIndex:"status",render:(e,t)=>t.__isSummary?null:e}],dataSource:Ye(at,mt,jt,pt,xt),loading:nt,pagination:{currentPage:lt,pageSize:dt,total:ct,onPageChange:e=>rt(e),onPageSizeChange:e=>{ot(e),rt(1)}},rowKey:"id"})]}),s.jsxs(p,{tab:q("注册用户"),itemKey:"users",children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsx(m,{prefix:s.jsx(F,{size:16}),placeholder:q("搜索用户ID/用户名/渠道标识"),value:Wt,onChange:e=>Rt(e),onEnterPress:()=>{Ot(1),is(Qe,1,Pt,Wt,Ft,Lt)},style:{width:220}}),s.jsx(g,{type:"date",placeholder:q("注册开始日期"),value:Ft,onChange:(e,t)=>
1Ut(t),style:{width:150}}),s.jsx(g,{type:"date",placeholder:q("注册结束日期"),value:Lt,onChange:(e,t)=>Nt(t),style:{width:150}}),s.jsx(d,{onClick:()=>{Ot(1),is(Qe,1,Pt,Wt,Ft,Lt)},children:q("搜索")}),s.jsx(d,{onClick:()=>{Rt(""),Ut(""),Nt(""),Ot(1),is(Qe,1,Pt,"","","")},children:q("重置")})]}),s.jsx(u,{columns:[{title:"ID",dataIndex:"id"},{title:q("用户"),render:(e,t)=>s.jsxs("div",{children:[s.jsx("div",{children:t.username}),s.jsx("div",{style:{fontSize:12,color:"gray"},children:t.display_name})]})},{title:q("渠道"),dataIndex:"invite_channel",render:e=>e?s.jsx(n,{style:{cursor:"pointer"},onClick:()=>(e=>{e&&(O(e)?P(q("已复制")):T(q("复制失败")))})(e),children:e}):"-"},{title:q("注册时间"),dataIndex:"created_at",render:e=>new Date(1e3*e).toLocaleString()},{title:q("累计充值"),dataIndex:"total_topup_amount",render:(e,t)=>s.jsx(d,{theme:"borderless",type:"primary",size:"small",style:{padding:"0 4px"},onClick:()=>{tt("topups"),wt(String(t.id)),ft(""),Ct(""),rt(1),ns(Qe,1,dt,String(t.id),"","")},children:Xe(e||0)})},{title:q("状态"),dataIndex:"status",render:e=>s.jsx(n,{color:1===e?"green":"red",children:q(1===e?"正常":"禁用")})}],dataSource:It,loading:zt,pagination:{currentPage:$t,pageSize:Pt,total:Bt,onPageChange:e=>Ot(e),onPageSizeChange:e=>{Dt(e),Ot(1)}},rowKey:"id"}),It.length>0&&s.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"12px 16px",borderTop:"1px solid hsl(var(--border))",background:"hsl(var(--foreground) / 0.02)",borderRadius:"0 0 6px 6px"},children:s.jsxs(M,{strong:!0,children:[q("累计充值合计"),":",Xe(Et),s.jsxs(M,{type:"tertiary",style:{marginLeft:8,fontWeight:"normal"},children:["(",Bt," ",q("人"),")"]})]})})]}),s.jsxs(p,{tab:q("注册日期统计"),itemKey:"reg-date",children:[s.jsx(j,{type:"info",description:q("按用户注册日期分组统计,该日期注册用户后续的所有充值都归到注册日,方便计算投入产出"),style:{marginTop:10,marginBottom:12}}),s.jsxs("div",{style:{marginBottom:12,display:"flex",gap:8,flexWrap:"wrap"},children:[s.jsx(g,{type:"date",placeholder:q("注册开始日期"),value:aa,onChange:(e,t)=>
1sa(t),style:{width:150}}),s.jsx(g,{type:"date",placeholder:q("注册结束日期"),value:na,onChange:(e,t)=>ia(t),style:{width:150}}),s.jsx(d,{onClick:()=>{Yt(1),ls(Qe,1,Qt,aa,na,la)},children:q("搜索")}),s.jsx(d,{onClick:()=>{sa(""),ia(""),Yt(1),ra("desc"),ls(Qe,1,Qt,"","","desc")},children:q("重置")}),s.jsxs(y,{placeholder:q("显示周期充值列"),style:{minWidth:180},value:da,onChange:e=>oa(e||[]),multiple:!0,showClear:!0,maxTagCount:2,size:"default",children:[s.jsx(y.Option,{value:"3d",children:q("3天充值")}),s.jsx(y.Option,{value:"7d",children:q("7天充值")}),s.jsx(y.Option,{value:"1m",children:q("1个月充值")}),s.jsx(y.Option,{value:"3m",children:q("3个月充值")}),s.jsx(y.Option,{value:"6m",children:q("6个月充值")}),s.jsx(y.Option,{value:"1y",children:q("1年充值")})]})]}),s.jsx(u,{columns:[{title:s.jsxs("span",{style:{cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",gap:4},onClick:()=>{ra("desc"===la?"asc":"desc"),Yt(1)},children:[q("注册日期"),"desc"===la?s.jsx(L,{size:14}):s.jsx(N,{size:14})]}),dataIndex:"reg_date",render:(e,t)=>t._isSummary?s.jsx("strong",{children:e}):e?e.substring(0,10):e},{title:q("注册人数"),dataIndex:"register_count"},{title:q("充值人数"),dataIndex:"topup_user_count"},{title:q("转化率"),dataIndex:"conversion_rate"},{title:q("充值笔数"),dataIndex:"topup_count"},{title:q("充值总额"),dataIndex:"topup_amount",render:e=>Xe(e||0)},{title:q("实付总额"),dataIndex:"topup_money",render:e=>`¥${(e||0).toFixed(2)}`},{title:q("人均充值"),dataIndex:"avg_topup_money",render:e=>`¥${(e||0).toFixed(2)}`},...[{key:"3d",title:"3天充值",dataIndex:"topup_money_3d"},{key:"7d",title:"7天充值",dataIndex:"topup_money_7d"},{key:"1m",title:"1个月充值",dataIndex:"topup_money_1m"},{key:"3m",title:"3个月充值",dataIndex:"topup_money_3m"},{key:"6m",title:"6个月充值",dataIndex:"topup_money_6m"},{key:"1y",title:"1年充值",dataIndex:"topup_money_1y"}].filter(e=>da.includes(e.key)).map(e=>({title:q(e.title),dataIndex:e.dataIndex,render:e=>`¥${(e||0).toFixed(2)}`}))],dataSource:qt?[{...qt,reg_date:q("总计"),_isSummary:!0},...Jt]:Jt,loading:Ht,pagination:{currentPage:Xt,pageSize:Qt,total:ea,showSizeChanger:!0,pageSizeOpts:[10,20,50,100],onPageChange:e=>Yt(e),onPageSizeChange:e=>{Zt(e),Yt(1)}},rowKey:"reg_date"})]}),s.jsxs(p,{tab:q("上报日志"),itemKey:"ocpc-logs",children:[Sa&&s.jsxs("div",{style:{display:"flex",gap:16,marginBottom:16,marginTop:10,flexWrap:"wrap"},children:[s.jsxs(c,{style:{flex:1,minWidth:160},bodyStyle:{padding:"12px 16px"},children:[s.jsx(M,{type:"tertiary",size:14,children:q("今日注册上报")}),s.jsx(J,{heading:3,style:{margin:"4px 0 0"},children:Sa.today_registration||0})]}),s.jsxs(c,{style:{flex:1,minWidth:160},bodyStyle:{padding:"12px 16px"},children:[s.jsx(M,{type:"tertiary",size:14,children:q("今日付费上报")}),s.jsx(J,{heading:3,style:{margin:"4px 0 0"},children:Sa.today_purchase||0})]}),s.jsxs(c,{style:{flex:1,minWidth:160},bodyStyle:{padding:"12px 16px"},children:[s.jsx(M,{type:"tertiary",size:14,children:q("今日成功率")}),s.jsxs(J,{heading:3,style:{margin:"4px 0 0"},children:[Sa.today_success_rate||0,"%"]})]})]}),s.jsxs("div",{style:{marginBottom:12,display:"flex",gap:8,flexWrap:"wrap"},children:[s.jsxs(y,{placeholder:q("转化类型"),value:va,onChange:e=>{fa(e),ya(1)},style:{width:130},children:[s.jsx(y.Option,{value:0,children:q("全部")}),s.jsx(y.Option,{value:25,children:q("注册")}),s.jsx(y.Option,{value:26,children:q("付费")})]}),s.jsxs(y,{placeholder:q("状态"),value:ka,onChange:e=>{Ca(e),ya(1)},style:{width:120},children:[s.jsx(y.Option,{value:"",children:q("全部")}),s.jsx(y.Option,{value:"true",children:q("成功")}),s.jsx(y.Option,{value:"false",children:q("失败")})]}),s.jsx(g,{type:"date",placeholder:q("开始日期"),value:Ia,onChange:(e,t)=>
1ba(t),style:{width:150}}),s.jsx(g,{type:"date",placeholder:q("结束日期"),value:za,onChange:(e,t)=>Ta(t),style:{width:150}}),s.jsx(d,{onClick:()=>{ya(1),ds(1,ma,va,ka,Ia,za)},children:q("搜索")}),s.jsx(d,{onClick:()=>{fa(0),Ca(""),ba(""),Ta(""),ya(1),ds(1,ma,0,"","","")},children:q("重置")})]}),s.jsx(u,{columns:[{title:q("时间"),dataIndex:"created_at",width:170,render:e=>e?new Date(1e3*e).toLocaleString("zh-CN"):"-"},{title:q("类型"),dataIndex:"new_type",width:80,render:e=>25===e?s.jsx(n,{color:"blue",children:q("注册")}):s.jsx(n,{color:"green",children:q("付费")})},{title:"LogidUrl",dataIndex:"logid_url",width:250,ellipsis:!0,render:e=>s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e||"-"})},{title:q("转化金额(分)"),dataIndex:"convert_value",width:90,render:e=>null!=e?e:"-"},{title:"HTTP",dataIndex:"http_status",width:70},{title:q("状态"),dataIndex:"success",width:80,render:e=>e?s.jsx(n,{color:"green",children:q("成功")}):s.jsx(n,{color:"red",children:q("失败")})},{title:q("来源"),dataIndex:"source",width:120,ellipsis:!0},{title:"IP",dataIndex:"ip_address",width:130},{title:q("操作"),width:80,render:(e,t)=>s.jsx(d,{theme:"light",type:"primary",size:"small",onClick:()=>{Da(t),Oa(!0)},children:q("详情")})}],dataSource:ca,loading:pa,pagination:{currentPage:xa,pageSize:ma,total:ja,showSizeChanger:!0,pageSizeOpts:[10,20,50,100],onPageChange:e=>ya(e),onPageSizeChange:e=>{ga(e),ya(1)}},rowKey:"id",empty:s.jsx(x,{description:q("暂无上报日志")})}),s.jsx(_,{title:q("上报详情"),visible:$a,onCancel:()=>Oa(!1),footer:null,width:700,children:Pa&&s.jsxs("div",{children:[s.jsx(J,{heading:6,children:q("请求体")}),s.jsx("pre",{style:{background:"hsl(var(--foreground) / 0.02)",padding:12,borderRadius:6,maxHeight:250,overflow:"auto",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:(()=>{try{return JSON.stringify(JSON.parse(Pa.request_body),null,2)}catch{return Pa.request_body}})()}),s.jsx(J,{heading:6,style:{marginTop:12},children:q("响应体")}),s.jsx("pre",{style:{background:"hsl(var(--foreground) / 0.02)",padding:12,borderRadius:6,maxHeight:250,overflow:"auto",fontSize:12,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:(()=>{try{return JSON.stringify(JSON.parse(Pa.response_body),null,2)}catch{return Pa.response_body}})()}),Pa.error_message&&s.jsxs(s.Fragment,{children:[s.jsx(J,{heading:6,style:{marginTop:12},children:q("错误信息")}),s.jsx(M,{type:"danger",children:Pa.error_message})]})]})})]}),s.jsxs(p,{tab:q("广告效果"),itemKey:"baidu-clicks",children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsx(m,{placeholder:q("搜索长尾词"),value:Ha,onChange:e=>Ga(e),style:{width:160},prefix:s.jsx(F,{size:16})}),s.jsx(m,{placeholder:q("计划ID"),value:Xa,onChange:e=>Ya(e),style:{width:130}}),s.jsx(g,{type:"date",placeholder:q("注册开始日期"),value:Ja,onChange:(e,t)=>
1Ma(t),style:{width:150}}),s.jsx(g,{type:"date",placeholder:q("注册结束日期"),value:qa,onChange:(e,t)=>Va(t),style:{width:150}}),s.jsx(d,{onClick:()=>{Ua(1),rs(Qe,1,La,Ja,qa,Ha,Xa)},children:q("搜索")}),s.jsx(d,{onClick:()=>{Ga(""),Ya(""),Ma(""),Va(""),Ua(1),rs(Qe,1,La,"","","","")},children:q("重置")})]}),s.jsx(u,{columns:[{title:"bd_vid",dataIndex:"bid",width:150,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:130,fontFamily:"monospace",fontSize:12,cursor:"pointer"},onClick:()=>{navigator.clipboard?.writeText(e),P(q("已复制"))},children:e}):"-"},{title:q("用户 ID"),dataIndex:"user_id",width:80,render:e=>e?s.jsx(n,{children:e}):"-"},{title:q("长尾词"),dataIndex:"longtail",width:180,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:160,display:"inline-block"},children:e}):"-"},{title:q("匹配方式"),dataIndex:"match_type",width:90,render:e=>{const t={e:{label:q("精确"),color:"blue"},p:{label:q("短语"),color:"cyan"},b:{label:q("广泛"),color:"grey"}}[e];return t?s.jsx(n,{color:t.color,children:t.label}):e||"-"}},{title:q("设备"),dataIndex:"equipment_type",width:75,render:e=>e?s.jsx(n,{color:"pc"===e?"indigo":"orange",children:e}):"-"},{title:q("城市"),dataIndex:"city",width:90,render:e=>e||"-"},{title:q("计划ID"),dataIndex:"plan_id",width:100,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e}):"-"},{title:q("单元ID"),dataIndex:"unit_id",width:100,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e}):"-"},{title:q("创意ID"),dataIndex:"creative",width:100,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e}):"-"},{title:q("关键词ID"),dataIndex:"keyword_id",width:100,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e}):"-"},{title:q("账户ID"),dataIndex:"baidu_userid",width:100,ellipsis:!0,render:e=>e?s.jsx(l.Text,{ellipsis:{showTooltip:!0},style:{width:"100%",display:"inline-block"},children:e}):"-"},{title:q("人群ID"),dataIndex:"crowd_id",width:90,render:e=>e||"-"},{title:q("渠道"),dataIndex:"channel_key",width:100,render:e=>e?s.jsx(n,{color:"light-blue",children:e}):"-"},{title:q("注册时间"),dataIndex:"registered_at",width:165,render:e=>e?new Date(1e3*e).toLocaleString("zh-CN"):"-"},{title:q("充值次数"),dataIndex:"topup_count",width:90,render:e=>e>0?s.jsx(n,{color:"green",children:e}):s.jsx(n,{color:"grey",children:"0"})},{title:q("实付总额"),dataIndex:"topup_money",width:105,render:e=>s.jsxs(M,{style:{color:e>0?"hsl(var(--success))":void 0},children:["¥",(e||0).toFixed(2)]})}],dataSource:Ba,loading:Wa,pagination:{currentPage:Fa,pageSize:La,total:Ea,showSizeChanger:!0,pageSizeOpts:[20,50,100],onPageChange:e=>Ua(e),onPageSizeChange:e=>{Na(e),Ua(1)}},rowKey:"id",scroll:{x:1500},empty:s.jsx(x,{description:q("暂无广告点击记录")})})]})]})]})]})}),s.jsx(S,{title:q(ne?"编辑渠道":"创建渠道"),visible:ae,onCancel:()=>{se(!1),ie(null)},width:480,children:s.jsxs(w,{getFormApi:e=>Qa.current=e,onSubmit:async e=>{try{const t=ne?`/api/invite-channels/${ne.id}`:"/api/invite-channels/",a=ne?"put":"post",s={...e,status:"boolean"==typeof e.status?e.status?1:2:e.status||1},n=await $[a](t,s);n.data.success?(P(q(ne?"更新成功":"创建成功")),se(!1),ie(null),as(),Qa.current&&Qa.current.reset()):T(n.data.message||q("操作失败"))}catch(t){T(q("操作失败"))}},initValues:ne?{...ne,status:ne.status||1,assigned_user_id:ne.user_id||void 0}:{status:1},children:[s.jsx(w.Input,{field:"channel_name",label:q("渠道名称"),placeholder:q("例如:微信朋友圈"),rules:[{required:!0,message:q("请输入渠道名称")}]}),s.jsx(w.TextArea,{field:"description",label:q("描述"),placeholder:q("可选,描述此渠道的用途")}),s.jsx(w.Switch,{field:"status",label:q("启用状态"),checkedValue:1,uncheckedValue:2}),(k()||C()||I())&&s.jsxs("div",{style:{marginBottom:20},children:[s.jsx("div",{style:{marginBottom:8,fontSize:14,fontWeight:600,color:"hsl(var(--foreground))"},children:q("负责人")}),s.jsxs(i,{style:{width:"100%",marginBottom:8}
1,align:"center",children:[s.jsx(m,{value:pe,onChange:ue,placeholder:q("输入用户ID"),prefix:s.jsx(A,{size:16}),style:{flex:1,minWidth:0},onEnterPress:()=>ts(pe)}),s.jsx(d,{loading:ce,onClick:()=>ts(pe),icon:s.jsx(F,{size:16}),children:q("搜索")})]}),s.jsx(w.Select,{field:"assigned_user_id",optionList:de,style:{width:"100%"},showClear:!0,placeholder:de.length>0?q("请从结果中选择用户"):q("请先输入ID后点击搜索")})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},children:[s.jsx(d,{onClick:()=>se(!1),children:q("取消")}),s.jsx(d,{theme:"solid",htmlType:"submit",children:q(ne?"更新":"创建")})]})]})})]}):s.jsxs("div",{className:"px-2",children:[s.jsxs(c,{style:{marginBottom:16},children:[s.jsx(J,{heading:3,children:q("我的推广数据")}),s.jsx(M,{type:"tertiary",children:q("查看您负责推广渠道的数据统计")})]}),me&&s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:16,marginBottom:16},children:[s.jsx(cs,{title:q("总注册数"),value:me.total_registers||0}),s.jsx(cs,{title:q("总充值人数"),value:me.total_topups||0}),s.jsx(cs,{title:q("充值总额"),value:Xe(me.total_amount||0)})]}),s.jsx(c,{children:s.jsxs(h,{type:"line",children:[s.jsxs(p,{tab:q("渠道概览"),itemKey:"my-channels",children:[s.jsx("div",{style:{marginBottom:12,marginTop:10,display:"flex",justifyContent:"flex-end"},children:s.jsx(d,{icon:s.jsx(R,{size:16}),onClick:Za,children:q("刷新")})}),s.jsx(u,{loading:je,dataSource:xe,rowKey:"id",pagination:!1,empty:s.jsx(x,{description:q("暂无分配给您的推广渠道")}),columns:[{title:q("渠道名称"),dataIndex:"channel_name"},{title:q("渠道标识"),dataIndex:"channel_key",render:e=>s.jsx(n,{children:e})},{title:q("统计数据"),key:"stats",render:(e,t)=>{const a=t.stats||{};return s.jsxs(i,{vertical:!0,align:"start",children:[s.jsxs(M,{type:"tertiary",children:[q("注册"),": ",a.total_registers||0]}),s.jsxs(M,{type:"tertiary",children:[q("充值人数"),": ",a.total_topups||0]}),s.jsxs(M,{type:"tertiary",children:[q("充值金额"),": ",Xe(a.total_amount||0)]})]})}},{title:q("推广链接"),key:"link",render:(e,t)=>s.jsx(d,{icon:s.jsx(B,{size:16}),size:"small",onClick:()=>{const e=`${window.location.origin}/register?channel=${t.channel_key}`;O(e)?P(q("渠道链接已复制到剪贴板")):T(q("复制失败"))},children:q("复制链接")})},{title:q("操作"),key:"action",render:(e,t)=>s.jsx(d,{icon:s.jsx(D,{size:16}),size:"small",onClick:()=>{Ue(t.channel_key),Ce(1),es(t.channel_key,1,Ie,"","","")},children:q("充值明细")})}]})]}),s.jsxs(p,{tab:q("充值明细"),itemKey:"my-topups",children:[s.jsxs("div",{style:{marginBottom:16,display:"flex",gap:8,flexWrap:"wrap",marginTop:10},children:[s.jsx(y,{placeholder:q("选择渠道"),style:{width:200},value:Fe,onChange:e=>{Ue(e||""),Ce(1)},showClear:!0,children:xe.map(e=>s.jsxs(y.Option,{value:e.channel_key,children:[e.channel_name," (",e.channel_key,")"]},e.id))}),s.jsx(m,{prefix:s.jsx(F,{size:16}),placeholder:q("搜索用户ID/用户名/渠道标识"),value:Je,onChange:e=>Me(e),onEnterPress:()=>{Ce(1),es(Fe,1,Ie,Je,Le,Ee)},style:{width:200}}),s.jsx(g,{type:"date",placeholder:q("开始日期"),value:Le,onChange:(e,t)=>
1Ne(t),style:{width:140}}),s.jsx(g,{type:"date",placeholder:q("结束日期"),value:Ee,onChange:(e,t)=>Ae(t),style:{width:140}}),s.jsx(d,{onClick:()=>{Ce(1),es(Fe,1,Ie,Je,Le,Ee)},children:q("搜索")}),s.jsx(d,{onClick:()=>{Ue(""),Me(""),Ne(""),Ae(""),Ce(1),es("",1,Ie,"","","")},children:q("重置")})]}),s.jsx(u,{loading:ve,dataSource:Ye(Se,Be,We,$e,Pe),rowKey:"id",pagination:{currentPage:ke,pageSize:Ie,total:ze,onPageChange:e=>{Ce(e),es(Fe,e,Ie,Je,Le,Ee)},onPageSizeChange:e=>{be(e),Ce(1),es(Fe,1,e,Je,Le,Ee)}},columns:[{title:"ID",dataIndex:"id",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:q("总计")}):e},{title:q("用户"),render:(e,t)=>t.__isSummary?null:s.jsxs("div",{children:[s.jsx("div",{children:t.username}),s.jsx("div",{style:{fontSize:12,color:"gray"},children:t.display_name})]})},{title:q("渠道"),dataIndex:"invite_channel",render:(e,t)=>t.__isSummary?null:s.jsx(n,{children:e})},{title:q("金额"),dataIndex:"amount",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:Xe(e)}):Xe(e)},{title:q("实付金额"),dataIndex:"money",render:(e,t)=>t.__isSummary?s.jsx("strong",{children:`¥${Number(e).toFixed(2)}`}):`¥${e}`},{title:q("时间"),dataIndex:"create_time",render:(e,t)=>t.__isSummary?null:new Date(1e3*e).toLocaleString()},{title:q("状态"),dataIndex:"status",render:(e,t)=>t.__isSummary?null:e}],empty:s.jsx(x,{description:q("暂无充值记录")})})]})]})})]})};export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.