This commit is contained in:
clay
2022-01-22 20:45:07 +08:00
parent 72fbaed559
commit 6b2d1034c2
20 changed files with 181 additions and 149 deletions

View File

@@ -1,47 +1,22 @@
<template>
<div class="news_center">
<!--title
<el-row>
<el-col :xs="1" :sm="2" :md="4" :lg="6" :xl="6">
<div class="grid-content"></div>
</el-col>
<el-col class="headline" :xs="22" :sm="20" :md="16" :lg="12" :xl="12">
<div class="title">
{{ $t('message.news_center') }}
<div class="headline">
<div class="hr_div">
<div class="hr_line_left">
</div>
<el-row>
<el-col :span="9">
<hr class="hr">
</el-col>
<el-col :span="6">
<div class="divider_text">News Center</div>
</el-col>
<el-col :span="9">
<hr class="hr">
</el-col>
</el-row>
</el-col>
</el-row>-->
<!--title-->
<div class="headline">
<div class="hr_div">
<div class="hr_line_left">
</div>
<div class="hr_dot_left">
</div>
</div>
<div class="title">
{{ $t('message.news_ceter') }}
</div>
<div class="hr_div">
<div class="hr_line_right">
</div>
<div class="hr_dot_right">
</div>
<div class="hr_dot_left">
</div>
</div>
<div class="title">
{{ $t('message.news_ceter') }}
</div>
<div class="hr_div">
<div class="hr_line_right">
</div>
<div class="hr_dot_right">
</div>
</div>
</div>
<!--录播图-->
@@ -52,8 +27,8 @@
<el-col :xs="22" :sm="20" :md="20" :lg="18" :xl="14">
<div class="slideshow">
<el-carousel trigger="click" height="23.3vw">
<el-carousel-item v-for="(item,index) in bannerDate" :key="index" @click="clickTo(item.link)">
<div>
<el-carousel-item v-for="(item,index) in bannerDate" :key="index">
<div v-show="$i18n.locale === 'cn'" @click="clickTo(item.link)">
<img :src="item.imgurl" alt="">
<div class="bottom_title">
<el-row>
@@ -63,6 +38,16 @@
</el-row>
</div>
</div>
<div v-show="$i18n.locale === 'en'" @click="clickTo(item.enLink)">
<img :src="item.imgurl" alt="">
<div class="bottom_title">
<el-row>
<el-col :offset="2" :span="18">
{{ item.enTitle }}
</el-col>
</el-row>
</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
@@ -125,25 +110,25 @@ export default {
this.getBanner()
},
methods: {
clickTo(link){
clickTo(link) {
//console.log(link)
window.location.href=link;//当前标签页
window.location.href = link;//当前标签页
},
lookMore(news){
info(news.id).then(res=>{
lookMore(news) {
info(news.id).then(res => {
let info = getParentNode(res.data.encodeId)
console.log(res)
if (info.three ==null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type);
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type);
if (info.three == null) {
if (this.width) {
this.$router.push("/pc/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else {
this.$router.push("/mobile/" + info.second.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type);
}else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type);
} else {
if (this.width) {
this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
} else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type + "&lang=" + sessionStorage.getItem("lang"));
}
}
})
@@ -161,9 +146,9 @@ export default {
info(news.id).then(res => {
let info = getParentNode(res.data.encodeId)
if (this.width) {
this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id);
this.$router.push("/pc/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
} else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id);
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?id=" + news.id + "&lang=" + sessionStorage.getItem("lang"));
}
})
},
@@ -176,7 +161,7 @@ export default {
}
</script>
<style>
.el-carousel__indicators{
.el-carousel__indicators {
display: none;
}
</style>
@@ -231,7 +216,8 @@ export default {
border: 0.1rem solid #CAD9F3;
.news_context_img {
height: 14rem;
height: 62%;
width: 100%;
img {
width: 100%;
@@ -239,18 +225,19 @@ export default {
}
.news_context_text {
font-size: 1.6rem;
font-family: "微软雅黑";
font-weight: 400;
color: #262626;
margin: 1rem auto;
height: 28%;
width: 80%;
//height: 4rem;
overflow: hidden; //超出的文本隐藏
text-overflow: ellipsis; //溢出用省略号显示
display: -webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp: 3; //显示的行
font-size: 1.6rem;
font-weight: 400;
text-align: center;
color: #262626;
margin: 0 auto;
padding: 1rem 0;
text-overflow: ellipsis;
overflow: hidden;
display:-webkit-box; //作为弹性伸缩盒子模型显示。
-webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
-webkit-line-clamp:3; //显示的行
}
}
}

View File

@@ -138,15 +138,15 @@ export default {
console.log(res)
if (info.three ==null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}
})

View File

@@ -175,15 +175,15 @@ export default {
console.log(res)
if (info.three ==null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}
})
@@ -204,15 +204,15 @@ export default {
console.log(info)
if (info.three == null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id);
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id);
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}
}

View File

@@ -1,14 +1,26 @@
<template>
<div class="banner-card">
<ul class="ul">
<li v-for="(item,index) in bannerDate" :key="index" @click="clickTo(item.link)">
<div class="card_img">
<img
:src="item.imgurl"
alt=""/>
<li v-for="(item,index) in bannerDate" :key="index">
<div v-if="$i18n.locale === 'cn'" @click="clickTo(item.link)">
<div class="card_img" >
<img
:src="item.imgurl"
alt=""/>
</div>
<div class="card_title">
{{item.title}}
</div>
</div>
<div class="card_title">
{{item.title}}
<div v-if="$i18n.locale === 'en'" @click="clickTo(item.enLink)">
<div class="card_img" >
<img
:src="item.imgurl"
alt=""/>
</div>
<div class="card_title">
{{item.enTitle}}
</div>
</div>
</li>
</ul>

View File

@@ -98,15 +98,15 @@ export default {
console.log(res)
if (info.three ==null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId +"?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId + "/" + info.three.encodeId + "?type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}
})
@@ -130,15 +130,15 @@ export default {
console.log(info)
if (info.three == null){
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type);
this.$router.push("/pc/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type);
this.$router.push("/mobile/" + info.second.encodeId +"?id="+news.id + "&type=" + info.second.type+"&lang="+sessionStorage.getItem("lang"));
}
}else {
if (this.width){
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id);
this.$router.push("/pc/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}else {
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id);
this.$router.push("/mobile/" + info.second.encodeId +"/" +info.three.encodeId+"?id="+news.id+"&lang="+sessionStorage.getItem("lang"));
}
}