guhongwei 5 年之前
父节点
当前提交
67540b5e6b

+ 2 - 0
src/store/index.js

@@ -5,6 +5,7 @@ import chat from '@common/store/live/chat';
 import roomchat from '@common/store/live/room-chat';
 import apply from '@common/store/live/apply';
 import dock from '@common/store/live/dock';
+import column from '@common/store/live/column';
 import news from '@common/store/live/news';
 import market from '@common/store/market/market';
 import transaction from '@common/store/market/transaction';
@@ -36,6 +37,7 @@ export default new Vuex.Store({
     chat,
     dock,
     apply,
+    column,
     news,
     login,
     personalchat,

+ 1 - 1
src/views/detail/detail.vue

@@ -14,7 +14,7 @@
             <img :src="detailinfo.picture" class="detailimg" />
           </div>
           <div class="detailcontext">
-            {{ detailinfo.content }}
+            <p v-html="detailinfo.content"></p>
           </div>
         </div>
       </div>

+ 2 - 2
src/views/detail/eduDetail.vue

@@ -13,12 +13,12 @@
             <img :src="detailinfo.picture" class="detailimg" />
           </div>
           <div class="detailVideo">
-            <video :src="videoUrl" controls="controls">
+            <video :src="detailinfo.filepath" controls="controls">
               您的浏览器不支持 video 标签。
             </video>
           </div>
           <div class="detailcontext">
-            {{ detailinfo.content }}
+            <p v-html="detailinfo.content"></p>
           </div>
         </div>
       </div>

+ 1 - 1
src/views/detail/semDetail.vue

@@ -33,7 +33,7 @@
                     <span>1楼</span>
                   </el-col>
                   <el-col :span="24" class="info">
-                    <p>{{ detail.content }}</p>
+                    <p v-html="detail.content"></p>
                   </el-col>
                   <el-col :span="24" class="jubao">
                     <span>举报</span>

+ 25 - 12
src/views/technical/index.vue

@@ -18,7 +18,7 @@
             <p>{{ item.publish_time }}</p>
             <p>
               <span @click="$router.push({ path: '/live/semDetail', query: { id: item.id } })" class="textOver">{{ item.title }}</span>
-              <span>{{ item.content }}</span>
+              <span>{{ item.titlejj }}</span>
             </p>
           </el-col>
         </el-col>
@@ -85,7 +85,7 @@
             <p>{{ item.publish_time }}</p>
             <p>
               <span class="textOver" @click="$router.push({ path: '/live/eduDetail', query: { id: item.id } })">{{ item.title }}</span>
-              <span>{{ item.content }}</span>
+              <span>{{ item.titlejj }}</span>
             </p>
           </el-col>
         </el-col>
@@ -97,6 +97,7 @@
 <script>
 import _ from 'lodash';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: column } = createNamespacedHelpers('column');
 const { mapActions: news } = createNamespacedHelpers('news');
 export default {
   name: 'technical',
@@ -123,16 +124,28 @@ export default {
   },
 
   methods: {
-    ...news(['query']),
-    async searchInfo() {
-      let res = await this.query({ skip: 0, limit: 5, column_name: '专题研讨' });
-      if (this.$checkRes(res)) this.$set(this, `zhuantiList`, res.data);
-      res = await this.query({ skip: 0, limit: 8, column_name: '技术问答' });
-      if (this.$checkRes(res)) this.$set(this, `jishuList`, res.data);
-      res = await this.query({ skip: 0, limit: 8, column_name: '行业研究' });
-      if (this.$checkRes(res)) this.$set(this, `hangyeList`, res.data);
-      res = await this.query({ skip: 0, limit: 5, column_name: '教育培训' });
-      if (this.$checkRes(res)) this.$set(this, `jiaoyuList`, res.data);
+    ...column({ columnList: 'query', columnInfo: 'fetch' }),
+    ...news({ newsList: 'query' }),
+    async searchInfo({ ...info } = {}) {
+      const res = await this.columnList({ ...info });
+      for (const val of res.data) {
+        this.tpxwSearch({ column_id: val.id, column_name: val.name, site: val.site });
+      }
+    },
+    async tpxwSearch({ column_id, column_name, site } = {}) {
+      if (column_name == '专题研讨') {
+        const res = await this.newsList({ skip: 0, limit: 5, column_id: column_id });
+        if (this.$checkRes(res)) this.$set(this, `zhuantiList`, res.data);
+      } else if (column_name == '专家问诊') {
+        const res = await this.newsList({ skip: 0, limit: 8, column_id: column_id });
+        if (this.$checkRes(res)) this.$set(this, `jishuList`, res.data);
+      } else if (column_name == '行业研究') {
+        const res = await this.newsList({ skip: 0, limit: 8, column_id: column_id });
+        if (this.$checkRes(res)) this.$set(this, `hangyeList`, res.data);
+      } else if (column_name == '教育培训') {
+        const res = await this.newsList({ skip: 0, limit: 5, column_id: column_id });
+        if (this.$checkRes(res)) this.$set(this, `jiaoyuList`, res.data);
+      }
     },
     turnToList(column_name) {
       this.$router.push({ path: '/technical/list', query: { column_name: column_name } });

+ 3 - 3
src/views/technical/list.vue

@@ -17,7 +17,7 @@
             <p>{{ item.publish_time }}</p>
             <p>
               <span class="textOver" @click="clickzhuanti(item.id)">{{ item.title }}</span>
-              <span>{{ item.content }}</span>
+              <span>{{ item.titlejj }}</span>
             </p>
           </el-col>
         </el-col>
@@ -51,7 +51,7 @@
             <p>{{ item.publish_time }}</p>
             <p>
               <span class="textOver" @click="clickjiaoyu(item.id)">{{ item.title }}</span>
-              <span>{{ item.content }}</span>
+              <span>{{ item.titlejj }}</span>
             </p>
           </el-col>
         </el-col>
@@ -132,7 +132,7 @@ export default {
         res = await this.query({ skip, limit, column_name: '专题研讨', ...info });
         this.$set(this, `zhuantiList`, res.data);
       } else if (name == '专家问诊') {
-        res = await this.query({ skip, limit, column_name: '技术问答', ...info });
+        res = await this.query({ skip, limit, column_name: '专家问诊', ...info });
         this.$set(this, `jishuList`, res.data);
       } else if (name == '行业研究') {
         res = await this.query({ skip, limit, column_name: '行业研究', ...info });