guhongwei před 4 roky
rodič
revize
b221bad949

+ 2 - 0
src/views/hallList/parts/kjpd.vue

@@ -59,6 +59,8 @@ export default {
     async linkBtn(item) {
       if (this.user.uid || this.user.suid) {
         if (
+          this.user.role == '0' ||
+          this.user.role == '1' ||
           this.user.role == '2' ||
           this.user.role == '3' ||
           this.user.role == '4' ||

+ 165 - 11
src/views/kjpdhall/index.vue

@@ -1,32 +1,186 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24">
-        <p>index</p>
+      <el-col :span="24" class="main">
+        <el-col :span="24" class="maininfo">
+          <div class="w_1200">
+            <el-col :span="24" class="one">
+              科技频道
+            </el-col>
+            <el-col :span="24" class="two">
+              <el-col :span="24" class="two1">
+                <el-button type="primary" size="mini" @click="$router.push({ path: '/hallList/index' })">返回</el-button>
+              </el-col>
+              <el-col :span="24" class="two2">
+                <el-col :span="24" class="title">
+                  {{ info.title }}
+                </el-col>
+                <el-col :span="24" class="video">
+                  <video :src="getvideo(videodata)" autoplay="" controls="controls" controlsList="nodownload">
+                    您的浏览器不支持 video 标签。
+                  </video>
+                </el-col>
+              </el-col>
+              <el-col :span="24" class="two3">
+                <el-tabs type="border-card">
+                  <el-tab-pane label="视频简介">
+                    <el-col :span="24">
+                      <p><span>来源:</span>{{ info.orgin }}</p>
+                    </el-col>
+                    <el-col :span="24">
+                      <p><span>更新时间:</span>{{ info.create_time }}</p>
+                    </el-col>
+                    <el-col :span="24">
+                      <p class="desc"><span>视频简介:</span>{{ info.desc }}</p>
+                    </el-col>
+                  </el-tab-pane>
+                </el-tabs>
+              </el-col>
+            </el-col>
+          </div>
+        </el-col>
+        <div class="pz_down">
+          <live-foot></live-foot>
+        </div>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import liveFoot from '@/layout/live/foot.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: channel } = createNamespacedHelpers('channel');
+var moment = require('moment');
 export default {
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
   name: 'index',
   props: {},
-  components: {},
+  components: { liveFoot },
   data: function() {
-    return {};
+    return {
+      // 信息详情
+      info: {},
+      videodata: [],
+      times: 5,
+    };
+  },
+  async created() {
+    await this.search();
+    await this.searchinfo();
+  },
+  methods: {
+    ...channel(['query', 'fetch', 'update', 'create', 'delete']),
+    async search() {
+      let id = this.$route.query.id;
+      if (id) {
+        let res = await this.fetch(id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `info`, res.data);
+        }
+      }
+    },
+    async searchinfo() {
+      let id = this.$route.query.id;
+      if (id) {
+        let res = await this.fetch(id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `videodata`, res.data.videodata);
+        }
+      }
+    },
+    async searchvideo() {
+      this.timer = setInterval(async () => {
+        this.times--;
+        if (this.times === 0) {
+          this.searchinfo();
+          this.times = 5;
+          clearInterval(this.timer);
+        }
+      }, 1000);
+    },
+    getvideo(data) {
+      let adate = moment().format('YYYY-MM-DD HH:mm');
+      // 05-10 10-15
+      // let adate = '2020-11-10 11:10';
+      let arr = data.find(i => i.start_time == adate);
+      if (arr) {
+        return arr.url;
+      } else {
+        if (data[0]) {
+          return data[0].url;
+        }
+      }
+    },
   },
-  created() {},
-  methods: {},
   computed: {
     ...mapState(['user']),
+    // id() {
+    //   return this.$route.query.id;
+    // },
+  },
+  watch: {
+    times: {
+      immediate: true,
+      handler(val) {
+        if (val == 5) {
+          this.searchvideo();
+        }
+      },
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
   },
-  watch: {},
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.main {
+  .maininfo {
+    min-height: 935px;
+    background-color: #292a2f;
+    padding: 0 0 15px 0;
+    .one {
+      height: 100px;
+      margin: 50px 0;
+      font-size: 50px;
+      color: #fff;
+      font-family: cursive;
+      line-height: 100px;
+    }
+    .two {
+      min-height: 660px;
+      background: #fff;
+      padding: 20px;
+      .two1 {
+        text-align: right;
+        padding: 0 0 10px 0;
+      }
+      .two2 {
+        margin: 0 0 10px 0;
+        .title {
+          font-size: 25px;
+          padding: 15px 0 40px 0;
+          text-align: center;
+          font-weight: bold;
+        }
+        .video {
+          text-align: center;
+          video {
+            height: 350px;
+          }
+        }
+      }
+      .two3 {
+        p {
+          padding: 5px 10px 0px 10px;
+          font-size: 16px;
+          span {
+            font-weight: bold;
+          }
+        }
+      }
+    }
+  }
+}
+</style>

+ 15 - 0
src/views/superAdminCenter/channel/index.vue

@@ -38,6 +38,9 @@
                   <el-option v-for="item in options" :key="item.code" :label="item.name" :value="item.code"> </el-option>
                 </el-select>
               </el-form-item>
+              <el-form-item label="信息来源">
+                <el-input v-model="form.orgin" placeholder="请输入信息来源"> </el-input>
+              </el-form-item>
               <el-form-item label="主办方">
                 <el-input v-model="form.sponsor" placeholder="请输入主办方"> </el-input>
               </el-form-item>
@@ -47,6 +50,10 @@
               <el-form-item label="简介">
                 <el-input type="textarea" v-model="form.desc" placeholder="请输入简介"></el-input>
               </el-form-item>
+              <el-form-item label="发布时间">
+                <el-date-picker v-model="form.create_time" type="date" placeholder="请选择发布时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+                </el-date-picker>
+              </el-form-item>
               <el-form-item label="图片">
                 <upload :limit="1" :data="form.image_path" type="image_path" :url="'/files/imgpath/upload'" @upload="uploadSuccess"></upload>
               </el-form-item>
@@ -267,6 +274,14 @@ export default {
       this.form.videodata.push(data);
       this.dialogclose();
     },
+    // 删除
+    delAttend(index, val) {
+      this.form.videodata.splice(index, 1);
+      this.$message({
+        message: '删除专利信息成功',
+        type: 'success',
+      });
+    },
     // 关闭
     dialogclose() {
       this.videoform = {};