Files
console-dev/app/pages/finance/index.vue
T
cieanyau 651c36367f
前端验证 / verify (push) Failing after 15m2s
接入 ESLint 与 Prettier 并加入 CI 静态门禁
2026-11-07 01:24:36 +08:00

1952 lines
84 KiB
Vue

<script>
/**
* 财务中心:账单、交易、余额、提现与冻结记录分开加载;钱包入口为本页别名,充值/提现能力由站点配置决定。
*/
import { definePageMeta } from "#imports";
import "~/assets/styles/orders.BflDlvVz.css";
import "~/assets/styles/WithdrawDialog.ks0wdKEK.css";
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
import "~/assets/styles/RechargeDialog.DpsMly4r.css";
import "~/assets/styles/finance.BkxKMno0.css";
definePageMeta({
alias: [`/wallet`],
});
import { toDisplayString } from "vue";
import { onMounted } from "vue";
import { onScopeDispose } from "vue";
import { watch } from "vue";
import { createBlock } from "vue";
import { ref } from "vue";
import { withCtx } from "vue";
import { createCommentVNode } from "vue";
import { computed } from "vue";
import { isRef } from "vue";
import { createElementBlock } from "vue";
import { createElementVNode } from "vue";
import { createTextVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { createVNode } from "vue";
import { openBlock } from "vue";
import { withKeys } from "vue";
import { useRoute } from "#app";
import { navigateTo } from "#app";
import { NuxtLink } from "#components";
import { sanitizeMessage } from "~/lib/auth.js";
import { useApi } from "~/lib/auth.js";
import { useAuth } from "~/lib/auth.js";
import { t as useSiteConfig_t } from "~/lib/useSiteConfig.js";
import button from "primevue/button";
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
import message from "primevue/message";
import inputtext from "primevue/inputtext";
import { r as dict_r } from "~/lib/dict.js";
import { s as dict_s } from "~/lib/dict.js";
import { t as dict_t } from "~/lib/dict.js";
import datatable from "primevue/datatable";
import iconfield from "primevue/iconfield";
import inputicon from "primevue/inputicon";
import select from "primevue/select";
import inputnumber from "primevue/inputnumber";
import column from "primevue/column";
import ListSegments from "~/components/ListSegments.vue";
import ListEmpty from "~/components/ListEmpty.vue";
import tag from "primevue/tag";
import toggleswitch from "primevue/toggleswitch";
import RechargeDialog from "~/components/RechargeDialog.vue";
import WithdrawDialog from "~/components/WithdrawDialog.vue";
import { t as useWithdrawAvailability_t } from "~/lib/useWithdrawAvailability.js";
import tabs from "primevue/tabs";
import tabpanels from "primevue/tabpanels";
import tabpanel from "primevue/tabpanel";
import tablist from "primevue/tablist";
import tab from "primevue/tab";
import { t as composables_t } from "~/lib/composables-2.js";
import { n as orders_n } from "~/pages/orders/index.vue";
import index from "~/pages/orders/index.vue";
var je = {
class: `page`,
},
Me = {
class: `wallet-card`,
},
Ne = {
class: `summary-value`,
},
Pe = {
key: 0,
class: `wallet-pending-refund`,
},
Fe = {
class: `pending-refund-value`,
},
Ie = {
class: `summary-actions`,
},
Le = {
class: `panel reminder-panel`,
"aria-labelledby": `credit-reminder-title`,
},
Re = {
class: `reminder-form`,
},
ze = {
class: `panel wallet-tabs`,
},
Be = {
class: `wallet-toolbar`,
},
Ve = {
class: `wallet-filters`,
},
He = {
key: 1,
},
Ue = {
class: `wallet-toolbar`,
},
We = {
class: `wallet-filters`,
},
Ge = {
class: `credit-summary`,
},
Ke = {
class: `wallet-toolbar`,
},
qe = {
class: `wallet-filters`,
},
Je = {
class: `amount`,
},
Ye = {
key: 0,
class: `reject`,
},
Xe = {
class: `amount`,
},
x = _plugin_vue_export_helper_t(
defineComponent({
__name: `index`,
setup(f) {
composables_t({
alias: [`/wallet`],
});
let _ = useApi(),
x = useRoute(),
S = useAuth(),
{ rechargeClosed: Qe, load: C } = useSiteConfig_t(),
{ enabled: $e, load: w } = useWithdrawAvailability_t(),
T = ref(20),
E = ref(!1),
D = ref(!1),
O = ref(!1),
k = ref(100),
A = ref(!1),
j = ref(``),
et = ref(!1),
M = ref(null),
N = ref(``);
// 账户总览变化时同步余额提醒设置,仅回填本地草稿。
function tt() {
let e = S.overview;
e &&
((O.value = Number(e.credit_remind) === 1),
(k.value = Number(e.credit_remind_amount ?? k.value)));
}
watch(() => S.overview, tt, {
immediate: !0,
});
// 开启余额提醒必须填写正的有限阈值;关闭时发送零阈值,成功后同步账户总览。
async function nt() {
((j.value = ``), (et.value = !1));
let e = Number(k.value ?? 0);
if (O.value && (!Number.isFinite(e) || e <= 0)) {
j.value = `请输入大于 0 的提醒阈值`;
return;
}
A.value = !0;
try {
(await _.post(`/account/credit/remind`, {
credit_remind: +!!O.value,
credit_remind_amount: O.value ? e : 0,
}),
(et.value = !0),
S.overview &&
((S.overview.credit_remind = +!!O.value),
(S.overview.credit_remind_amount = O.value
? e.toFixed(2)
: `0.00`)));
} catch (e) {
j.value =
e instanceof Error ? e.message : `余额提醒保存失败,请重试`;
} finally {
A.value = !1;
}
}
// 读取待审核退款总额;接口未开放的 403/404 不作为普通页面错误展示。
async function rt() {
N.value = ``;
try {
let e = await _.get(`/refund/pending/amount`),
t = e?.amount ?? e?.pending_amount;
M.value = t == null ? null : String(t);
} catch (e) {
M.value = null;
let t =
typeof e == `object` && e && `status` in e ? Number(e.status) : 0;
N.value =
t === 403 || t === 404
? ``
: e instanceof Error
? e.message
: `待审核退款金额加载失败`;
}
}
// 只允许已知财务标签值,其他查询参数回落到账单。
function P(e) {
return typeof e == `string` &&
[`bills`, `transaction`, `credit`, `withdraw`, `freeze`].includes(e)
? e
: `bills`;
}
let F = ref(P(x.query.tab));
// 切换标签时更新 URL 并保留其他查询参数,使刷新后仍能恢复位置。
function it(e) {
return navigateTo(
{
path: `/finance`,
query: {
...x.query,
tab: P(e),
},
},
{
replace: !0,
},
);
}
let I = ref(``),
L = ref(``),
R = ref(null),
z = ref(``),
B = ref(``),
at = [
{
label: `全部`,
value: ``,
},
{
label: `新订单`,
value: `new`,
},
{
label: `续费订单`,
value: `renew`,
},
{
label: `升降级订单`,
value: `upgrade`,
},
{
label: `人工订单`,
value: `artificial`,
},
{
label: `充值订单`,
value: `recharge`,
},
],
ot = [
{
label: `全部`,
value: ``,
},
{
label: `充值`,
value: `Recharge`,
},
{
label: `消费`,
value: `Applied`,
},
{
label: `退款`,
value: `Refund`,
},
{
label: `提现`,
value: `Withdraw`,
},
{
label: `人工`,
value: `Artificial`,
},
];
// 搜索词在提交后才应用;按当前标签重置对应页码并加载。
function V() {
((B.value = z.value.trim()),
F.value === `transaction`
? ((H.value = 1), J())
: F.value === `credit`
? ((W.value = 1), X())
: F.value === `withdraw` && ((yt.value = 1), Q()));
}
function st() {
((z.value = ``),
(B.value = ``),
(I.value = ``),
(L.value = ``),
(R.value = null),
V());
}
let ct = ref([]),
lt = ref(0),
H = ref(1),
ut = ref(!1),
U = ref(``),
dt = ref([]),
ft = ref(0),
W = ref(1),
pt = ref(!1),
G = ref(``),
K = ref(`0.00`),
q = 0,
disposed = !1;
// 交易流水使用独立请求序号,快速筛选时忽略更早的结果。
async function J() {
if (disposed) return;
let e = ++q;
((ut.value = !0), (U.value = ``));
try {
let t = await _.get(`/transaction`, {
page: H.value,
limit: T.value,
type: I.value,
keywords: B.value,
});
if (e !== q) return;
((ct.value = t.list), (lt.value = t.count));
} catch (t) {
if (e !== q) return;
((U.value = t instanceof Error ? t.message : `加载交易记录失败`),
(ct.value = []),
(lt.value = 0));
} finally {
e === q && (ut.value = !1);
}
}
let Y = 0;
// 余额流水与累计金额同步更新;失败时不保留旧金额冒充新结果。
async function X() {
if (disposed) return;
let e = ++Y;
((pt.value = !0), (G.value = ``));
try {
let t = await _.get(`/credit`, {
page: W.value,
limit: T.value,
type: L.value,
keywords: B.value,
});
if (e !== Y) return;
((dt.value = t.list),
(ft.value = t.count),
(K.value = t.total_amount));
} catch (t) {
if (e !== Y) return;
((G.value = t instanceof Error ? t.message : `加载余额记录失败`),
(dt.value = []),
(ft.value = 0),
(K.value = `0.00`));
} finally {
e === Y && (pt.value = !1);
}
}
function mt(e) {
((H.value = e.page + 1), (T.value = e.rows), J());
}
function ht(e) {
((W.value = e.page + 1), (T.value = e.rows), X());
}
// 充值完成后刷新账户余额与相关流水,不在本地直接累加金额。
function gt() {
(S.refreshOverview(), X(), J());
}
let _t = {
0: {
label: `待审核`,
severity: `warn`,
},
1: {
label: `待打款`,
severity: `info`,
},
2: {
label: `审核驳回`,
severity: `danger`,
},
3: {
label: `已打款`,
severity: `success`,
},
},
Z = ref([]),
vt = ref(0),
yt = ref(1),
bt = ref(!1),
xt = ref(``),
St = computed(() => {
let e = B.value.toLowerCase();
return e
? Z.value.filter((t) =>
[t.id, t.amount, t.method, t.reason].some((t) =>
String(t ?? ``)
.toLowerCase()
.includes(e),
),
)
: Z.value;
}),
Ct = 0;
// 按服务端状态分页查询提现记录;本地关键词筛选仅作用于当前返回页。
async function Q() {
if (disposed) return;
let e = ++Ct;
((bt.value = !0), (xt.value = ``));
try {
let t = await _.get(`/withdraw`, {
page: yt.value,
limit: T.value,
status: R.value ?? ``,
});
if (e !== Ct) return;
((Z.value = t.list), (vt.value = t.count));
} catch (t) {
if (e !== Ct) return;
((xt.value = t instanceof Error ? t.message : `加载提现记录失败`),
(Z.value = []),
(vt.value = 0));
} finally {
e === Ct && (bt.value = !1);
}
}
function wt(e) {
((yt.value = e.page + 1), (T.value = e.rows), Q());
}
// 提现完成后刷新账户总览、提现列表及余额明细。
function Tt() {
(S.refreshOverview(), Q(), X());
}
let Et = ref([]),
Dt = ref(0),
Ot = ref(1),
kt = ref(!1),
$ = ref(``),
freezeRequestVersion = 0;
// 冻结记录与其他流水遵守同一代次规则,旧请求不能改写结果、错误或加载状态。
async function At() {
if (disposed) return;
let requestVersion = ++freezeRequestVersion;
((kt.value = !0), ($.value = ``));
try {
let e = await _.get(`/account/credit/freeze`, {
page: Ot.value,
limit: T.value,
});
if (requestVersion !== freezeRequestVersion) return;
((Et.value = e.list ?? []), (Dt.value = e.count ?? 0));
} catch (e) {
if (requestVersion !== freezeRequestVersion) return;
(($.value = e instanceof Error ? e.message : `加载冻结记录失败`),
(Et.value = []),
(Dt.value = 0));
} finally {
requestVersion === freezeRequestVersion && (kt.value = !1);
}
}
function jt(e) {
((Ot.value = e.page + 1), (T.value = e.rows), At());
}
return (
// 与共用列表加载器一致:销毁后拒绝新读取,并作废各列表全部在途响应。
onScopeDispose(() => {
((disposed = !0), q++, Y++, Ct++, freezeRequestVersion++);
}),
watch(
() => x.query.tab,
(e) => {
let t = P(e);
F.value !== t &&
((F.value = t),
t !== `bills` &&
(t === `credit`
? X()
: t === `withdraw`
? Q()
: t === `freeze`
? At()
: J()));
},
),
onMounted(() => {
(C().catch(() => {}),
w(),
rt(),
S.overview || S.fetchOverview().catch(() => {}),
J(),
X(),
Q(),
At());
}),
// 各财务标签使用各自列表/错误;充值、提现和冻结记录弹窗不能以页面当前余额替代实时接口结果。
(t, n) => {
let i = NuxtLink,
s = button,
f = message,
ne = toggleswitch,
re = inputnumber,
h = tab,
oe = tablist,
g = tabpanel,
_ = ListSegments,
y = inputicon,
b = inputtext,
x = iconfield,
C = column,
w = datatable,
tt = select,
rt = tag,
P = ListEmpty,
B = tabpanels,
q = tabs,
J = RechargeDialog,
Y = WithdrawDialog;
return (
openBlock(),
createElementBlock(`div`, je, [
createElementVNode(`section`, Me, [
createElementVNode(`div`, null, [
(n[13] ||= createElementVNode(
`div`,
{
class: `summary-label`,
},
`可用余额`,
-1,
)),
createElementVNode(`div`, Ne, [
(n[12] ||= createElementVNode(`small`, null, `¥`, -1)),
createTextVNode(
toDisplayString(unref(S).overview?.credit ?? `—`),
1,
),
]),
]),
createElementVNode(`div`, { class: `wallet-stat` }, [
createElementVNode(
`div`,
{ class: `summary-label` },
`本月消费`,
),
createElementVNode(
`div`,
{ class: `wallet-stat-value` },
toDisplayString(
unref(S).overview?.this_month_consume == null ||
unref(S).overview?.this_month_consume === ``
? `—`
: `¥` + unref(S).overview?.this_month_consume,
),
1,
),
]),
createElementVNode(`div`, { class: `wallet-stat` }, [
createElementVNode(
`div`,
{ class: `summary-label` },
`累计消费`,
),
createElementVNode(
`div`,
{ class: `wallet-stat-value` },
toDisplayString(
unref(S).overview?.consume == null ||
unref(S).overview?.consume === ``
? `—`
: `¥` + unref(S).overview?.consume,
),
1,
),
]),
unref(M) === null
? createCommentVNode(``, !0)
: (openBlock(),
createElementBlock(`div`, Pe, [
(n[14] ||= createElementVNode(
`div`,
{
class: `summary-label`,
},
`待审核退款`,
-1,
)),
createElementVNode(
`div`,
Fe,
`¥` + toDisplayString(unref(M)),
1,
),
])),
createElementVNode(`div`, Ie, [
createVNode(
i,
{
to: `/finance?tab=bills&status=Unpaid`,
class: `finance-shortcut`,
},
{
default: withCtx(() => [
...(n[15] ||= [createTextVNode(`待付款账单`, -1)]),
]),
_: 1,
},
),
createVNode(
i,
{
to: `/orders`,
class: `finance-shortcut`,
},
{
default: withCtx(() => [
...(n[16] ||= [createTextVNode(`全部订单`, -1)]),
]),
_: 1,
},
),
unref($e)
? (openBlock(),
createBlock(s, {
key: 0,
label: `提现`,
severity: `secondary`,
outlined: ``,
onClick: (n[0] ||= (e) => (D.value = !0)),
}))
: createCommentVNode(``, !0),
createVNode(
s,
{
label: `充值`,
icon: `pi pi-plus`,
disabled: unref(Qe),
title: unref(Qe) ? `站点已关闭充值` : void 0,
onClick: (n[1] ||= (e) => (E.value = !0)),
},
null,
8,
[`disabled`, `title`],
),
]),
]),
unref(N)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `warn`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(toDisplayString(unref(N)), 1),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createElementVNode(`section`, Le, [
(n[19] ||= createElementVNode(
`div`,
{
class: `reminder-copy`,
},
[
createElementVNode(
`h3`,
{
id: `credit-reminder-title`,
},
`余额不足提醒`,
),
createElementVNode(
`p`,
null,
`余额低于设定金额时,通过账户通知提醒你及时充值。`,
),
],
-1,
)),
createElementVNode(`div`, Re, [
createVNode(
ne,
{
modelValue: unref(O),
"onUpdate:modelValue": (n[2] ||= (e) =>
isRef(O) ? (O.value = e) : null),
inputId: `credit-reminder-enabled`,
disabled: unref(A),
},
null,
8,
[`modelValue`, `disabled`],
),
(n[17] ||= createElementVNode(
`label`,
{
for: `credit-reminder-enabled`,
},
`开启提醒`,
-1,
)),
createVNode(
re,
{
modelValue: unref(k),
"onUpdate:modelValue": (n[3] ||= (e) =>
isRef(k) ? (k.value = e) : null),
inputId: `credit-reminder-amount`,
mode: `decimal`,
min: 0.01,
minFractionDigits: 2,
maxFractionDigits: 2,
suffix: ` 元`,
disabled: !unref(O) || unref(A),
},
null,
8,
[`modelValue`, `disabled`],
),
createVNode(
s,
{
label: `保存`,
icon: `pi pi-check`,
loading: unref(A),
onClick: nt,
},
null,
8,
[`loading`],
),
]),
unref(j)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `error`,
closable: !1,
},
{
default: withCtx(() => [
createTextVNode(toDisplayString(unref(j)), 1),
]),
_: 1,
},
))
: unref(et)
? (openBlock(),
createBlock(
f,
{
key: 1,
severity: `success`,
closable: !1,
},
{
default: withCtx(() => [
...(n[18] ||= [
createTextVNode(`余额提醒设置已保存`, -1),
]),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
]),
createElementVNode(`div`, ze, [
createVNode(
q,
{
value: unref(F),
"onUpdate:value": it,
},
{
default: withCtx(() => [
createVNode(oe, null, {
default: withCtx(() => [
createVNode(
h,
{
value: `bills`,
},
{
default: withCtx(() => [
...(n[20] ||= [createTextVNode(`账单`, -1)]),
]),
_: 1,
},
),
createVNode(
h,
{
value: `transaction`,
},
{
default: withCtx(() => [
...(n[21] ||= [
createTextVNode(`交易记录`, -1),
]),
]),
_: 1,
},
),
createVNode(
h,
{
value: `credit`,
},
{
default: withCtx(() => [
...(n[22] ||= [
createTextVNode(`余额变动`, -1),
]),
]),
_: 1,
},
),
createVNode(
h,
{
value: `withdraw`,
},
{
default: withCtx(() => [
...(n[23] ||= [
createTextVNode(`提现记录`, -1),
]),
]),
_: 1,
},
),
createVNode(
h,
{
value: `freeze`,
},
{
default: withCtx(() => [
...(n[24] ||= [
createTextVNode(`冻结记录`, -1),
]),
]),
_: 1,
},
),
]),
_: 1,
}),
createVNode(B, null, {
default: withCtx(() => [
createVNode(
g,
{
value: `bills`,
},
{
default: withCtx(() => [
unref(F) === `bills`
? (openBlock(),
createBlock(index, {
key: 0,
bills: ``,
}))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
g,
{
value: `transaction`,
},
{
default: withCtx(() => [
(n[26] ||= createElementVNode(
`h3`,
{
class: `wallet-section-title`,
},
`交易记录`,
-1,
)),
createElementVNode(`div`, Be, [
createVNode(
_,
{
modelValue: unref(I),
"onUpdate:modelValue": [
(n[4] ||= (e) =>
isRef(I) ? (I.value = e) : null),
V,
],
options: at,
},
null,
8,
[`modelValue`],
),
createElementVNode(`div`, Ve, [
createVNode(x, null, {
default: withCtx(() => [
createVNode(y, {
class: `pi pi-search`,
}),
createVNode(
b,
{
modelValue: unref(z),
"onUpdate:modelValue": (n[5] ||= (
e,
) =>
isRef(z)
? (z.value = e)
: null),
placeholder: `输入关键字`,
"aria-label": `搜索财务记录`,
onKeyup: withKeys(V, [`enter`]),
},
null,
8,
[`modelValue`],
),
]),
_: 1,
}),
createVNode(s, {
label: `清除筛选`,
icon: `pi pi-filter-slash`,
severity: `secondary`,
outlined: ``,
onClick: st,
}),
]),
]),
unref(U)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `error`,
closable: !1,
class: `v-msg`,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(U)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createVNode(
w,
{
value: unref(ct),
loading: unref(ut),
lazy: ``,
paginator: ``,
rows: unref(T),
totalRecords: unref(lt),
first: (unref(H) - 1) * unref(T),
rowsPerPageOptions: [20, 50, 100],
dataKey: `id`,
onPage: mt,
},
{
empty: withCtx(() => [
...(n[25] ||= [
createElementVNode(
`div`,
{
class: `empty`,
},
`暂无消费记录`,
-1,
),
]),
]),
default: withCtx(() => [
createVNode(
C,
{
header: `交易时间`,
field: `create_time`,
style: {
"min-width": `170px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`formatTime` in t
? t.formatTime
: unref(dict_r))(
n.create_time,
),
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `交易 ID`,
style: {
"min-width": `110px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`#` + toDisplayString(t.id),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `订单 ID`,
style: {
"min-width": `110px`,
},
},
{
body: withCtx(({ data: t }) => [
unref(orders_n)(t.order_id)
? (openBlock(),
createBlock(
i,
{
key: 0,
to: unref(orders_n)(
t.order_id,
),
class: `link`,
},
{
default: withCtx(() => [
createTextVNode(
`#` +
toDisplayString(
t.order_id,
),
1,
),
]),
_: 2,
},
1032,
[`to`],
))
: (openBlock(),
createElementBlock(
`span`,
He,
`—`,
)),
]),
_: 1,
},
),
createVNode(
C,
{
header: `类型`,
style: {
"min-width": `100px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`orderTypeLabel` in t
? t.orderTypeLabel
: unref(dict_s))(n.type),
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `支付方式`,
style: {
"min-width": `140px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
toDisplayString(
t.gateway ||
t.gateway_name ||
`—`,
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `交易流水号`,
style: {
"min-width": `220px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
toDisplayString(
t.transaction_number || `—`,
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `金额`,
headerClass: `amount-heading`,
bodyClass: `amount-cell`,
style: {
"min-width": `110px`,
},
},
{
body: withCtx(({ data: t }) => [
createElementVNode(
`b`,
null,
`¥` +
toDisplayString(t.amount),
1,
),
]),
_: 1,
},
),
]),
_: 1,
},
8,
[
`value`,
`loading`,
`rows`,
`totalRecords`,
`first`,
],
),
]),
_: 1,
},
),
createVNode(
g,
{
value: `credit`,
},
{
default: withCtx(() => [
(n[29] ||= createElementVNode(
`h3`,
{
class: `wallet-section-title`,
},
`余额变动`,
-1,
)),
createElementVNode(`div`, Ue, [
createVNode(
_,
{
modelValue: unref(L),
"onUpdate:modelValue": [
(n[6] ||= (e) =>
isRef(L) ? (L.value = e) : null),
V,
],
options: ot,
},
null,
8,
[`modelValue`],
),
createElementVNode(`div`, We, [
createVNode(x, null, {
default: withCtx(() => [
createVNode(y, {
class: `pi pi-search`,
}),
createVNode(
b,
{
modelValue: unref(z),
"onUpdate:modelValue": (n[7] ||= (
e,
) =>
isRef(z)
? (z.value = e)
: null),
placeholder: `输入关键字`,
"aria-label": `搜索财务记录`,
onKeyup: withKeys(V, [`enter`]),
},
null,
8,
[`modelValue`],
),
]),
_: 1,
}),
createVNode(s, {
label: `清除筛选`,
icon: `pi pi-filter-slash`,
severity: `secondary`,
outlined: ``,
onClick: st,
}),
]),
]),
unref(G)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `error`,
closable: !1,
class: `v-msg`,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(G)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createElementVNode(`div`, Ge, [
createElementVNode(`span`, null, [
(n[27] ||= createTextVNode(
`累计入账:`,
-1,
)),
createElementVNode(
`b`,
null,
`¥` + toDisplayString(unref(K)),
1,
),
]),
]),
createVNode(
w,
{
value: unref(dt),
loading: unref(pt),
lazy: ``,
paginator: ``,
rows: unref(T),
totalRecords: unref(ft),
first: (unref(W) - 1) * unref(T),
rowsPerPageOptions: [20, 50, 100],
dataKey: `id`,
onPage: ht,
},
{
empty: withCtx(() => [
...(n[28] ||= [
createElementVNode(
`div`,
{
class: `empty`,
},
`暂无余额记录`,
-1,
),
]),
]),
default: withCtx(() => [
createVNode(
C,
{
header: `交易时间`,
style: {
"min-width": `170px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`formatTime` in t
? t.formatTime
: unref(dict_r))(
n.create_time,
),
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `交易 ID`,
style: {
"min-width": `120px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`#` + toDisplayString(t.id),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `类型`,
style: {
"min-width": `100px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`balanceTypeLabel` in t
? t.balanceTypeLabel
: unref(dict_t))(n.type),
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `描述`,
style: {
"min-width": `280px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
toDisplayString(t.notes || `—`),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `金额`,
headerClass: `amount-heading`,
bodyClass: `amount-cell`,
style: {
"min-width": `110px`,
},
},
{
body: withCtx(({ data: t }) => [
createElementVNode(
`b`,
null,
`¥` +
toDisplayString(t.amount),
1,
),
]),
_: 1,
},
),
]),
_: 1,
},
8,
[
`value`,
`loading`,
`rows`,
`totalRecords`,
`first`,
],
),
]),
_: 1,
},
),
createVNode(
g,
{
value: `withdraw`,
},
{
default: withCtx(() => [
createVNode(
f,
{
severity: `info`,
closable: !1,
class: `withdraw-notice`,
},
{
default: withCtx(() => [
...(n[30] ||= [
createTextVNode(
`提现申请提交后,可在此查看审核状态、手续费与到账记录。`,
-1,
),
]),
]),
_: 1,
},
),
(n[31] ||= createElementVNode(
`h3`,
{
class: `wallet-section-title`,
},
`提现记录`,
-1,
)),
createElementVNode(`div`, Ke, [
createElementVNode(`div`, qe, [
createVNode(x, null, {
default: withCtx(() => [
createVNode(y, {
class: `pi pi-search`,
}),
createVNode(
b,
{
modelValue: unref(z),
"onUpdate:modelValue": (n[8] ||= (
e,
) =>
isRef(z)
? (z.value = e)
: null),
placeholder: `筛选当前页记录`,
"aria-label": `搜索财务记录`,
onKeyup: withKeys(V, [`enter`]),
},
null,
8,
[`modelValue`],
),
]),
_: 1,
}),
createVNode(
tt,
{
modelValue: unref(R),
"onUpdate:modelValue": (n[9] ||= (
e,
) =>
isRef(R) ? (R.value = e) : null),
options: Object.entries(_t).map(
([e, t]) => ({
label: t.label,
value: Number(e),
}),
),
optionLabel: `label`,
optionValue: `value`,
placeholder: `选择状态`,
"aria-label": `提现状态`,
showClear: ``,
onChange: V,
},
null,
8,
[`modelValue`, `options`],
),
createVNode(s, {
label: `清除筛选`,
icon: `pi pi-filter-slash`,
severity: `secondary`,
outlined: ``,
onClick: st,
}),
]),
]),
unref(xt)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `error`,
closable: !1,
class: `v-msg`,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref(xt)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createVNode(
w,
{
value: unref(St),
loading: unref(bt),
lazy: ``,
paginator: ``,
rows: unref(T),
totalRecords: unref(vt),
first: (unref(yt) - 1) * unref(T),
rowsPerPageOptions: [20, 50, 100],
dataKey: `id`,
onPage: wt,
},
{
empty: withCtx(() => [
createVNode(P, {
icon: `pi pi-wallet`,
title: `暂无提现记录`,
description: `余额提现申请后可在此查看审核与打款进度`,
}),
]),
default: withCtx(() => [
createVNode(
C,
{
header: `ID`,
style: {
width: `90px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`#` + toDisplayString(t.id),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `提现金额`,
style: {
width: `130px`,
},
},
{
body: withCtx(({ data: t }) => [
createElementVNode(
`span`,
Je,
`¥` + toDisplayString(t.amount),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `手续费`,
style: {
width: `110px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`¥` + toDisplayString(t.fee),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `到账金额`,
style: {
width: `130px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`¥` +
toDisplayString(
t.withdraw_amount,
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `提现方式`,
style: {
width: `120px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
toDisplayString(
t.method || `--`,
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `状态`,
style: {
width: `130px`,
},
},
{
body: withCtx(({ data: t }) => [
createVNode(
rt,
{
value:
_t[t.status]?.label ?? `--`,
severity:
_t[t.status]?.severity ??
`secondary`,
},
null,
8,
[`value`, `severity`],
),
t.status === 2 && t.reason
? (openBlock(),
createElementBlock(
`div`,
Ye,
toDisplayString(
unref(sanitizeMessage)(
t.reason,
),
),
1,
))
: createCommentVNode(``, !0),
]),
_: 1,
},
),
createVNode(
C,
{
header: `申请时间`,
style: {
width: `170px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`formatTime` in t
? t.formatTime
: unref(dict_r))(
n.create_time,
),
),
1,
),
]),
_: 1,
},
),
]),
_: 1,
},
8,
[
`value`,
`loading`,
`rows`,
`totalRecords`,
`first`,
],
),
]),
_: 1,
},
),
createVNode(
g,
{
value: `freeze`,
},
{
default: withCtx(() => [
unref($)
? (openBlock(),
createBlock(
f,
{
key: 0,
severity: `error`,
closable: !1,
class: `v-msg`,
},
{
default: withCtx(() => [
createTextVNode(
toDisplayString(unref($)),
1,
),
]),
_: 1,
},
))
: createCommentVNode(``, !0),
createVNode(
w,
{
value: unref(Et),
loading: unref(kt),
lazy: ``,
paginator: ``,
rows: unref(T),
totalRecords: unref(Dt),
first: (unref(Ot) - 1) * unref(T),
rowsPerPageOptions: [20, 50, 100],
dataKey: `id`,
onPage: jt,
},
{
empty: withCtx(() => [
createVNode(P, {
icon: `pi pi-lock`,
title: `暂无冻结记录`,
description: `账户余额被冻结时,记录会显示在这里`,
}),
]),
default: withCtx(() => [
createVNode(
C,
{
header: `ID`,
style: {
width: `90px`,
},
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
`#` + toDisplayString(t.id),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `冻结金额`,
style: {
width: `140px`,
},
},
{
body: withCtx(({ data: t }) => [
createElementVNode(
`span`,
Xe,
`¥` + toDisplayString(t.amount),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `备注`,
},
{
body: withCtx(({ data: t }) => [
createTextVNode(
toDisplayString(
t.client_notes || `--`,
),
1,
),
]),
_: 1,
},
),
createVNode(
C,
{
header: `冻结时间`,
style: {
width: `170px`,
},
},
{
body: withCtx(({ data: n }) => [
createTextVNode(
toDisplayString(
(`formatTime` in t
? t.formatTime
: unref(dict_r))(
n.create_time,
),
),
1,
),
]),
_: 1,
},
),
]),
_: 1,
},
8,
[
`value`,
`loading`,
`rows`,
`totalRecords`,
`first`,
],
),
]),
_: 1,
},
),
]),
_: 1,
}),
]),
_: 1,
},
8,
[`value`],
),
]),
createVNode(
J,
{
modelValue: unref(E),
"onUpdate:modelValue": (n[10] ||= (e) =>
isRef(E) ? (E.value = e) : null),
onSuccess: gt,
},
null,
8,
[`modelValue`],
),
createVNode(
Y,
{
modelValue: unref(D),
"onUpdate:modelValue": (n[11] ||= (e) =>
isRef(D) ? (D.value = e) : null),
onSuccess: Tt,
},
null,
8,
[`modelValue`],
),
])
);
}
);
},
}),
[[`__scopeId`, `data-v-18fe1f08`]],
);
export {};
export default x;
</script>