【发布时间】:2020-03-14 07:59:00
【问题描述】:
我们必须在我们的胶囊中实现一个订票系统,我们需要选择框来选择票。但我在 Bixby 中没有选择框。所以,我使用滑块来选择。在那我必须用输入表单元素滑块显示事件。但是,无法在一页上显示 js 详细信息和滑块。
链接:https://bixbydevelopers.com/dev/docs/reference/type/input-view.render.form.elements.slider
行动:
action (Book) {
type(Search)
collect {
input (rating) {
type (Rating)
min (Required) max (One)
}
input (event) {
type (Event)
min (Optional) max (One)
}
}
output (OrderBooking)
}
结构:
structure (OrderBooking){
property (event) {
type (Event)
min (Optional)
max (One)
}
property (rating){
type (Rating)
min (Required)
max (One)
}
}
查看:
input-view {
match {
OrderBooking (rating)
}
render {
form {
elements {
slider {
id (rating)
min-value (0)
max-value (10)
min-label (0 - Lowest)
max-label (10 - Highest)
step (1)
type (Rating)
}
}
on-submit {
goal: Rating
value: viv.core.FormElement(rating)
}
}
if (exists(rating.ticketName)){
selection-of (rating) {
navigation-mode {
read-many {
page-size (3)
page-content{
underflow-statement (This is the final set)
item-selection-question {
if(exists(rating.ticketName)){
template ("Here are a few suggestions for the events.")
}else{
template (Which one would you like)
}
}
overflow-statement (That's all I have)
}
}
}
has-details (false)
where-each (item) {
layout-macro (book-type-summary) {
param (singlebook) {
expression (item)
}
}
}
}
}
}
}
布局:
layout-macro-def(book-type-summary) {
params {
param (singlebook) {
type (OrderBooking)
min (Required)
max (One)
}
}
content {
compound-card {
content {
paragraph {
value {
if (exists(singlebook.event)){
template ("#{value(singlebook.event)}")
}
}
style (Detail_M)
}
}
}
}
}
【问题讨论】:
标签: bixby bixbystudio