提交 8f982b4d authored 作者: coderBryanFu's avatar coderBryanFu

update

上级 c8425a6b
import request from "@/api/request.js";
// 今日要闻
export function getTodayNew() {
return request({
method: 'GET',
url: `/api/news/latestNews`,
})
}
// 今日要闻-带参
/**
* @param {industryId}
*/
export function getTodayNewByArea(params) {
return request({
method: 'GET',
url: `/api/news/latestNews`,
params
})
}
// 中美博弈专题
export function getHotNews() {
return request({
method: 'GET',
url: `/api/news/hotNews`,
})
}
// 今日要闻-带参
/**
* @param {industryId}
*/
export function getHotNewsByArea(params) {
return request({
method: 'GET',
url: `/api/news/hotNews`,
params
})
}
\ No newline at end of file
import request from "@/api/request.js";
// 全局信息
/**
* @param {newsId}
*/
export function getNewsSummary(params) {
return request({
method: 'GET',
url: `/api/news/summary/${params.newsId}`,
params
})
}
// 新闻内容
/**
* @param {newsId}
*/
export function getNewsContent(params) {
return request({
method: 'GET',
url: `/api/news/newsContent/${params.newsId}`,
params
})
}
// 事件脉络
/**
* @param {newsId}
*/
export function getNewsEvent(params) {
return request({
method: 'GET',
url: `/api/news/newsEvent/${params.newsId}`,
params
})
}
// 相关新闻
/**
* @param {newsId}
*/
export function getRelationNews(params) {
return request({
method: 'GET',
url: `/api/news/relationNews/${params.newsId}`,
params
})
}
\ No newline at end of file
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
class="box3-item" class="box3-item"
v-for="(news, index) in newsList" v-for="(news, index) in newsList"
:key="index" :key="index"
@click="handleClickToNewsDetail()" @click="handleClickToNewsDetail(news)"
> >
<div class="left"> <div class="left">
<img :src="getProxyUrl(news.newsImage) || News1" alt="" referrerpolicy="no-referrer" @error="e => e.target.src = News1" /> <img :src="getProxyUrl(news.newsImage) || News1" alt="" referrerpolicy="no-referrer" @error="e => e.target.src = News1" />
...@@ -884,9 +884,16 @@ const handleToMoreRiskSignal = () => { ...@@ -884,9 +884,16 @@ const handleToMoreRiskSignal = () => {
window.open(route.href, "_blank"); window.open(route.href, "_blank");
}; };
// 跳转新闻详情页 // 跳转新闻详情页
const handleClickToNewsDetail = () => { const handleClickToNewsDetail = (news) => {
// window.sessionStorage.setItem("newsId", "119_HR_1"); // window.sessionStorage.setItem("newsId", "119_HR_1");
const route = router.resolve("/newsAnalysis"); const route = router.resolve(
{
path: "/newsAnalysis",
query: {
newsId: news.newsId
}
}
);
window.open(route.href, "_blank"); window.open(route.href, "_blank");
}; };
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</div> </div>
</div> </div>
<div class="box3-main"> <div class="box3-main">
<div class="box3-item" v-for="(news, index) in newsList" :key="index" @click="handleToNewsAnalysis()"> <div class="box3-item" v-for="(news, index) in newsList" :key="index" @click="handleToNewsAnalysis(news)">
<div class="left"> <div class="left">
<img :src="news.img" alt="" /> <img :src="news.img" alt="" />
</div> </div>
...@@ -768,6 +768,7 @@ const handleGetNews = async () => { ...@@ -768,6 +768,7 @@ const handleGetNews = async () => {
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
newsList.value = res.data.map(item => { newsList.value = res.data.map(item => {
return { return {
newsId: item.newsId,
img: item.newsImage, img: item.newsImage,
title: item.newsTitle, title: item.newsTitle,
content: item.newsContent, content: item.newsContent,
...@@ -781,8 +782,15 @@ const handleGetNews = async () => { ...@@ -781,8 +782,15 @@ const handleGetNews = async () => {
}; };
handleGetNews(); handleGetNews();
// 点击新闻条目,跳转到新闻分析页 // 点击新闻条目,跳转到新闻分析页
const handleToNewsAnalysis = () => { const handleToNewsAnalysis = (news) => {
const route = router.resolve("/newsAnalysis"); const route = router.resolve(
{
path: "/newsAnalysis",
query: {
newsId: news.newsId
}
}
);
window.open(route.href, "_blank"); window.open(route.href, "_blank");
}; };
......
<template> <template>
<div class="header-btn" style="width: 100px;display: flex;" @click="back"> <div class="back-btn" @click="back">
<img :src="`src/assets/icons/arrow-left.png`" style="width: 24px;height: 24px;" /> 返回 <div class="icon">
</div> <img src="@/assets/icons/arrow-left.png" alt="" />
<div style="width: 100%;height: 100%;padding:0 20% "> </div>
<div> <div class="text">{{ "返回" }}</div>
<div class=" news-header" style="text-align: left;"> </div>
中美博弈专题 <div class="wrapper">
</div> <div>
<div class="content" style="margin-bottom: 20px;"> <div class="news-header">中美博弈专题</div>
汇聚全球资讯,呈现全球动态,掌握时事脉搏 <div class="news-desc">汇聚全球资讯,呈现全球动态,掌握时事脉搏</div>
</div> </div>
<div class="main">
</div> <div class="main-header">
<div class="box" style="width: 100%;height: 90%;"> <div
<div class="box-header" style="height: 5vh;"> v-for="(item, index) in btnList"
<div style="display: flex; justify-content: center; "> :key="index"
<div v-for="item in btnList" :class="btnSelect !== item ? 'header-btn-gray' : 'header-btn-select'" class="header-btn"
@click="changeBtn(item)"> :class="{ headerBtnSelect: btnSelect === item }"
{{ item }} > @click="changeBtn(item)"
</div> >
{{ item }}
</div> </div>
</div> </div>
<div class="divider"></div> <div class="content-box">
<div v-for="item in HeadlinesData"> <div class="item" v-for="(item, index) in HeadlinesData" :key="index">
<div style="display: flex;"> <div class="item-left">
<div> <div class="title">{{ item.title }}</div>
<div class="title-blob"> <div class="content">
{{ item.title }} <div class="source">新闻来源: {{ item.from }}</div>
</div> <div class="time">发表时间:{{ item.time }}</div>
<div class="content"> </div>
新闻来源: {{ item.from }} 发表时间:{{ item.time }} <div class="tag-box">
</div> <div v-for="(tag, index) in item.tag" class="tag" :key="index">
<div style="display: flex;"> {{ tag }}
<div v-for="tag in item.tag" class="tag"> </div>
{{ tag }} </div>
</div> </div>
</div> <div class="item-right">
</div> <img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
<div style="margin-left: auto;padding: 10px;"> </div>
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" /> </div>
</div> </div>
</div> </div>
</div>
<div class="divider">
</div>
</div>
</div>
</div>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
// const props = defineProps({ const btnList = ref(["全部", "军事", "政治", "经济", "敌我"]);
const btnSelect = ref("新闻纵览");
// type: {
// type: String,
// default: 'home'
// }
// })
const btnList = ref(["全部", "军事", "政治", "经济", "敌我"])
const btnSelect = ref('新闻纵览')
const HeadlinesData = ref([ const HeadlinesData = ref([
{ {
"title": "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”", title: "黎巴嫩真主党指责美国破坏黎稳定 谴责以色列“蓄意挑衅”",
"from": "人民网", from: "人民网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["以色列", "美国"], tag: ["以色列", "美国"],
"arrow": '0', arrow: "0"
}, },
{ {
"title": "IMF上调中东和北非地区经济增长预期", title: "IMF上调中东和北非地区经济增长预期",
"from": "CNN", from: "CNN",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["经济", "中东", "IMF"], tag: ["经济", "中东", "IMF"],
"arrow": '1', arrow: "1"
}, },
{ {
"title": "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面", title: "日本外务省亚洲大洋洲局局长金井正彰启程访华 预计18日与中方会面",
"from": "人民网", from: "人民网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["日本", "访华"], tag: ["日本", "访华"],
"arrow": '1', arrow: "1"
}, },
{ {
"title": "韩日因独岛主权争议暂停本月联合搜救演习", title: "韩日因独岛主权争议暂停本月联合搜救演习",
"from": "凤凰网", from: "凤凰网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["独岛", "联合军演", "韩国", "日本"], tag: ["独岛", "联合军演", "韩国", "日本"],
"arrow": '0', arrow: "0"
}, },
{ {
"title": "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结", title: "美“福特”号航母抵达加勒比海 于委内瑞拉附近展开大规模军事集结",
"from": "央视网", from: "央视网",
"time": "2025-10-05", time: "2025-10-05",
"tag": ["美国", "航母", "加勒比海"], tag: ["美国", "航母", "加勒比海"],
"arrow": '0', arrow: "0"
} }
]) ]);
function changeBtn(btn) { function changeBtn(btn) {
btnSelect.value = btn btnSelect.value = btn;
} }
const emit = defineEmits(["back"]); const emit = defineEmits(["back"]);
function back() { function back() {
emit('back', 'home') emit("back", "home");
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
@import url('./style.css');
.newsBrief-page { .newsBrief-page {
max-width: 100vw; max-width: 100vw;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
margin: 0 auto; margin: 0 auto;
padding: 5vh 10vw 20vh 10vw; padding: 5vh 10vw 20vh 10vw;
background: url('@/assets/images/background.png') no-repeat; background: url("@/assets/images/background.png") no-repeat;
background-position: center -100px; background-position: center -100px;
background-size: 100% 100%; background-size: 100% 100%;
min-height: 100vh; min-height: 100vh;
.back-btn {
position: absolute;
top: 24px;
left: 40px;
width: 92px;
height: 40px;
display: flex;
gap: 4px;
align-items: center;
justify-content: center;
box-sizing: border-box;
border: 1px solid rgba(255, 255, 255, 1);
border-radius: 32px;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0 0 10px 10px var(--color-bg-hover);
cursor: pointer;
&:hover {
background: var(--color-bg-hover);
}
.icon {
width: 16px;
height: 16px;
img {
width: 100%;
height: 100%;
}
}
.text {
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: center;
}
}
.wrapper {
height: 930px;
position: relative;
.news-header {
margin-top: 80px;
margin-left: 484px;
height: 60px;
color: rgba(34, 41, 52, 1);
font-family: YouSheBiaoTiHei;
font-size: 46px;
font-weight: 400;
line-height: 60px;
letter-spacing: 0px;
text-align: left;
}
.news-desc {
margin-top: 2px;
margin-left: 484px;
height: 30px;
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.main {
margin: 30px auto;
width: 1000px;
height: 778px;
box-sizing: border-box;
border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px;
background: rgba(255, 255, 255, 0.8);
.main-header {
height: 64px;
display: flex;
gap: 16px;
padding-top: 24px;
padding-left: 24px;
.header-btn {
height: 40px;
line-height: 40px;
padding: 0 20px;
border-radius: 32px;
background: rgba(32, 33, 35, 0.07);
color: rgba(95, 101, 108, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
letter-spacing: 0px;
text-align: center;
}
.headerBtnSelect {
box-sizing: border-box;
border: 1px solid rgba(174, 214, 255, 1);
border-radius: 32px;
background: rgba(231, 243, 255, 1);
color: var(--color-main-active);
}
}
.content-box {
margin: 0 auto;
width: 952px;
height: 674px;
overflow: hidden;
overflow-y: auto;
.item {
width: 952px;
height: 114px;
border-bottom: 1px solid rgba(234, 236, 238, 1);
display: flex;
justify-content: space-between;
box-sizing: border-box;
padding-top: 16px;
.item-left {
width: 710px;
.title {
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.content {
margin-top: 2px;
display: flex;
gap: 16px;
height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
}
.tag-box {
margin-top: 4px;
display: flex;
gap: 4px;
.tag {
height: 24px;
padding: 0 8px;
border-radius: 4px;
background: rgba(223, 226, 231, 0.41);
line-height: 24px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 20px;
letter-spacing: 0px;
text-align: left;
}
}
}
}
}
}
}
} }
</style> </style>
<template> <template>
<div class="newsBrief-page"> <div class="newsBrief-page">
<div v-if="showPage === 'home'"> <div v-if="showPage === 'home'">
<div style="justify-content: space-between;"> <div style="justify-content: space-between">
<div class="news-header"> <div class="news-header">新闻速览</div>
新闻速览 <div class="input-box">
</div> <el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 800px; height: 48px">
<div class="input-box"> </el-input>
<el-input placeholder="请输入关键词" :suffix-icon="searchInput" clearable style="width: 800px;height: 48px;"> </div>
</el-input>
</div>
<div class="btn-box"> <div class="btn-box">
<div v-for="item,index in btnList" :key="index" :class="btnSelect !== item ? 'header-btn' : 'header-btn-select'" <div
@click="changeBtn(item)"> v-for="(item, index) in btnList"
<div class="btn-box-text">{{ item }}</div> :key="index"
<div class="btn-box-icon"> :class="btnSelect !== item ? 'header-btn' : 'header-btn-select'"
<img v-if="btnSelect === item" src="@/assets/icons/btn-arrow-right-active.png" alt=""> @click="changeBtn(item)"
<img v-else src="@/assets/icons/btn-arrow-right.png" alt=""> >
<div class="btn-box-text">{{ item }}</div>
</div> <div class="btn-box-icon">
</div> <img v-if="btnSelect === item" src="@/assets/icons/btn-arrow-right-active.png" alt="" />
<div class="header-btn-more"> <img v-else src="@/assets/icons/btn-arrow-right.png" alt="" />
<img src="@/assets/icons/adjustment.png" /> </div>
</div> </div>
</div> <div class="header-btn-more">
<img src="@/assets/icons/adjustment.png" />
</div> </div>
<div class="main" style="display: flex;"> </div>
<div class="box"> </div>
<div class="box-header"> <div class="main">
<img class="box-header-img" src="@/assets/icons/Headlines-icon.svg"></img> <div class="box">
<div style="cursor: pointer;" @click="changePage('headlines')"> <div class="box-header">
今日要闻 > <div class="box-header-img">
</div> <img src="@/assets/icons/Headlines-icon.svg" />
</div> </div>
<div class="divider"></div> <div class="box-header-title" @click="changePage('headlines')">今日要闻 ></div>
<div v-for="item,index in HeadlinesData" :key="index"> </div>
<div style="display: flex;"> <div class="divider"></div>
<div> <div v-for="(item, index) in HeadlinesData" :key="index">
<div class="title-blob"> <div class="box1-item">
{{ item.title }} <div class="box1-item-left">
</div> <div class="box1-item-title">
<div class="content"> {{ item.title }}
新闻来源: {{ item.from }} 发表时间:{{ item.time }} </div>
</div> <div class="box1-item-content">
<div style="display: flex;"> <div class="source">新闻来源: {{ item.from }}</div>
<div v-for="tag,index in item.tag" :key="index" class="tag"> <div class="time">发表时间:{{ item.time }}</div>
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto;padding: 10px;">
<img :src="item.image" />
</div>
</div>
<div class="divider">
</div>
</div>
</div>
<div class="box" style=" margin-left: 4%;">
<div class="box-header">
<img class="box-header-img" src="@/assets/icons/subject-icon.png"></img>
<div style="cursor: pointer;" @click="changePage('subject')">
中美博弈专题
</div>
</div>
<div class="divider">
</div>
<div v-for="(item, index) in subjectData" :key="index">
<div class="subject-line">
<!-- 左侧:序号 + 文字 -->
<div style="display: flex; align-items: center;">
<div :style="{
color:
index === 0 ? '#CF4F51'
: index === 1 ? '#FF964D'
: index === 2 ? '#E8BD0D'
: '#3B414B'
}">
{{ index <= 2 ? index + 1 : "." }} </div>
<div
style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width: 32vw ;margin-left: 20px;"
:class="index <= 2 ? 'title-blob' : 'content'">{{ item.text }}
</div>
</div> </div>
<div class="tag-box">
<div v-for="(tag, index) in item.tag" :key="index" class="tag">
{{ tag }}
</div>
</div>
</div>
<div style="margin-left: auto; padding: 10px">
<img :src="item.image" />
</div>
</div>
<!-- 右侧:箭头 --> <div class="divider"></div>
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" /> </div>
</div> </div>
</div> <div class="box">
<div class="box-header">
</div> <div class="box-header-img"><img src="@/assets/icons/subject-icon.png" /></div>
</div> <div class="box-header-title" @click="changePage('subject')">中美博弈专题</div>
</div> </div>
<div class="divider"></div>
<div v-for="(item, index) in subjectData" :key="index">
<div class="subject-line">
<div style="display: flex; align-items: center">
<div class="subject-line-id" :class="{ subjectLineId1: index===0, subjectLineId2: index === 1, subjectLineId3: index === 2 }">
{{ index <= 2 ? index + 1 : "•" }}
</div>
<div class="text" :class="{ textTop: index < 3 }">
{{ item.text }}
</div>
</div>
<img :src="`src/assets/icons/arrow-${item.arrow}.png`" />
</div>
</div>
</div>
</div>
</div>
<Headlines v-if="showPage === 'headlines'" @type="showPage" @back="changePage" /> <Headlines v-if="showPage === 'headlines'" @type="showPage" @back="changePage" />
<Subject v-if="showPage === 'subject'" @back="changePage" /> <Subject v-if="showPage === 'subject'" @back="changePage" />
</div>
</div>
</template> </template>
<script setup> <script setup>
...@@ -184,7 +169,6 @@ const subjectData = ref([ ...@@ -184,7 +169,6 @@ const subjectData = ref([
background: url("@/assets/images/background.png") no-repeat; background: url("@/assets/images/background.png") no-repeat;
background-position: center -100px; background-position: center -100px;
background-size: 100% 100%; background-size: 100% 100%;
padding-top: 50px; padding-top: 50px;
} }
</style> </style>
...@@ -118,6 +118,8 @@ ...@@ -118,6 +118,8 @@
width: 1440px; width: 1440px;
height: 714px; height: 714px;
margin: 0 auto; margin: 0 auto;
display: flex;
gap: 16px;
} }
.box { .box {
...@@ -127,31 +129,41 @@ ...@@ -127,31 +129,41 @@
border: 1px solid rgba(231, 243, 255, 1); border: 1px solid rgba(231, 243, 255, 1);
border-radius: 10px; border-radius: 10px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
padding: 1vw; padding: 0 24px;
} }
.box-header { .box-header {
height: 56px; height: 56px;
display: flex; display: flex;
text-align: left;
font-size: 24px;
font-weight: 700;
align-items: center; align-items: center;
} }
.box-header-img { .box-header-img {
height: 24px; height: 20px;
width: 24px; width: 20px;
margin: 0 5px; border-radius: 2px;
background: rgba(5, 95, 194, 0.16);
box-sizing: border-box;
padding: 2px;
} }
.title-blob { .box-header-img img {
font-size: 16px; width: 16px;
font-weight: 400; height: 16px;
line-height: 30px; }
.box-header-title {
margin-left: 10px;
height: 24px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 18px;
font-weight: 700;
line-height: 24px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
cursor: pointer;
} }
.tag { .tag {
...@@ -167,30 +179,106 @@ ...@@ -167,30 +179,106 @@
text-align: left; text-align: left;
} }
.content { .divider {
width: 100%;
height: 1px;
background: #eaecee;
}
.box1-item {
display: flex;
height: 114px;
}
.box1-item-left {
margin-top: 16px;
width: 500px;
}
.box1-item-title {
width: 500px;
height: 30px;
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.box1-item-content {
margin-top: 2px;
height: 22px;
color: rgba(132, 136, 142, 1); color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
line-height: 22px; line-height: 22px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
display: flex;
gap: 16px;
} }
.divider { .tag-box {
width: 100%; margin-top: 4px;
height: 1px; display: flex;
background: #eaecee; gap: 4px;
} }
.subject-line { .subject-line {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 100%; height: 30px;
height: 2.7vh; margin: 16px 0;
margin: 1vh 0; }
.subject-line-id {
width: 20px;
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
color: rgba(59, 65, 75, 1);
}
.subjectLineId1 {
color: #CE4F51 !important;
}
.subjectLineId2 {
color: #FF954D !important;
} }
.subjectLineId3 {
color: #E8BD0B !important;
}
.text {
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 400;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
.textTop {
font-family: Microsoft YaHei;
font-size: 16px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0px;
text-align: left;
}
:deep(.el-input__wrapper) { :deep(.el-input__wrapper) {
box-shadow: none; box-shadow: none;
border-radius: 10px; border-radius: 10px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论