0

我的应用程序基本上为用户提供了三种选择。

1:我正在使用result-viewcell-card。当我使用每个卡片时,我能够点击卡片并触发一个意图,该意图以compound-card. 现在,为了让用户通过说第一、第二或第三来选择选项,我需要使用navigation-support,为此我需要list-ofresult-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]")
  }
}
4

1 回答 1

0

您的代码有几个问题

  1. 您已在摘要布局中创建了一个意图。文档说, https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.cell-card

    如果您有此卡以列表的形式列出结果,则单击该卡会在详细信息模式下打开所选项目,并且未传递定义的意图

  2. 如果你尝试在IDElayout-match里面where-each使用会显示WARN_DEPRECATED错误。虽然现在这可能不会引发编译错误,但建议使用layout-macro

尝试的建议:

  1. 使用 layout-macro 定义您的布局(摘要和详细信息)
  2. 在详细信息布局中添加意图
于 2019-02-19T19:58:24.823 回答