fix(web): 支付表列与表单语义校准
充值金额/实付金额文案与 dataIndex;期间两行;备注列收窄; 选用弹层 booting 不闪登录;订阅 paid_at 不默认当前时间。
This commit is contained in:
@@ -149,8 +149,8 @@ watch(
|
||||
s.paid_at != null ? unixToBeijingWall(s.paid_at) : null;
|
||||
subForm.remark = s.remark;
|
||||
} else {
|
||||
// 订阅的 paid_at 是「套餐付款时刻」,可空——不默认填今天
|
||||
resetSub();
|
||||
subForm.paid_at = dayjs();
|
||||
}
|
||||
if (props.editingTop) {
|
||||
isSub.value = false;
|
||||
@@ -248,7 +248,7 @@ async function onSubmit() {
|
||||
}
|
||||
} else {
|
||||
if (topForm.amount == null || topForm.amount <= 0) {
|
||||
error.value = "请填写计费单位金额(须为正)";
|
||||
error.value = "请填写充值金额 amount(须为正)";
|
||||
return;
|
||||
}
|
||||
if (topForm.money == null || topForm.money < 0) {
|
||||
@@ -362,7 +362,7 @@ async function onSubmit() {
|
||||
{{ quotaPreview }} · 落库为原始 quota
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="付款金额 / 时间(可空)">
|
||||
<a-form-item label="付款金额 / 付款时间(可空)">
|
||||
<a-input-number
|
||||
v-model:value="subForm.paid_amount"
|
||||
:min="0"
|
||||
@@ -374,10 +374,12 @@ async function onSubmit() {
|
||||
v-model:value="subForm.paid_at"
|
||||
:format="TIME_FMT"
|
||||
:show-time="{ defaultValue: undefined }"
|
||||
placeholder="付款时间(可空)"
|
||||
placeholder="钱出手时刻(可空)"
|
||||
style="width: 200px; margin-left: 8px"
|
||||
/>
|
||||
<div class="form-note">金额数值——币种由你们约定,系统不预设;金额不可为负</div>
|
||||
<div class="form-note">
|
||||
社交层付款事实:金额数值、币种由你们约定;未知可留空。登记时刻由系统另记
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注">
|
||||
<a-input v-model:value="subForm.remark" />
|
||||
@@ -385,7 +387,7 @@ async function onSubmit() {
|
||||
</a-form>
|
||||
|
||||
<a-form v-else layout="vertical">
|
||||
<a-form-item label="计费单位 amount" required>
|
||||
<a-form-item label="充值金额 amount" required>
|
||||
<a-space>
|
||||
<a-input-number
|
||||
v-model:value="topForm.amount"
|
||||
@@ -396,17 +398,18 @@ async function onSubmit() {
|
||||
<a-button @click="topPickerOpen = true">从平台选用</a-button>
|
||||
</a-space>
|
||||
<div class="form-note">
|
||||
上游 amount(美元额度形态);换得 quota = amount × QPU
|
||||
平台计费侧充值额(不标币种);与「实付」之间汇率由管理员约定。换得 quota ≈ amount × QPU
|
||||
<template v-if="quotaPreview"> · {{ quotaPreview }}</template>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="实付 money" required>
|
||||
<a-form-item label="实付金额 money" required>
|
||||
<a-input-number
|
||||
v-model:value="topForm.money"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
style="width: 180px"
|
||||
/>
|
||||
<div class="form-note">实际支付金额(不预设币种)</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="入账时间 paid_at" required>
|
||||
<a-date-picker
|
||||
|
||||
@@ -28,6 +28,8 @@ const username = ref("");
|
||||
const password = ref("");
|
||||
const error = ref("");
|
||||
const loading = ref(false);
|
||||
/** 打开后检查登录并拉取中——避免闪现登录表单 */
|
||||
const booting = ref(false);
|
||||
const list = ref<PlatformSubscription[]>([]);
|
||||
|
||||
function readToken(): string {
|
||||
@@ -51,13 +53,18 @@ watch(
|
||||
() => props.open,
|
||||
(v) => {
|
||||
if (v) {
|
||||
// 每次打开都重新拉取——上游续订/新订阅要能看见
|
||||
if (readToken()) void load(true);
|
||||
// 有 token:先显示「检查中」,拉完再进列表/登录,不闪登录表单
|
||||
if (readToken()) {
|
||||
booting.value = true;
|
||||
void load(true).finally(() => {
|
||||
booting.value = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
list.value = [];
|
||||
error.value = "";
|
||||
password.value = "";
|
||||
// 用户名可留作便利;密码绝不残留
|
||||
booting.value = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -119,7 +126,11 @@ function onUse(s: PlatformSubscription) {
|
||||
destroy-on-hidden
|
||||
@update:open="emit('update:open', $event)"
|
||||
>
|
||||
<template v-if="list.length === 0">
|
||||
<div v-if="booting || (loading && list.length === 0)" class="plat-pick__boot">
|
||||
<a-spin />
|
||||
<span class="plat-pick__boot-text">正在检查登录并拉取…</span>
|
||||
</div>
|
||||
<template v-else-if="list.length === 0">
|
||||
<p class="plat-pick__hint">
|
||||
使用 NewAPI 控制台账号登录后拉取订阅,仅用于预填登记;密码不保存。
|
||||
</p>
|
||||
@@ -183,6 +194,19 @@ function onUse(s: PlatformSubscription) {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.plat-pick__boot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 48px 0;
|
||||
}
|
||||
|
||||
.plat-pick__boot-text {
|
||||
font-size: 12px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.plat-pick__hint {
|
||||
margin: 0 0 16px;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -28,6 +28,8 @@ const username = ref("");
|
||||
const password = ref("");
|
||||
const error = ref("");
|
||||
const loading = ref(false);
|
||||
/** 打开后检查登录并拉取中——避免闪现登录表单 */
|
||||
const booting = ref(false);
|
||||
const items = ref<PlatformTopup[]>([]);
|
||||
const total = ref(0);
|
||||
const page = ref(1);
|
||||
@@ -121,14 +123,19 @@ watch(
|
||||
() => props.open,
|
||||
(v) => {
|
||||
if (v) {
|
||||
// 每次打开重拉第一页(有 token 则免再输密码)
|
||||
if (readToken()) void loadPage(1, { allowTokenOnly: true });
|
||||
if (readToken()) {
|
||||
booting.value = true;
|
||||
void loadPage(1, { allowTokenOnly: true }).finally(() => {
|
||||
booting.value = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
items.value = [];
|
||||
total.value = 0;
|
||||
page.value = 1;
|
||||
error.value = "";
|
||||
password.value = "";
|
||||
booting.value = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -145,7 +152,14 @@ watch(
|
||||
destroy-on-hidden
|
||||
@update:open="emit('update:open', $event)"
|
||||
>
|
||||
<template v-if="items.length === 0 && !loading">
|
||||
<div
|
||||
v-if="booting || (loading && items.length === 0)"
|
||||
class="top-pick__boot"
|
||||
>
|
||||
<a-spin />
|
||||
<span class="top-pick__boot-text">正在检查登录并拉取…</span>
|
||||
</div>
|
||||
<template v-else-if="items.length === 0 && !loading">
|
||||
<p class="top-pick__hint">
|
||||
登录 NewAPI 控制台拉取充值单(传统分页);密码不保存。
|
||||
</p>
|
||||
@@ -222,6 +236,19 @@ watch(
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.top-pick__boot {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 48px 0;
|
||||
}
|
||||
|
||||
.top-pick__boot-text {
|
||||
font-size: 12px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.top-pick__hint {
|
||||
margin: 0 0 16px;
|
||||
font-size: 12px;
|
||||
|
||||
Reference in New Issue
Block a user