|
@@ -35,20 +35,19 @@
|
|
@click.stop="share"></button>
|
|
@click.stop="share"></button>
|
|
</view> -->
|
|
</view> -->
|
|
<!-- 4.追剧 -->
|
|
<!-- 4.追剧 -->
|
|
- <view class="comment" @click.stop="toComment(list.iszj,list.pid,list.mid)"
|
|
|
|
- style="opacity: 0.9; margin-top: 17px;">
|
|
|
|
- <block v-if="videoInfo.is_binge_watch">
|
|
|
|
|
|
+ <view class="comment" style="opacity: 0.9; margin-top: 17px;">
|
|
|
|
+ <view v-if="videoInfo.is_binge_watch" @click="unBingewatch">
|
|
<image src="@/static/scRed.png"
|
|
<image src="@/static/scRed.png"
|
|
style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
|
style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
|
<text
|
|
<text
|
|
style="color: #ff0000; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">已追</text>
|
|
style="color: #ff0000; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">已追</text>
|
|
- </block>
|
|
|
|
- <block v-else>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view v-else @click="bingewatch">
|
|
<image src="@/static/sc.png"
|
|
<image src="@/static/sc.png"
|
|
style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
|
style="width: 40px; height: 40px; position: absolute; right: 6px;"></image>
|
|
<text
|
|
<text
|
|
style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">追剧</text>
|
|
style="color: #FFFFFF; margin-top: 5px; font-size: 14px; font-weight: bold; text-align: center; margin-top: 40px;">追剧</text>
|
|
- </block>
|
|
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -121,7 +120,11 @@
|
|
getVideoInfo,
|
|
getVideoInfo,
|
|
videoEpisodePlay,
|
|
videoEpisodePlay,
|
|
videoEpisodeZan,
|
|
videoEpisodeZan,
|
|
- } from '@/common/apis/video.js'
|
|
|
|
|
|
+ } from '@/common/apis/video.js';
|
|
|
|
+ import {
|
|
|
|
+ delShelf,
|
|
|
|
+ storeshelf
|
|
|
|
+ } from '@/common/apis/zju.js'
|
|
import configs from "@/common/config.js"
|
|
import configs from "@/common/config.js"
|
|
let audo = uni.createInnerAudioContext('myVideo')
|
|
let audo = uni.createInnerAudioContext('myVideo')
|
|
export default {
|
|
export default {
|
|
@@ -200,6 +203,13 @@
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.initTabs();
|
|
this.initTabs();
|
|
|
|
+ this.initSwiperData(this.swiperCurrent + 1)
|
|
|
|
+ getVideoInfo({
|
|
|
|
+ video_id: this.video_id
|
|
|
|
+ }).then(res => {
|
|
|
|
+ // console.log(res, 'getVideoInfogetVideoInfogetVideoInfo')
|
|
|
|
+ this.videoInfo = res
|
|
|
|
+ })
|
|
},
|
|
},
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
let that = this;
|
|
let that = this;
|
|
@@ -208,16 +218,9 @@
|
|
that.top_height = res.statusBarHeight; //data中 声明 top_height:0
|
|
that.top_height = res.statusBarHeight; //data中 声明 top_height:0
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.initSwiperData(this.swiperCurrent + 1)
|
|
|
|
if (e.video_id) {
|
|
if (e.video_id) {
|
|
- this.video_id = e.video_id
|
|
|
|
|
|
+ this.video_id = Number(e.video_id)
|
|
}
|
|
}
|
|
- getVideoInfo({
|
|
|
|
- video_id: 4
|
|
|
|
- }).then(res => {
|
|
|
|
- console.log(res, 'getVideoInfogetVideoInfogetVideoInfo')
|
|
|
|
- this.videoInfo = res
|
|
|
|
- })
|
|
|
|
uni.getSystemInfo({
|
|
uni.getSystemInfo({
|
|
success: res => {
|
|
success: res => {
|
|
this.safeArea = res.safeAreaInsets.bottom;
|
|
this.safeArea = res.safeAreaInsets.bottom;
|
|
@@ -260,6 +263,23 @@
|
|
},
|
|
},
|
|
onBackPress() {},
|
|
onBackPress() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ bingewatch() {
|
|
|
|
+ storeshelf(this.video_id).then(res => {
|
|
|
|
+ console.log(res, 'storeshelfstoreshelfstoreshelf')
|
|
|
|
+ this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '追剧成功',
|
|
|
|
+ duration: 1000,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ unBingewatch() {
|
|
|
|
+ delShelf(this.video_id).then(res => {
|
|
|
|
+ console.log(res, 'storeshelfstoreshelfstoreshelf')
|
|
|
|
+ this.videoInfo.is_binge_watch = !Boolean(this.videoInfo.is_binge_watch)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
leftClick(e) {
|
|
leftClick(e) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
title: '加入追剧',
|
|
title: '加入追剧',
|
|
@@ -269,6 +289,7 @@
|
|
cancelText: '不用了',
|
|
cancelText: '不用了',
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
|
|
+ this.bingewatch()
|
|
// 用户点击了确定按钮
|
|
// 用户点击了确定按钮
|
|
// 执行加入追剧的逻辑
|
|
// 执行加入追剧的逻辑
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
@@ -428,7 +449,7 @@
|
|
initSwiperData(originIndex) {
|
|
initSwiperData(originIndex) {
|
|
this.isqp = false
|
|
this.isqp = false
|
|
videoEpisodePlay({
|
|
videoEpisodePlay({
|
|
- video_id: 4,
|
|
|
|
|
|
+ video_id: this.video_id,
|
|
sequence: originIndex
|
|
sequence: originIndex
|
|
}).then(res => {
|
|
}).then(res => {
|
|
this.currentVideoInfo = res
|
|
this.currentVideoInfo = res
|