Skip to content

模版子码组件(创建子码)

以下内容描述创建子码接口时子码组件数据的上送定义。

示例组件数据

json
{
    "fieldId": 1,
    "type": "text",
    "text": {
        "value": "Hello World"
    }
}
json
{
    "fieldId": 2,
    "type": "textarea",
    "textarea": {
        "value": "Hello World\nHello World"
    }
}
json
{
    "fieldId": 3,
    "type": "number",
    "number": {
        "value": 123
    }
}
json
{
    "fieldId": 4,
    "type": "date",
    "date": {
        "value": "2025-03-04"
    }
}
json
{
    "fieldId": 5,
    "type": "radio",
    "radio": {
        "value": "选项1"
    }
}
json
{
    "fieldId": 6,
    "type": "checkbox",
    "checkbox": {
        "value": ["选项1", "选项2"]
    }
}
json
{
    "fieldId": 7,
    "type": "address",
    "address": {
        "address": "浙江省宁波市海曙区灵桥路",
        "lat": 29.85957,
        "log": 121.55084
    }
}
json
{
    "fieldId": 8,
    "type": "image",
    "image": {
        "url": "https://ncstatic.clewm.net/undefined.png"
    }
}
json
{
    "fieldId": 9,
    "type": "audio",
    "audio": {
        "title": "音频标题",
        "url": "https://ncstatic.clewm.net/undefined.mp3"
    }
}

组件详情

fieldId number

组件ID


title string

组件标题


type string

组件类型

说明
text文本
textarea多行文本
number数字
date日期
radio单选项
checkbox多选项
address定位
image图片
file文件

当type使用"text"时, 上送组件内容为文本, 文本内容使用text字段。当type使用"image"时, 上送组件内容为图片, 图片内容使用image字段。以此类推。目前暂不支持视频与音频组件进行子码创建。


文本组件

text object

当内容是文本组件时上送

text.value string

文本内容


多行文本组件

textarea object

当内容是多行文本组件时上送

textarea.value string

多行文本内容


数字组件

number object

当内容是数字组件时上送

number.value number

数字内容


日期组件

date object

当内容是日期组件时上送

date.value string

日期内容


单选项组件

radio object

当内容是单选项组件时上送

radio.optionId number

单选项id,取自查询模版接口返回的单选项组件id

radio.otherValue string

其他选项内容,如果该选项是其他选项,则上送其他选项内容, 否则无需上送


多选项组件

checkbox object

当内容是多选项组件时上送

checkbox.optionCreateDataList []object

多选项列表

checkbox.optionCreateDataList[].optionId number

多选项id,取自查询模版接口返回的多选项组件id

checkbox.optionCreateDataList[].otherValue string

其他选项内容,如果该选项是其他选项,则上送其他选项内容, 否则无需上送


定位组件

address object

当内容是定位组件时上送

address.address string

地址

address.lat number

纬度

address.log number

经度


图片组件

image object

当内容是图片组件时上送

image.images []object

图片内容

image.images[].url string

图片URL


文件组件

file object

当内容是文件组件时上送

file.files []object

文件内容

file.files[].url string

文件URL

file.files[].title string

文件名称