Files
cneicy 42dfead9cd
前端验证 / verify (push) Failing after 15m3s
feat(ui): 优化控制台响应式布局与视觉体验
- 统一页面标题、圆角、字体和响应式断点,调整暗色主题及图表配色
- 新增表格列标签插件,在窄屏下将表格转换为卡片布局,优化实例、订单、工单等列表展示
- 支持移动端点击订单行进入详情,并完善订单凭据的打印布局
- 在财务中心展示本月及累计消费,补充充值关闭时的提示
- 优化工单详情布局,将附件上传入口整合至富文本编辑器工具栏
- 调整实例操作按钮、SSH 密钥操作及安全菜单图标
- 为多个页面显式导入 definePageMeta,完善页面元数据声明
2026-11-07 00:09:57 +08:00

224 lines
7.5 KiB
Vue

<script>
/** 首页钱包:余额来自当前会话总览,充值与提现入口分别读取配置;弹窗成功后重新查询余额,不在本地自行加减。 */
import "~/assets/styles/WithdrawDialog.ks0wdKEK.css";
import "~/assets/styles/PaymentDialog.BNFKQF1U.css";
import "~/assets/styles/RechargeDialog.DpsMly4r.css";
import "~/assets/styles/HomeWalletCard.C5SHzGlJ.css";
import { toDisplayString } from "vue";
import { onMounted } from "vue";
import { normalizeClass } from "vue";
import { createBlock } from "vue";
import { ref } from "vue";
import { withCtx } from "vue";
import { createCommentVNode } from "vue";
import { isRef } from "vue";
import { createElementBlock } from "vue";
import { createElementVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { createVNode } from "vue";
import { openBlock } from "vue";
import { NuxtLink } from "#components";
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 skeleton from "primevue/skeleton";
import RechargeDialog from "~/components/RechargeDialog.vue";
import WithdrawDialog from "~/components/WithdrawDialog.vue";
import { t as useWithdrawAvailability_t } from "~/lib/useWithdrawAvailability.js";
var C = {
class: `home-card`,
},
w = {
class: `home-card-head`,
},
T = {
class: `home-card-body wallet-body`,
},
E = {
class: `balance-value`,
},
D = {
key: 0,
},
O = {
key: 1,
},
k = Object.assign(
_plugin_vue_export_helper_t(
defineComponent({
__name: `HomeWalletCard`,
setup(d) {
let v = useAuth(),
{ rechargeClosed: k, load: A } = useSiteConfig_t(),
{ enabled: j, load: M } = useWithdrawAvailability_t(),
N = ref(!1),
P = ref(!1);
// 配置控制入口展示,不能替代服务端对充值/提现请求的最终校验。
onMounted(() => {
(A().catch(() => {}), M());
});
// 两个弹窗共用刷新回调;刷新失败不猜测操作后的余额。
async function F() {
await v.refreshOverview().catch(() => {});
}
// 总览未返回时显示骨架而非零余额,充值/提现各自维护可见状态。
return (t, i) => {
let d = NuxtLink,
h = skeleton,
g = button,
S = RechargeDialog,
A = WithdrawDialog;
return (
openBlock(),
createElementBlock(`div`, C, [
createElementVNode(`div`, w, [
(i[5] ||= createElementVNode(
`div`,
{
class: `home-card-title`,
},
`钱包`,
-1,
)),
createVNode(
d,
{
to: `/finance`,
class: `home-card-more`,
"aria-label": `钱包明细`,
},
{
default: withCtx(() => [
...(i[4] ||= [
createElementVNode(
`i`,
{
class: `pi pi-angle-right`,
},
null,
-1,
),
]),
]),
_: 1,
},
),
]),
createElementVNode(`div`, T, [
(i[6] ||= createElementVNode(
`div`,
{
class: `balance-label`,
},
`可用余额`,
-1,
)),
createElementVNode(`div`, E, [
unref(v).overview
? (openBlock(),
createElementBlock(
`span`,
O,
`¥` + toDisplayString(unref(v).overview.credit),
1,
))
: (openBlock(),
createElementBlock(`span`, D, [
createVNode(h, {
width: `90px`,
height: `28px`,
}),
])),
]),
createElementVNode(
`div`,
{
class: normalizeClass([
`wallet-actions`,
{
"wallet-actions-single": !unref(j),
},
]),
},
[
unref(j)
? (openBlock(),
createBlock(g, {
key: 0,
label: `提现`,
severity: `secondary`,
outlined: ``,
onClick: (i[0] ||= (e) => (P.value = !0)),
}))
: createCommentVNode(``, !0),
createVNode(
g,
{
label: `充值`,
icon: `pi pi-plus`,
disabled: unref(k),
severity: unref(k) ? `secondary` : void 0,
outlined: unref(k),
title: unref(k) ? `站点已关闭充值` : void 0,
onClick: (i[1] ||= (e) => (N.value = !0)),
},
null,
8,
[`disabled`, `severity`, `outlined`, `title`],
),
],
2,
),
unref(k)
? (openBlock(),
createElementBlock(
`div`,
{
key: 0,
class: `wallet-hint`,
},
`站点暂未开放充值`,
))
: createCommentVNode(``, !0),
]),
createVNode(
S,
{
modelValue: unref(N),
"onUpdate:modelValue": (i[2] ||= (e) =>
isRef(N) ? (N.value = e) : null),
onSuccess: F,
},
null,
8,
[`modelValue`],
),
createVNode(
A,
{
modelValue: unref(P),
"onUpdate:modelValue": (i[3] ||= (e) =>
isRef(P) ? (P.value = e) : null),
onSuccess: F,
},
null,
8,
[`modelValue`],
),
])
);
};
},
}),
[[`__scopeId`, `data-v-0dbd1f86`]],
),
{
__name: `HomeWalletCard`,
},
);
export {};
export default k;
</script>