模板协议样例
{"templateId": 123,"theme": "blue","templateName": "模板名称","platform": [{ "label": "5G商城·云网商城", "value": "1" }],"moduleList": [{"moduleId": 123,"moduleCode": "topNav","sort": 0,"anchor": {"show": true,"title": "左侧电梯导航中的模块名称"},"contentAttrs": [{}],"displayAttrs": [{}]}]}
模板协议
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| templateId | Number | - | |
| templateName | String | - | |
| theme | String | blue | 首页主题,可选项:blue、orange、red |
| platform | Object[] | 模板被投放的平台信息。如:[{ “label”: “5G商城·云网商城”, “value”: “1” }] | |
| moduleList | Object[] | - | 模块信息,如:顶栏,轮播、重点推荐、商品等 |
moduleList
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| moduleId | Number | 模块id | |
| moduleCode | String | - | 可选值:topNav、slideshow、productList、solution、news、partner、certification、recommend |
| sort | Number | - | 排序(即索引顺序) |
| anchor | Object | { show: false, text: “标题” } |
是否在左侧电梯中显示; 显示时的标题 ,8个字符 |
| contentAttrs | Object | - | 内容属性 |
| displayAttrs | Object | - | 显示属性 |
不同moduleCode值, 对应的contentAttrs 和 displayAttrs 对象会有不同。
topNav - 顶栏
{"moduleId": 0,"sort":0,"anchor":{"show":false},"moduleCode":"topNav","contentAttrs":{"logo":{"picture":[{"fileId": "1399298959351156738","fileName": "logo.png","fileUrl": "http://172.21.96.66:18888/group1/M00/00/1A/rBVgQmC0rlWAY5qiAAAVD-2zbDQ464.png"}],"slogon": ""}}}
slideshow - 轮播
{"moduleId": 1,"sort":1,"anchor":{"show":false},"moduleCode": "slideshow","contentAttrs": {"group": [{"picture": "http://xxx.jpg","title": "轮播主题","description": "轮播简介","buttons": [{"text": "按钮名称","url": "链接地址"}],"url":"点击轮播图片的跳转地址"}]},"displayAttrs": {"height": 535, // 535和250两个可选值"title": {"show": true,"text": "轮播标题"},"description": {"show": true,"text": "轮播简介"}}}
product - 爆款商品
{"moduleId": 2,"sort": 2,"anchor": {"show": true,"text": "爆款商品"},"moduleCode": "product","contentAttrs": {"group": [{"title": "热门", // 品类名称"headline": {"show": true,"activity": {"title": "活动标题","description": "简介","link": {"text": "","url": ""}},"product": [{"label": "商品名称","value": "productTitle"},{"label": "商品简介","value": "productDesc"},{"label": "商品特性","value": "productDesc"},{"label": "商品简介","value": "productFeature"}]},"productList": [{"productId": 1,"productName": "商品名称","businessType": "业务类型","tags": [{ "label": "hot", "value": "hot" },{ "label": "new", "value": "new" }]}],"tags": [{ "label": "hot", "value": "hot" },{ "label": "new", "value": "new" }],"dir": { "label": "一级目录", "value": 1 }}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
solution - 解决方案
{"moduleId": 3,"sort": 3,"anchor": {"show": true,"text": "解决方案"},"moduleCode": "solution","contentAttrs": {"group": [{"category": "应用场景","solutionTitleCN": "方案名称 - 中文","solutionTitleEN": "方案名称 - 英文","solutionDesc": "方案简介1","customerTitle": "方案简介2","customerDesc": "客户简介","solutionLogo":"图标地址","customerLogo":"图标地址","relaProdocts": [{"productId": 1,"productName": "产品名称"}]}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
news - 最新动态
{"moduleId": 4,"sort": 4,"anchor": {"show": true,"text": "最新动态"},"moduleCode": "news","contentAttrs": {"group": [{"title": "资讯标题","id":1,"createDate": "2021-04-24","img":"资讯配图",}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
partner - 合作伙伴
{"moduleId": 5,"sort": 5,"anchor": {"show": true,"text": "合作伙伴"},"moduleCode": "partner","contentAttrs": {"group": [{"id":1,"name": "合作伙伴名称","logo": "logo图片"}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
certification - 资质证明
{"moduleId": 6,"sort": 6,"anchor": {"show": true,"text": "资质证明"},"moduleCode": "certification","contentAttrs": {"group": [{"Id":1,"name": "资质名称","logo": "logo图片"}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
recommend - 重点推荐
{"moduleId": 6,"sort": 6,"anchor": {"show": true,"text": "重点推荐"},"moduleCode": "recommend","contentAttrs": {"group": [{"Id":1,"name": "资质名称","logo": "logo图片"}]},"displayAttrs": {"layout": "style1", // 布局风格,值style1,style2类推"sectionTitle": {"show": true,"text": "段落标题"},"sectionDesc": {"show": true,"text": "段落简介"},"more": {"show": true,"text": "段落简介","url": "链接"}}}
获取模板(待补充)
| 请求地址 | /api/homePageTemplate/getHomePageTemplate |
|---|---|
| 请求方式 | post |
入参:
{"templateId":"1397456704411709442"}
回参:
{"resultCode": "0","resultMsg": "SUCCESS","resultData": {"moduleList": [{"displayAttrs": [{}],"moduleCode": "模块名称","anchor": {"show": true,"title": "左侧电梯导航中的模块名称"},"contentAttrs": [{}],"sort": 0}],"templateName": "4模4板测试","theme": "blue","templateId": "1397179293673664514","platform": [{"label": "5G商城·云网商城","value": "1"}],"status": 0},"resultMsgCode": null}
保存模板(待补充)
| 请求地址 | /api/homePageTemplate/saveTemplateContent |
|---|---|
| 请求方式 | post |
入参:
{"templateId": "1397179293673664514","theme": "blue","templateName": "4模4板测试","status": 0,"platform": [{ "label": "5G商城·云网商城", "value": "1" }],"moduleList": [{"moduleCode": "模块名称","sort": 0,"anchor": {"show": true,"title": "左侧电梯导航中的模块名称"},"contentAttrs": [{}],"displayAttrs": [{}]}]}
回参:
{"resultCode": "0","resultMsg": "SUCCESS","resultData": null,"resultMsgCode": null}
