For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/templates/checkout-card.md.

确认订单卡

CheckoutCard 用于承载商品或服务的订单信息和后续操作,适合交易前的订单核对、下单确认和支付确认。

CheckoutCard 确认订单卡效果

示例

import { CheckoutCard, type CheckoutCardProductItem } from '@doubao-dev/template';

const productItems: CheckoutCardProductItem[] = [
  {
    key: 'set-001',
    tagText: '新',
    tagTone: 'highlight',
    title: '双人下午茶套餐',
    spec: '2 杯饮品 + 2 款甜点',
    imageSrc: 'https://example.com/afternoon-tea.png',
    price: '¥68',
    quantity: 1
  },
  {
    key: 'coffee-001',
    title: '榛果拿铁',
    spec: '少糖 · 热饮',
    price: '¥28',
    quantity: 2,
    showChevron: false
  }
];

export default function AfternoonTeaCheckoutCard() {
  return (
    <CheckoutCard
      productItems={productItems}
      infoItems={[
        { key: 'store', label: '提单门店', value: '朝阳大悦城店' },
        { key: 'time', label: '预计时间', value: '今天 15:30', valueExtra: '到店自取' }
      ]}
      feeItems={[
        { key: 'discount', label: '优惠', value: '-¥12' },
        { key: 'package', label: '包装费', value: '¥2' },
        { key: 'service', label: '服务费', value: '¥0' }
      ]}
      totalLabel="合计"
      totalPrice="¥126"
      footer={{
        secondaryActionButton: {
          text: '修改',
          onClick: () => console.log('edit')
        },
        primaryActionButton: {
          text: '提交订单',
          onClick: () => console.log('submit')
        }
      }}
    />
  );
}

主要 Props

Prop类型说明
headerTemplateCardHeaderProps标题栏及右侧操作入口
productItemsCheckoutCardProductItem[]单个或多个商品摘要
infoItemsCheckoutCardInfoItem[]提单信息列表
feeItemsCheckoutCardFeeItem[]费用明细,也用于优惠信息
totalLabel / totalPricestring / TemplateText合计标签和价格
footerTemplateCardFooterProps底部主、次操作按钮

使用说明

  • productItems 支持单个或多个商品。常用字段包括 title、tagText、tagTone、spec、imageSrc、image、pricePrefix、price、quantity、showChevron 和 onClick;tagText 展示在标题前,tagTone="highlight" 使用强调色。
  • image 只支持直接传入的 <image /> 或 <svg />,优先级高于 imageSrc。
  • infoItems 的 value 和 valueExtra 均支持 TemplateText,使用相同样式并与左侧 label 的首行对齐。
  • feeItems、totalLabel 和 totalPrice 作为一个整体配置费用汇总,最多展示两行;优惠信息也通过 feeItems 传入。
  • 底部按钮使用 footer.primaryActionButton 和 footer.secondaryActionButton。