|
|
@@ -154,6 +154,15 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
</div>
|
|
|
<h3>{{ item.name }}</h3>
|
|
|
<p class="plan-tagline">{{ item.tagline }}</p>
|
|
|
+ <!-- 名额显示已用/上限(2026-12-03 用户反馈「看不到我的限额」);列表未载出时只显示上限 -->
|
|
|
+ <p class="plan-quota">
|
|
|
+ @if (live.hasData()) {
|
|
|
+ <strong>{{ live.agents().length }}/{{ item.quota }}</strong>
|
|
|
+ } @else {
|
|
|
+ <strong>{{ item.quota }}</strong>
|
|
|
+ }
|
|
|
+ <span>{{ item.quotaLabel }}</span>
|
|
|
+ </p>
|
|
|
|
|
|
<div class="plan-price">
|
|
|
<strong>价格待定</strong>
|
|
|
@@ -195,15 +204,11 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
|
|
|
<app-renewal-guide />
|
|
|
|
|
|
+ <!--
|
|
|
+ 底部不再放「我的容器」入口卡(2026-12-03 用户反馈):
|
|
|
+ 顶部状态条已有「管理容器」按钮,两个入口同页重复。
|
|
|
+ -->
|
|
|
<div class="plans-links">
|
|
|
- <section class="plans-link-card">
|
|
|
- <i class="fa-solid fa-server" aria-hidden="true"></i>
|
|
|
- <div>
|
|
|
- <h3>我的容器</h3>
|
|
|
- <p>查看已有的容器与名额使用情况</p>
|
|
|
- </div>
|
|
|
- <button type="button" class="plans-link-btn" (click)="go('/desktop/my-containers')">查看</button>
|
|
|
- </section>
|
|
|
<section class="plans-link-card">
|
|
|
<i class="fa-solid fa-shield-halved" aria-hidden="true"></i>
|
|
|
<div>
|
|
|
@@ -467,6 +472,22 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
color: var(--muted);
|
|
|
font-size: var(--fs-13);
|
|
|
}
|
|
|
+ .plan-quota {
|
|
|
+ display: flex;
|
|
|
+ align-items: baseline;
|
|
|
+ gap: 3px;
|
|
|
+ margin: var(--sp-2, 8px) 0 0;
|
|
|
+ line-height: 1.2;
|
|
|
+ }
|
|
|
+ .plan-quota strong {
|
|
|
+ font-size: var(--fs-18);
|
|
|
+ font-weight: 600;
|
|
|
+ letter-spacing: -0.02em;
|
|
|
+ }
|
|
|
+ .plan-quota span {
|
|
|
+ color: var(--muted);
|
|
|
+ font-size: var(--fs-12);
|
|
|
+ }
|
|
|
.plan-price {
|
|
|
display: flex;
|
|
|
align-items: baseline;
|
|
|
@@ -709,6 +730,12 @@ export class DkPlansPage implements OnInit {
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
void this.provision.restorePending();
|
|
|
+ /*
|
|
|
+ * 配额预检与重名校验都依赖容器列表(2026-12-03):
|
|
|
+ * /plans 是顶层路由不在 shell 内,没人替本页拉 live,
|
|
|
+ * 不主动加载 existingNames() 永远是空 —— 配额预检形同虚设。
|
|
|
+ */
|
|
|
+ void this.live.ensureLoaded();
|
|
|
}
|
|
|
|
|
|
protected readonly plans = computed(() => this.plan.catalog);
|
|
|
@@ -738,7 +765,11 @@ export class DkPlansPage implements OnInit {
|
|
|
* · 进阶/企业开通 → 只受理,很快,之后跳等待页
|
|
|
*/
|
|
|
protected readonly loadingHint = computed<{ message: string; detail: string } | null>(() => {
|
|
|
- if (this.provision.restoring()) return { message: '正在检查开通任务…', detail: '正在找回已有进度,请稍候' };
|
|
|
+ /*
|
|
|
+ * 🔴 restoring 不再上全屏遮罩(2026-12-03 用户实测反馈):
|
|
|
+ * 开通中离开再回 /plans,每次进页都重放一遍「正在检查开通任务…」过场动画。
|
|
|
+ * restore 本来就是静默找回——完了有任务就显示 plans-banner,没有就无事发生。
|
|
|
+ */
|
|
|
const p = this.provision.startingPlan();
|
|
|
if (!p) return null;
|
|
|
if (p === 'trial' || p === 'starter') {
|
|
|
@@ -772,8 +803,14 @@ export class DkPlansPage implements OnInit {
|
|
|
*
|
|
|
* 与移动端同源逻辑:试用/入门留在本页给提示词,进阶/企业跳全屏等待页。
|
|
|
*/
|
|
|
- protected apply(code: PaidPlanCode | 'trial'): void {
|
|
|
+ protected async apply(code: PaidPlanCode | 'trial'): Promise<void> {
|
|
|
if (this.provision.isRunning()) return;
|
|
|
+ /*
|
|
|
+ * 配额判断依赖容器列表;首载还没落地时 existingNames() 是空数组,
|
|
|
+ * 直接判会永远放行(2026-12-03 用户实测:已有 2 个容器仍没看到名额提示)。
|
|
|
+ * 先等首载完成再校验;加载失败则由服务端配额校验兜底。
|
|
|
+ */
|
|
|
+ await this.live.ensureLoaded();
|
|
|
/*
|
|
|
* 名额已满就别让用户填名字了(2026-12-03)。
|
|
|
* 在弹窗之前拦,而不是等提交后云函数返回 409 ——
|
|
|
@@ -804,6 +841,14 @@ export class DkPlansPage implements OnInit {
|
|
|
replaceUrl: true,
|
|
|
});
|
|
|
}
|
|
|
+ } catch {
|
|
|
+ /*
|
|
|
+ * 提交抛错也要关弹窗(2026-12-03):否则弹窗永远盖在页面上,
|
|
|
+ * 页面级的错误提示(plans-error)用户根本看不到。
|
|
|
+ * 错误本身由 ProvisionService.error() 呈现在页面上。
|
|
|
+ */
|
|
|
+ this.confirmOpen.set(false);
|
|
|
+ this.pendingCode.set(null);
|
|
|
} finally {
|
|
|
this.submitting.set(false);
|
|
|
}
|