电商组件 / 发票 / cu-shop-invoice-detail 发票详情
01 / Overview

cu-shop-invoice-detail

发票详情面板:抬头、金额、类型、税号、订单号、发票号码 / 代码、开票时间与收票邮箱,状态徽标显示待开 / 已开 / 已驳回,驳回时展示原因;长数字每 4 位分组,复制、重发与下载只发事件。

发票 7 条 props 3 事件 已实现
02 / Demo

实时预览

演示页:/pages/shop-order/invoice-detail。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。

依赖

  • 基础件:cu-button、cu-loading-icon
  • Shop 共享件:locale/index.uts(cuShopT)、utils/price.uts(formatFen)、store/shop-config.uts(shopCurrencySymbol)
03 / Props · Events · Slots

全量契约

props

参数说明类型默认值
invoice发票实体 ShopInvoice,读 id / title / status / type / titleType / taxNo / orderId / invoiceNo / invoiceCode / issuedAt / email / downloadUrl / rejectReason / amountFenObject必填
showActions显示重发与下载操作行booleantrue
loading加载中替换主体,只保留 header / footer 插槽booleanfalse
customStyle根节点自定义样式Object{}
customClass根节点自定义类名string''
url透传字段,本件未接线string''
linkType透传字段,本件未接线string'navigateTo'

events

事件说明载荷
@resend点「重发到邮箱」;email 为空时按钮禁用{ email }
@download点「下载发票」;downloadUrl 为空时按钮禁用{ url }
@copy点复制;field 取 taxNo / orderId / invoiceNo / invoiceCode,text 为原文{ text, field }

slots

插槽作用域说明
header无面板顶部
footer无面板底部
04 / Example

代码示例

uvue
<cu-shop-invoice-detail :invoice="invoice" :showActions="true" :loading="false"
	@resend="onResend" @download="onDownload" @copy="onCopy">
	<template #header><text>发票抬头提示</text></template>
	<template #footer><text>如需换开请联系客服</text></template>
</cu-shop-invoice-detail>
05 / Notes

注意事项

空态:id / title / invoiceNo 三者皆空时显示空态文案;否则缺失字段显示 -。

长数字分组:taxNo / orderId / invoiceNo / invoiceCode 为纯数字且长度大于 4 时每 4 位从右分组显示;复制取未分组原文,非纯数字原样显示。

金额只走 utils/price.uts 的 formatFen(amountFen, true, shopCurrencySymbol),不自行拼货币符号。

状态徽标:pending 待开 / issued 已开 / rejected 已驳回;其它值显示 -。

驳回原因仅在 status=rejected 且 rejectReason 非空时展示。

issuedAt 按 ISO 字符串截取「前 10 位 + 空格 + 第 11–16 位」,不转时区。

复制、重发与下载只 emit,不写剪贴板、不调下载 API。

不请求接口、不持久化、不弹 toast。

安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。