|
@@ -2,6 +2,7 @@ import { UserNoticePipe } from '../../../components/feedback/user-notice.pipe';
|
|
|
import { ChangeDetectionStrategy, Component, computed, inject, OnInit, signal } from '@angular/core';
|
|
import { ChangeDetectionStrategy, Component, computed, inject, OnInit, signal } from '@angular/core';
|
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
|
import { PaidPlanCode } from '../../../core/api/models';
|
|
import { PaidPlanCode } from '../../../core/api/models';
|
|
|
|
|
+import { BILLING_OPTIONS, BillingPeriod, DEFAULT_BILLING, billingDays } from '../../../core/billing-period';
|
|
|
import { LoadingOverlayComponent } from '../../../components/domain/loading-overlay/loading-overlay';
|
|
import { LoadingOverlayComponent } from '../../../components/domain/loading-overlay/loading-overlay';
|
|
|
import { ProvisionInstructionComponent } from '../../../components/domain/provision-instruction/provision-instruction';
|
|
import { ProvisionInstructionComponent } from '../../../components/domain/provision-instruction/provision-instruction';
|
|
|
import { PlanService } from '../../../core/plan.service';
|
|
import { PlanService } from '../../../core/plan.service';
|
|
@@ -42,7 +43,7 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
@if (trialExpiredName(); as expired) {
|
|
@if (trialExpiredName(); as expired) {
|
|
|
<div class="quota-full quota-full--expired" role="alert">
|
|
<div class="quota-full quota-full--expired" role="alert">
|
|
|
<p>「{{ expired }}」的两天试用已到期。</p>
|
|
<p>「{{ expired }}」的两天试用已到期。</p>
|
|
|
- <p>开通入门版(本地容器 + App)或进阶版(平台容器)后即可继续使用。</p>
|
|
|
|
|
|
|
+ <p>开通入门版(本地容器 + App)或进阶版(平台容器)后即可继续使用;到期后数据保留 7 天,7 天后容器与数据将被回收。</p>
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|
|
|
<header class="plans-head">
|
|
<header class="plans-head">
|
|
@@ -171,13 +172,20 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
<span>{{ item.quotaLabel }}</span>
|
|
<span>{{ item.quotaLabel }}</span>
|
|
|
</p>
|
|
</p>
|
|
|
|
|
|
|
|
|
|
+ <!-- 付费时长三档(2026-12-03 用户裁决:月/季/年,默认月 30 天;价格仍待定不出现金额) -->
|
|
|
|
|
+ <div class="plan-periods" role="radiogroup" [attr.aria-label]="item.name + ' 计费周期'">
|
|
|
|
|
+ @for (opt of billingOptions; track opt.value) {
|
|
|
|
|
+ <button type="button" role="radio"
|
|
|
|
|
+ [attr.aria-checked]="billingOf(item.code) === opt.value"
|
|
|
|
|
+ [class.on]="billingOf(item.code) === opt.value"
|
|
|
|
|
+ (click)="setBilling(item.code, opt.value)">{{ opt.label }}</button>
|
|
|
|
|
+ }
|
|
|
|
|
+ </div>
|
|
|
<div class="plan-price">
|
|
<div class="plan-price">
|
|
|
<strong>价格待定</strong>
|
|
<strong>价格待定</strong>
|
|
|
- @if (item.billingUnit) {
|
|
|
|
|
- <span>{{ item.billingUnit }}</span>
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ <span>{{ periodUnit(item.code) }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <p class="plan-billing">{{ item.billingNote }}</p>
|
|
|
|
|
|
|
+ <p class="plan-billing">按{{ periodLabel(item.code) }}开通 · {{ periodDays(item.code) }} 天</p>
|
|
|
|
|
|
|
|
<button
|
|
<button
|
|
|
type="button"
|
|
type="button"
|
|
@@ -220,7 +228,7 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
<i class="fa-solid fa-shield-halved" aria-hidden="true"></i>
|
|
<i class="fa-solid fa-shield-halved" aria-hidden="true"></i>
|
|
|
<div>
|
|
<div>
|
|
|
<h3>数据为你保留</h3>
|
|
<h3>数据为你保留</h3>
|
|
|
- <p>试用结束后,开通套餐即可继续使用原有容器</p>
|
|
|
|
|
|
|
+ <p>试用结束后,开通套餐即可继续使用原有容器;到期后数据保留 7 天,7 天后容器与数据将被回收</p>
|
|
|
</div>
|
|
</div>
|
|
|
</section>
|
|
</section>
|
|
|
</div>
|
|
</div>
|
|
@@ -499,6 +507,29 @@ import { suggestContainerName } from '../../../components/domain/provision-confi
|
|
|
color: var(--muted);
|
|
color: var(--muted);
|
|
|
font-size: var(--fs-12);
|
|
font-size: var(--fs-12);
|
|
|
}
|
|
}
|
|
|
|
|
+ .plan-periods {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 2px;
|
|
|
|
|
+ margin: var(--sp-2) 0 0;
|
|
|
|
|
+ padding: 2px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ background: var(--surface-2);
|
|
|
|
|
+ }
|
|
|
|
|
+ .plan-periods button {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-height: 30px;
|
|
|
|
|
+ border: 0;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ color: var(--muted);
|
|
|
|
|
+ font-size: var(--fs-12);
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ .plan-periods button.on {
|
|
|
|
|
+ background: var(--surface);
|
|
|
|
|
+ color: var(--ink);
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
.plan-price {
|
|
.plan-price {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: baseline;
|
|
align-items: baseline;
|
|
@@ -749,6 +780,17 @@ export class DkPlansPage implements OnInit {
|
|
|
void this.live.ensureLoaded();
|
|
void this.live.ensureLoaded();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /* 付费时长三档(2026-12-03):每张卡各自记住选择,默认月 */
|
|
|
|
|
+ protected readonly billingOptions = BILLING_OPTIONS;
|
|
|
|
|
+ private readonly billingSel = signal<Record<string, BillingPeriod>>({});
|
|
|
|
|
+ protected billingOf(code: string): BillingPeriod { return this.billingSel()[code] ?? DEFAULT_BILLING; }
|
|
|
|
|
+ protected setBilling(code: string, v: BillingPeriod): void {
|
|
|
|
|
+ this.billingSel.update((m) => ({ ...m, [code]: v }));
|
|
|
|
|
+ }
|
|
|
|
|
+ protected periodLabel(code: string): string { return BILLING_OPTIONS.find((o) => o.value === this.billingOf(code))?.label ?? '月付'; }
|
|
|
|
|
+ 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)); }
|
|
|
|
|
+
|
|
|
protected readonly plans = computed(() => this.plan.catalog);
|
|
protected readonly plans = computed(() => this.plan.catalog);
|
|
|
|
|
|
|
|
/** 运行中的容器数(资产概览用;状态口径与通讯录一致) */
|
|
/** 运行中的容器数(资产概览用;状态口径与通讯录一致) */
|
|
@@ -843,7 +885,7 @@ export class DkPlansPage implements OnInit {
|
|
|
if (!code) return;
|
|
if (!code) return;
|
|
|
this.submitting.set(true);
|
|
this.submitting.set(true);
|
|
|
try {
|
|
try {
|
|
|
- const result = await this.provision.start(code, name);
|
|
|
|
|
|
|
+ const result = await this.provision.start(code, name, this.billingOf(code));
|
|
|
this.confirmOpen.set(false);
|
|
this.confirmOpen.set(false);
|
|
|
this.pendingCode.set(null);
|
|
this.pendingCode.set(null);
|
|
|
|
|
|