Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
Last active September 7, 2015 09:58
Show Gist options
  • Save shaobin0604/fb4219678da5e8507549 to your computer and use it in GitHub Desktop.
Save shaobin0604/fb4219678da5e8507549 to your computer and use it in GitHub Desktop.
附近信息提交模板
{
"id": 1,
"version": 1,
"title": "二手车信息采集",
"entries": [
{
"key": "email",
"name": "电子邮件",
"optional": false,
"widget": "edittext",
"widget_params": {
"hint": "请输入电子邮件",
"input_type": "textEmailAddress",
"validators": [
{
"name": "email",
"error_msg": "邮件格式不正确"
}
]
}
},
{
"key": "phone",
"name": "电话号码",
"optional": false,
"widget": "edittext",
"widget_params": {
"hint": "请输入电话号码",
"input_type": "phone",
"validators": [
{
"name": "phone",
"error_msg": "电话号码格式不正确"
}
]
}
},
{
"key": "work_age",
"name": "工作年限",
"optional": false,
"widget": "single_choice",
"widget_params": {
"entry_names": [
"小于三年",
"三年到五年",
"五年到十年",
"十年以上"
],
"entry_values": [
"1",
"2",
"3",
"4"
]
}
},
{
"key": "channel",
"name": "发布渠道",
"optional": false,
"widget": "multi_choice",
"widget_params": {
"entry_names": [
"豌豆荚",
"360",
"百度",
"酷市场"
],
"entry_values": [
"1",
"2",
"3",
"4"
]
}
},
{
"key": "birthday",
"name": "生日",
"optional": false,
"widget": "datepicker",
"widget_params": {
"initial_date": "2015-06-04",
"min_date": "1970-01-01",
"max_date": "2035-01-01"
}
},
{
"key": "begin_time",
"name": "开门时间",
"optional": false,
"widget": "timepicker",
"widget_params": {
"initial_time": "09:00:00"
}
},
{
"key": "address",
"name": "详细地址",
"optional": false,
"widget": "address",
"widget_params": {}
},
{
"key": "photo_id_card",
"name": "身份证",
"optional": false,
"widget": "photo",
"widget_params": {
"photo_list": [
"NAME_CARD_FRONT",
"NAME_CARD_BEHIND"
]
}
}
]
}
## 表单模板格式
id # 表单标识
version # 表单版本
title # 表单名称
entries # 表单项目列表
key # http form post param name
name # 界面展示名称
optional # 是否为可选参数
widget # 控件类型,目前支持[edittext, single_choice, multi_choice, datepicker, timepicker, photo, address]
widget_params # 控件参数,不同控件类型参数可能不同
## widget_params
### edittext
- hint
- input_type
- validators
- phone, email, numeric, range, regex # 不同的类型参数可能不同
### single_choice
- entry_names
- entry_values
### multi_choice
- entry_names
- entry_values
### datepicker
- initial_date
- min_date
- max_date
### timepicker
- initial_time
### photo
- photo_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment