|
@@ -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>
|