Browse Source

修改融媒体对接

master
changtong 1 month ago
parent
commit
25e81517ac
  1. 4
      config/index.js
  2. 10
      src/views/screen/components/mediaBigScreen/content.vue
  3. 240
      src/views/screen/media-screen.vue

4
config/index.js

@ -25,8 +25,8 @@ module.exports = {
changeOrigin: true,
},
'/socket.io': {
target: 'http://localhost:19990/',
// target: 'http://60.255.186.185:9024/',
// target: 'http://localhost:19990/',
target: 'http://60.255.186.185:9024/',
changeOrigin: true,
}
},

10
src/views/screen/components/mediaBigScreen/content.vue

@ -13,14 +13,14 @@
:key="index"
>
<div class="back">
<img :src="item.image_url" @error="imageError($event, index)" />
<img :src="item.url || ''" @error="imageError($event, index)" />
</div>
<div
class="content-box"
:class="{ 'special-box': item.jumpContentType == '15' }"
>
<div>{{ item.title }}</div>
<div>{{ item.pubDate || item.startTime }}</div>
<div>{{ item.publish_time }}</div>
</div>
</div>
<div v-if="scrollData.length == 0 && !parentLoad" class="noData">
@ -130,7 +130,8 @@ export default {
},
},
created() {},
mounted() {},
mounted () {
},
methods: {
closeVideo(data) {
console.log(data);
@ -170,7 +171,8 @@ export default {
},
//
queryDetail (item) {
this.jumpWindow(item.url, item.title);
console.log(item)
this.jumpWindow('http://m.cuipingrongmei.cn/cms/content/' + item.id, item.title);
},
getContentById(item) {
let url = "/links/getImageTextContentById";

240
src/views/screen/media-screen.vue

@ -16,9 +16,7 @@
<div class="box-icon-text">
<!-- 右边标题 -->
<div class="left-title">
<span class="title-text">{{
item.columnName
}}</span>
<span class="title-text">{{ item.name }}</span>
</div>
</div>
</div>
@ -46,7 +44,7 @@
</div>
</Spin>
</div>
<div class="page" v-if="scrollData.length > 0 && infoState">
<!-- <div class="page" v-if="scrollData.length > 0 && infoState">
<Page
:total="dataFilter.total"
:current.sync="dataFilter.page"
@ -54,7 +52,7 @@
@on-change="pageChange"
show-elevator
/>
</div>
</div> -->
</div>
</div>
</div>
@ -75,48 +73,49 @@ export default {
pageSize: 20,
total: 0,
},
tagTitle: [
{
columnName: "翠屏",
columnId: "3f7adceb-fcf9-4adb-956d-7987b42cd10f",
},
{
columnName: "部门动态",
columnId: "16653738-7af1-45d3-b6a3-ab13c49b2760",
},
{
columnName: "电视新闻",
columnId: "9d3fe8a8-a994-475e-981c-aac2bce70c9b",
},
{
columnName: "微视频",
columnId: "bdb2782e-eaba-4bd9-9f1e-09d85e32c73d",
},
{
columnName: "镇村动态",
columnId: "28009c03-4766-40eb-b86d-fe09bb11ac21",
},
{
columnName: "法治翠屏",
columnId: "1d15515f-e7d5-4efd-bcdb-12d65104c14d",
},
{
columnName: "医保动态",
columnId: "972136f0-172f-436e-9fa9-332ea58fa3d4",
},
{
columnName: "办事指南",
columnId: "cd775f6e-d6f5-4b10-a78f-80042e0aa6de",
},
{
columnName: "医保政策",
columnId: "a914aa8c-27b9-4ff3-ba83-54811b41fe0b",
},
{
columnName: "直播",
columnId: "08d99eb1-b653-4386-955a-53a43c5139c3",
},
],
// tagTitle: [
// {
// columnName: "",
// columnId: "3f7adceb-fcf9-4adb-956d-7987b42cd10f",
// },
// {
// columnName: "",
// columnId: "16653738-7af1-45d3-b6a3-ab13c49b2760",
// },
// {
// columnName: "",
// columnId: "9d3fe8a8-a994-475e-981c-aac2bce70c9b",
// },
// {
// columnName: "",
// columnId: "bdb2782e-eaba-4bd9-9f1e-09d85e32c73d",
// },
// {
// columnName: "",
// columnId: "28009c03-4766-40eb-b86d-fe09bb11ac21",
// },
// {
// columnName: "",
// columnId: "1d15515f-e7d5-4efd-bcdb-12d65104c14d",
// },
// {
// columnName: "",
// columnId: "972136f0-172f-436e-9fa9-332ea58fa3d4",
// },
// {
// columnName: "",
// columnId: "cd775f6e-d6f5-4b10-a78f-80042e0aa6de",
// },
// {
// columnName: "",
// columnId: "a914aa8c-27b9-4ff3-ba83-54811b41fe0b",
// },
// {
// columnName: "",
// columnId: "08d99eb1-b653-4386-955a-53a43c5139c3",
// },
// ],
tagTitle: [],
scrollData: [],
tenantDomainName: "",
tabJumpId: "",
@ -131,10 +130,38 @@ export default {
const { calcRate, windowDraw } = useIndex(this.$refs.appRef);
calcRate();
windowDraw();
this.onClick(this.tagTitle[0], 0);
this.queryFlData();
},
created() {},
methods: {
//
queryFlData() {
let url = "/convergenceMedia/getColumn";
let params = {
columnId: "64525",
};
this.$http.post(url, this.common.request(params)).then((res) => {
if (res && res.data.code >= 200 && res.data.code < 400) {
let data = res.data.data;
if (
data &&
data.body &&
data.body.blocks &&
data.body.blocks.length >= 5
) {
this.tagTitle =
data.body.blocks[4].data_props &&
data.body.blocks[4].data_props.length > 0
? data.body.blocks[4].data_props
: [];
this.onClick(this.tagTitle[0], 0);
}
} else {
this.$Message.error("获取数据失败");
}
});
},
openInfo(data) {
this.infoState = data;
},
@ -146,35 +173,120 @@ export default {
this.flog = index;
this.dataFilter.page = 1;
this.dataFilter.total = 0;
this.tabJumpId = item.columnId;
this.tabJumpId =
item.redirection &&
item.redirection.related_data &&
item.redirection.related_data.id;
this.infoState = true;
this.currentColumnName = item.columnName;
this.queryScrollDataList(item);
this.currentColumnName = item.name;
this.queryScrollDataList(this.tabJumpId);
},
//
queryScrollDataList(item) {
let url = "/convergenceMedia/selectByAppSpecial";
queryScrollDataList (id) {
this.scrollData = []
let url = "/convergenceMedia/syncNewsColumn";
let params = {
appInfoId: 516,
columnId: item.columnId,
pageNum: this.dataFilter.page - 1,
pageSize: 10,
url: "http://hongqi.wengegroup.com:9001/newNews/getNewsColumnData",
userId: "",
// appInfoId: 516,
columnId: id,
// pageNum: this.dataFilter.page - 1,
// pageSize: 10,
// url: "http://hongqi.wengegroup.com:9001/newNews/getNewsColumnData",
// userId: "",
};
this.$http.post(url, this.common.request(params)).then((res) => {
if (res && res.data.code >= 200 && res.data.code < 400) {
this.loadState = false;
this.scrollData = res.data.data[0].list;
if (res.data.data[0].total) {
this.dataFilter.total = res.data.data[0].total
}
let data =
res.data.data && res.data.data.length > 0 && res.data.data.filter(item => {
if (item.name.includes("新闻列表") || item.name.includes("专题列表")) {
return true
}
})
data.forEach(element => {
if (element.data_props && element.data_props.length > 0) {
this.scrollData.push(...element.data_props)
}
});
// data.data_props && data.data_props.length > 0
// ? data.data_props
// : [];
this.scrollData = this.scrollData.map((item) => {
let contentData =
item.related_data &&
item.related_data.thumbnails &&
item.related_data.thumbnails.length > 0 &&
item.related_data.thumbnails[0];
return {
...item,
url: contentData.url,
title: item.related_data && item.related_data.title,
publish_time:
item.related_data &&
this.formatTime(item.related_data.publish_time),
};
});
} else {
this.$Message.error("获取数据失败");
}
});
},
formatTime(timestamp) {
//
if (!timestamp || isNaN(Number(timestamp))) {
return "未知";
}
//
const targetTime = Number(timestamp) * 1000;
const now = Date.now();
const diff = now - targetTime; //
//
const seconds = Math.floor(diff / 1000);
const minutes = Math.floor(seconds / 60);
const hours = Math.floor(minutes / 60);
const days = Math.floor(hours / 24);
const years = Math.floor(days / 365);
// 160
if (seconds < 60) {
return "刚刚";
}
// 11
if (minutes < 60) {
return `${minutes}分钟前`;
}
// 124
if (hours < 24) {
return `${hours}小时前`;
}
// 243
if (days >= 1 && days < 3) {
return `${days}天前`;
}
//
const date = new Date(targetTime);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hour = String(date.getHours()).padStart(2, "0");
const minute = String(date.getMinutes()).padStart(2, "0");
//
if (years >= 1) {
return `${year}-${month}-${day} ${hour}:${minute}`;
}
// 31
return `${month}-${day} ${hour}:${minute}`;
},
//
queryPageList() {
this.scrollData = [];
@ -193,7 +305,7 @@ export default {
this.loadState = false;
this.scrollData = res.data.data[0].list;
if (res.data.data[0].total) {
this.dataFilter.total = res.data.data[0].total
this.dataFilter.total = res.data.data[0].total;
}
} else {
this.$Message.error("获取数据失败");

Loading…
Cancel
Save