hookehuyr

feat(news): 添加新闻标题英文显示支持

在新闻详情页添加英文标题显示字段,并调整样式间距
<!--
* @Date: 2024-10-18 12:06:09
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-12-16 10:15:10
* @LastEditTime: 2025-08-06 09:55:51
* @FilePath: /hager/src/views/news/detail.vue
* @Description: 文件描述
-->
......@@ -21,6 +21,7 @@
</hager-box>
<hager-box>
<div class="news-title">{{ title }}</div>
<div class="news-title-en">{{ title_en }}</div>
<div :class="['news-content', is_xs ? 'xs' : '']" v-html="content"></div>
</hager-box>
</div>
......@@ -46,6 +47,7 @@ export default {
data () {
return {
title: '获奖+1!海格电气荣获2023酒店文旅优秀国际标杆品牌',
title_en: '',
content: '',
keyword: '',
description: '',
......@@ -55,6 +57,7 @@ export default {
const { code, data } = await getNewsDetailAPI({ id: this.$route.params.id });
if (code) {
this.title = data.post_title;
this.title_en = data.post_title_en;
this.content = data.product_advantages;
this.keyword = data.post_keyword ? data.post_keyword : 'hager 海格电气 新闻';
this.description = data.post_description ? data.post_description : data.post_title;
......@@ -89,7 +92,15 @@ export default {
text-align: center;
font-size: 1.75rem;
font-weight: bold;
margin: 3rem 0;
margin: 3rem 0 0 0;
}
.news-title-en {
color: @primary-color;
text-align: center;
font-size: 1.2rem;
font-weight: bold;
margin: 0 0 2rem 0;
}
:deep(.news-content) {
......