refactor(dashboard): 重构基本信息面板数据源及运行天数计算
- 统一从 app_product.product_id=65 和 app_subscription 获取面板数据,替代原硬编码和 tenant/siteStore - 字段映射调整,软件名称、版本号、运行状态、创建时间等均改用 product 与 subscription 字段 - 删除硬编码的 systemInfo reactive,移除不必要的 reactive 导入 - 新增 productStatusText 计算属性,对 publishStatus 状态做文字和颜色映射 - 重写运行天数计算,改用订阅生效时间 startTime,修正续费重置计数的边界响应 - 模板绑定全部字段,增加骨架屏 loading 状态,避免界面闪烁 - 添加「系统运行」字段提示信息,明确起算时间语义 - 保持 loadSubscriptionInfo 调用 getProductDetail,无新增接口请求 - 确保 vue-tsc 类型校验无新增错误
This commit is contained in:
@@ -146,3 +146,23 @@
|
||||
- form reactive 默认值新增 `paymentVoucher: undefined`,对齐 `ShopOrder` model。
|
||||
- `ShopOrder` model 中 `paymentVoucher?: string` 字段早就存在(payTime 之后),无需改 model/API。
|
||||
- 用户场景:仅线下付款(payType=9)的订单才有此凭证图,条件渲染自然处理。
|
||||
|
||||
## Dashboard 基本信息 6 字段数据源重构(product + subscription)
|
||||
|
||||
- 需求:dashboard「基本信息」面板原先混用硬编码/tenant/siteStore,改为统一从 `app_product.product_id=65` + `app_subscription` 读取,语义更准确。
|
||||
- 字段映射决策(用户确认):
|
||||
- 系统名称 → `currentProduct.productName`(原硬编码 '小程序商城')
|
||||
- 版本号 → `currentProduct.version`(原硬编码 '2.0.0')
|
||||
- 运行状态 → `currentProduct.publishStatus` + 中文映射 + a-tag 颜色(原 `siteStore.statusText`)
|
||||
- 创建时间 → `currentSubscription.startTime`(原 `tenantStore.company?.createTime`)
|
||||
- 到期时间 → `currentSubscription.expireTime`(保持不变,原本就是这个)
|
||||
- 系统运行天数 → 自 `currentSubscription.startTime` 起累计(原自 `tenantStore.company?.createTime`;后改为 startTime,与"创建时间"行同源,语义统一)
|
||||
- 改动 `src/views/shop/dashboard/index.vue`:
|
||||
- 删除硬编码 `systemInfo` reactive(已确认 cms 那两个 systemInfo 是独立 const,互不影响)。
|
||||
- import 移除 `reactive`。
|
||||
- 新增 `productStatusText` computed:publishStatus → {text,color} 映射(published=已发布/green、pending_review=审核中/orange、developing=开发中/blue、rejected=已驳回/red、deprecated=已下架/red),未知状态显示原始值,无 product 显示 '-'。
|
||||
- 重写 `runDays` computed:数据源由 `tenantStore.company?.createTime` 改为 `currentSubscription.value?.startTime`(与"创建时间"行同源),注释说明续费新增订阅记录会重置计数的边界行为。
|
||||
- 模板 6 个字段全部重绑,每个字段加 `subscriptionLoading` 骨架屏分支(避免空白/老数据闪现)。
|
||||
- 「系统运行」加 `a-tooltip title="自您首次开通小程序商城起"`(用户要求)。
|
||||
- 数据流复用:`loadSubscriptionInfo()` 原本就调 `getProductDetail(65)` 填充 `currentProduct`,无需新增接口调用。
|
||||
- 类型校验:vue-tsc 对 `shop/dashboard/index.vue` 行级错误 0 条;cms 那批历史错误与本次无关。
|
||||
|
||||
Reference in New Issue
Block a user