我的应用基本上向用户提供了三种选择。
1:我正在使用result-view
和cell-card
。当我使用每种卡时,我可以单击卡并触发一个意图,该意图以compound-card
的形式向用户显示更多详细信息。现在,要让用户通过说第一,第二或第三来选择选项,我需要使用navigation-support
,为此,我需要在list-of
中使用result-view
。使用list-of
后,我无法触发意图on-click
。如何实现?
2:如果用户说的是第一,第二或第三,则如何触发该意图。现在,如果用户通过说第一,第二和第三来进行选择,则会弹出除其他两个之外的cell-card
。如何实现?
我的结果视图是:
result-view {
match: ArtistChoiceResult (artistchoice) {
from-output: ArtistChoice
}
message {template("Here is the upcoming event")}
list-of (artistchoice) {
navigation-mode {
read-many {
page-size(3)
underflow-statement (This is the first set)
item-selection-question (Which one would you like?)
overflow-statement (That's all I have)
}
}
where-each (one) {
layout-match (one) {
mode (Summary)
}
}
}
layout-match
就是这样
layout {
match: ArtistChoiceResult (singleArtist)
mode(Summary)
content{
section{
content{
cell-card {
slot1 {
image {
url ("#{value(singleArtist.multiple_image)}")
shape (Square)
}
}
slot2 {
content {
order (PrimarySecondary)
primary ("#{value(singleArtist.multiple_name)}")
secondary ("#{value(singleArtist.multiple_cat)}")
}
}
on-click {
intent {
goal: ArtistChoice
value-set:MultipleID{$expr(singleArtist.multiple_id)}
}
}
}
}
}
}
}
导航支持文件为
navigation-support {
match: ArtistChoiceResult (this)
ordinal-selection-patterns {
pattern ("(first)[v:viv.core.OrdinalSelector]")
pattern ("(first)[v:viv.core.OrdinalSelector] one")
pattern ("that (first)[v:viv.core.OrdinalSelector] one")
pattern ("yes (first)[v:viv.core.OrdinalSelector]")
pattern ("yes (first)[v:viv.core.OrdinalSelector] one")
pattern ("yes that (first)[v:viv.core.OrdinalSelector] one")
pattern ("result number (one)[v:viv.core.CardinalSelector:1]")
pattern ("the (first)[v:viv.core.CardinalSelector:1]")
pattern ("select (first)[v:viv.core.OrdinalSelector] one")
pattern ("select (first)[v:viv.core.OrdinalSelector]")
}
}
答案 0 :(得分:1)
您的代码有几个问题
您已在“摘要”布局中创建了一个意图。该文件说, https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.cell-card
如果您有这张卡片可以列出带有-of的结果,请点击 卡会在“详细信息”模式下打开所选项目,并且未传递定义的意图
如果尝试在layout-match
中使用where-each
,则IDE将显示WARN_DEPRECATED
错误。尽管这可能现在不会引发编译错误,但建议使用layout-macro
建议尝试: