开放官方播放器
This commit is contained in:
parent
783cc313f0
commit
faa16feedd
2
app.ts
2
app.ts
@ -9,7 +9,7 @@ App({
|
|||||||
loginPromise: null,
|
loginPromise: null,
|
||||||
statusBarHeight: 0,
|
statusBarHeight: 0,
|
||||||
canUsePlayletExtension: tt.canIUse('PlayletExtension'),
|
canUsePlayletExtension: tt.canIUse('PlayletExtension'),
|
||||||
useVideoByte: true,
|
useVideoByte: true,//是否使用官方播放器
|
||||||
},
|
},
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
const loginPromise: any = new Promise((resolve: any) => {
|
const loginPromise: any = new Promise((resolve: any) => {
|
||||||
|
@ -17,13 +17,13 @@ Component({
|
|||||||
console.log("触发开始播放onPlay回调,时间是:", new Date());
|
console.log("触发开始播放onPlay回调,时间是:", new Date());
|
||||||
});
|
});
|
||||||
pm.onPause((e) => {
|
pm.onPause((e) => {
|
||||||
console.error('触发暂停播放onPause回调', e)
|
console.log('触发暂停播放onPause回调', e)
|
||||||
})
|
})
|
||||||
pm.onEnded((e) => {
|
pm.onEnded((e) => {
|
||||||
console.error('触发播放到末尾onEnded回调', e)
|
console.log('触发播放到末尾onEnded回调', e)
|
||||||
})
|
})
|
||||||
pm.onError((e) => {
|
pm.onError((e) => {
|
||||||
console.error('触发onError回调', e)
|
console.log('触发onError回调', e)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 播放进度变化时
|
// 播放进度变化时
|
||||||
@ -47,6 +47,7 @@ Component({
|
|||||||
})
|
})
|
||||||
|
|
||||||
pm.onClickUnlock((e) => {
|
pm.onClickUnlock((e) => {
|
||||||
|
console.log('aaa')
|
||||||
this.adOpen()
|
this.adOpen()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -101,5 +102,15 @@ Component({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
adOpen() {
|
||||||
|
let adBanner: any = this.data.adBanner;
|
||||||
|
tt.showToast({
|
||||||
|
title: `广告加载中...`,
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
adBanner.show().then(() => {
|
||||||
|
// res: any console.log("视频广告展示");
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -5,7 +5,9 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
bookcase: [],
|
bookcase: [],
|
||||||
bookcaseFlag: false,
|
bookcaseFlag: false,
|
||||||
bookId: ''
|
bookId: '',
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad: function () {
|
onLoad: function () {
|
||||||
// options
|
// options
|
||||||
@ -32,10 +34,19 @@ Page({
|
|||||||
toPathVideo(ev: any) {
|
toPathVideo(ev: any) {
|
||||||
const sid = ev.currentTarget.dataset.sid;
|
const sid = ev.currentTarget.dataset.sid;
|
||||||
const id = ev.currentTarget.dataset.id;
|
const id = ev.currentTarget.dataset.id;
|
||||||
console.log(id, "chapteridchapteridchapterid")
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
let url = `/pages/videoDetail/videoDetail?sid=${sid}&id=${id || ''}`;
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
url = `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id}&sid=${sid}`;
|
||||||
|
}
|
||||||
|
console.log("url",url);
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${id || ''}`,
|
url: url,
|
||||||
});
|
});
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${id || ''}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
myModalRef(ref: any) {
|
myModalRef(ref: any) {
|
||||||
this.myModal = ref
|
this.myModal = ref
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<view class="collection_h_list">
|
<view class="collection_h_list">
|
||||||
<block tt:for="{{bookcase}}">
|
<block tt:for="{{bookcase}}">
|
||||||
<view class="collection_h_li_item" catchtap="toPathVideo" data-sid="{{item.articleid}}"
|
<view class="collection_h_li_item" catchtap="toPathVideo" data-sid="{{item.articleid}}"
|
||||||
tt:key="{{item.id}}" data-id="{{item.chapterid}}">
|
tt:key="{{item.id}}" data-id="{{item.chapterid}}" data-item="{{item}}" >
|
||||||
<view class="collection_h_li_warp">
|
<view class="collection_h_li_warp">
|
||||||
<view class="collection_h_li_wa_left">
|
<view class="collection_h_li_wa_left">
|
||||||
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
||||||
@ -26,9 +26,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="_colle_h_li_wa_ri_btoom">
|
<view class="_colle_h_li_wa_ri_btoom">
|
||||||
<view class="_colle_h_li_wa_ri_continue" catchtap="toPathVideo"
|
<view class="_colle_h_li_wa_ri_continue" catchtap="toPathVideo" data-item="{{item}}"
|
||||||
data-sid="{{item.articleid}}" data-id="{{item.chapterid}}">
|
data-sid="{{item.articleid}}" data-id="{{item.chapterid}}">
|
||||||
<text class="_colle_h_li_wa_ri_continue_text">继续观看</text>
|
<text class="_colle_h_li_wa_ri_continue_text" >继续观看</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -3,7 +3,9 @@ import { httpRequest } from "../../utils/httpReques";
|
|||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
historyList: [],
|
historyList: [],
|
||||||
historyFlag: false
|
historyFlag: false,
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad: function () {
|
onLoad: function () {
|
||||||
// options
|
// options
|
||||||
@ -24,8 +26,18 @@ Page({
|
|||||||
toPathVideo(ev: any) {
|
toPathVideo(ev: any) {
|
||||||
const sid = ev.currentTarget.dataset.sid;
|
const sid = ev.currentTarget.dataset.sid;
|
||||||
const chapterid = ev.currentTarget.dataset.chapterid;
|
const chapterid = ev.currentTarget.dataset.chapterid;
|
||||||
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
let url = `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
url = `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id}&sid=${sid}`;
|
||||||
|
}
|
||||||
|
console.log("url",url);
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`,
|
url: url,
|
||||||
});
|
});
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -3,7 +3,7 @@
|
|||||||
<view class="_history_h_list">
|
<view class="_history_h_list">
|
||||||
<block tt:for="{{historyList}}">
|
<block tt:for="{{historyList}}">
|
||||||
<view class="_history__li_item">
|
<view class="_history__li_item">
|
||||||
<view class="_history__li_it_warp" catchtap="toPathVideo" data-sid="{{item.sid}}"
|
<view class="_history__li_it_warp" catchtap="toPathVideo" data-item="{{item}}" data-sid="{{item.sid}}"
|
||||||
data-chapterid="{{item.chapterid}}">
|
data-chapterid="{{item.chapterid}}">
|
||||||
<view class="_history__li_it_wa_left">
|
<view class="_history__li_it_wa_left">
|
||||||
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
||||||
|
@ -6,7 +6,9 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
platform: '',
|
platform: '',
|
||||||
historyList: []
|
historyList: [],
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
tt.getSystemInfo({
|
tt.getSystemInfo({
|
||||||
@ -48,9 +50,20 @@ Page({
|
|||||||
toPathVideo(ev: any) {
|
toPathVideo(ev: any) {
|
||||||
const sid = ev.currentTarget.dataset.sid;
|
const sid = ev.currentTarget.dataset.sid;
|
||||||
const chapterid = ev.currentTarget.dataset.chapterid;
|
const chapterid = ev.currentTarget.dataset.chapterid;
|
||||||
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
let url = `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
url = `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id}&sid=${sid}`;
|
||||||
|
}
|
||||||
|
console.log("url",url);
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`,
|
url: url,
|
||||||
});
|
});
|
||||||
|
//
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
toPathRechargeRecord() {
|
toPathRechargeRecord() {
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
<view class="_my_ste_4_history">
|
<view class="_my_ste_4_history">
|
||||||
<scroll-view class="_my_ste_4_scr_H" scroll-x="true" style="width: 100%">
|
<scroll-view class="_my_ste_4_scr_H" scroll-x="true" style="width: 100%">
|
||||||
<block tt:for="{{historyList}}">
|
<block tt:for="{{historyList}}">
|
||||||
<view class="_my_ste_4_scr_H_item" tt:key="{{item.sid}}" data-sid="{{item.sid}}" data-chapterid="{{item.chapterid}}" bindtap="toPathVideo">
|
<view class="_my_ste_4_scr_H_item" tt:key="{{item.sid}}" data-sid="{{item.sid}}" data-item="{{item}}" data-chapterid="{{item.chapterid}}" bindtap="toPathVideo">
|
||||||
<view class="_my_ste_4_scr_H_i_cover">
|
<view class="_my_ste_4_scr_H_i_cover">
|
||||||
<image src="{{item.cover}}" class="__m_c_iiii" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__m_c_iiii" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
|
@ -5,7 +5,9 @@ Page({
|
|||||||
searchValue: '',
|
searchValue: '',
|
||||||
historySearchList: [],
|
historySearchList: [],
|
||||||
searchList: [],
|
searchList: [],
|
||||||
searchFlag: false
|
searchFlag: false,
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad: function () {
|
onLoad: function () {
|
||||||
// options
|
// options
|
||||||
@ -84,8 +86,19 @@ Page({
|
|||||||
},
|
},
|
||||||
toPathVideo(ev: any) {
|
toPathVideo(ev: any) {
|
||||||
const sid = ev.currentTarget.dataset.sid;
|
const sid = ev.currentTarget.dataset.sid;
|
||||||
|
const chapterid = ev.currentTarget.dataset.chapterid;
|
||||||
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
let url = `/pages/videoDetail/videoDetail?sid=${sid}&id=${chapterid || ''}`
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
url = `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id}&sid=${sid}`;
|
||||||
|
}
|
||||||
|
console.log("url",url);
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
url: `/pages/videoDetail/videoDetail?sid=${sid}`,
|
url: url,
|
||||||
});
|
});
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoDetail/videoDetail?sid=${sid}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -35,7 +35,7 @@
|
|||||||
<block tt:elif="{{searchFlag && searchList.length}}">
|
<block tt:elif="{{searchFlag && searchList.length}}">
|
||||||
<view class="_search_con_vi_lis">
|
<view class="_search_con_vi_lis">
|
||||||
<block tt:for="{{searchList}}">
|
<block tt:for="{{searchList}}">
|
||||||
<view class="_search_con_vi_l_item" tt:key="{{item.id}}" data-sid="{{item.id}}" catchtap="toPathVideo">
|
<view class="_search_con_vi_l_item" tt:key="{{item.id}}" data-sid="{{item.id}}" data-item="{{item}}" catchtap="toPathVideo">
|
||||||
<view class="_search_con_vi_l_i_warp">
|
<view class="_search_con_vi_l_i_warp">
|
||||||
<view class="_search_con_vi_l_i_w_cover">
|
<view class="_search_con_vi_l_i_w_cover">
|
||||||
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
||||||
|
@ -6,7 +6,9 @@ Page({
|
|||||||
categoryList: [],
|
categoryList: [],
|
||||||
categoryid: '',
|
categoryid: '',
|
||||||
module1: [],
|
module1: [],
|
||||||
module2: []
|
module2: [],
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// options
|
// options
|
||||||
@ -57,8 +59,18 @@ Page({
|
|||||||
},
|
},
|
||||||
toPathVideo(ev: any) {
|
toPathVideo(ev: any) {
|
||||||
const sid = ev.currentTarget.dataset.sid;
|
const sid = ev.currentTarget.dataset.sid;
|
||||||
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
let url = `/pages/videoDetail/videoDetail?sid=${sid}`;
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
url = `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id}&sid=${sid}`;
|
||||||
|
}
|
||||||
|
console.log("url",url);
|
||||||
tt.navigateTo({
|
tt.navigateTo({
|
||||||
url: `/pages/videoDetail/videoDetail?sid=${sid}`,
|
url: url,
|
||||||
});
|
});
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoDetail/videoDetail?sid=${sid}`,
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
})
|
})
|
@ -36,7 +36,7 @@
|
|||||||
<view class="_mo_one_con_list">
|
<view class="_mo_one_con_list">
|
||||||
<block tt:for="{{module2}}">
|
<block tt:for="{{module2}}">
|
||||||
<view class="_mo_one_con_li_item" tt:key="{{item.id}}">
|
<view class="_mo_one_con_li_item" tt:key="{{item.id}}">
|
||||||
<view class="_mo_one_con_li_it_warp" data-sid="{{item.id}}" catchtap="toPathVideo">
|
<view class="_mo_one_con_li_it_warp" data-sid="{{item.id}}" catchtap="toPathVideo" data-item="{{item}}" >
|
||||||
<view class="_mo_one_con_li_it_wa_cover">
|
<view class="_mo_one_con_li_it_wa_cover">
|
||||||
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
||||||
|
|
||||||
@ -83,7 +83,7 @@
|
|||||||
<view class="_mo_one_con_list">
|
<view class="_mo_one_con_list">
|
||||||
<block tt:for="{{module1}}">
|
<block tt:for="{{module1}}">
|
||||||
<view class="_mo_one_con_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}"
|
<view class="_mo_one_con_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}"
|
||||||
catchtap="toPathVideo">
|
catchtap="toPathVideo" data-item="{{item}}" >
|
||||||
<view class="_mo_one_con_li_it_warp">
|
<view class="_mo_one_con_li_it_warp">
|
||||||
<view class="_mo_one_con_li_it_wa_cover">
|
<view class="_mo_one_con_li_it_wa_cover">
|
||||||
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
<image src="{{item.cover}}" class="__wa_img" mode="aspectFill"></image>
|
||||||
|
@ -12,6 +12,7 @@ PlayletExtension({
|
|||||||
options: undefined,
|
options: undefined,
|
||||||
data: {
|
data: {
|
||||||
watchInfo: null,
|
watchInfo: null,
|
||||||
|
nextbatchList: [],
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
emitInfoFromChildren(val,data) {
|
emitInfoFromChildren(val,data) {
|
||||||
@ -91,7 +92,7 @@ PlayletExtension({
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
|
// this.getNext();
|
||||||
},
|
},
|
||||||
async init(status?:string,data?:any) {
|
async init(status?:string,data?:any) {
|
||||||
console.log("data",data)
|
console.log("data",data)
|
||||||
@ -123,8 +124,26 @@ PlayletExtension({
|
|||||||
this.setData({
|
this.setData({
|
||||||
watchInfo: _watchinfo
|
watchInfo: _watchinfo
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
async getNext(){
|
||||||
|
// let params = {
|
||||||
|
// ...this.options,
|
||||||
|
// album_id: !!data ? data.album_id : this.options.tt_album_id,
|
||||||
|
// episode_id: !!data ? data.episode_id : this.options.tt_episode_id,
|
||||||
|
// sid: null,
|
||||||
|
// id: null,
|
||||||
|
// tt_album_id: null,
|
||||||
|
// tt_episode_id: null,
|
||||||
|
// }
|
||||||
|
let nextbatchList = [];
|
||||||
|
const nextbatchRes: any = await httpRequest('/nextbatch', 'POST', this.options);
|
||||||
|
if (nextbatchRes.status == 1 && Array.isArray(nextbatchRes.data)) {
|
||||||
|
nextbatchList = nextbatchRes.data;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
nextbatchList
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
<!-- 完结推荐-->
|
||||||
|
<block tt:if="{{nextbatchList.length}}">
|
||||||
|
<swiper-item>
|
||||||
|
<view class="_play_drama_complete">
|
||||||
|
<view class="_pla_dra_com_mask">
|
||||||
|
<image src="{{videoInfo.cover}}" mode="aspectFill" class="__wa_img_no_radius"></image>
|
||||||
|
</view>
|
||||||
|
<view class="_pla_dra_com_content">
|
||||||
|
<view class="_pla__com_con_title">
|
||||||
|
<text class="_pla__com_con_ti_text">本剧已结束</text>
|
||||||
|
</view>
|
||||||
|
<view class="_pla__com_con_warp">
|
||||||
|
<view class="_pla__com_con_w_header">
|
||||||
|
<view class="_pla__com__w_he_title">更多推荐</view>
|
||||||
|
<view class="_pla__com__w_he_exit" catchtap="handelReplace">换一换</view>
|
||||||
|
</view>
|
||||||
|
<view class="_pla__com_con_w_list">
|
||||||
|
<block tt:for="{{nextbatchList}}">
|
||||||
|
<view class="_pla__com_con_w_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}"
|
||||||
|
catchtap="toPathVideoitself">
|
||||||
|
<view class="_pla__com_con_w_li_it_mm">
|
||||||
|
<view class="_pla__com__w_li_it_m_cover">
|
||||||
|
<image src="{{item.cover}}" mode="aspectFill"
|
||||||
|
class="_pla__com__w_li_it_m_co_img"></image>
|
||||||
|
</view>
|
||||||
|
<view class="_pla__com__w_li_it_m_title">
|
||||||
|
<text class="_pla__com__w_li_it_m_ti_text">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</block>
|
@ -23,9 +23,11 @@ Page({
|
|||||||
nextbatchList: [],
|
nextbatchList: [],
|
||||||
selectedId: '',
|
selectedId: '',
|
||||||
unlockFlag: true,
|
unlockFlag: true,
|
||||||
adBanner: null
|
adBanner: null,
|
||||||
|
canUsePlayletExtension: getApp().globalData.canUsePlayletExtension,
|
||||||
|
useVideoByte: getApp().globalData.useVideoByte,
|
||||||
},
|
},
|
||||||
onLoad(options: any) {
|
async onLoad(options: any) {
|
||||||
const videoCanIUse = tt.canIUse('video-player');
|
const videoCanIUse = tt.canIUse('video-player');
|
||||||
tt.getSystemInfo({
|
tt.getSystemInfo({
|
||||||
success: (res: any) => {
|
success: (res: any) => {
|
||||||
@ -40,11 +42,75 @@ Page({
|
|||||||
sid: options?.sid || ''
|
sid: options?.sid || ''
|
||||||
})
|
})
|
||||||
const params = {
|
const params = {
|
||||||
...options
|
...options,
|
||||||
|
album_id: options?.tt_album_id,
|
||||||
|
episode_id: options?.tt_episode_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initFn(params);
|
// 1:查询状态,下架了就拦截
|
||||||
this.adInit()
|
// let nextbatchList = [];
|
||||||
|
// const nextbatchRes: any = await httpRequest('/nextbatch', 'POST', params);
|
||||||
|
// if (nextbatchRes?.status == 1 && Array.isArray(nextbatchRes?.data)) {
|
||||||
|
// nextbatchList = nextbatchRes.data;
|
||||||
|
// this.setData({
|
||||||
|
// nextbatchList,
|
||||||
|
// })
|
||||||
|
// }else{
|
||||||
|
// //1:新播放器
|
||||||
|
// if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${params.album_id}&tt_episode_id=${params.episode_id}`
|
||||||
|
// });
|
||||||
|
// }else{
|
||||||
|
// //2: 本页
|
||||||
|
// this.initFn(params);
|
||||||
|
// this.adInit()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//查询状态
|
||||||
|
// let checkstatus: any = await httpRequest('/skitslibrarystate', 'POST', params);
|
||||||
|
// console.log(checkstatus)
|
||||||
|
// if (checkstatus.data.status != 1) { //下架了拉推荐
|
||||||
|
// let nextbatchList = [];
|
||||||
|
// const nextbatchRes: any = await httpRequest('/nextbatch', 'POST', params);
|
||||||
|
// if (nextbatchRes?.status == 1 && Array.isArray(nextbatchRes?.data)) {
|
||||||
|
// nextbatchList = nextbatchRes.data;
|
||||||
|
// this.setData({
|
||||||
|
// nextbatchList,
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// return
|
||||||
|
// }else{
|
||||||
|
// //1:新播放器
|
||||||
|
// if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
// tt.navigateTo({
|
||||||
|
// url: `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${params.album_id}&tt_episode_id=${params.episode_id}`
|
||||||
|
// });
|
||||||
|
// return
|
||||||
|
// }else{
|
||||||
|
// //2: 本页
|
||||||
|
// this.initFn(params);
|
||||||
|
// this.adInit()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// this.initFn(params);
|
||||||
|
// this.adInit()
|
||||||
|
|
||||||
|
//1:新播放器
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
let urlstr = this.objectToQueryString(params)
|
||||||
|
tt.redirectTo({
|
||||||
|
url: `/pages/videoByte/videoByte?is_continue=0&${urlstr}`
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}else{
|
||||||
|
//2: 本页
|
||||||
|
this.initFn(params);
|
||||||
|
this.adInit()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() { },
|
onShow() { },
|
||||||
async initFn(params: any) {
|
async initFn(params: any) {
|
||||||
@ -492,7 +558,17 @@ Page({
|
|||||||
sid
|
sid
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.initFn(params);
|
const album_id = ev.currentTarget.dataset.item.album_id;
|
||||||
|
const episode_id = ev.currentTarget.dataset.item.episode_id;
|
||||||
|
//1:新播放器
|
||||||
|
if(this.data.canUsePlayletExtension&&this.data.useVideoByte){
|
||||||
|
tt.redirectTo({
|
||||||
|
url: `/pages/videoByte/videoByte?is_continue=0&tt_album_id=${album_id}&tt_episode_id=${episode_id||''}`
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
//2: 页面刷新
|
||||||
|
this.initFn(params);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async handelReplace() {
|
async handelReplace() {
|
||||||
const sid = this.data.sid;
|
const sid = this.data.sid;
|
||||||
@ -565,4 +641,17 @@ Page({
|
|||||||
const context: any = tt.createVideoContext(`${videoInfo.id}`);
|
const context: any = tt.createVideoContext(`${videoInfo.id}`);
|
||||||
context?.play?.();
|
context?.play?.();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
objectToQueryString(obj) {
|
||||||
|
return Object.keys(obj).map(key => {
|
||||||
|
let value = obj[key];
|
||||||
|
// 处理数组情况
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value = value.map(v => encodeURIComponent(v)).join(',');
|
||||||
|
} else {
|
||||||
|
value = encodeURIComponent(value);
|
||||||
|
}
|
||||||
|
return `${encodeURIComponent(key)}=${value}`;
|
||||||
|
}).join('&');
|
||||||
|
}
|
||||||
})
|
})
|
@ -177,12 +177,12 @@
|
|||||||
<view class="_pla__com_con_warp">
|
<view class="_pla__com_con_warp">
|
||||||
<view class="_pla__com_con_w_header">
|
<view class="_pla__com_con_w_header">
|
||||||
<view class="_pla__com__w_he_title">更多推荐</view>
|
<view class="_pla__com__w_he_title">更多推荐</view>
|
||||||
<view class="_pla__com__w_he_exit" catchtap="handelReplace">换一换</view>
|
<view class="_pla__com__w_he_exit" catchtap="`handelReplace`">换一换</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="_pla__com_con_w_list">
|
<view class="_pla__com_con_w_list">
|
||||||
<block tt:for="{{nextbatchList}}">
|
<block tt:for="{{nextbatchList}}">
|
||||||
<view class="_pla__com_con_w_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}"
|
<view class="_pla__com_con_w_li_item" tt:key="{{item.id}}" data-sid="{{item.id}}"
|
||||||
catchtap="toPathVideoitself">
|
catchtap="toPathVideoitself" data-item="{{item}}">
|
||||||
<view class="_pla__com_con_w_li_it_mm">
|
<view class="_pla__com_con_w_li_it_mm">
|
||||||
<view class="_pla__com__w_li_it_m_cover">
|
<view class="_pla__com__w_li_it_m_cover">
|
||||||
<image src="{{item.cover}}" mode="aspectFill"
|
<image src="{{item.cover}}" mode="aspectFill"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"condition": {
|
"condition": {
|
||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"current": 1732184262860,
|
"current": 1732245477906,
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
"id": 1715845062520,
|
"id": 1715845062520,
|
||||||
@ -121,6 +121,16 @@
|
|||||||
"scene": "011002",
|
"scene": "011002",
|
||||||
"launchFrom": "search_suggest_list_top",
|
"launchFrom": "search_suggest_list_top",
|
||||||
"location": "",
|
"location": "",
|
||||||
|
"mockUpdateType": "Noupdate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1732245477906,
|
||||||
|
"name": "pages/videoDetail/videoDetail",
|
||||||
|
"pathName": "pages/videoDetail/videoDetail",
|
||||||
|
"query": "sid=265&id=14265&tid=1234&union_tid=15875&tt_album_id=7336037389002867237&tt_episode_id=7336037720098783759",
|
||||||
|
"scene": "011002",
|
||||||
|
"launchFrom": "search_suggest_list_top",
|
||||||
|
"location": "",
|
||||||
"mockUpdateType": "Noupdate",
|
"mockUpdateType": "Noupdate",
|
||||||
"addType": "manual"
|
"addType": "manual"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user