【问题标题】:Bixby : Display form element slider along with other informationBixby:显示表单元素滑块以及其他信息
【发布时间】: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


    【解决方案1】:

    这个问题有两点:

    1. 您似乎希望在input-view 中显示其他信息。目前这是不可能的。您不能添加不符合您想要呈现给用户的形式的内容。
    2. 使用selection-of (documentation) 来代替滑块可能会更好

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多