Эх сурвалжийг харах

Merge branch 'dev' of xiongzhu/imt into master

panhui 5 жил өмнө
parent
commit
071a7b6f5d

+ 15 - 1
src/main/pc/src/components/news/Gride.vue

@@ -1,5 +1,14 @@
 <template>
-    <router-link class="news-info" :to="'/NewsDetail?id=' + this.info.id">
+    <router-link
+        class="news-info"
+        :to="{
+            name: 'NewsDetail',
+            query: {
+                id: info.id,
+                type: type
+            }
+        }"
+    >
         <el-card :class="[shadow ? 'shadow' : 'border']" :body-style="{ padding: '0px' }">
             <div class="top">
                 <div
@@ -50,6 +59,11 @@ export default {
             default: false
         }
     },
+    computed: {
+        type() {
+            return this.$route.query.type || '';
+        }
+    },
     methods: {
         goDetail() {
             this.$router.push('/NewsDetail?id=' + this.info.id);

+ 13 - 4
src/main/pc/src/components/news/Row.vue

@@ -7,12 +7,12 @@
                 </div>
                 <div class="info">
                     <div class="name">
-                        <el-tag v-if="isList && info.top" size="mini" effect="dark">{{$t('zhi-ding')}}</el-tag>
+                        <el-tag v-if="isList && info.top" size="mini" effect="dark">{{ $t('zhi-ding') }}</el-tag>
                         <!-- {{ info.title }} -->
                         <span v-html="getImport(info.title)"></span>
                     </div>
                     <template v-if="isActivity">
-                        <div class="info-item" style="margin-top: 20px">
+                        <div class="info-item" style="margin-top: 20px;">
                             <div class="info-name">{{ $t('shi-jian') }}:</div>
                             <div class="info-val">{{ info.date }}</div>
                         </div>
@@ -96,12 +96,21 @@ export default {
         isEnd() {
             return this.info.isEnd || false;
         },
+        type() {
+            return this.$route.query.type || '';
+        },
         routerPath() {
+            let path = '';
             if (this.userActivity) {
-                return '/mineActivityDetail?informationId=' + this.info.id;
+                path = '/mineActivityDetail?informationId=' + this.info.id;
             } else {
-                return '/NewsDetail?id=' + this.info.id;
+                path = '/NewsDetail?id=' + this.info.id;
+            }
+
+            if (this.type) {
+                path += '&type=' + this.type;
             }
+            return path;
         }
     },
     methods: {

+ 1 - 1
src/main/pc/src/locales/zh.json

@@ -45,7 +45,7 @@
   "fen-xiang-zhan-shang": "分享",
   "guan-yu": "关于",
   "chan-pin-mu-lu": "产品目录",
-  "xin-wen-zi-xun": "新闻资讯",
+  "xin-wen-zi-xun": "科技资讯",
   "di-zhi": "地址",
   "chang-ci": "场次",
   "bao-ming-jie-shu": "报名结束",

+ 7 - 2
src/main/pc/src/views/news/NewsDetail.vue

@@ -4,8 +4,10 @@
             <el-breadcrumb separator="/">
                 <el-breadcrumb-item :to="{ path: '/' }">{{ $t('shou-ye') }}</el-breadcrumb-item>
                 <el-breadcrumb-item :to="{ path: '/NEWS' }">{{ $t('xin-wen-zi-xun') }}</el-breadcrumb-item>
-                <el-breadcrumb-item :to="typeTo" replace>{{ $i18n.t(typeInfo.name) }}</el-breadcrumb-item>
-                <el-breadcrumb-item>{{ $i18n.t(typeInfo.name) }} {{ $t('xiang-qing') }}</el-breadcrumb-item>
+                <el-breadcrumb-item v-if="showType" :to="typeTo" replace>{{
+                    $i18n.t(typeInfo.name)
+                }}</el-breadcrumb-item>
+                <el-breadcrumb-item>{{ $t('xiang-qing') }}</el-breadcrumb-item>
             </el-breadcrumb>
             <div class="default-info" v-if="information.type !== 'INDUSTRY_ACTIVITIES'">
                 <div class="main-title">
@@ -126,6 +128,9 @@ export default {
         };
     },
     computed: {
+        showType() {
+            return !!(this.$route.query.type || '');
+        },
         typeInfo() {
             if (this.information.type) {
                 return [...InformationType].find(item => {