Commit a20c9ac9 authored by zhanglw's avatar zhanglw

资讯详情

parent 9365911a
...@@ -59,7 +59,8 @@ router.beforeEach((to, from, next) => { ...@@ -59,7 +59,8 @@ router.beforeEach((to, from, next) => {
/* has no token*/ /* has no token*/
if (to.path === '/') { // 根路由重定向到前台home页 if (to.path === '/') { // 根路由重定向到前台home页
next('/home') next('/home')
} else if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 } else if (findUrl(whiteList, to.path)) { // 在免登录白名单,直接进入
// } else if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next() next()
} else if (findUrl(backUrlList, to.path)) { // 后台路由重定向到后台登录 } else if (findUrl(backUrlList, to.path)) { // 后台路由重定向到后台登录
next(`/backlogin?redirect=${to.fullPath}`) next(`/backlogin?redirect=${to.fullPath}`)
......
...@@ -92,6 +92,14 @@ export const constantRouterMap = [ ...@@ -92,6 +92,14 @@ export const constantRouterMap = [
}, },
hidden: true hidden: true
}, },
{
path: '/information/details/:id',
meta: { title: '资讯详情', noCache: true },
component: (resolve) => {
return require(['@/views/homepage/information/details'], resolve)
},
hidden: true
},
{ {
path: '/backstage', path: '/backstage',
component: Layout, component: Layout,
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
>{{ item.name }}</div> >{{ item.name }}</div>
</div></el-col> </div></el-col>
<el-col :span="8"><div class="box-toplist"> <el-col :span="8"><div class="box-toplist">
<div class="title">供应商TOP8</div> <div class="toplist-title">供应商TOP8</div>
<ul class="contact-list"> <ul class="contact-list">
<li v-for="(item, index) in topSuppliers" :key="'ts_'+index" class="contact-item"> <li v-for="(item, index) in topSuppliers" :key="'ts_'+index" class="contact-item">
<img src="@/assets/home_images/to_like_b.png"> <img src="@/assets/home_images/to_like_b.png">
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
</ul> </ul>
</div></el-col> </div></el-col>
<el-col :span="8"><div class="box-toplist"> <el-col :span="8"><div class="box-toplist">
<div class="title">产品TOP8</div> <div class="toplist-title">产品TOP8</div>
<ul class="contact-list"> <ul class="contact-list">
<li v-for="(item, index) in topProducts" :key="'tp_'+index" class="contact-item"> <li v-for="(item, index) in topProducts" :key="'tp_'+index" class="contact-item">
<img src="@/assets/home_images/to_like_a.png"> <img src="@/assets/home_images/to_like_a.png">
...@@ -594,7 +594,7 @@ export default { ...@@ -594,7 +594,7 @@ export default {
border-radius: 10px; border-radius: 10px;
font-size: 22px; font-size: 22px;
letter-spacing: 2px; letter-spacing: 2px;
.title { .toplist-title {
width: 100%; width: 100%;
padding: 10px 15px; padding: 10px 15px;
background: #0457C7; background: #0457C7;
......
<template>
<div class="page-body">
<div class="head-box">
<div class="head-box-top">
<div class="top-call" />
<div class="top-call"><img src="@/assets/home_images/gemho_logo_b.png"></div>
<div class="top-call"><title-menus ref="titleMenus" menu-index="6" style="padding-top: 15px" /></div>
<div class="top-call"><user-login ref="userLogin" /></div>
<div class="top-call"><language-setting ref="languageSetting" /></div>
</div>
</div>
<div class="content-box">
<div style="width: 88%;padding-left: 9%;">
<div class="showcase">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/information' }">行业资讯</el-breadcrumb-item>
<el-breadcrumb-item>资讯详情</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="news-head">
<h2>{{ dataObj.title }}</h2>
<div class="news-info">
<span>来源:{{ dataObj.msgSrc }}</span>
<span>发布时间:{{ dataObj.date }}</span>
</div>
</div>
<div class="news-body">
<p v-html="dataObj.content" />
</div>
</div>
</div>
<home-footer ref="homeFooter" />
<inquiry-view ref="inquiryView" />
<el-backtop />
</div>
</template>
<script>
import default_project from '@/assets/home_images/default_project.png'
import default_banner from '@/assets/home_images/banner.png'
import titleMenus from '../components/titleMenusV2'
import userLogin from '../components/userLoginV2'
import languageSetting from '../components/languageSettingV2'
import homeFooter from '../components/homeFooter'
import inquiryView from '../components/inquiryView'
export default {
components: { titleMenus, userLogin, languageSetting, homeFooter, inquiryView },
dicts: [],
data() {
return {
defaultImgProject: default_project,
defaultImgBanner: default_banner,
imgSrcStart: process.env.VUE_APP_BASE_API,
page: 1,
pageSize: 16,
total: 55,
tabIndex: '1',
query: {
keyword: '',
area: undefined,
type: undefined,
sort: false
},
dataObj: {
title: '工业传感器:夯实新基建工业创新基础',
content: '           与当前快速发展的互联网一样,传感器的发展为其带来机遇与挑战。未来传感器的先进程度决定了机械制造、汽车、过程控制和制造领域的国际竞争力。美国则在上世纪80年代就成立了国际技术小组(BGT),从国家层面协调政府资源、企业和相关部门在传感器技术、功能材料等全方面开展工作,服务于美国工业制造、智能制造和军工领域。日本在上世纪末就已经将传感器技术列为本世纪十大技术之首与当前快速发展的互联网一样,传感器的发展为其带来机遇与挑战。未来传感器的先进程度决定了机械制造、汽车、过程控制和制造领域的国际竞争力。美国则在上世纪80年代就成立了国际技术小组(BGT),从国家层面协调政府资源、企业和相关部门在传感器技术、功能材料等全方面开展工作,服务于美国工业制造、智能制造和军工领域。日本在上世纪末就已经将传感器技术列为本世纪十大技术之首与当前快速发展的互联网一样,传感器的发展为其带来机遇与挑战。未来传感器的先进程度决定了机械制造、汽车、过程控制和制造领域的国际竞争力。美国则在上世纪80年代就成立了国际技术小组(BGT),从国家层面协调政府资源、企业和相关部门在传感器技术、功能材料等全方面开展工作,服务于美国工业制造、智能制造和军工领域。日本在上世纪末就已经将传感器技术列为本世纪十大技术之首与当前快速发展的互联网一样,传感器的发展为其带来机遇与挑战。未来传感器的先进程度决定了机械制造、汽车、过程控制和制造领域的国际竞争力。美国则在上世纪80年代就成立了国际技术小组(BGT),从国家层面协调政府资源、企业和相关部门在传感器技术、功能材料等全方面开展工作,服务于美国工业制造、智能制造和军工领域。日本在上世纪末就已经将传感器技术列为本世纪十大技术之首与当前快速发展的互联网一样,传感器的发展为其带来机遇与挑战。未来传感器的先进程度决定了机械制造、汽车、过程控制和制造领域的国际竞争力。美国则在上世纪80年代就成立了国际技术小组(BGT),从国家层面协调政府资源、企业和相关部门在传感器技术、功能材料等全方面开展工作,服务于美国工业制造、智能制造和军工领域。日本在上世纪末就已经将传感器技术列为本世纪十大技术之首',
msgSrc: 'xxxx新闻网',
date: '2023-06-12'
},
throttle: null, // 节流器
throttleTime: 300
}
},
mounted() {
this.$nextTick(() => {
console.log(this.$route.params)
})
},
methods: {
onDictReady(dict) {
},
setQuertType(type) {
if (type === this.query.type) {
this.query.sort = !this.query.sort
} else {
this.query.type = type
this.query.sort = false
}
},
changeTabIndex(index) {
if (this.tabIndex !== index) {
this.tabIndex = index
this.page = 1
}
},
// 点击询价
inquiry(item, type) {
console.log(item, type)
this.$refs.inquiryView.initView(item.id, type)
},
// 跳转到详情
goToDetails(item, type) {
console.log(item, type)
},
pageChange(e) {
this.page = e
this.loadData()
},
loadData() {
},
goTop() {
document.body.scrollTop = 0
document.documentElement.scrollTop = 0
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.touch {
cursor:pointer;
}
.clear {
clear: both
}
.inline-block {
display: inline-block;
}
.ellipsis {
// 多行溢出省略号
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
-webkit-line-clamp: 4;
text-overflow: ellipsis;
}
.pagination {
margin-top: 23px;
text-align: center;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
>>>.el-pagination.is-background .el-pager li {
font-style: normal;
font-weight: 400;
font-size: 14px;
text-align: center;
background-color: #fff;
color: #000000;
border: 1px solid #e5e5ea;
}
/* 激活后的样式 */
>>>.el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #ffffff;
color: #0366ed;
border: 1px solid #0366ed;
text-align: center;
}
/* 修改左右箭头样式 */
>>>.el-pagination .btn-next .el-icon, >>>.el-pagination .btn-prev .el-icon {
font-style: normal;
font-weight: 400;
font-size: 14px;
text-align: center;
background-color: #fff;
color: #e5e5ea;
border: 1px solid #e5e5ea;
}
>>>.el-pager {
height: 35.5px !important;
}
>>>.number, >>>.el-icon {
height: 35.5px !important;
line-height: 35.5px !important;
}
}
.head-box {
width: 100vw;
top: 0;
position: fixed;
background: none repeat scroll 0 0 white;
z-index: 999;
box-shadow: 0px 3px 7px 0px rgba(0,0,0,0.2);
.head-box-top {
display: flex;
justify-content: space-evenly;
align-items: center;
.top-call {
height: 80px;
padding-top: 15px;
}
}
}
.content-box {
min-height: 80vh;
margin-top: 94px;
font-family: Source Han Sans CN;
.tab-box {
margin: 20px 0;
width: 100%;
display: flex;
justify-content: center;
padding: 7px;
border-top: 3px solid #0457C7;
border-bottom: 3px solid #0457C7;
.tab-menu {
width: 300px;
line-height: 30px;
text-align: center;
font-size: 22px;
font-weight: 400;
color: #666666;
}
.tab-menu:hover {
font-weight: bold;
}
.active {
color: #0457C7;
}
.tab-separate {
width: 3px;
height: 30px;
background: #0457C7;
}
}
.page-title {
margin-top: 20px;
padding: 0 20px;
font-size: 26px;
font-weight: bold;
color: #333333;
}
.block-box {
width: 100%;
margin: 12px 0;
border: 1px solid rgba(0,0,0,0.12);
box-shadow: 1px 2px 8px 0 rgba(0,0,0,0.12);
border-radius: 10px;
.content {
height: 150px;
padding: 14px 30px 20px 0;
font-size: 16px;
line-height: 32px;
color: #666666;
}
}
.box-title {
padding-top: 24px;
font-size: 22px;
}
.box-title:hover {
color: #0457C7
}
.inline-box {
width: 100%;
border-bottom: 1px solid rgba(0,0,0,0.12);
.content {
padding: 10px 0;
height: 110px;
font-size: 16px;
line-height: 26px;
color: #666666;
}
}
.box-card {
display: inline-block;
position: relative;
margin: 12px;
padding: 10px 0;
width: 350px;
background: #FFFFFF;
border: 1px solid rgba(0,0,0,0.12);
box-shadow: 1px 2px 8px 0 rgba(0,0,0,0.12);
border-radius: 10px;
.line-text {
width: 100%;
text-align: center;
padding: 5px;
font-size: 18px;
font-weight: bolder;
opacity: 0.85;
}
.line-text:hover {
opacity: 1;
}
.float-title {
width: 344px;
position: absolute;
padding: 5px;
top: 200px;
left: 2px;
text-align: center;
font-weight: 600;
color: #fff;
background: rgba(0,0,0,0.6);
opacity: 0.9;
}
.float-title:hover {
opacity: 1;
}
.title {
width: 305px;
padding: 2px 20px;
font-size: 18px;
color: #333333;
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow:ellipsis;
}
.title:hover {
font-weight: 600;
}
.subTitle {
width: 260px;
padding: 2px 20px;
font-size: 15px;
color: #1961C5;
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow:ellipsis;
}
.area {
padding: 2px 0;
font-size: 17px;
color: #666666;
}
.date {
padding: 2px 10px;
font-size: 17px;
color: #999999;
}
.stamp {
border-style: none;
position: absolute;
z-index: 99;
}
}
}
.search-box {
padding-top: 12px;
width: 100%;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
user-select: none;
.search-item {
width: 100%;
height: 38px;
display: inline-block;
padding: 8px 20px;
background: #F7F7F7;
border: 1px solid rgba(0,0,0,0.12);
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow:ellipsis;
.label:hover {
font-weight: 600;
}
.btn {
width: 74px;
padding: 3px;
margin-left: 12px;
display: inline-block;
background: #1961C5;
border-radius: 6px;
color: white;
text-align: center;
opacity: 0.7;
}
.btn:hover {
opacity: 1;
}
}
.area-title {
height: 62px;
background: #F7F7F7;
border: 1px solid rgba(0,0,0,0.12);
text-align: center;
line-height: 60px;
}
.area_item {
height: 30px;
padding: 6px 12px;
display: inline-block;
}
.area_item:hover {
font-weight: 600;
}
.active {
color: #1961C5;
}
.search-tools {
width: 100%;
.btn{
width: 76%;
height: 38px;
border: 2px solid #1961C5;
border-radius: 8px;
background: #1961C5;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 21px;
color: #ffffff;
opacity: 0.7;
}
.btn:hover {
opacity: 1;
}
>>>.el-input__inner {
height: 38px;
border: 2px solid #1961C5;
border-radius: 8px;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 18px;
color: #333333;
opacity: 0.7;
}
>>>.el-input__inner:hover {
opacity: 1;
}
}
.search-keyword {
padding: 5px 0;
font-family: Source Han Sans CN;
font-weight: 400;
font-size: 14px;
text-align: left;
.label {
padding: 1px 15px 1px;
color: #333333;
cursor:pointer;
user-select: none;
}
.label:hover {
color: #1961C5;
}
}
}
.line-btn {
display: flex;
justify-content: center;
font-family: Source Han Sans CN;
font-weight: 400;
.btn-o {
margin: 0 25px;
width: 360px;
padding: 6px 10px;
background: #F7601A;
box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
text-align: center;
border: 1px solid transparent;
font-size: 22px;
color: #FFFFFF;
cursor:pointer;
user-select: none;
}
.btn-o:hover {
border: 1px solid rgba(30, 144, 255, 0.8);
color: #1482f0;
}
.btn-l {
margin: 0 25px;
width: 360px;
padding: 10px;
background: #1961C5;
box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
text-align: center;
border: 1px solid transparent;
font-size: 22px;
color: #FFFFFF;
cursor:pointer;
user-select: none;
}
.btn-l:hover {
border: 1px solid rgba(0,0,0,0.3);
color: #F7601A;
}
.btn-b {
margin: 0 10px;
width: 168px;
padding: 6px;
background: #EFF6FF;
border: 1px solid transparent;
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2);
text-align: center;
font-size: 20px;
color: #1961C5;
cursor:pointer;
user-select: none;
}
.btn-b:hover {
border: 1px solid rgba(30, 144, 255, 0.9);
}
.active {
color: #FFFFFF;
font-weight: 400;
background: #1961C5;
}
}
.showcase {
padding: 1px 0;
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: 400;
}
.news-head {
text-align: center;
h2 {
font-size: 42px;
}
.news-info {
width: 70%;
margin: auto;
padding-bottom: 15px;
border-bottom: 2px dotted #a3a3a3;
font-size: 14px;
color: #666;
span {
padding: 0 100px;
}
}
}
.news-body {
width: 100%;
padding: 0 10px;
color: #666;
}
</style>
...@@ -171,6 +171,11 @@ export default { ...@@ -171,6 +171,11 @@ export default {
// 跳转到详情 // 跳转到详情
goToDetails(item, type) { goToDetails(item, type) {
console.log(item, type) console.log(item, type)
switch (type) {
case 'information':
this.$router.push({ path: `/information/details/${item.id || 123}` })
break
}
}, },
pageChange(e) { pageChange(e) {
this.page = e this.page = e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment