guhongwei 3 年之前
父节点
当前提交
2707203202

+ 1 - 0
src/store/index.js

@@ -67,6 +67,7 @@ import mechanism from '@common/src/store/mechanism';
 // 科教之旅
 import Medium from '@common/src/store/kjzl/Medium';
 import Order from '@common/src/store/kjzl/Order';
+
 Vue.use(Vuex);
 
 export default new Vuex.Store({

+ 20 - 22
src/views/twoweb/universal/index.vue

@@ -5,10 +5,10 @@
         <div class="w_1200">
           <el-col :span="24" class="one">
             <el-col :span="12" class="left">
-              <venues :list="kydtList"></venues>
+              <venues :list="kpcgList"></venues>
             </el-col>
             <el-col :span="12" class="right">
-              <experience :list="xsjlList"></experience>
+              <experience :list="kptyList"></experience>
             </el-col>
           </el-col>
           <el-col :span="24" class="two">
@@ -16,10 +16,10 @@
           </el-col>
           <el-col :span="24" class="one">
             <el-col :span="12" class="left">
-              <read :list="ydhzList"></read>
+              <read :list="kxjdList"></read>
             </el-col>
             <el-col :span="12" class="right">
-              <science :list="hyyjList"></science>
+              <science :list="hkjList"></science>
             </el-col>
           </el-col>
         </div>
@@ -34,8 +34,7 @@ import experience from './index/experience.vue';
 import read from './index/read.vue';
 import science from './index/science.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: column } = createNamespacedHelpers('column');
-const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: universal } = createNamespacedHelpers('universal');
 export default {
   metaInfo() {
     return { title: this.$route.meta.title };
@@ -51,31 +50,30 @@ export default {
   data: function() {
     return {
       imgUrl: require('@common/src/assets/center/kxpj.png'),
-      kydtList: [],
-      xsjlList: [],
-      ydhzList: [],
-      hyyjList: [],
+      kpcgList: [],
+      kptyList: [],
+      kxjdList: [],
+      hkjList: [],
+      typeList: [
+        { name: '科普场馆', type: 'kpcg' },
+        { name: '科普体验', type: 'kpty' },
+        { name: '科学解读', type: 'kxjd' },
+        { name: '黑科技', type: 'hkj' },
+      ],
     };
   },
   async created() {
     await this.search();
   },
   methods: {
-    ...column({ columnQuery: 'query' }),
-    ...news(['query']),
+    ...universal(['query']),
     async search({ skip = 0, limit = 11, ...info } = {}) {
-      let res = await this.columnQuery();
-      if (this.$checkRes(res)) {
-        for (const val of res.data) {
-          let arr = await this.query({ skip, limit, column_id: val.id, ...info });
-          if (this.$checkRes(arr)) {
-            if (this[`${val.site}List`]) {
-              this.$set(this, `${val.site}List`, arr.data);
-            }
-          }
+      for (const val of this.typeList) {
+        let res = await this.query({ skip, limit, type: val.name, ...info });
+        if (this.$checkRes(res)) {
+          this.$set(this, `${val.type}List`, res.data);
         }
       }
-      console.log(res);
     },
   },
   computed: {

+ 1 - 1
src/views/twoweb/universal/index/experience.vue

@@ -12,7 +12,7 @@
                 {{ item.title }}
               </el-col>
               <el-col :span="4" class="date textOver">
-                {{ item.publish_time || '暂无' }}
+                {{ item.create_time || '暂无' }}
               </el-col>
             </el-col>
           </el-col>

+ 1 - 1
src/views/twoweb/universal/index/read.vue

@@ -12,7 +12,7 @@
                 {{ item.title }}
               </el-col>
               <el-col :span="4" class="date textOver">
-                {{ item.publish_time || '暂无' }}
+                {{ item.create_time || '暂无' }}
               </el-col>
             </el-col>
           </el-col>

+ 1 - 1
src/views/twoweb/universal/index/science.vue

@@ -12,7 +12,7 @@
                 {{ item.title }}
               </el-col>
               <el-col :span="4" class="date textOver">
-                {{ item.publish_time || '暂无' }}
+                {{ item.create_time || '暂无' }}
               </el-col>
             </el-col>
           </el-col>

+ 1 - 1
src/views/twoweb/universal/index/venues.vue

@@ -12,7 +12,7 @@
                 {{ item.title }}
               </el-col>
               <el-col :span="4" class="date textOver">
-                {{ item.publish_time || '暂无' }}
+                {{ item.create_time || '暂无' }}
               </el-col>
             </el-col>
           </el-col>

+ 28 - 30
src/views/twoweb/universal/list/detail-model/news-model.vue

@@ -11,18 +11,24 @@
           <p>{{ data.title }}</p>
           <p>
             <span>信息来源:{{ data.origin || '暂无' }}</span>
-            <span>发布时间:{{ data.publish_time || '暂无' }}</span>
+            <span>发布时间:{{ data.create_time || '暂无' }}</span>
           </p>
         </el-col>
-        <el-col :span="24" class="two" v-if="data.picture != null || undefined">
-          <el-image :src="data.picture"></el-image>
+        <el-col :span="24" class="two" v-if="data.img_url.length > 0">
+          <el-carousel height="300px">
+            <el-carousel-item v-for="(item, index) in data.img_url" :key="index">
+              <el-image :src="item.url"></el-image>
+            </el-carousel-item>
+          </el-carousel>
         </el-col>
-        <el-col :span="24" class="three">
-          <p v-html="data.content"></p>
+        <el-col :span="24" class="thr" v-if="data.file_url.length > 0">
+          <video :src="getVideo(data.file_url)" controls autoplay loop>
+            <source src="movie.mp4" type="video/mp4" />
+            <source src="movie.ogg" type="video/ogg" />
+          </video>
         </el-col>
-        <el-col :span="24" class="four" v-if="data.filepath">
-          <h4>附件:</h4>
-          <el-link :href="data.filepath" :underline="false">{{ data.filepathname || '附件下载' }}</el-link>
+        <el-col :span="24" class="four">
+          <p v-html="data.content"></p>
         </el-col>
       </el-col>
     </el-row>
@@ -41,7 +47,11 @@ export default {
     return {};
   },
   created() {},
-  methods: {},
+  methods: {
+    getVideo(data) {
+      if (data.length > 0) return data[0].url;
+    },
+  },
   computed: {
     ...mapState(['user', 'menuParams']),
     pageTitle() {
@@ -82,30 +92,18 @@ export default {
   }
   .two {
     text-align: center;
-    margin: 0 0 15px 0;
+    margin: 0 0 10px 0;
     .el-image {
-      width: 60%;
+      height: 300px;
     }
   }
-  .three {
-    margin: 0 0 15px 0;
-    /deep/p {
-      font-size: 16px;
-      font-family: 微软雅黑;
-      color: #444;
-      // img {
-      //   padding: 10px 140px !important;
-      // }
-    }
-  }
-  .four {
-    h4 {
-      color: #400eff;
-      font-weight: bold;
-      margin: 0;
-    }
-    .el-link {
-      padding: 10px 0 0 10px;
+  .thr {
+    text-align: center;
+    margin: 0 0 10px 0;
+    video {
+      width: 50%;
+      height: 250px;
+      overflow: hidden;
     }
   }
 }

+ 4 - 15
src/views/twoweb/universal/list/experience.vue

@@ -14,8 +14,7 @@
 <script>
 import listPage from '@c/list/list-page.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: column } = createNamespacedHelpers('column');
-const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: universal } = createNamespacedHelpers('universal');
 export default {
   name: 'dynamic',
   props: ['listModel'],
@@ -35,15 +34,13 @@ export default {
     };
   },
   async created() {
-    await this.searchOther();
     await this.search();
   },
   methods: {
-    ...column({ columnQuery: 'query' }),
-    ...news(['query', 'fetch']),
+    ...universal(['query', 'fetch']),
     async search({ skip = 0, limit = this.pageSize, ...info } = {}) {
       // TODO: 查询
-      let res = await this.query({ skip, limit, column_id: this.column.id, ...info });
+      let res = await this.query({ skip, limit, type: '科普体验', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -55,7 +52,7 @@ export default {
       const list = data.map(i => {
         const obj = { id: i.id || i._id };
         obj.p1 = _.get(i, 'title');
-        obj.p2 = _.get(i, 'publish_time');
+        obj.p2 = _.get(i, 'create_time');
         return obj;
       });
       return list;
@@ -67,14 +64,6 @@ export default {
         this.$set(this, `detail`, res.data);
       }
     },
-    // 查询其他
-    async searchOther() {
-      let res = await this.columnQuery();
-      if (this.$checkRes(res)) {
-        let column = res.data.find(i => i.site == 'xsjl');
-        if (column) this.$set(this, `column`, column);
-      }
-    },
   },
   computed: {
     ...mapState(['user', 'menuParams']),

+ 4 - 15
src/views/twoweb/universal/list/read.vue

@@ -14,8 +14,7 @@
 <script>
 import listPage from '@c/list/list-page.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: column } = createNamespacedHelpers('column');
-const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: universal } = createNamespacedHelpers('universal');
 export default {
   name: 'cooperation',
   props: ['listModel'],
@@ -35,15 +34,13 @@ export default {
     };
   },
   async created() {
-    await this.searchOther();
     await this.search();
   },
   methods: {
-    ...column({ columnQuery: 'query' }),
-    ...news(['query', 'fetch']),
+    ...universal(['query', 'fetch']),
     async search({ skip = 0, limit = this.pageSize, ...info } = {}) {
       // TODO: 查询
-      let res = await this.query({ skip, limit, column_id: this.column.id, ...info });
+      let res = await this.query({ skip, limit, type: '科学解读', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -55,7 +52,7 @@ export default {
       const list = data.map(i => {
         const obj = { id: i.id || i._id };
         obj.p1 = _.get(i, 'title');
-        obj.p2 = _.get(i, 'publish_time');
+        obj.p2 = _.get(i, 'create_time');
         return obj;
       });
       return list;
@@ -67,14 +64,6 @@ export default {
         this.$set(this, `detail`, res.data);
       }
     },
-    // 查询其他
-    async searchOther() {
-      let res = await this.columnQuery();
-      if (this.$checkRes(res)) {
-        let column = res.data.find(i => i.site == 'ydhz');
-        if (column) this.$set(this, `column`, column);
-      }
-    },
   },
   computed: {
     ...mapState(['user', 'menuParams']),

+ 4 - 15
src/views/twoweb/universal/list/science.vue

@@ -14,8 +14,7 @@
 <script>
 import listPage from '@c/list/list-page.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: column } = createNamespacedHelpers('column');
-const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: universal } = createNamespacedHelpers('universal');
 export default {
   name: 'industry',
   props: ['listModel'],
@@ -35,15 +34,13 @@ export default {
     };
   },
   async created() {
-    await this.searchOther();
     await this.search();
   },
   methods: {
-    ...column({ columnQuery: 'query' }),
-    ...news(['query', 'fetch']),
+    ...universal(['query', 'fetch']),
     async search({ skip = 0, limit = this.pageSize, ...info } = {}) {
       // TODO: 查询
-      let res = await this.query({ skip, limit, column_id: this.column.id, ...info });
+      let res = await this.query({ skip, limit, type: '黑科技', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -55,7 +52,7 @@ export default {
       const list = data.map(i => {
         const obj = { id: i.id || i._id };
         obj.p1 = _.get(i, 'title');
-        obj.p2 = _.get(i, 'publish_time');
+        obj.p2 = _.get(i, 'create_time');
         return obj;
       });
       return list;
@@ -67,14 +64,6 @@ export default {
         this.$set(this, `detail`, res.data);
       }
     },
-    // 查询其他
-    async searchOther() {
-      let res = await this.columnQuery();
-      if (this.$checkRes(res)) {
-        let column = res.data.find(i => i.site == 'hyyj');
-        if (column) this.$set(this, `column`, column);
-      }
-    },
   },
   computed: {
     ...mapState(['user', 'menuParams']),

+ 4 - 15
src/views/twoweb/universal/list/venues.vue

@@ -14,8 +14,7 @@
 <script>
 import listPage from '@c/list/list-page.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: column } = createNamespacedHelpers('column');
-const { mapActions: news } = createNamespacedHelpers('news');
+const { mapActions: universal } = createNamespacedHelpers('universal');
 export default {
   name: 'dynamic',
   props: ['listModel'],
@@ -35,15 +34,13 @@ export default {
     };
   },
   async created() {
-    await this.searchOther();
     await this.search();
   },
   methods: {
-    ...column({ columnQuery: 'query' }),
-    ...news(['query', 'fetch']),
+    ...universal(['query', 'fetch']),
     async search({ skip = 0, limit = this.pageSize, ...info } = {}) {
       // TODO: 查询
-      let res = await this.query({ skip, limit, column_id: this.column.id, ...info });
+      let res = await this.query({ skip, limit, type: '科普场馆', ...info });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
@@ -55,7 +52,7 @@ export default {
       const list = data.map(i => {
         const obj = { id: i.id || i._id };
         obj.p1 = _.get(i, 'title');
-        obj.p2 = _.get(i, 'publish_time');
+        obj.p2 = _.get(i, 'create_time');
         return obj;
       });
       return list;
@@ -67,14 +64,6 @@ export default {
         this.$set(this, `detail`, res.data);
       }
     },
-    // 查询其他
-    async searchOther() {
-      let res = await this.columnQuery();
-      if (this.$checkRes(res)) {
-        let column = res.data.find(i => i.site == 'kydt');
-        if (column) this.$set(this, `column`, column);
-      }
-    },
   },
   computed: {
     ...mapState(['user', 'menuParams']),