feat(shopOrder): 添加订单商品明细展开功能并优化订单状态显示
- 在订单列表中增加商品明细的展开/收起功能,默认显示2条商品信息 - 支持点击“展开全部 N 件”切换显示全部或折叠商品明细 - 优化订单状态栏支付状态、发货状态、开票状态及操作按钮中的分隔线统一风格 - 将shop/dashboard运行天数改为基于租户创建时间,而非订阅生效时间,保证准确性 - 调整订单列表表格列宽及显示顺序,改善界面布局和信息展示 - 注释和代码格式微调,删除无用的组件显示及注释代码,提升代码整洁度 - 修复了部分变量定义和模板标签排版,完善代码可维护性
This commit is contained in:
@@ -344,10 +344,10 @@ const { loading: statisticsLoading } = storeToRefs(statisticsStore);
|
||||
// ============================================================
|
||||
// 基本信息:数据来源拆分
|
||||
// - 身份信息(系统名称/版本号/运行状态)来自 app_product (productId=65)
|
||||
// - 时间线(创建时间/到期时间/系统运行天数)来自 app_subscription
|
||||
// · 创建时间 = subscription.startTime(订阅生效时间)
|
||||
// - 时间线(开通时间/到期时间)来自 app_subscription
|
||||
// · 开通时间 = subscription.startTime(订阅生效时间)
|
||||
// · 到期时间 = subscription.expireTime
|
||||
// · 系统运行天数 = 自 subscription.createTime 起累计
|
||||
// - 系统运行天数 = 自租户创建时间起累计(tenantStore.company.createTime)
|
||||
// ============================================================
|
||||
// 当前应用产品(按固定 productId=65 查询)
|
||||
const currentProduct = ref<AppProduct | null>(null);
|
||||
@@ -643,15 +643,13 @@ const onPayModalClose = () => {
|
||||
// 计算属性
|
||||
const now = ref(Date.now());
|
||||
let runDaysTimer: ReturnType<typeof setInterval>;
|
||||
// 系统运行天数:自订阅生效时间起累计
|
||||
// 锚定 currentSubscription.startTime(与"创建时间"行同源,语义统一)。
|
||||
// 注意:若后端续费为新增订阅记录,此处取的是 expireTime 最新的 active 订阅,
|
||||
// startTime 可能是续费生效日,runDays 会从续费日重新计数。
|
||||
// 如需"累计运行天数",应改用最早的 active 订阅 startTime 或后端额外提供字段。
|
||||
// 系统运行天数:自租户创建时间起累计
|
||||
// 锚定 tenantStore.company.createTime(租户建档时间),与后台租户创建时间一致。
|
||||
// 数据来源:loadData 中已调用 tenantStore.fetchTenantInfo() 写入 tenantStore.company。
|
||||
const runDays = computed(() => {
|
||||
const startTime = currentSubscription.value?.startTime;
|
||||
if (!startTime) return 0;
|
||||
return Math.floor((now.value - new Date(startTime).getTime()) / (24 * 60 * 60 * 1000));
|
||||
const createTime = tenantStore.company?.createTime;
|
||||
if (!createTime) return 0;
|
||||
return Math.floor((now.value - new Date(createTime).getTime()) / (24 * 60 * 60 * 1000));
|
||||
});
|
||||
const userCount = computed(() => statisticsStore.userCount);
|
||||
const orderCount = computed(() => statisticsStore.orderCount);
|
||||
|
||||
Reference in New Issue
Block a user