cu-shop-after-sale-detail
售后详情页主体:顶部状态大字与一句状态说明,进度节点用真实 `<view>` 绘制(不引时间线组件),其上依次是售后信息行、商品清单、协商记录、举证九宫格与底部动作;进度与协商记录都读售后单的 `steps`。
实时预览
演示页:/pages/shop-order/after-sale-detail。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。
依赖
- 基础件:
cu-tag、cu-button - Shop 共享件:
locale/index.uts(cuShopT)、utils/price.uts(formatFen)、store/shop-config.uts(shopCurrencySymbol)
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| detail | 售后单 ShopAfterSale | Object | 必填 |
| steps | 进度节点 ShopAfterSaleNode[];空则按状态推导 | Array | [] |
| loading | 骨架态 | boolean | false |
| customStyle | 根节点自定义样式 | Object | {} |
| customClass | 根节点自定义类名 | string | '' |
| url | 透传字段,本件未接线 | string | '' |
| linkType | 透传字段,本件未接线 | string | 'navigateTo' |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @click-action | 点动作按钮先发本事件,action 为 cancel / modify / contact | { action, detail } |
| @cancel | 撤销申请(仅 pending 时按钮存在) | 无 |
| @modify | 修改申请(pending / approved 时按钮存在) | 无 |
| @contact | 联系客服(按钮恒在) | 无 |
| @copy | field 为 afterSaleNo / contactPhone / trackingNo | { text, field } |
| @preview | 点举证缩略图,images 为凭证 URL 数组 | { images, index } |
slots
| 插槽 | 作用域 | 说明 |
|---|---|---|
| header | 无 | 替换默认状态区 |
| before-steps | 无 | 进度卡之前追加内容 |
| after-steps | 无 | 进度卡之后追加内容 |
| extra | 无 | 动作区之后追加内容 |
| footer | 无 | 组件末尾追加内容 |
代码示例
<cu-shop-after-sale-detail :detail="detail" @click-action="onAction" @cancel="onCancel"
@modify="onModify" @contact="onContact" @copy="onCopy" @preview="onPreview" />
注意事项
steps 元素按字典 ShopAfterSaleNode({ code, title, text, createdAt });只有 steps 为空才按 status 推导 3–5 个节点。
协商记录取 detail.steps 倒序;超过 3 条时右侧出现「查看全部 / 收起」按钮,只在本组件内展开。
举证只发 preview { images, index },不调 uni.previewImage;单号、电话、运单号只发 copy { text, field },不写剪贴板。
状态色映射:pending / refunding → warning,approved / returning → primary,completed → success,rejected → error,closed / 其他 → info;顶部大字按状态取 primary / success / danger / muted 四调。
动作推导:cancel 仅 pending;modify 在 pending / approved;contact 恒在。loading=true 时只渲染骨架。
不同步状态、不请求接口、不持久化、不弹轻提示。
安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。