【发布时间】:2019-05-21 21:11:42
【问题描述】:
我花了很长时间查看文档,但在运行我的操作之前无法显示确认视图。向胶囊中添加确认视图的步骤是什么?
我有一个名为Evaluate 的操作和一个地址输入,我会自动从用户的个人资料中提取。我想在运行Evaluate之前确认这个地址,以防用户想使用不同的地址
这是我所做的:
1) 在 capsule.bxb 中导入 viv.common:
import (viv.common) {
as (common)
version (3.30.0)
}
2) 在 Evaluate 操作中添加确认/按语句:
confirm {
by (common.Confirmation)
}
3) 添加一个与评估操作匹配的确认视图:
confirmation-view {
match: common.Confirmation {
confirming {Evaluate (action) }
}
mode (PositiveEmphasis)
message ("Is this the correct address?")
render {
layout {
section {
content{
paragraph {
style (Title_XS)
value {
template (
"#{value(action.address)}}?"
)
}
}
}
}
}
}
confirm-options {
label ("Yes")
}
abort-options {
label ("Try another Address")
on-abort {
intent {
goal: InputAddress
}
}
}
}
我希望这样做,但我想我还缺少其他东西。有什么想法吗?
【问题讨论】:
标签: bixby