newsPage / news 列表
http://showdoc.cqyqdc.com/web/#/32/253
调用方式
html
<hlx-template
component-type="newsPage"
component-query-option="{'columnIds':[],'start':0,'count':5,'showMedium':'PC'}"
component-variable="newsList"
></hlx-template>html
<hlx-template
component-type="newsPage"
component-query-option="{'columnIds':[],'start':0,'count':6,'showMedium':'PC','listViewCode':['ONE_IMAGE']}"
component-variable="newsCarouselList"
></hlx-template>提示
需要注意所有 number 类型是没有 引号的!
提示
columnIds 可以为空,即使 'columnIds':[] 不传入任何参数
为空时,自动获取当前栏目
| 参数名 | 必传 | 类型 | 描述 |
|---|---|---|---|
| columnIds | 是 | List<Long> | 'columnIds':[1916192] |
| showMedium | 是 | 枚举/string | 'showMedium':'PC' |
| start | 是 | Integer | 起始位置(默认 0) |
| count | 是 | Integer | 获取总数量(默认 10),最大 1000 |
| listViewCode | List 枚举/string | 'listViewCode':['ONE_IMAGE'] | |
| contentType | List 枚举/string | 'contentType':['TEXT'] | |
| newsType | List 枚举/string | 'newsType':['PIC'] | |
| showPageHtml | boolean | true,输出分页组件样式 | |
| showSpecial | boolean | true,查询稿件所属专题 | |
| showModuleData | boolean | true,查询组件化数据 |
ts
enum ShowMedium {
PC,
H5,
APP,
}ts
enum contentType {
TEXT = "稿件",
OUT_LINK = "外链",
MULTIPLE_IMAGE = "多图",
LIVE = "直播",
TOPIC = "专题",
}ts
enum newsType {
COMMON = "一般新闻",
HEADLINE = "头条新闻",
IMPORTANT = "重要新闻",
OTHER = "其他新闻",
PIC = "图片新闻",
VIDEO = "视频新闻",
}ts
enum listViewCode {
NO_IMAGE = "无图",
ONE_IMAGE = "单图",
MULTI_IMAGE = "多图",
BIG_IMAGE = "大图",
}返回值
ONE_IMAGE
为 ONE_IMAGE 时的数据结构
html
<hlx-template
component-type="newsPage"
component-query-option="{'columnIds':[5001578],'start':0,'count':1,'showMedium':'PC','listViewCode':['ONE_IMAGE']}"
component-variable="IntellectualPropertyTitle"
></hlx-template>json
[
{
"listId": 36312743,
"newsId": 1370526680476221400,
"newsType": "NORMAL",
"listTitle": "应用技术创新资源促进知识产权转化能力提升培训班顺利开班",
"pubTime": "2024-07-02 15:26:35",
"listImage": "http://23.99.13.145/webshare/resource/30073/ORIGINAL/MEDIA/PICTURE/2025/5/9/18ca22c190b14090936a0d1ae3995a96_wh1024x682.png",
"listViewCode": "ONE_IMG",
"second": "0",
"showViewCountStatus": "0",
"currentColName": "知识产权服务",
"currentColId": 5001578,
"columnsType": "0",
"currentColPcUrl": "http://www.cqsts.cn/web/column/col5001578.html",
"currentColAppUrl": " ",
"currentColH5Url": " ",
"currentColJsonUrl": " ",
"article": {
"id": 1370526680476221400,
"title": "应用技术创新资源促进知识产权转化能力提升培训班顺利开班",
"summary": "<p>7月2日,由市知识产权局指导,市科协科技服务中心主办的应用技术创新资源促进知识产权转化能力提升培训班顺利开班。市科协科技服务中心党总支书记、主任郑吉安出席开班仪式并致辞。</p>",
"author": [],
"source": "",
"keyword": "",
"tag": "",
"editor": "",
"liability": "",
"content": "<p>7月2日,由市知识产权局指导,市科协科技服务中心主办的应用技术创新资源促进知识产权转化能力提升培训班顺利开班。市科协科技服务中心党总支书记、主任郑吉安出席开班仪式并致辞。</p><p>本期培训班以“线上+线下”的方式同步进行,培训为期4天,包括创新方法主题培训和海外专利信息应用推广主题培训。其中,创新方法主题培训采用线下培训结合线上同步直播方式进行,线下培训将采取分组讨论式结合学员课题演练辅导方式进行授课;海外专利信息应用推广主题培训将采取知识产权知名专家现场授课,以及专业人员主讲结合现场演示方式授课。</p><p>来自全市企业的科技人员、技术骨干、工程师、一线班组长、劳模、工匠人才等共计100余人参加线下培训,另有2000余人参加线上培训。</p><p class=\"rteright\">(创新发展部 供稿)</p>",
"pubTime": null,
"columnID": null,
"column": null,
"appMainColumnId": null,
"masterColUrl": null,
"multimediaLink": null,
"audio": "",
"showHighSensitivity": false,
"appId": 30073,
"pcUrl": "http://www.cqsts.cn/web/article/1370526680476221440/web/content_1370526680476221440.html",
"h5Url": "",
"appUrl": "",
"jsonUrl": "",
"videoUrl": "",
"videoImg": "",
"extFields": null,
"pureVideo": false,
"contentType": "TEXT",
"liveStartTime": null,
"liveEndTime": null,
"videoLiveUrl": "",
"liveVideoType": null,
"allowGray": null,
"sourceUrl": "",
"dispatch": false,
"relateXi": null,
"pcTemplateId": 2007499,
"webMainColumnId": null,
"selfMainColumnId": 5001578,
"shareData": {
"shareTitle": "应用技术创新资源促进知识产权转化能力提升培训班顺利开班",
"shareDescription": "7月2日,由市知识产权局指导,市科协科技服务中心主办的应用技术创新资源促进知识产权转化能力提升培训班顺利开班。市科协科技服务中心党总支书记、主任郑吉安出席开班仪式并致辞。",
"shareImage": "http://23.99.13.145/webshare/resource/30073/ORIGINAL/MEDIA/PICTURE/2025/5/9/18ca22c190b14090936a0d1ae3995a96_wh1024x682.png",
"shareUrl": ""
},
"formMap": {},
"mainSpecialId": null,
"mainSpecialPcUrl": null,
"mainSpecialJsonUrl": null,
"mainSpecialAppUrl": null,
"mainSpecialH5Url": null,
"mainColPcUrl": null,
"mainColAppUrl": null,
"mainColH5Url": null,
"mainColJsonUrl": null,
"imgCount": null,
"playTime": null,
"pureAudio": false,
"audioUrl": "",
"audioImg": "",
"audioTime": null
},
"infoLabel": "",
"showLabel": false,
"showOnlineTime": false,
"isModule": 0,
"showColumn": true,
"showTitle": true,
"showVoicePlayButton": false,
"specialConfig": "",
"moduleData": null,
"moduleListCode": "",
"selfColumnInfos": null
}
]视频
视频
json
[
{
"listId": 36588965,
"newsId": 1376879186349498400,
"newsType": "NORMAL",
"listTitle": "kakakakakakakaka",
"pubTime": "2025-05-27 11:05:30",
"listImage": "",
"listViewCode": "NO_IMG",
"second": "0",
"showViewCountStatus": "1",
"currentColName": "人大视频",
"currentColId": 5003158,
"columnsType": "0",
"currentColPcUrl": "http://dzqrd.dzqzf.com/web/column/col5003158.html",
"currentColAppUrl": "",
"currentColH5Url": "",
"currentColJsonUrl": "",
"article": {
"id": 1376879186349498400,
"title": "kakakakakakakaka",
"summary": "",
"author": [],
"source": "",
"keyword": "",
"tag": "",
"editor": "秦爽",
"liability": "秦爽",
"content": "",
"pubTime": null,
"columnID": null,
"column": null,
"appMainColumnId": null,
"masterColUrl": null,
"multimediaLink": null,
"audio": "",
"showHighSensitivity": false,
"appId": 30032,
"pcUrl": "http://dzqrd.dzqzf.com/web/article/1376879186349498368/web/content_1376879186349498368.html",
"h5Url": "",
"appUrl": "",
"jsonUrl": "",
"videoUrl": "http://23.99.13.145/webshare/resource/30032/REPRINT/MEDIA/VIDEO/2025/5/22/1dcb8459d3e44451aed693d524d179ae_wh960x720.mp4",
"videoImg": "http://23.99.13.145/webshare/resource/30032/REPRINT/CONTENT_CLOUD/VIDEO/2025/5/27/a6225a5a1a8141f29d5ab27a8157c195_wh160x120.png",
"extFields": null,
"pureVideo": true,
"contentType": "TEXT",
"liveStartTime": null,
"liveEndTime": null,
"videoLiveUrl": "",
"liveVideoType": null,
"allowGray": false,
"sourceUrl": "",
"dispatch": false,
"relateXi": null,
"pcTemplateId": 2007586,
"webMainColumnId": null,
"selfMainColumnId": 5003158,
"shareData": {
"shareTitle": "kakakakakakakaka",
"shareDescription": "",
"shareImage": "https://res.cqnews.net/public/img/logo/30032.png",
"shareUrl": ""
},
"formMap": {},
"mainSpecialId": null,
"mainSpecialPcUrl": null,
"mainSpecialJsonUrl": null,
"mainSpecialAppUrl": null,
"mainSpecialH5Url": null,
"mainColPcUrl": null,
"mainColAppUrl": null,
"mainColH5Url": null,
"mainColJsonUrl": null,
"imgCount": 0,
"playTime": 15850,
"pureAudio": false,
"audioUrl": "",
"audioImg": "",
"audioTime": null
},
"infoLabel": "",
"showLabel": true,
"showOnlineTime": true,
"isModule": 0,
"showColumn": true,
"showTitle": true,
"showVoicePlayButton": true,
"specialConfig": "",
"moduleData": null,
"moduleListCode": "",
"selfColumnInfos": null
}
]为 MULTI_IMAGE 时的数据结构
注意 listImage 是一个 string,然后用,分割
json
"listImage": "http://23.99.13.145/webshare/resource/30057/REPRINT/CONTENT_CLOUD/PICTURE/2025/6/6/7620c8b7f3a0432a9c69ddcb644e7b81_wh219x166.jpg,http://23.99.13.145/webshare/resource/30057/REPRINT/CONTENT_CLOUD/PICTURE/2025/6/6/26df20e445c14adca00f892853fc20b6_wh1000x795.jpg"取值:
html
<span th:text="${#strings.split(item.listImage, ',')[0]}"></span>完整实例:
json
[
{
"listId": 36918862,
"newsId": 1380503493084250000,
"newsType": "NORMAL",
"listTitle": "eeee",
"pubTime": "2025-06-06 11:07:25",
"listImage": "http://23.99.13.145/webshare/resource/30057/REPRINT/CONTENT_CLOUD/PICTURE/2025/6/6/7620c8b7f3a0432a9c69ddcb644e7b81_wh219x166.jpg,http://23.99.13.145/webshare/resource/30057/REPRINT/CONTENT_CLOUD/PICTURE/2025/6/6/26df20e445c14adca00f892853fc20b6_wh1000x795.jpg",
"listViewCode": "MULTI_IMG",
"second": "0",
"showViewCountStatus": "1",
"currentColName": "ѳ����־",
"currentColId": 5003704,
"columnsType": "0",
"currentColPcUrl": "https://www.hongyanmuseum.cn/web/column/col5003704.html",
"currentColAppUrl": " ",
"currentColH5Url": " ",
"currentColJsonUrl": " ",
"article": {
"id": 1380503493084250000,
"title": "eeee",
"summary": "1949��9��6��",
"author": [],
"source": "",
"keyword": "",
"tag": "",
"editor": "��ˬ",
"liability": "��ˬ",
"content": "<p>ee</p>",
"pubTime": null,
"columnID": null,
"column": null,
"appMainColumnId": null,
"masterColUrl": null,
"multimediaLink": null,
"audio": "",
"showHighSensitivity": false,
"appId": 30057,
"pcUrl": "https://www.hongyanmuseum.cn/web/article/1380503493084250112/web/content_1380503493084250112.html",
"h5Url": "",
"appUrl": "",
"jsonUrl": "",
"videoUrl": "",
"videoImg": "",
"extFields": null,
"pureVideo": false,
"contentType": "TEXT",
"liveStartTime": null,
"liveEndTime": null,
"videoLiveUrl": "",
"liveVideoType": null,
"allowGray": false,
"sourceUrl": "",
"dispatch": false,
"relateXi": null,
"pcTemplateId": 2007607,
"webMainColumnId": null,
"selfMainColumnId": 5003704,
"shareData": {
"shareTitle": "eeee",
"shareDescription": "1949��9��6��",
"shareImage": "http://23.99.13.145/webshare/resource/30057/REPRINT/CONTENT_CLOUD/PICTURE/2025/6/6/7620c8b7f3a0432a9c69ddcb644e7b81_wh219x166.jpg",
"shareUrl": ""
},
"formMap": {
"extend_field_name2E": [],
"extend_field_isHome": { "id": "��", "name": "��" },
"extend_field_isTop": [],
"extend_field_isGgdt": { "id": "��", "name": "��" }
},
"mainSpecialId": null,
"mainSpecialPcUrl": null,
"mainSpecialJsonUrl": null,
"mainSpecialAppUrl": null,
"mainSpecialH5Url": null,
"mainColPcUrl": null,
"mainColAppUrl": null,
"mainColH5Url": null,
"mainColJsonUrl": null,
"imgCount": 0,
"playTime": null,
"pureAudio": false,
"audioUrl": "",
"audioImg": "",
"audioTime": null
},
"infoLabel": "",
"showLabel": true,
"showOnlineTime": true,
"isModule": 0,
"showColumn": true,
"showTitle": true,
"showVoicePlayButton": true,
"specialConfig": "",
"moduleData": null,
"moduleListCode": "NEWS_MULTI_IMG",
"selfColumnInfos": null
}
]外链
外链
json
[
{
"listId": 37113093,
"newsId": 1382404398831382500,
"newsType": "NORMAL",
"listTitle": "把党的二十大精神全面落实在重庆大地上",
"pubTime": "2025-06-11 17:00:34",
"listImage": "",
"listViewCode": "NO_IMG",
"second": "0",
"showViewCountStatus": "1",
"currentColName": "首页横幅",
"currentColId": 5004032,
"columnsType": "0",
"currentColPcUrl": " ",
"currentColAppUrl": "",
"currentColH5Url": "",
"currentColJsonUrl": " ",
"article": {
"id": 1382404398831382500,
"title": "把党的二十大精神全面落实在重庆大地上",
"summary": "",
"author": [],
"source": "",
"keyword": "",
"tag": "",
"editor": "秦爽",
"liability": "秦爽",
"content": "/web/column/col5003949.html",
"pubTime": null,
"columnID": null,
"column": null,
"appMainColumnId": null,
"masterColUrl": null,
"multimediaLink": null,
"audio": "",
"showHighSensitivity": false,
"appId": 30101,
"pcUrl": "/web/column/col5003949.html",
"h5Url": "/web/column/col5003949.html",
"appUrl": "/web/column/col5003949.html",
"jsonUrl": "",
"videoUrl": "",
"videoImg": "",
"extFields": null,
"pureVideo": false,
"contentType": "OUT_LINK",
"liveStartTime": null,
"liveEndTime": null,
"videoLiveUrl": "",
"liveVideoType": null,
"allowGray": false,
"sourceUrl": "",
"dispatch": false,
"relateXi": null,
"pcTemplateId": null,
"webMainColumnId": null,
"selfMainColumnId": 5004032,
"shareData": {
"shareTitle": "把党的二十大精神全面落实在重庆大地上",
"shareDescription": "",
"shareImage": "https://res.cqnews.net/public/img/logo/30101.png",
"shareUrl": "/web/column/col5003949.html"
},
"formMap": {},
"mainSpecialId": null,
"mainSpecialPcUrl": null,
"mainSpecialJsonUrl": null,
"mainSpecialAppUrl": null,
"mainSpecialH5Url": null,
"mainColPcUrl": null,
"mainColAppUrl": null,
"mainColH5Url": null,
"mainColJsonUrl": null,
"imgCount": null,
"playTime": null,
"pureAudio": null,
"audioUrl": "",
"audioImg": "",
"audioTime": null
},
"infoLabel": "",
"showLabel": true,
"showOnlineTime": true,
"isModule": 0,
"showColumn": true,
"showTitle": true,
"showVoicePlayButton": false,
"specialConfig": "",
"moduleData": null,
"moduleListCode": "NEWS_NO_IMG",
"selfColumnInfos": null
}
]