fix layout

This commit is contained in:
Timi
2026-10-28 14:21:26 +08:00
parent 5609d2484e
commit adc6e38328
83 changed files with 5587 additions and 5386 deletions
+104 -100
View File
@@ -1,105 +1,109 @@
<template>
<t-navbar
fixed
:z-index="20"
title="套餐配置详情"
left-arrow
@left-click="$router.back()"
>
<template #right>
<t-button
v-if="canUpdate"
@click="toEdit"
theme="primary"
variant="text"
size="small"
content="编辑"
/>
</template>
</t-navbar>
<div v-can="permissionCodes.packageConfig.read" class="package-config-detail">
<template v-if="config">
<section class="hero" v-entrance-transition>
<div class="header">
<span class="eyebrow" v-text="'套餐管理'" />
<t-tag
:content="getPackageConfigStatusText(config.status)"
variant="light-outline"
:theme="getStatusTheme(config.status)"
/>
</div>
<h1 class="title" v-text="config.name || '未命名套餐'" />
<p class="description" v-text="config.description || '暂无套餐说明'" />
<div class="items-price">
<span v-text="`${config.itemList?.length || 0} 项产品权益`" />
<div class="price text-bold">
<span class="red">¥</span>
<span class="red value" v-text="formatPackageAmount(config.standardAmount)" />
</div>
</div>
</section>
<t-cell-group v-if="canReadSalesOrder" theme="card" v-entrance-transition>
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
<template #left-icon>
<t-icon name="gift" />
</template>
</t-cell>
</t-cell-group>
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
<t-cell title="标准价" :note="formatPackageAmount(config.standardAmount)" />
<t-cell title="起始日期" :note="config.beginAt ? Time.toDateTime(config.beginAt) : '不限'" />
<t-cell title="终止日期" :note="config.endAt ? Time.toDateTime(config.endAt) : '不限'" />
<t-cell title="最后修改人" :note="config.updater?.nick || config.updater?.name || '未知'" />
</t-cell-group>
<t-cell-group class="product" title="产品权益" theme="card" v-entrance-transition>
<t-cell
class="item"
v-for="item in config.itemList || []"
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
>
<template #leftIcon>
<t-image
v-if="getItemPhotoURL(item)"
:src="getItemPhotoURL(item)"
:alt="item.productNameSnapshot || '产品图片'"
fit="cover"
class="avatar"
/>
<div
v-else
class="avatar fallback"
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
/>
</template>
<template #title>
<div class="title">
<span v-text="item.productNameSnapshot || '未命名产品'" />
<product-sku-tags
:product-name="item.productNameSnapshot"
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
<div class="page-layout navbar">
<t-navbar
fixed
:z-index="20"
title="套餐配置详情"
left-arrow
@left-click="$router.back()"
>
<template #right>
<t-button
v-if="canUpdate"
@click="toEdit"
theme="primary"
variant="text"
size="small"
content="编辑"
/>
</template>
</t-navbar>
<main class="page-content scroll column">
<div v-can="permissionCodes.packageConfig.read" class="package-config-detail">
<template v-if="config">
<section class="hero" v-entrance-transition>
<div class="header">
<span class="eyebrow" v-text="'套餐管理'" />
<t-tag
:content="getPackageConfigStatusText(config.status)"
variant="light-outline"
:theme="getStatusTheme(config.status)"
/>
</div>
</template>
</t-cell>
<center-tips v-if="!config.itemList?.length" :content="'暂无产品权益'" />
</t-cell-group>
<t-button
v-if="canPurchase"
class="cell-button"
theme="primary"
content="购买套餐"
@click="toPurchase"
/>
<t-button
v-if="canDelete"
class="cell-button"
theme="danger"
@click="removeConfig"
content="删除"
/>
</template>
<t-empty v-else :description="isLoading ? '正在加载套餐配置' : '套餐配置不存在'" />
<h1 class="title" v-text="config.name || '未命名套餐'" />
<p class="description" v-text="config.description || '暂无套餐说明'" />
<div class="items-price">
<span v-text="`${config.itemList?.length || 0} 项产品权益`" />
<div class="price text-bold">
<span class="red">¥</span>
<span class="red value" v-text="formatPackageAmount(config.standardAmount)" />
</div>
</div>
</section>
<t-cell-group v-if="canReadSalesOrder" theme="card" v-entrance-transition>
<t-cell title="套餐订单列表" arrow @click="toPackageOrderList">
<template #left-icon>
<t-icon name="gift" />
</template>
</t-cell>
</t-cell-group>
<t-cell-group title="基本信息" theme="card" v-entrance-transition>
<t-cell title="标准价" :note="formatPackageAmount(config.standardAmount)" />
<t-cell title="起始日期" :note="config.beginAt ? Time.toDateTime(config.beginAt) : '不限'" />
<t-cell title="终止日期" :note="config.endAt ? Time.toDateTime(config.endAt) : '不限'" />
<t-cell title="最后修改人" :note="config.updater?.nick || config.updater?.name || '未知'" />
</t-cell-group>
<t-cell-group class="product" title="产品权益" theme="card" v-entrance-transition>
<t-cell
class="item"
v-for="item in config.itemList || []"
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
>
<template #leftIcon>
<t-image
v-if="getItemPhotoURL(item)"
:src="getItemPhotoURL(item)"
:alt="item.productNameSnapshot || '产品图片'"
fit="cover"
class="avatar"
/>
<div
v-else
class="avatar fallback"
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
/>
</template>
<template #title>
<div class="title">
<span v-text="item.productNameSnapshot || '未命名产品'" />
<product-sku-tags
:product-name="item.productNameSnapshot"
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
/>
</div>
</template>
</t-cell>
<center-tips v-if="!config.itemList?.length" :content="'暂无产品权益'" />
</t-cell-group>
<t-button
v-if="canPurchase"
class="cell-button"
theme="primary"
content="购买套餐"
@click="toPurchase"
/>
<t-button
v-if="canDelete"
class="cell-button"
theme="danger"
@click="removeConfig"
content="删除"
/>
</template>
<t-empty v-else :description="isLoading ? '正在加载套餐配置' : '套餐配置不存在'" />
</div>
</main>
</div>
</template>
@@ -228,7 +232,7 @@ onMounted(async () => {
<style scoped lang="less">
.package-config-detail {
gap: 1rem;
padding: calc(var(--app-nav-height) + 1rem) 0 2rem;
padding: 0 0 2rem;
display: flex;
flex-direction: column;