## 自定义表单(Diyform)
## 获取字段接口\[index\]【编辑需登录】
获取编辑或添加的表单字段接口
### 请求URL
http://www.yoursite.com/addons/cms/api.diyform/index
### 请求方法
GET
### 请求参数
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
| --- | --- | --- | --- | --- |
| diyname | string | 否 | 表单名称,为空则默认第一个 | message |
| id | number | 否 | 表单数据id,编辑时传 | 1 |
### 返回值
~~~json
{
"code": 1,
"msg": "",
"time": "1616741008",
"data": {
"diyform": {
"id": 1,
"name": "留言",
"title": "留言",
"seotitle": "",
"keywords": "留言板",
"description": "欢迎给我们留言反馈你的问题",
"fields": "name,telephone",
"needlogin": 0,
"isedit": 1,
"successtips": "留言已成功提交,我们会在第一时间进行处理",
"redirecturl": "",
"diyname": "message",
"usermode": "all",
"statusmode": "normal",
"createtime": 1540091957,
"updatetime": 1606787163,
"setting": {
"orderfields": [
"createtime"
]
},
"status": "normal",
"url": "/cms/d/message.html"
},
"fields": [
{
"id": 1,
"source": "diyform",
"source_id": 1,
"name": "name",
"type": "string",
"title": "姓名",
"content": "value1|title1\r\nvalue2|title2",
"defaultvalue": "",
"rule": "required",
"msg": "",
"ok": "",
"tip": "",
"decimals": 0,
"length": 50,
"minimum": 0,
"maximum": 0,
"extend": "",
"setting": null,
"weigh": 136,
"createtime": 1540110334,
"updatetime": 1540110334,
"isorder": 0,
"iscontribute": 1,
"isfilter": 0,
"status": "normal",
"value": "",
"content_list": "value1|title1\r\nvalue2|title2",
"isrequire": true
},
{
"id": 2,
"source": "diyform",
"source_id": 1,
"name": "telephone",
"type": "string",
"title": "手机",
"content": "value1|title1\r\nvalue2|title2",
"defaultvalue": "",
"rule": "required; mobile",
"msg": "",
"ok": "",
"tip": "",
"decimals": 0,
"length": 50,
"minimum": 0,
"maximum": 0,
"extend": "",
"setting": null,
"weigh": 135,
"createtime": 1540110369,
"updatetime": 1540110369,
"isorder": 0,
"iscontribute": 1,
"isfilter": 0,
"status": "normal",
"value": "",
"content_list": "value1|title1\r\nvalue2|title2",
"isrequire": false
}
]
}
}
~~~
## 提交或修改表单数据接口\[postForm\]【需登录】
提交或修改表单数据
### 请求URL
http://www.yoursite.com/addons/cms/api.diyform/postForm
### 请求方法
POST
### 请求参数
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
| --- | --- | --- | --- | --- |
| {} | object | 是 | 提交的表单对象数据 | {name:"测试",telephone:"18333333333"} |
### 返回值
~~~json
{
"code": 1,
"msg": "留言已成功提交,我们会在第一时间进行处理",
"time": "1616741526",
"data": null
}
~~~
## 获取表单数据列表接口\[formList\]
获取表单数据列表接口
### 请求URL
http://www.yoursite.com/addons/cms/api.diyform/formList
### 请求方法
GET
### 请求参数
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
| --- | --- | --- | --- | --- |
| orderby | string | 否 | 排序字段 | default |
| orderway | string | 否 | 排序方式 | desc |
| page | number | 是 | 文档id | 1 |
| diyname | string | 否 | 表单名称,为空则默认第一个 | message |
> 更多条件见`filterList`和`orderList`
### 返回值
~~~json
{
"code": 1,
"msg": "",
"time": "1616741960",
"data": {
"pageList": {
"total": 3,
"per_page": 15,
"current_page": 1,
"last_page": 1,
"data": [
{
"id": 9,
"user_id": 1,
"name": "留言君",
"telephone": "18333333333",
"qq": "123456",
"content": "史蒂夫",
"os": "windows",
"language": "zh-cn",
"address": "河北省/秦皇岛市/昌黎县",
"category": "1,2",
"memo": "",
"image": [
"http://www.fa.com/uploads/2021/20210326/be50b9c1759142a4fb2e885f1de39aac.png"
],
"createtime": 1616741527,
"updatetime": 1616741527,
"status": "hidden",
"PHP": "2021-03-17 00:00:00 - 2021-03-19 23:59:59",
"title": "",
"images": "",
"mobile": "value1"
},
{
"id": 6,
"user_id": 1,
"name": "PHP",
"telephone": "18589834416",
"qq": "1261502635",
"content": "sdfsdf789789",
"os": "windows",
"language": "zh-cn,en",
"address": "广西壮族自治区/贺州市/昭平县",
"category": "Android开发,CRM系统 ,SASS平台软件,官方新闻,微信公众号,测试1",
"memo": "",
"image": [
"http://www.fa.com/uploads/2020/20200901/5871cf963ae2d5e2565b7a997db8500c.png"
],
"createtime": 1598947226,
"updatetime": 1598947774,
"status": "hidden",
"PHP": "",
"title": "",
"images": "",
"mobile": null
},
{
"id": 5,
"user_id": 1,
"name": "赵六",
"telephone": "13411111111",
"qq": "123456",
"content": "一键压缩打包JS和CSS文件,一键CDN静态资源部署,一键生成控制器菜单和规则",
"os": "windows",
"language": "zh-cn",
"address": "安徽省/芜湖市/弋江区",
"category": "12,1",
"memo": "需要需要需要需要",
"image": [
"https://cdn.demo.fastadmin.net/uploads/2019/20190328/30752b442c826ab7d3a63f1ddfb5d9ac.png",
"https://cdn.demo.fastadmin.net/uploads/2019/20190328/c9abe74b02cd5789f08bb47e5d18d1aa.png",
"https://cdn.demo.fastadmin.net/uploads/2019/20190328/242c72f8f3d4515b045875d4093d4bfa.png",
"https://cdn.demo.fastadmin.net/uploads/2019/20190328/c503015461309deefc8d75be6372bbe4.png"
],
"createtime": 1597200638,
"updatetime": 1597221389,
"status": "hidden",
"PHP": "",
"title": "",
"images": "",
"mobile": null
}
]
},
"orderList": [
{
"name": "default",
"field": "createtime DESC,id DESC",
"title": "默认",
"active": true,
"url": "?filter[language]=zh-cn&orderby=default&orderway=asc"
},
{
"name": "createtime",
"field": "createtime",
"title": "添加时间",
"active": false,
"url": "?filter[language]=zh-cn&orderby=createtime&orderway=desc"
}
],
"filterList": [
{
"name": "os",
"title": "操作系统",
"content": [
{
"value": "",
"title": "全部",
"active": true,
"url": "?language=zh-cn&orderby=default&orderway=desc"
},
{
"value": "windows",
"title": "Windows",
"active": false,
"url": "?language=zh-cn&os=windows&orderby=default&orderway=desc"
},
{
"value": "mac",
"title": "Mac",
"active": false,
"url": "?language=zh-cn&os=mac&orderby=default&orderway=desc"
}
]
},
{
"name": "language",
"title": "语言",
"content": [
{
"value": "",
"title": "全部",
"active": false,
"url": "?orderby=default&orderway=desc"
},
{
"value": "zh-cn",
"title": "中文",
"active": true,
"url": "?language=&orderby=default&orderway=desc"
},
{
"value": "en",
"title": "英文",
"active": false,
"url": "?language=en&orderby=default&orderway=desc"
}
]
},
{
"name": "mobile",
"title": "手机号码",
"content": [
{
"value": "",
"title": "全部",
"active": true,
"url": "?language=zh-cn&orderby=default&orderway=desc"
},
{
"value": "value1",
"title": "title1",
"active": false,
"url": "?language=zh-cn&mobile=value1&orderby=default&orderway=desc"
},
{
"value": "value2",
"title": "title2",
"active": false,
"url": "?language=zh-cn&mobile=value2&orderby=default&orderway=desc"
}
]
}
]
}
}
~~~
## 绑定详情\[show\]
绑定详情
### 请求URL
http://www.yoursite.com/addons/cms/api.diyform/show
### 请求方法
GET
### 请求参数
| Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. |
| --- | --- | --- | --- | --- |
| diyname | string | 否 | 表单名称,为空则默认第一个 | message |
| id | number | 是 | 表单数据id | 1 |
### 返回值
~~~json
{
"code": 1,
"msg": "",
"time": "1616747583",
"data": {
"fieldsList": [
{
"id": 1,
"source": "diyform",
"source_id": 1,
"name": "name",
"type": "string",
"title": "姓名",
"content": "value1|title1\r\nvalue2|title2",
"defaultvalue": "",
"rule": "required",
"msg": "",
"ok": "",
"tip": "",
"decimals": 0,
"length": 50,
"minimum": 0,
"maximum": 0,
"extend": "",
"setting": null,
"weigh": 136,
"createtime": 1540110334,
"updatetime": 1540110334,
"isorder": 0,
"iscontribute": 1,
"isfilter": 0,
"status": "normal",
"value": "PHP",
"content_list": "value1|title1\r\nvalue2|title2",
"isrequire": true
},
{
"id": 2,
"source": "diyform",
"source_id": 1,
"name": "telephone",
"type": "string",
"title": "手机",
"content": "value1|title1\r\nvalue2|title2",
"defaultvalue": "",
"rule": "required; mobile",
"msg": "",
"ok": "",
"tip": "",
"decimals": 0,
"length": 50,
"minimum": 0,
"maximum": 0,
"extend": "",
"setting": null,
"weigh": 135,
"createtime": 1540110369,
"updatetime": 1540110369,
"isorder": 0,
"iscontribute": 1,
"isfilter": 0,
"status": "normal",
"value": "18589834416",
"content_list": "value1|title1\r\nvalue2|title2",
"isrequire": false
}
],
"diydata": {
"id": 6,
"user_id": 1,
"name": "PHP",
"telephone": "18589834416",
"qq": "1261502635",
"content": "sdfsdf789789",
"os": "windows",
"language": "zh-cn,en",
"address": "广西壮族自治区/贺州市/昭平县",
"category": "Android开发,CRM系统 ,SASS平台软件,官方新闻,微信公众号,测试1",
"memo": "",
"image": "/uploads/2020/20200901/5871cf963ae2d5e2565b7a997db8500c.png",
"createtime": 1598947226,
"updatetime": 1598947774,
"status": "hidden",
"PHP": "",
"title": "",
"images": "",
"mobile": null
},
"diyform": {
"id": 1,
"name": "留言",
"title": "留言",
"seotitle": "",
"keywords": "留言板",
"description": "欢迎给我们留言反馈你的问题",
"fields": "name,telephone,qq,content,image,os,language,address,category,PHP,mobile",
"needlogin": 0,
"isedit": 1,
"successtips": "留言已成功提交,我们会在第一时间进行处理",
"redirecturl": "",
"diyname": "message",
"usermode": "all",
"statusmode": "normal",
"createtime": 1540091957,
"updatetime": 1606787163,
"setting": {
"orderfields": [
"createtime"
]
},
"status": "normal",
"url": "/cms/d/message.html"
}
}
}
~~~
- 概述
- 安装
- 配置
- 模板
- 标签
- 全局标签
- 文档/文档列表
- 专题/专题列表
- 栏目/栏目列表
- 公共参数
- 单页/单页列表
- 特殊标签
- 栏目列表页
- 分页标签
- 自定义字段
- ThinkPHP5标签
- 自定义表单数据列表
- 自定义过滤条件
- 用户信息
- 模板目录
- API
- 小程序
- 控制器
- Archives.php
- Base.php
- Common.php
- Index.php
- My.php
- User.php
- 准备工作
- 导入项目
- 修改配置
- 测试数据
- 多语言
- 常见问题
- Uniapp版
- 1.准备工作
- 1.HbuilderX安装
- 2.Hbuilder 插件安装
- 2.导入项目
- 3.运行项目
- 1.运行前的配置
- 2.运行为H5
- 3.运行为微信小程序
- 4.运行为APP
- 4.项目发布
- 1.发布H5端
- 2.发布微信小程序
- 3.发布APP
- 5.登录配置
- 6.常见问题
- 1.关于自定义导航栏切换闪烁问题
- 2.关于后台移动端样式预览问题
- 3.关于支付配置的问题
- 4.前端跨域的问题
- 5.关于各端内容分享的问题
- 6.关于签到问题
- 7.关于公众号授权登录问题
- 8.关于底部导航的追加或删除问题
- 9.运行微信小程序,进入微信小程序客户端后,没有底部菜单
- 10.关于首页焦点图的修改
- 11.关于发布小程序代码大小超出的问题
- 12.前端显示空白或白屏或提示网络请求错误的问题
- 13.关于如何在非tabbar配置页面显示tabbar导航
- 14.关于更换资讯页为主页的问题
- 15.关于更新1.4.4版本分包问题
- 16.Tabbar底部高亮显示问题
- 17.微信小程序获取手机号失败
- 18.微信小程序从页面侧滑返回或按键返回时Tabbar丢失的问题
- 19.Tabbar底部不支持外部链接的修复方法
- API文档
- 公共接口(Common)
- 文档接口(Archives)
- 评论接口(Comment)
- 自定义表单(Diyform)
- 短信验证码(Sms)
- 邮箱验证码(Ems)
- 登录/注册(Login)
- 我的接口(My)
- 搜索文档(Search)
- 标签文档(Tag)
- 日志中心(TheLogs)
- 会员中心(User)
- 专题接口(Special)
- 功能解说
- 自动内链
- 自定义表单
- 区块管理
- 栏目管理
- 模型管理
- 伪静态
- Sitemap
- 安全更新