Browse Source

feat(plans): 三档语义修正 + 企业版转客服 + 试用按账号 + 删续费卡 + 返回按钮

- 入门=自己的 Hermes;进阶=3 个平台容器;企业版无数量无价格,联系客服定制
- 额度只显示上限(裁决 B),超额仍禁止开通
- 试用与容器数无关,按账号一次;已用则禁用入口
- 删除「需要续费」卡,按钮按有无套餐切续费/开通
- 两端补返回按钮;文件读取云函数补注册并部署

Co-Authored-By: Claude Code <noreply@anthropic.com>
Huccct 9 hours ago
parent
commit
6f33f8cb96

+ 12 - 0
docs/00-tracking/操作追踪.md

@@ -10604,3 +10604,15 @@ Call log:
   - 8 数据留存 7 天:4 处落位(套餐页底部卡、两端到期提示条、移动通讯录到期徽标 tooltip、桌面我的容器「已到期」pill);提示词正文已含该文案。
   - 验证:build 通过;单测 **2255 SUCCESS**(3 个失败仍为 SafeArea 既知偶发项);新增 `billing-period.spec.ts` 3 条。
   - 踩坑:`title="中文…"` 会被 Angular 当表达式解析 → 必须用 `[attr.title]="'…'"`;桌面套餐页在顶层 `/plans` 不是 `/desktop/plans`。
+
+- 2026-12-03 23:30:00+08:00:**套餐页改造 + 项目删除修复 + 云函数全量部署(用户裁决 B)**
+  - 部署:`fmode-provisioning` → `xlosi3m46q` → `lfYlgU7SkK` → `AlP56LCKFm` → `tocXyQjyh6`(文件读取原先未注册进部署脚本,已补)。到期拦截实测:状态/交付/上传三个入口均 403「已到期」,现有容器未受影响。
+  - 项目删除复活:根因 `syncFromCloud` 在「云端空+本地有」时整体回推且 `wsUpsert` 不清软删;修法加本地墓碑 `deletedIds`,同步永不推回。
+  - 套餐页(用户裁决 B:额度只显示上限、超额仍禁止):
+    - 入门版:「1 个本地容器(你自己的 Hermes 接入 App)」
+    - 进阶版:「3 个平台容器」,卡片显示「3 个容器」(不再显示 4/3)
+    - 企业版:不显示数量与价格,改为「企业定制方案」+ 客服电话/邮箱,按钮「联系客服」(`contactOnly`)
+    - 试用:与容器数量无关,按账号一次;用过的账号按钮显示「已使用过试用」并禁用,后端 `TRIAL_USED` 兜底
+    - 删除「需要续费?」卡片;按钮按有无付费套餐自动切「续费 / 立即开通」
+    - 两端补返回按钮;外链统一 `target="_blank" rel="noopener"`
+  - 验证:build 通过;单测 **2255 SUCCESS**(SafeArea 3 项既知偶发,单跑登录页 24/24 亦通过);两端浏览器实测通过(桌面截图 plans-v2、移动截图 plans-mobile)。

+ 11 - 0
src/app/core/api/models.ts

@@ -994,6 +994,17 @@ export interface PlanCatalogItem {
   recommended?: boolean;
   /** 是否允许付费增配 */
   addonAllowed: boolean;
+  /**
+   * 是否「联系客服定制」(2026-12-03 用户裁决):企业版不显示价格与时长选择,
+   * 改为展示客服联系方式、定制化开发说明。
+   */
+  contactOnly?: boolean;
+  /**
+   * 额度展示口径(2026-12-03 用户裁决「只显示上限」):
+   *   `limit` = 只显示上限(3 个容器),不显示已用数。
+   * 已用数仍用于**禁止超额开通**,只是不上屏。
+   */
+  quotaDisplay?: 'limit' | 'usage';
 }
 
 /**

+ 7 - 4
src/app/core/plan.service.spec.ts

@@ -36,9 +36,11 @@ describe('PlanService', () => {
   });
 
   describe('权益目录', () => {
-    it('三档配额为 1 / 3 / 5', () => {
+    it('三档配额:入门 1 / 进阶 3 / 企业版不按容器数计(2026-12-03 用户裁决)', () => {
       const quotas = service.catalog.map((p) => p.quota);
-      expect(quotas).toEqual([1, 3, 5]);
+      expect(quotas).toEqual([1, 3, 0]);
+      const enterprise = service.catalog.find((p) => p.code === 'enterprise')!;
+      expect(enterprise.contactOnly).toBeTrue();
     });
 
     it('试用为 1 个容器', () => {
@@ -59,9 +61,10 @@ describe('PlanService', () => {
       expect(text).not.toMatch(/CPU\s*\d/i);
     });
 
-    it('进阶含一年资源', () => {
+    it('进阶可开通 3 个平台容器(2026-12-03 用户裁决)', () => {
       const advanced = service.catalog.find((p) => p.code === 'advanced')!;
-      expect(advanced.billingNote).toContain('一年');
+      expect(advanced.billingNote).toContain('3 个平台容器');
+      expect(advanced.features.join()).toContain('3 个平台容器');
     });
   });
 

+ 24 - 18
src/app/core/plan.service.ts

@@ -43,39 +43,43 @@ export class PlanService {
       code: 'starter',
       name: '入门版',
       shortName: '入门',
-      tagline: '一个专属空间,从这里开始。',
+      tagline: '使用你自己的 Hermes,接入 App。',
       quota: 1,
       quotaLabel: '个容器',
       billingUnit: '/ 月',
-      billingNote: '支持 1 个容器',
+      billingNote: '1 个本地容器',
+      quotaDisplay: 'limit',
       features: [
-        '1 个专属容器',
-        '独立云资源',
+        /* 2026-12-03 用户裁决:入门版只能使用自己的 Hermes(本地接入,不开平台容器) */
+        '1 个本地容器(你自己的 Hermes 接入 App)',
+        '不需要我们的服务器,模型与数据都在你本地',
         '查看每条会话的任务状态与进度',
         '在 App 中查看与管理成果文件',
         '手机与电脑均可使用',
       ],
