guhongwei 3 years ago
parent
commit
b672f8459d

+ 6 - 6
src/router/index.js

@@ -126,12 +126,12 @@ const live = [
   //   meta: { title: '直播大厅-对接项目', subSite: true },
   //   component: () => import('../views/achieveLive/product/detail.vue'),
   // },
-  // {
-  //   path: '/achieveLive/guestRoad/index',
-  //   name: 'achieveLive_guestRoad',
-  //   meta: { title: '直播大厅-嘉宾访谈,项目路演', subSite: true },
-  //   component: () => import('../views/achieveLive/guestRoad/index.vue'),
-  // },
+  {
+    path: '/achieveLive/news/detail',
+    name: 'achieveLive_news_detail',
+    meta: { title: '直播大厅-嘉宾访谈,项目路演', subSite: true },
+    component: () => import('../views/achieveLive/news/detail.vue'),
+  },
 
   {
     path: '/website',

+ 2 - 2
src/views/achieveLive/before.vue

@@ -51,9 +51,9 @@ export default {
     },
     dockBtn(data) {
       if (data.room_id == '1007') {
-        this.$router.push({ path: '/halltwo/directTwo', query: { id: data.id } });
+        this.$router.push({ path: '/halltwo/directTwo', query: { dock_id: data.id } });
       } else {
-        this.$router.push({ path: '/achieveLive/detail', query: { id: data.id } });
+        this.$router.push({ path: '/achieveLive/detail', query: { dock_id: data.id } });
       }
     },
   },

+ 4 - 4
src/views/achieveLive/detail.vue

@@ -78,12 +78,12 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...dock(['fetch']),
     async search() {
-      let res = await this.fetch(this.id);
+      let res = await this.fetch(this.dock_id);
       if (this.$checkRes(res)) {
         this.$set(this, `info`, res.data);
       }
@@ -91,8 +91,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 2 - 2
src/views/achieveLive/detail/chatData.vue

@@ -32,8 +32,8 @@ export default {
   methods: {},
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 3 - 3
src/views/achieveLive/detail/expertData.vue

@@ -51,7 +51,7 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...expert(['query']),
@@ -70,8 +70,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 5 - 5
src/views/achieveLive/detail/imgtextData.vue

@@ -91,18 +91,18 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...dockImgtxt(['query']),
     ...dockTranscation({ transQuery: 'query' }),
     async search() {
       // 查询图文
-      let res = await this.query({ dock_id: this.id });
+      let res = await this.query({ dock_id: this.dock_id });
       if (this.$checkRes(res)) {
         this.$set(this, `imgList`, res.data);
       }
-      res = await this.transQuery({ dock_id: this.id });
+      res = await this.transQuery({ dock_id: this.dock_id });
       if (this.$checkRes(res)) {
         let second = res.data.filter(i => i.status == '0');
         if (second) this.$set(this, `secondList`, second);
@@ -126,8 +126,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 7 - 5
src/views/achieveLive/detail/jiabinData.vue

@@ -43,21 +43,23 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...interview(['query']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, dock_id: this.id, ...info });
+      let res = await this.query({ skip, dock_id: this.dock_id, ...info });
       if (this.$checkRes(res)) this.$set(this, `list`, res.data);
     },
     // 详情
-    detail(data) {},
+    detail(data) {
+      this.$router.push({ path: '/achieveLive/news/detail', query: { dock_id: this.dock_id, id: data.id, type: '0' } });
+    },
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 4 - 4
src/views/achieveLive/detail/productData.vue

@@ -62,12 +62,12 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...statistics(['dockProduct']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      info.dock_id = this.id;
+      info.dock_id = this.dock_id;
       let res = await this.dockProduct({ skip, limit, type: '0', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `techolList`, res.data);
@@ -86,8 +86,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 3 - 3
src/views/achieveLive/detail/top.vue

@@ -69,7 +69,7 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...statistics(['dockQuery']),
@@ -83,8 +83,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 4 - 4
src/views/achieveLive/detail/videoData.vue

@@ -63,12 +63,12 @@ export default {
     };
   },
   async created() {
-    await this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...dockVideo(['query']),
     async search() {
-      let res = await this.query({ dock_id: this.id });
+      let res = await this.query({ dock_id: this.dock_id });
       if (this.$checkRes(res)) {
         this.$set(this, `videoList`, res.data);
         this.changeMenu('0', this.videoList[0]);
@@ -83,8 +83,8 @@ export default {
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 8 - 5
src/views/achieveLive/detail/xiangmuData.vue

@@ -45,21 +45,24 @@ export default {
     };
   },
   created() {
-    if (this.id) this.search();
+    if (this.dock_id) this.search();
   },
   methods: {
     ...roadShow(['query']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      let res = await this.query({ skip, dock_id: this.id, ...info });
+      let res = await this.query({ skip, dock_id: this.idock_idd, ...info });
       if (this.$checkRes(res)) this.$set(this, `list`, res.data);
     },
     // 查看详情
-    detail(data) {},
+    // 详情
+    detail(data) {
+      this.$router.push({ path: '/achieveLive/news/detail', query: { dock_id: this.dock_id, id: data.id, type: '1' } });
+    },
   },
   computed: {
     ...mapState(['user']),
-    id() {
-      return this.$route.query.id;
+    dock_id() {
+      return this.$route.query.dock_id;
     },
   },
   metaInfo() {

+ 166 - 0
src/views/achieveLive/news/detail.vue

@@ -0,0 +1,166 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="one">
+          <top :info="info"></top>
+        </el-col>
+        <el-col :span="24" class="two">
+          <div class="w_1200">
+            <el-col :span="24" class="two_1">
+              <el-col :span="24" class="top">
+                <el-button type="primary" size="mini" @click="back">返回</el-button>
+              </el-col>
+              <el-col :span="24" class="down">
+                <el-col :span="24" class="title">
+                  {{ detailInfo.title }}
+                </el-col>
+                <el-col :span="24" class="other">
+                  <span>发布时间:{{ detailInfo.publish_time || '暂无' }}</span>
+                  <span>信息来源:{{ detailInfo.origin || '暂无' }}</span>
+                </el-col>
+                <el-col :span="24" class="image" v-if="detailInfo.picture">
+                  <el-image :src="detailInfo.picture"></el-image>
+                </el-col>
+                <el-col :span="24" class="video" v-if="detailInfo.filepath">
+                  <video :src="detailInfo.filepath" controls="controls">
+                    您的浏览器不支持 video 标签。
+                  </video>
+                </el-col>
+                <el-col :span="24" class="content">
+                  <p v-html="detailInfo.content"></p>
+                </el-col>
+              </el-col>
+            </el-col>
+          </div>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '../detail/top.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: dock } = createNamespacedHelpers('dock');
+const { mapActions: interview } = createNamespacedHelpers('interview');
+const { mapActions: roadShow } = createNamespacedHelpers('roadShow');
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    top,
+  },
+  data: function() {
+    return {
+      info: {},
+      detailInfo: {},
+    };
+  },
+  created() {
+    if (this.dock_id) this.search();
+  },
+  methods: {
+    ...dock(['fetch']),
+    ...interview({ interviewFetch: 'fetch' }),
+    ...roadShow({ roadShowFetch: 'fetch' }),
+    async search() {
+      let res = await this.fetch(this.dock_id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `info`, res.data);
+      }
+      if (this.type == '0') {
+        let res = await this.interviewFetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `detailInfo`, res.data);
+        }
+      } else if (this.type == '1') {
+        let res = await this.roadShowFetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `detailInfo`, res.data);
+        }
+      }
+    },
+    back() {
+      this.$router.push({ path: '/achieveLive/detail', query: { dock_id: this.dock_id } });
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    dock_id() {
+      return this.$route.query.dock_id;
+    },
+    id() {
+      return this.$route.query.id;
+    },
+    type() {
+      return this.$route.query.type;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.main {
+  .two {
+    .two_1 {
+      min-height: 630px;
+      box-shadow: 0 0 5px #ccc;
+      background-color: #fff;
+      padding: 20px;
+      .top {
+        text-align: right;
+        margin: 0 0 10px 0;
+      }
+      .down {
+        .title {
+          text-align: center;
+          font-size: 30px;
+          font-weight: bold;
+          padding: 15px 0;
+        }
+        .other {
+          text-align: center;
+          font-size: 18px;
+          color: #666;
+          padding: 0 0 15px 0;
+          span {
+            padding: 0 0 0 10px;
+          }
+        }
+        .image {
+          text-align: center;
+          height: 300px;
+          overflow: hidden;
+          margin: 0 0 15px 0;
+          .el-image {
+            width: 50%;
+            height: 300px;
+          }
+        }
+        .video {
+          text-align: center;
+          margin: 0 0 15px 0;
+          height: 300px;
+          overflow: hidden;
+          video {
+            width: 50%;
+            height: 300px;
+            background-color: #000000;
+          }
+        }
+      }
+    }
+  }
+}
+</style>