123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <div class="bg-guide">
- <video v-for="item in topADList" id="ad" :key="item.id" class="w345h120" :poster="item.imgUrls[0]" :src="item.videoUrl" @click="playAd()" />
- <v-tabs v-model="tab" color="#3666F2" background-color="transparent" style="height: 42px;">
- <v-tab v-for="item in videoList" :key="item.plateId" style="height: 42px;">{{item.plateName}}</v-tab>
- <v-tabs-items v-model="tab">
- <v-tab-item v-for="item in videoList" :key="item.plateId" style="padding: 10px;">
- <video v-for="ele in item.videoCourseList" :id="'el-video-' + ele.id" :key="ele.id" class="w165h148" preload="auto" :poster="'http://110.53.221.195:8210/document/newFile/download/0/e858720c23ke455aa60e?fileKey=' + ele.coverImageKey" :src="'http://110.53.221.195:8210/document/newFile/download/0/e858720c23ke455aa60e?fileKey=' + ele.videoKey" @click="play('el-video-' + ele.id)" />
- </v-tab-item>
- </v-tabs-items>
- </v-tabs>
- </div>
- </template>
- <script>
- export default {
- name: 'GuidePc',
- auth: false,
- data() {
- return {
- tab: null,
- videoList: [],
- topADList: [],
- token: ''
- }
- },
- fetch() {
- this.token = this.$route.query.token;
- },
- created() {
- this.getActiveInfo()
- this.getAdInfoByAdPlace()
- },
- methods: {
- async getActiveInfo() {
- const res = await this.$axios.$get('/videoCourse/client/list');
- this.videoList = res.data;
- },
- async getAdInfoByAdPlace() {
- const data = {
- id: 1,
- adPlace: 511,
- os: 1
- }
- const res = await this.$axios.$post('/v5/advertising/getAdInfoByAdPlace', data);
- this.topADList = res.data;
- },
- play(item, ele) {
- const elVideo = document.getElementById('el-video-' + ele.id)
- if (elVideo.requestFullscreen) {
- elVideo.requestFullscreen()
- elVideo.play()
- } else if (elVideo.mozRequestFullscreen) {
- elVideo.mozRequestFullscreen()
- elVideo.play()
- } else if (elVideo.webkitRequestFullscreen) {
- elVideo.webkitRequestFullscreen()
- elVideo.play()
- }
- this.submit(item, ele, 1)
- },
- playAd(item, ele) {
- const elVideo = document.getElementById('ad')
- if (elVideo.requestFullscreen) {
- elVideo.requestFullscreen()
- elVideo.play()
- } else if (elVideo.mozRequestFullscreen) {
- elVideo.mozRequestFullscreen()
- elVideo.play()
- } else if (elVideo.webkitRequestFullscreen) {
- elVideo.webkitRequestFullscreen()
- elVideo.play()
- }
- this.submit(item, ele, 2)
- },
- submit(item, ele, flag) {
- const data = flag === 1 ? { id: ele.id, plateId: item.plateId, type: flag, videoId: ele.id } : { type: 2 }
- this.$axios.$post('/v5/advertising/getAdInfoByAdPlace', data, {headers: {Authorization: this.token}});
- }
- }
- }
- </script>
- <style lang="scss">
- @media (min-width: 0px) {
- .bg-guide {
- & .v-tabs-bar {
- height: 42px !important;
- }
- }
- }
- </style>
- <style lang="scss" scoped>
- @media (min-width: 0px) {
- .bg-guide {
- min-height: 100vh;
- overflow: hidden;
- & .v-tab {
- font-size: 12px;
- min-width: 88px;
- }
- & .v-tabs-bar {
- height: 42px !important;
- }
- }
- .w345h120 {
- width: 345px;
- height: 120px;
- margin: 10px auto;
- display: block;
- background: #FAFAFA;
- }
- .w165h148 {
- width: 165px;
- height: 148px;
- margin-bottom: 10px;
- margin-right: 30px;
- &:nth-of-type(4n+0){
- margin-right: 0px;
- }
- }
- }
- </style>
|