Wix Velo:获取要通过 checkoutBooking 提交的表单字段?

问题描述 投票:0回答:1

使用 checkoutBooking 时需要提交的参数之一是 FormFields 集合对象,该对象基于我想要预订的服务的自定义预订表单。我正在从我自己创建的自定义注册表单中收集 checkoutBooking 的客户数据。在查看示例时,我发现 FormField 对象应该有一个键值对,其中键是自定义预订表单使用的每个字段的“_id”。我不知道如何获取这些“_id”号码。在这种情况下,我如何使用我预订的服务的正确信息成功实例化 FormFields 对象?

velo
1个回答
0
投票

Wix 仪表板中有一个区域称为 CMS。 CMS 代表内容管理系统,包含站点中数据对象的定义。 这包括“Wix 应用程序集合”。 在此类别下,有“日程”、“服务”和“员工”子类别。 如果您进入“服务”子类别,您将看到一个表,其中表示已为站点定义的所有服务对象。 该表中的最后一列是“表单字段”列。 该列定义了该服务的预订表单中的所有表单字段。 它包含每个表单字段的定义,包括每个字段的唯一 ID。

例如:

{
  "fields": [
    {
      "_id": "00000000-0000-0000-0000-00000000000",
      "label": "Email",
      "constraints": {
        "required": true
      },
      "link": null,
      "type": "email"
    },
    {
      "_id": "00000000-0000-0000-0000-00000000000",
      "label": "Phone Number",
      "constraints": {
        "required": false
      },
      "link": null,
      "type": "tel"
    },
    {
      "_id": "00000000-0000-0000-0000-00000000000",
      "label": "Name",
      "constraints": {
        "required": true
      },
      "link": null,
      "type": "text"
    },
    {
      "_id": "ea32d7b8-8234-4911-939d-b0e41f1cf6",
      "label": "Referral",
      "constraints": {
        "required": false
      },
      "link": null,
      "type": "text"
    }
  ]
}
© www.soinside.com 2019 - 2024. All rights reserved.