|
@@ -4,14 +4,15 @@
|
|
|
:autoBack="false">
|
|
|
</u-navbar>
|
|
|
<swiper :style="'width: '+ windowWidth +'px; height:100vh; background-color: #000;'" class="swiper"
|
|
|
- :circular='false' @change="swiperChange" :current="swiperCurrent" :vertical="true" duration="300">
|
|
|
+ :circular='false' @change="swiperChange" :current="swiperCurrent" :vertical="true" duration="200">
|
|
|
<block v-for="content in videoInfo.updated_episode_num">
|
|
|
<swiper-item :key="content">
|
|
|
<view :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'">
|
|
|
- <video autoplay :key="content" id="myVideo" :controls="controls" :loop="!isplay"
|
|
|
- :enable-progress-gesture="false" :show-center-play-btn="false" :show-loading="false"
|
|
|
- :show-fullscreen-btn="false" @ended="ended" @controlstoggle="controlstoggle"
|
|
|
- @click="tapVides()" :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
|
|
|
+ <!-- @controlstoggle="controlstoggle" -->
|
|
|
+ <video v-if="isShowVideo(content)" autoplay :key="content" id="myVideo" :controls="controls"
|
|
|
+ :loop="!isplay" preload="auto" :enable-progress-gesture="true" :show-center-play-btn="false"
|
|
|
+ :show-loading="false" :show-fullscreen-btn="false" @ended="ended" @click="tapVides()"
|
|
|
+ :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
|
|
|
:src="currentVideoInfo.video_url" class="tsvideo">
|
|
|
</video>
|
|
|
<view v-if="isqp" class="userInfo">
|
|
@@ -62,24 +63,25 @@
|
|
|
</swiper-item>
|
|
|
</block>
|
|
|
</swiper>
|
|
|
- <uni-popup type="bottom" ref="select" style="z-index: 100;">
|
|
|
+ <uni-popup type="bottom" ref="select" style="z-index: 100;" :mask-click="true">
|
|
|
<view v-if="fenji==1" class="pop-my">
|
|
|
<view class="ju-top">
|
|
|
<view style="display: flex; flex-direction: column; ">
|
|
|
<view style="display: flex; flex-direction: column;">
|
|
|
<view style="display: flex; flex-direction: column;">
|
|
|
- <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
|
|
|
- :inactiveStyle="inactiveStyle" style="align-items: center; width: 100%;"
|
|
|
- :list="list1" :current="current" @click="click"></u-tabs>
|
|
|
+ <view class="utabs-top">
|
|
|
+ <u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
|
|
|
+ :inactiveStyle="inactiveStyle" class="utabs-top" :list="list1"
|
|
|
+ :current="current"></u-tabs>
|
|
|
+ </view>
|
|
|
<view class="ju-top-title">
|
|
|
{{videoInfo.name}}
|
|
|
</view>
|
|
|
<view class="ju-top-update"> 已更新至{{videoInfo.updated_episode_num}}集 </view>
|
|
|
</view>
|
|
|
<u-tabs v-if="fenji==1" :activeStyle="activeStyle" lineColor="none"
|
|
|
- :inactiveStyle="inactiveStyle" style="align-items: flex-start; width: 100%;"
|
|
|
- :list="labelList" @click="click"></u-tabs>
|
|
|
- {{labelList}}
|
|
|
+ :inactiveStyle="inactiveStyle" :current="tabcurrent" :list="labelList"
|
|
|
+ @click="labelListClick"></u-tabs>
|
|
|
</view>
|
|
|
<view class="down" @click="down">
|
|
|
<text class="down-text">收起</text>
|
|
@@ -109,6 +111,20 @@
|
|
|
</view>
|
|
|
<view v-if="fenji==2"
|
|
|
:style="'width: '+ windowWidth +'px;height:500px; background-color: #fff; border-top-left-radius: 10px; border-top-right-radius: 10px;'">
|
|
|
+ <view class="charge-wrapper">
|
|
|
+ <view class="top">
|
|
|
+ <text class="charge-title">充值购买后可继续观看{{topTitle}} </text>
|
|
|
+ <text class="charge-info">为保护创作者权益,当前内容需要付费观看。</text>
|
|
|
+ <view class="charge-coin">
|
|
|
+ <text class="ji">本集:</text>
|
|
|
+ <text class="bi">{{videoInfo.charge_coin}}k币</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="bottom">
|
|
|
+ <text></text>
|
|
|
+ <text></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
@@ -126,10 +142,10 @@
|
|
|
storeshelf
|
|
|
} from '@/common/apis/zju.js'
|
|
|
import configs from "@/common/config.js"
|
|
|
- let audo = uni.createInnerAudioContext('myVideo')
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ limitPage: 15,
|
|
|
top_height: 0,
|
|
|
episode: 1,
|
|
|
swiperCurrent: 0,
|
|
@@ -144,16 +160,9 @@
|
|
|
color: '#606266',
|
|
|
transform: 'scale(1)'
|
|
|
},
|
|
|
- activeIndex: 0,
|
|
|
+ activeIndex: 1,
|
|
|
tabcurrent: 0,
|
|
|
- videoInfo: {
|
|
|
- "name": "test1-112",
|
|
|
- "charge_sequence": 24,
|
|
|
- "charge_coin": 125,
|
|
|
- "total_episode_num": 98,
|
|
|
- "updated_episode_num": 24,
|
|
|
- "update_type": 1
|
|
|
- },
|
|
|
+ videoInfo: {},
|
|
|
labelList: [],
|
|
|
list1: [{
|
|
|
name: '当前剧集',
|
|
@@ -167,6 +176,7 @@
|
|
|
strShareSummary: "分享总结",
|
|
|
strShareImageUrl: ""
|
|
|
},
|
|
|
+ isShow: true,
|
|
|
fenji: 0,
|
|
|
controls: true,
|
|
|
windowWidth: 0,
|
|
@@ -184,6 +194,11 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ isShowVideo(item) {
|
|
|
+ return (item) => {
|
|
|
+ return this.swiperCurrent == item && this.isShow
|
|
|
+ }
|
|
|
+ },
|
|
|
isShowVip(item) {
|
|
|
return (item) => {
|
|
|
return item >= this.videoInfo.charge_sequence && item <= this.videoInfo.updated_episode_num
|
|
@@ -195,20 +210,20 @@
|
|
|
}
|
|
|
},
|
|
|
topTitle() {
|
|
|
- return `${this.videoInfo.name} 第${this.episode}集`
|
|
|
+ return `《${this.videoInfo.name}》 第${this.episode}集`
|
|
|
}
|
|
|
},
|
|
|
onReady: function(res) {
|
|
|
this.videoContext = uni.createVideoContext('myVideo')
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.initTabs();
|
|
|
this.initSwiperData(this.swiperCurrent + 1)
|
|
|
getVideoInfo({
|
|
|
video_id: this.video_id
|
|
|
}).then(res => {
|
|
|
// console.log(res, 'getVideoInfogetVideoInfogetVideoInfo')
|
|
|
- this.videoInfo = res
|
|
|
+ this.videoInfo = res.data
|
|
|
+ this.initTabs();
|
|
|
})
|
|
|
},
|
|
|
onLoad(e) {
|
|
@@ -261,6 +276,12 @@
|
|
|
return obj
|
|
|
// #endif
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ activeIndex(newVal, oldVal) {
|
|
|
+ let index = this.labelList.findIndex(el => el.content.includes(newVal))
|
|
|
+ this.tabcurrent = index
|
|
|
+ }
|
|
|
+ },
|
|
|
onBackPress() {},
|
|
|
methods: {
|
|
|
bingewatch() {
|
|
@@ -330,7 +351,7 @@
|
|
|
}
|
|
|
return arr
|
|
|
}
|
|
|
- const pageSize = 15;
|
|
|
+ const pageSize = this.limitPage;
|
|
|
const total = this.videoInfo.total_episode_num;
|
|
|
const pageCount = Math.ceil(total / pageSize);
|
|
|
for (let i = 0; i < pageCount; i++) {
|
|
@@ -380,9 +401,9 @@
|
|
|
this.down();
|
|
|
}
|
|
|
},
|
|
|
- click(item) {
|
|
|
+ labelListClick(item) {
|
|
|
this.tabcurrent = item.index
|
|
|
- console.log('item', item);
|
|
|
+ console.log('itemitemitemitemitem', item);
|
|
|
},
|
|
|
share() {
|
|
|
var href = '/pages/video/index?video_id=' + this.video_id
|
|
@@ -446,17 +467,31 @@
|
|
|
console.log('显示swiper Index:', this.displayIndex)
|
|
|
}
|
|
|
},
|
|
|
- /**
|
|
|
- * 初始一个显示的swiper数据
|
|
|
- * @originIndex 从源数据的哪个开始显示默认0,如从其他页面跳转进来,要显示第n个,这个参数就是他的下标
|
|
|
- */
|
|
|
initSwiperData(originIndex) {
|
|
|
- this.isqp = false
|
|
|
+ this.episode = originIndex;
|
|
|
+ this.isqp = true
|
|
|
videoEpisodePlay({
|
|
|
video_id: this.video_id,
|
|
|
sequence: originIndex
|
|
|
}).then(res => {
|
|
|
- this.currentVideoInfo = res
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.currentVideoInfo = res.data
|
|
|
+ this.activeIndex = this.episode;
|
|
|
+ this.isShow = true
|
|
|
+ } else if (res.code == 500101) {
|
|
|
+ console.log(this.currentVideoInfo, 'res.code == 500101res.code == 500101')
|
|
|
+ this.currentVideoInfo.video_url = ""
|
|
|
+ this.isShow = false
|
|
|
+ this.isqp = true
|
|
|
+ this.videoContext.stop()
|
|
|
+ this.fenji = 2
|
|
|
+ this.$refs.select.open('bottom');
|
|
|
+ // this.currentVideoInfo = {}
|
|
|
+ } else {
|
|
|
+ this.currentVideoInfo.video_url = ""
|
|
|
+ this.isShow = false
|
|
|
+ }
|
|
|
+
|
|
|
console.log(res, 'getVideoEpisodePlaygetVideoEpisodePlay')
|
|
|
})
|
|
|
},
|
|
@@ -467,8 +502,8 @@
|
|
|
const {
|
|
|
current
|
|
|
} = event.detail;
|
|
|
- this.episode = current + 1;
|
|
|
- this.activeIndex = this.episode;
|
|
|
+ this.swiperCurrent = current
|
|
|
+ console.log(this.swiperCurrent, 'this.swiperCurrentthis.swiperCurrent')
|
|
|
this.initSwiperData(current + 1)
|
|
|
},
|
|
|
controlstoggle(e) {
|
|
@@ -479,7 +514,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- page {
|
|
|
+ .content {
|
|
|
background: #000000;
|
|
|
}
|
|
|
|
|
@@ -535,6 +570,42 @@
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+ .charge-wrapper {
|
|
|
+ margin-top: 15px;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .top {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .charge-title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .charge-info {
|
|
|
+ font-size: 15px;
|
|
|
+ color: #868686;
|
|
|
+ margin: 8px 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .charge-coin {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+
|
|
|
+ .ji {
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bi {
|
|
|
+ font-size: 18px;
|
|
|
+ color: $accent-color;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.down {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -654,4 +725,8 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .utabs-top /deep/ .u-tabs {
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
</style>
|