PageSourceSearch

https://xyc.ai/static/js/async/1542.0c8e936409.js

js xyc.ai collected 2026-10-05 14:38:04 UTC 5,752 bytes, 1 lines download raw bytes

1"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[1542],{51653(e,a,s){s.r(a),s.d(a,{component:()=>C});var n=s(72361),i=s(68413),r=s(96962),t=s(53540),l=s(55667),d=s(6702),c=s(20598),x=s(63742),o=s(46775),u=s(1755),h=s(54023),j=s(61309),m=s(18434),p=s(32999),g=s(34151),f=s(67267),v=s(64577);async function N(e,a){let s=new URLSearchParams({p:String(e),page_size:"20"});a&&s.set("status",a);let n=await v.FH.get(`/api/referral/admin/withdrawals?${s.toString()}`);if(!n.data?.success)throw Error(n.data?.message??"load failed");return n.data.data}async function w(e,a,s){let n=await v.FH.post("/api/referral/admin/withdrawals/handle",{id:e,action:a,admin_remark:s});if(!n.data?.success)throw Error(n.data?.message??"handle failed")}let y={pending:{label:"Pending payment",variant:"secondary"},paid:{label:"Paid",variant:"default"},done:{label:"Credited to balance",variant:"outline"},rejected:{label:"Rejected",variant:"destructive"}};function A(e){return new Date(1e3*e).toLocaleString("zh-CN",{hour12:!1})}function b(e){return`\xa5${(e/100).toFixed(2)}`}let C=function(){let{t:e}=(0,d.Bd)(),a=(0,r.jE)(),[s,v]=(0,i.useState)("pending"),[C,_]=(0,i.useState)(1),[k,S]=(0,i.useState)(null),[R,P]=(0,i.useState)(""),{data:$,isLoading:E}=(0,t.I)({queryKey:["referral-admin",s,C],queryFn:()=>N(C,s)}),F=(0,l.n)({mutationFn:e=>{let{id:a,action:s}=e;return w(a,s,R)},onSuccess:()=>{c.oR.success(e("Processed")),S(null),P(""),a.invalidateQueries({queryKey:["referral-admin"]})},onError:e=>c.oR.error(e.message)}),z=$?.items??[],H=Math.max(1,Math.ceil(($?.total??0)/20));return(0,n.jsxs)(f.Ni,{children:[(0,n.jsx)(f.Ni.Title,{children:e("Referral Withdrawals")}),(0,n.jsx)(f.Ni.Description,{children:e("Confirm Alipay payouts or reject referral withdrawal requests")}),(0,n.jsxs)(f.Ni.Content,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)(g.tU,{value:s,onValueChange:e=>{v(e),_(1)},children:(0,n.jsxs)(g.j7,{children:[(0,n.jsx)(g.Xi,{value:"pending",children:e("Pending payment")}),(0,n.jsx)(g.Xi,{value:"paid",children:e("Paid")}),(0,n.jsx)(g.Xi,{value:"rejected",children:e("Rejected")}),(0,n.jsx)(g.Xi,{value:"",children:e("All")})]})}),E?(0,n.jsx)(m.E,{className:"h-48 w-full"}):(0,n.jsxs)(p.XI,{children:[(0,n.jsx)(p.A0,{children:(0,n.jsxs)(p.Hj,{children:[(0,n.jsx)(p.nd,{children:"ID"}),(0,n.jsx)(p.nd,{children:e("User")}),(0,n.jsx)(p.nd,{children:e("Amount")}),(0,n.jsx)(p.nd,{children:e("Method")}),(0,n.jsx)(p.nd,{children:e("Alipay account")}
1),(0,n.jsx)(p.nd,{children:e("Applied At")}),(0,n.jsx)(p.nd,{children:e("Status")}),(0,n.jsx)(p.nd,{})]})}),(0,n.jsxs)(p.BF,{children:[z.map(a=>{let s=y[a.status]??{label:a.status,variant:"secondary"};return(0,n.jsxs)(p.Hj,{children:[(0,n.jsx)(p.nA,{children:a.id}),(0,n.jsx)(p.nA,{children:a.username??a.user_id}),(0,n.jsx)(p.nA,{className:"font-medium",children:b(a.amount)}),(0,n.jsx)(p.nA,{children:"alipay"===a.method?e("Alipay transfer"):e("Exchange for account balance")}),(0,n.jsx)(p.nA,{className:"text-muted-foreground max-w-[180px] truncate text-xs",children:a.alipay_account?`${a.alipay_account} (${a.alipay_name})`:"—"}),(0,n.jsx)(p.nA,{className:"text-muted-foreground text-xs",children:A(a.created_at)}),(0,n.jsx)(p.nA,{children:(0,n.jsx)(x.E,{variant:s.variant,children:e(s.label)})}),(0,n.jsx)(p.nA,{children:(0,n.jsx)(o.$,{variant:"outline",size:"sm",onClick:()=>{S(a),P(a.admin_remark??"")},children:"pending"===a.status?e("Review"):e("View")})})]},a.id)}),0===z.length&&(0,n.jsx)(p.Hj,{children:(0,n.jsx)(p.nA,{colSpan:8,className:"text-muted-foreground py-10 text-center text-sm",children:e("No withdrawal records")})})]})]}),H>1&&(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,n.jsx)(o.$,{variant:"outline",size:"sm",disabled:C<=1,onClick:()=>_(e=>e-1),children:e("Previous")}),(0,n.jsxs)("span",{className:"text-muted-foreground text-xs",children:[C," / ",H]}),(0,n.jsx)(o.$,{variant:"outline",size:"sm",disabled:C>=H,onClick:()=>_(e=>e+1),children:e("Next")})]})]}),(0,n.jsx)(u.lG,{open:!!k,onOpenChange:e=>{e||S(null)},children:(0,n.jsxs)(u.Cf,{className:"max-w-lg",children:[(0,n.jsx)(u.c7,{children:(0,n.jsxs)(u.L3,{children:[e("Withdrawal")," #",k?.id]})}),k&&(0,n.jsxs)("div",{className:"flex flex-col gap-3 text-sm",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e("User"),": "]}),k.username??k.user_id," (#",k.user_id,")"]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e("Amount"),":"," "]}),(0,n.jsx)("strong",{children:b(k.amount)})]}),(0,n.jsxs)("div",{className:"col-span-2",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e("Alipay account"),":"," "]}),k.alipay_account||"—"]}),(0,n.jsxs)("div",{className:"col-span-2",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e("Recipient name"),":"," "]}),k.alipay_name||"—"]}),(0,n.jsxs)("div",{className:"col-span-2",children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[e("Applied At"),":"," "]}),A(k.created_at)]})]}),(0,n.jsxs)("div",{className:"grid gap-1.5",children:[(0,n.jsx)(j.J,{className:"text-xs",children:e("Admin Remark")}),(0,n.jsx)(h.p,{value:R,onChange:e=>P(e.target.value),placeholder:e("Optional, visible to user"),disabled:"pending"!==k.status})]})]}),k?.status==="pending"&&(0,n.jsxs)(u.Es,{children:[(0,n.jsx)(o.$,{variant:"destructive",disabled:F.isPending,onClick:()=>F.mutate({id:k.id,action:"rejected"}),children:e("Reject")}),(0,n.jsx)(o.$,{disabled:F.isPending,onClick:()=>F.mutate({id:k.id,action:"paid"}),children:e("Mark as paid")})]})]})})]})]})}}}]);

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.