ReceiptItem class

用于简化将项目添加到收据卡的 Builder 类。

构造函数

ReceiptItem(Session)

创建新的 ReceiptItem。

方法

create(Session, string, TextType)

创建新的 ReceiptItem。

image(ICardImage | IIsCardImage)

要显示在卡片上的图像。 某些通道可能会将图像作为单独的消息发送,或者只是包含指向图像的链接。

price(string)

金额与货币。

quantity(string)

给定类型的项数。

subtitle(TextType, any[])

副标题显示在“标题”字段下方,仅在字体样式上与“标题”不同。 在某些频道上,可能会与 标题文本组合使用。

tap(ICardAction | IIsCardAction)

当用户点击“项”气泡时,将激活此操作。 并非所有频道都支持点击操作。

text(TextType, any[])

文本字段显示在副标题下方,仅在字体样式上与副标题不同。

title(TextType, any[])

项的标题。

toItem()

返回项的 JSON。

构造函数详细信息

ReceiptItem(Session)

创建新的 ReceiptItem。

new ReceiptItem(session?: Session)

参数

session
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)

参数

返回

price(string)

金额与货币。

function price(v: string)

参数

v

string

返回

quantity(string)

给定类型的项数。

function quantity(v: string)

参数

v

string

返回

subtitle(TextType, any[])

副标题显示在“标题”字段下方,仅在字体样式上与“标题”不同。 在某些频道上,可能会与 标题文本组合使用。

function subtitle(text: TextType, args: any[])

参数

text
TextType
args

any[]

返回

tap(ICardAction | IIsCardAction)

当用户点击“项”气泡时,将激活此操作。 并非所有频道都支持点击操作。

function tap(action: ICardAction | IIsCardAction)

参数

返回

text(TextType, any[])

文本字段显示在副标题下方,仅在字体样式上与副标题不同。

function text(text: TextType, args: any[])

参数

text
TextType
args

any[]

返回

title(TextType, any[])

项的标题。

function title(text: TextType, args: any[])

参数

text
TextType
args

any[]

返回

toItem()

返回项的 JSON。

function toItem()

返回