01 / Overview
cu-shop-refund-summary
退款金额的对账清单:逐行列出商品金额、运费、优惠、已退金额与可退上限,再给出本次实退;等式不成立时标题右侧出现「金额待核对」,实退超过可退上限时实退数字标红;可选显示计算式与优惠分摊。
售后
11 条 props
0 事件
已实现
02 / Demo
实时预览
演示页:/pages/shop-order/refund-summary。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。
依赖
- Shop 共享件:
locale/index.uts(cuShopT/cuShopTf)、utils/price.uts(formatFen)、store/shop-config.uts(shopCurrencySymbol)、utils/after-sale.uts(allocateDiscount/isRefundConsistent)
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| goodsFen | 商品金额(分) | number | 0 |
| freightFen | 运费(分) | number | 0 |
| discountFen | 优惠分摊(分,正数表示减免) | number | 0 |
| refundedFen | 已退金额(分) | number | 0 |
| refundableFen | 本次可退上限(分) | number | 0 |
| refundFen | 本次实退(分) | number | 0 |
| showFormula | 是否显示计算式与分摊行 | boolean | true |
| customStyle | 根节点自定义样式 | Object | {} |
| customClass | 根节点自定义类名 | string | '' |
| url | 透传字段,本件未接线 | string | '' |
| linkType | 透传字段,本件未接线 | string | 'navigateTo' |
events
本件不派发事件。
slots
| 插槽 | 作用域 | 说明 |
|---|---|---|
| extra | 无 | 清单末尾追加内容 |
04 / Example
代码示例
<cu-shop-refund-summary :goodsFen="26400" :freightFen="800" :discountFen="1200"
:refundedFen="0" :refundableFen="26000" :refundFen="26000" />
05 / Notes
注意事项
不变量 goods + freight − discount − refunded = refundable 由 isRefundConsistent 判定;不成立只显示「金额待核对」红字,不替宿主重算。
refundFen > refundableFen 时实退数字标红加粗;组件不弹提示、不拦截,是否允许提交由父级校验。
优惠分摊走 allocateDiscount:按商品金额占比向下取整,尾差落到运费行;仅 showFormula=true 且 discountFen > 0 时显示分摊行。
计算式固定输出 商品 + 运费 - 优惠 - 已退 = 可退上限;discountFen / refundedFen 为 0 时行内显示 ¥0.00。
纯展示件:无事件、不请求接口、不持久化、不弹轻提示。
安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。