ReceiptItem class
用于简化将项目添加到收据卡的 Builder 类。
构造函数
Receipt |
创建新的 ReceiptItem。 |
方法
create(Session, string, Text |
创建新的 ReceiptItem。 |
image(ICard |
要显示在卡片上的图像。 某些通道可能会将图像作为单独的消息发送,或者只是包含指向图像的链接。 |
price(string) | 金额与货币。 |
quantity(string) | 给定类型的项数。 |
subtitle(Text |
|
tap(ICard |
当用户点击“项”气泡时,将激活此操作。 并非所有频道都支持点击操作。 |
text(Text |
文本字段显示在副标题下方,仅在字体样式上与副标题不同。 |
title(Text |
项的标题。 |
to |
返回项的 JSON。 |
构造函数详细信息
ReceiptItem(Session)
方法详细信息
create(Session, string, TextType)
创建新的 ReceiptItem。
static function create(session: Session, price: string, title?: TextType)
参数
- session
- Session
- price
-
string
- title
- TextType
返回
image(ICardImage | IIsCardImage)
要显示在卡片上的图像。 某些通道可能会将图像作为单独的消息发送,或者只是包含指向图像的链接。
function image(img: ICardImage | IIsCardImage)
参数
- img
返回
price(string)
quantity(string)
subtitle(TextType, any[])
副标题显示在“标题”字段下方,仅在字体样式上与“标题”不同。 在某些频道上,可能会与 标题 或 文本组合使用。
function subtitle(text: TextType, args: any[])
参数
- text
- TextType
- args
-
any[]
返回
tap(ICardAction | IIsCardAction)
当用户点击“项”气泡时,将激活此操作。 并非所有频道都支持点击操作。
function tap(action: ICardAction | IIsCardAction)
参数
- action
返回
text(TextType, any[])
文本字段显示在副标题下方,仅在字体样式上与副标题不同。
function text(text: TextType, args: any[])
参数
- text
- TextType
- args
-
any[]