-      mobileQuota: '1 个专属容器',
-      mobileBenefit: '会话任务状态 · App 文件管理 · 多端使用',
+      mobileQuota: '1 个本地容器',
+      mobileBenefit: '自己的 Hermes 接入 · 会话任务状态 · 多端使用',
       addonAllowed: false,
     },
     {
       code: 'advanced',
       name: '进阶版',
       shortName: '进阶',
-      tagline: '更多空间,接住不同的想法。',
+      tagline: '平台为你开通容器,开箱即用。',
       quota: 3,
       quotaLabel: '个容器',
-      billingUnit: '/ 年',
-      billingNote: '含一年资源费用',
+      billingUnit: '/ 月',
+      billingNote: '最多 3 个平台容器',
+      quotaDisplay: 'limit',
       features: [
-        '3 个专属容器',
+        /* 2026-12-03 用户裁决:进阶版可在平台开通 3 个容器 */
+        '3 个平台容器(我们为你开通,开箱即用)',
         '查看各会话的任务状态与进度',
         '在 App 中统一管理成果文件',
         '独立云资源与接入服务',
         '支持加购容器名额',
       ],
-      mobileQuota: '3 个专属容器',
+      mobileQuota: '3 个平台容器',
       mobileBenefit: '会话任务状态 · App 文件管理 · 支持加购名额',
       recommended: true,
       addonAllowed: true,
@@ -84,21 +88,23 @@ export class PlanService {
       code: 'enterprise',
       name: '企业版',
       shortName: '企业',
-      tagline: '让整个团队,有序地协作。',
-      quota: 5,
-      quotaLabel: '个共享',
+      tagline: '企业专属,按需定制。',
+      quota: 0,
+      quotaLabel: '',
       billingUnit: '',
-      billingNote: '团队共享',
+      billingNote: '按需定制',
+      /* 2026-12-03 用户裁决:企业版不显示容器数量、不显示价格,改为联系客服做定制化开发 */
+      contactOnly: true,
       features: [
-        '5 个企业容器',
+        '容器数量与资源按企业需求定制',
         '团队成员共享容器与会话',
         '查看各会话的任务状态与进度',
         '在 App 中统一管理成果文件',
         '企业成员管理',
         '通讯录与容器共享',
-        '支持加购容器名额',
+        '专属技术支持与定制化开发',
       ],
-      mobileQuota: '5 个共享容器',
+      mobileQuota: '按需定制',
       mobileBenefit: '成员管理 · 会话任务状态 · 共享文件管理',
       addonAllowed: true,
     },

+ 97 - 17
src/app/desktop/pages/plans/plans.ts

@@ -7,7 +7,6 @@ import { LoadingOverlayComponent } from '../../../components/domain/loading-over
 import { ProvisionInstructionComponent } from '../../../components/domain/provision-instruction/provision-instruction';
 import { PlanService } from '../../../core/plan.service';
 import { ProvisionService } from '../../../core/provision.service';
-import { RenewalGuideComponent } from '../../../components/domain/renewal-guide/renewal-guide';
 import { LiveService } from '../../../core/live.service';
 import { ProvisionConfirmComponent } from '../../../components/domain/provision-confirm/provision-confirm';
 import { suggestContainerName } from '../../../components/domain/provision-confirm/container-name';
@@ -28,7 +27,7 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
 @Component({
   selector: 'app-dk-plans-page',
   changeDetection: ChangeDetectionStrategy.OnPush,
-  imports: [UserNoticePipe, ProvisionInstructionComponent, LoadingOverlayComponent, RenewalGuideComponent, ProvisionConfirmComponent],
+  imports: [UserNoticePipe, ProvisionInstructionComponent, LoadingOverlayComponent, ProvisionConfirmComponent],
   template: `
     <div class="plans-page">
       <!-- 名额已满提示(2026-12-03):页面顶部,用户点了开通马上能看到 -->
@@ -47,6 +46,10 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
         </div>
       }
       <header class="plans-head">
+        <!-- 返回(2026-12-03):套餐页多为门禁跳转进来的,必须能退回去 -->
+        <button type="button" class="plans-back" [disabled]="!canGoBack()" (click)="goBack()">
+          <i class="fa-solid fa-arrow-left" aria-hidden="true"></i> 返回
+        </button>
         <div>
           <p class="plans-eyebrow"><i class="fa-solid fa-crown" aria-hidden="true"></i> 套餐与开通</p>
           <h1>选择适合你的协作方式。</h1>
@@ -125,12 +128,12 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
             <h2>先体验,再决定。<span>两天试用</span></h2>
             <p>用你自己的 Hermes 接入 Fmode:<b>本机直接安装</b>或 <b>Docker 容器</b>均可</p>
           </div>
-          <button type="button" class="plans-banner-btn" [disabled]="provision.startBlocked()" (click)="apply('trial')">
+          <button type="button" class="plans-banner-btn" [disabled]="provision.startBlocked() || trialUsed()" (click)="apply('trial')">
             @if (provision.isStarting('trial')) {
               <i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>
               生成中…
             } @else {
-              开始两天试用
+              {{ trialUsed() ? '已使用过试用' : '开始两天试用' }}
             }
           </button>
         </section>
@@ -162,16 +165,29 @@ 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>
+            <!--
+              额度(2026-12-03 用户裁决 B):
+                · 只显示**上限**(如「3 个容器」),不显示已用数;
+                · 超额仍会**禁止开通**(判定在 apply(),用 existingNames 与配额比);
+                · 企业版(contactOnly)不显示任何数量。
+            -->
+            @if (!item.contactOnly && item.quota > 0) {
+              <p class="plan-quota"><strong>{{ item.quota }}</strong><span>{{ item.quotaLabel }}</span></p>
+            }
 
+            <!-- 企业版(contactOnly):不显示时长与价格,改为联系客服定制(2026-12-03 用户裁决) -->
+            @if (item.contactOnly) {
+              <div class="plan-contact">
+                <p class="plan-contact-title">企业定制方案</p>
+                <p>容器数量、专属资源、私有化部署与定制化开发,按企业需求评估。</p>
+                <a class="plan-contact-link" href="tel:400-000-0000" target="_blank" rel="noopener">
+                  <i class="fa-solid fa-phone" aria-hidden="true"></i> 客服电话:400-000-0000
+                </a>
+                <a class="plan-contact-link" href="mailto:contact@fmode.cn" target="_blank" rel="noopener">
+                  <i class="fa-solid fa-envelope" aria-hidden="true"></i> 联系邮箱:contact@fmode.cn
+                </a>
+              </div>
+            } @else {
             <!-- 付费时长三档(2026-12-03 用户裁决:月/季/年,默认月 30 天;价格仍待定不出现金额) -->
             <div class="plan-periods" role="radiogroup" [attr.aria-label]="item.name + ' 计费周期'">
               @for (opt of billingOptions; track opt.value) {
@@ -186,7 +202,12 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
               <span>{{ periodUnit(item.code) }}</span>
             </div>
             <p class="plan-billing">按{{ periodLabel(item.code) }}开通 · {{ periodDays(item.code) }} 天</p>
+            }
+
 
+            @if (item.contactOnly) {
+              <a class="plan-cta plan-cta--contact" href="mailto:contact@fmode.cn?subject=企业版定制咨询" target="_blank" rel="noopener">联系客服</a>
+            } @else {
             <button
               type="button"
               class="plan-cta"
@@ -199,9 +220,10 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
                 <i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>
                 提交中…
               } @else {
-                立即开通
+                {{ ctaText(item.code) }}
               }
             </button>
+            }
 
             <ul class="plan-features">
               @for (f of item.features; track f) {
@@ -217,8 +239,6 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
         <span>具体价格请咨询客服。提交申请后由工作人员联系确认,确认前不会产生费用。</span>
       </p>
 
-      <app-renewal-guide />
-
       <!--
         底部不再放「我的容器」入口卡(2026-12-03 用户反馈):
         顶部状态条已有「管理容器」按钮,两个入口同页重复。
@@ -507,6 +527,33 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
         color: var(--muted);
         font-size: var(--fs-12);
       }
+      .plans-back {
+        display: inline-flex; align-items: center; gap: var(--sp-2);
+        min-height: 32px; margin-bottom: var(--sp-3); padding: 0 var(--sp-2);
+        border: 0; border-radius: 8px; background: transparent;
+        color: var(--ink-2); font-size: var(--fs-13); cursor: pointer;
+      }
+      .plans-back:hover { background: var(--surface-2); color: var(--ink); }
+      .plans-back:disabled { opacity: .5; cursor: default; }
+      .plan-contact {
+        display: flex;
+        flex-direction: column;
+        gap: var(--sp-2);
+        margin: var(--sp-3) 0;
+        padding: var(--sp-3);
+        border: 1px dashed var(--edge);
+        border-radius: var(--r-md, 10px);
+        background: var(--surface-2);
+        font-size: var(--fs-13);
+      }
+      .plan-contact-title { margin: 0; font-weight: 600; color: var(--ink); }
+      .plan-contact p { margin: 0; color: var(--ink-2); line-height: 1.5; }
+      .plan-contact-link {
+        display: inline-flex; align-items: center; gap: var(--sp-2);
+        color: var(--primary); text-decoration: none;
+      }
+      .plan-contact-link:hover { text-decoration: underline; }
+      .plan-cta--contact { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
       .plan-periods {
         display: flex;
         gap: 2px;
@@ -780,6 +827,21 @@ export class DkPlansPage implements OnInit {
     void this.live.ensureLoaded();
   }
 
+  /**
+   * 是否已有付费套餐(2026-12-03 用户裁决:按有无套餐自动切「开通 / 续费」)。
+   *
+   * 判据:名下任一容器 planCode 属于付费档(starter/advanced/enterprise)。
+   * 试用不算「已有套餐」——试用是体验,不是订阅。
+   */
+  protected readonly hasPaidPlan = computed(() =>
+    this.live.agents().some((a) => a.planCode === 'starter' || a.planCode === 'advanced' || a.planCode === 'enterprise'),
+  );
+
+  /** 按钮文案:已有套餐 → 续费;否则 → 开通(企业版走联系客服,不经过这里) */
+  protected ctaText(_code: string): string {
+    return this.hasPaidPlan() ? '续费' : '立即开通';
+  }
+
   /* 付费时长三档(2026-12-03):每张卡各自记住选择,默认月 */
   protected readonly billingOptions = BILLING_OPTIONS;
   private readonly billingSel = signal<Record<string, BillingPeriod>>({});
@@ -791,6 +853,15 @@ export class DkPlansPage implements OnInit {
   protected periodUnit(code: string): string { return BILLING_OPTIONS.find((o) => o.value === this.billingOf(code))?.unit ?? '/ 月'; }
   protected periodDays(code: string): number { return billingDays(this.billingOf(code)); }
 
+  /**
+   * 该账号是否已用过试用(2026-12-03 用户裁决:试用与容器数量无关,按账号只一次)。
+   * 判据来自云函数派生的 trialUsedAt/trialExpired;用过就禁用试用入口,
+   * 后端 `TRIAL_USED` 仍是最终防线。
+   */
+  protected readonly trialUsed = computed(() =>
+    this.live.agents().some((a) => a.planCode === 'trial' || a.trialExpired === true),
+  );
+
   protected readonly plans = computed(() => this.plan.catalog);
 
   /** 运行中的容器数(资产概览用;状态口径与通讯录一致) */
@@ -856,6 +927,10 @@ export class DkPlansPage implements OnInit {
    *
    * 与移动端同源逻辑:试用/入门留在本页给提示词,进阶/企业跳全屏等待页。
    */
+  /** 是否有上一页(直接打开 /plans 时没有,按钮置灰) */
+  protected canGoBack(): boolean { return history.length > 1; }
+  protected goBack(): void { if (history.length > 1) history.back(); else void this.router.navigateByUrl('/desktop/chat'); }
+
   protected async apply(code: PaidPlanCode | 'trial'): Promise<void> {
     if (this.provision.isRunning()) return;
     /*
@@ -869,8 +944,13 @@ export class DkPlansPage implements OnInit {
      * 在弹窗之前拦,而不是等提交后云函数返回 409 ——
      * 「认真填完名字才被告知名额已满」是很差的体验。
      */
+    /*
+     * 超额禁止(2026-12-03 用户裁决 B):卡片只显示上限不显示已用数,
+     * 但达到上限后仍然**不允许再开**——这里就是拦截点。
+     * 试用独立计数(与容器数量无关,只按账号判一次)。
+     */
     const quota = code === 'trial' ? 1 : (this.plan.planOf(code as never)?.quota ?? 0);
-    if (quota > 0 && this.existingNames().length >= quota) {
+    if (code !== 'trial' && quota > 0 && this.existingNames().length >= quota) {
       this.quotaFull.set({ plan: this.plan.planOf(code as never)?.name || '该套餐', quota });
       return;
     }

+ 49 - 18
src/app/mobile/pages/plans/plans.ts

@@ -10,7 +10,6 @@ import { LoadingOverlayComponent } from '../../../components/domain/loading-over
 import { ProvisionInstructionComponent } from '../../../components/domain/provision-instruction/provision-instruction';
 import { MAppBarComponent } from '../../components/m-app-bar/m-app-bar';
 import { MDrawerComponent } from '../../components/m-drawer/m-drawer';
-import { RenewalGuideComponent } from '../../../components/domain/renewal-guide/renewal-guide';
 import { ProvisionConfirmComponent } from '../../../components/domain/provision-confirm/provision-confirm';
 import { suggestContainerName } from '../../../components/domain/provision-confirm/container-name';
 
@@ -35,10 +34,11 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
 @Component({
   selector: 'app-mb-plans-page',
   changeDetection: ChangeDetectionStrategy.OnPush,
-  imports: [UserNoticePipe, MAppBarComponent, MDrawerComponent, ProvisionInstructionComponent, LoadingOverlayComponent, RenewalGuideComponent, ProvisionConfirmComponent],
+  imports: [UserNoticePipe, MAppBarComponent, MDrawerComponent, ProvisionInstructionComponent, LoadingOverlayComponent, ProvisionConfirmComponent],
   template: `
     <div class="m-page--scroll">
-      <app-m-app-bar title="套餐与开通" [menu]="true" (menuTap)="drawerOpen.set(true)" />
+      <!-- 返回(2026-12-03):套餐页多为门禁跳转进来的,必须能退回去 -->
+      <app-m-app-bar title="套餐与开通" [back]="true" (backTap)="goBack()" [menu]="true" (menuTap)="drawerOpen.set(true)" />
       <!-- 名额已满提示(2026-12-03):页面顶部,用户点了开通马上能看到 -->
       @if (quotaFull(); as qf) {
         <div class="quota-full" role="alert">
@@ -110,12 +110,12 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
               <h2>先体验,再决定<span>两天试用</span></h2>
               <p>用你自己的 Hermes 接入 Fmode:<b>本机直接安装</b>或 <b>Docker 容器</b>均可</p>
             </div>
-            <button type="button" class="plans-trial-btn" (click)="apply('trial')" [disabled]="provision.startBlocked()">
+            <button type="button" class="plans-trial-btn" (click)="apply('trial')" [disabled]="provision.startBlocked() || trialUsed()">
               @if (provision.isStarting('trial')) {
                 <i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>
                 生成中…
               } @else {
-                开始试用
+                {{ trialUsed() ? '已使用过试用' : '开始试用' }}
               }
             </button>
           </section>
@@ -143,15 +143,16 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
               }
               <i class="plan-icon" [class]="iconOf(plan.code)" aria-hidden="true"></i>
               <h3>{{ plan.shortName }}</h3>
-              <!-- 名额显示已用/上限(2026-12-03 用户反馈「看不到我的限额」);列表未载出时只显示上限 -->
-              <p class="plan-quota">
-                @if (live.hasData()) {
-                  <strong>{{ live.agents().length }}/{{ plan.quota }}</strong>
-                } @else {
-                  <strong>{{ plan.quota }}</strong>
-                }
-                <span>{{ plan.quotaLabel }}</span>
-              </p>
+              <!-- 额度(2026-12-03 用户裁决 B):只显示上限;超额仍禁止开通;企业版不显示 -->
+              @if (!plan.contactOnly && plan.quota > 0) {
+                <p class="plan-quota"><strong>{{ plan.quota }}</strong><span>{{ plan.quotaLabel }}</span></p>
+              }
+              @if (plan.contactOnly) {
+                <!-- 企业版(2026-12-03 用户裁决):不显示数量与价格,联系客服定制 -->
+                <a class="plan-contact" href="tel:400-000-0000" target="_blank" rel="noopener">
+                  <i class="fa-solid fa-phone" aria-hidden="true"></i> 客服 400-000-0000
+                </a>
+              } @else {
               <!-- 付费时长三档(2026-12-03 用户裁决:月/季/年,默认月 30 天;价格仍待定不出现金额) -->
               <div class="plan-periods" role="radiogroup" [attr.aria-label]="plan.name + ' 计费周期'">
                 @for (opt of billingOptions; track opt.value) {
@@ -163,6 +164,10 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
               </div>
               <p class="plan-price">价格待定</p>
               <p class="plan-unit">按{{ periodLabel(plan.code) }}开通 · {{ periodDays(plan.code) }} 天</p>
+              }
+              @if (plan.contactOnly) {
+                <a class="plan-btn plan-btn--contact" href="mailto:contact@fmode.cn?subject=企业版定制咨询" target="_blank" rel="noopener">联系客服</a>
+              } @else {
               <button
                 type="button"
                 class="plan-btn"
@@ -174,9 +179,10 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
                   <i class="fa-solid fa-circle-notch fa-spin" aria-hidden="true"></i>
                   提交中…
                 } @else {
-                  开通
+                  {{ ctaText(plan.code) }}
                 }
               </button>
+              }
             </article>
           }
         </div>
@@ -186,8 +192,6 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
           <span>具体价格请咨询客服。试用与入门使用你自己的容器;进阶与企业由平台创建。</span>
         </p>
 
-        <app-renewal-guide />
-
         <h2 class="plans-heading">权益说明</h2>
         <div class="plans-detail">
           @for (plan of plans(); track plan.code) {
@@ -588,6 +592,14 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
         color: var(--muted);
         font-size: var(--fs-10, 11px);
       }
+      .plan-contact {
+        display: flex; align-items: center; justify-content: center; gap: 4px;
+        margin: var(--sp-2) 0; padding: var(--sp-2);
+        border: 1px dashed var(--edge); border-radius: 8px;
+        background: var(--surface-2); color: var(--primary);
+        font-size: var(--fs-11, 11px); text-decoration: none;
+      }
+      .plan-btn--contact { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
       .plan-periods {
         display: flex;
         gap: 2px;
@@ -753,6 +765,12 @@ export class MbPlansPage implements OnInit {
   protected readonly drawerOpen = signal(false);
 
   /** 付费三档(试用单独走横幅) */
+  /** 是否已有付费套餐(2026-12-03):决定按钮文案「开通 / 续费」;试用不算 */
+  protected readonly hasPaidPlan = computed(() =>
+    this.live.agents().some((a) => a.planCode === 'starter' || a.planCode === 'advanced' || a.planCode === 'enterprise'),
+  );
+  protected ctaText(_code: string): string { return this.hasPaidPlan() ? '续费' : '立即开通'; }
+
   /* 付费时长三档(2026-12-03):每张卡各自记住选择,默认月 */
   protected readonly billingOptions = BILLING_OPTIONS;
   private readonly billingSel = signal<Record<string, BillingPeriod>>({});
@@ -763,6 +781,15 @@ export class MbPlansPage implements OnInit {
   protected periodLabel(code: string): string { return BILLING_OPTIONS.find((o) => o.value === this.billingOf(code))?.label ?? '月付'; }
   protected periodDays(code: string): number { return billingDays(this.billingOf(code)); }
 
+  /**
+   * 该账号是否已用过试用(2026-12-03 用户裁决:试用与容器数量无关,按账号只一次)。
+   * 判据来自云函数派生的 trialUsedAt/trialExpired;用过就禁用试用入口,
+   * 后端 `TRIAL_USED` 仍是最终防线。
+   */
+  protected readonly trialUsed = computed(() =>
+    this.live.agents().some((a) => a.planCode === 'trial' || a.trialExpired === true),
+  );
+
   protected readonly plans = computed(() => this.plan.catalog);
 
   /**
@@ -821,6 +848,9 @@ export class MbPlansPage implements OnInit {
    * 跳转前必须 `await` 到 `jobId` 存在 —— 带着 undefined 跳过去,
    * 等待页会拉不到任务,用户看到的是空转。
    */
+  /** 返回上一页;直接打开时回会话页(2026-12-03) */
+  protected goBack(): void { if (history.length > 1) history.back(); else void this.router.navigateByUrl('/mobile/chat'); }
+
   protected async apply(code: PlanCode): Promise<void> {
     if (this.provision.isRunning()) return;
     /*
@@ -835,7 +865,8 @@ export class MbPlansPage implements OnInit {
      * 「认真填完名字才被告知名额已满」是很差的体验。
      */
     const quota = code === 'trial' ? 1 : (this.plan.planOf(code as never)?.quota ?? 0);
-    if (quota > 0 && this.existingNames().length >= quota) {
+    /* 超额禁止(2026-12-03 裁决 B):只显示上限,但达到上限仍不允许再开 */
+    if (code !== 'trial' && quota > 0 && this.existingNames().length >= quota) {
       this.quotaFull.set({ plan: this.plan.planOf(code as never)?.name || '该套餐', quota });
       return;
     }