01 / Overview
cu-shop-order-progress
订单详情的物流与履约进度条:按节点数组渲染横向或纵向轨迹,当前节点高亮,异常节点同时用颜色与文案标记。
订单
8 条 props
1 事件
已实现
02 / Demo
实时预览
演示页:/pages/shop-order/order-progress。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。
依赖
- 基础件:无
- Shop 共享件:
locale/index.uts(cuShopT)、utils/shop-date.uts(formatMonthDay) - 实体:
ShopOrderProgressNode(code/title/text/createdAt/isActive)
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| nodes | 节点数组(ShopOrderProgressNode);可选 status 取 done / current / pending / exception | Array | [] |
| current | 当前节点下标;越界时回退首个 isActive 节点,再回退 0 | number | 0 |
| vertical | 是否纵向;节点数超过 5 时强制纵向 | boolean | false |
| showTime | 是否显示节点时间 | boolean | true |
| customStyle | 根节点自定义样式 | Object | {} |
| customClass | 根节点自定义类名 | string | '' |
| url | 透传字段,本件未接线 | string | '' |
| linkType | 透传字段,本件未接线 | string | 'navigateTo' |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @clickNode | 点击某一节点 | { node, index } |
slots
| 插槽 | 作用域 | 说明 |
|---|---|---|
| extra | 无 | 进度列表上方补充内容 |
| footer | 无 | 进度列表下方补充内容 |
04 / Example
代码示例
<cu-shop-order-progress :nodes="progress.nodes" :current="progress.currentIndex" :showTime="true"
@clickNode="onClickNode" />
05 / Notes
注意事项
节点状态优先读可选 status;缺省按 current 与下标推导 done / current / pending。
节点数超过 5 或 vertical=true 时转纵向,横向最多 5 个节点。
异常节点用红点加「异常」角标,颜色与文案同时表达。
时间走 formatMonthDay 格式化为「月日」,createdAt 为空不显示。
不请求接口、不持久化、不弹 toast。
安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。