From 56a24896039d87a86bb8a9b5f392fda39eb963bf Mon Sep 17 00:00:00 2001 From: binbin0314 Date: Tue, 19 Jan 2021 18:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=94=E7=A9=B6=E9=99=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PlatformList/PlatformList.vue | 13 +++--- .../Children/ShareChild/Institute.vue | 44 +++++++++---------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/components/PlatformList/PlatformList.vue b/src/components/PlatformList/PlatformList.vue index 82f7581..d470f9f 100644 --- a/src/components/PlatformList/PlatformList.vue +++ b/src/components/PlatformList/PlatformList.vue @@ -5,7 +5,7 @@

{{ item.name }}

-

了解更多→

+

了解更多→

@@ -182,24 +182,27 @@ export default { } }, // 查看 研究院/仪器 详情 - jump(id) { + jump(item) { if (this.listState === 0) { this.$router.push({ path: '/NewPlatform/Share/Institute', name: 'Institute', - params: { id }, + params: { + id: item.id, + direction: item.direction, + }, }); } else if (this.listState === 1) { this.$router.push({ path: '/NewPlatform/Share/InsDet', name: 'InsDet', - params: { id }, + params: { id: item.id }, }); } else if (this.listState === 3) { this.$router.push({ path: '/NewPlatform/Share/InsDet', name: 'InsDet', - params: { id }, + params: { id: item.id }, }); } }, diff --git a/src/views/NewPlatform/Children/ShareChild/Institute.vue b/src/views/NewPlatform/Children/ShareChild/Institute.vue index 4e21f81..238231f 100644 --- a/src/views/NewPlatform/Children/ShareChild/Institute.vue +++ b/src/views/NewPlatform/Children/ShareChild/Institute.vue @@ -7,15 +7,10 @@

研究院介绍

-
研究院介绍
+
{{ direction }}

设备列表

-
+

{{ item.name }}

了解更多→

@@ -53,8 +48,8 @@

{{ obj.direction }}

- +
@@ -102,6 +99,7 @@ export default { ], obj: null, list: [], + direction: '', }; }, computed: mapState('home', ['LabId']), @@ -112,6 +110,9 @@ export default { } else { this.id = this.LabId; } + if (this.$route.params.direction) { + this.direction = this.$route.params.direction; + } this.getData(); this.getTeam(); }, @@ -131,7 +132,7 @@ export default { const res = await selInstrumentByRes(params); const { code, msg, data } = res.data; if (code === 200) { - if (data.list !== []) { + if (data.list && data.list.length > 0) { this.list = data.list; this.total = parseInt(data.total); } @@ -147,9 +148,8 @@ export default { const res = await teamSearch(params); const { code, msg, data } = res.data; if (code === 200) { - if (data !== [] && data.length > 0) { + if (data && data.length > 0) { this.obj = data[0]; - console.log('this.obj: ', this.obj); } } } catch (error) {