|
|
@@ -20,6 +20,7 @@ let interstitialAd = null
|
|
|
Page({
|
|
|
data: {
|
|
|
videoList: [],
|
|
|
+ originVideoList: [],
|
|
|
loading: false,
|
|
|
hasMore: true,
|
|
|
page: 1,
|
|
|
@@ -185,7 +186,7 @@ Page({
|
|
|
}
|
|
|
console.log('入口:', options)
|
|
|
try {
|
|
|
- let {type, jump, shared_video_id, tag_id} = options
|
|
|
+ let { type, jump, shared_video_id, tag_id } = options
|
|
|
const scene = wx.getStorageSync('scene');
|
|
|
console.log('入口:', type, jump, scene, shared_video_id)
|
|
|
if ((type === 'share' || type === 'tuiguang') && shared_video_id) {
|
|
|
@@ -223,7 +224,7 @@ Page({
|
|
|
}, 1000)
|
|
|
},
|
|
|
|
|
|
- // 插屏广告加载
|
|
|
+ // 插屏广告加载
|
|
|
interstitalLoad() {
|
|
|
let adId = apple.ads.insertAdId
|
|
|
interstitialAd = wx.createInterstitialAd({
|
|
|
@@ -296,7 +297,7 @@ Page({
|
|
|
// })
|
|
|
console.log('登录后的openid:', uuidres.open_id)
|
|
|
console.log('登录成功:', app.globalData)
|
|
|
- SendEvent('login_shanhu', {"uuid": uuidres.uuid});
|
|
|
+ SendEvent('login_shanhu', { "uuid": uuidres.uuid });
|
|
|
resolve(res.uuid)
|
|
|
}).catch((err) => {
|
|
|
reject(err)
|
|
|
@@ -354,6 +355,7 @@ Page({
|
|
|
currentCategoryId: categoryId,
|
|
|
page: 1,
|
|
|
videoList: [],
|
|
|
+ originVideoList: [],
|
|
|
hasMore: true
|
|
|
})
|
|
|
this.loadVideoList()
|
|
|
@@ -380,6 +382,7 @@ Page({
|
|
|
|
|
|
let videoList = []
|
|
|
try {
|
|
|
+
|
|
|
videoList = await getVideoList(params)
|
|
|
|
|
|
if (!Array.isArray(videoList)) {
|
|
|
@@ -393,8 +396,8 @@ Page({
|
|
|
adType: "video",
|
|
|
lock: false
|
|
|
}))
|
|
|
- videoList = this.formatVideoAdList(videoList);
|
|
|
- console.log("format videoList", videoList)
|
|
|
+ this.data.originVideoList = this.data.originVideoList.concat(videoList)
|
|
|
+ this.data.videoList = this.formatVideoAdList(deepCopy(this.data.originVideoList))
|
|
|
} catch (apiError) {
|
|
|
console.error('API调用失败:', apiError)
|
|
|
throw apiError
|
|
|
@@ -402,14 +405,16 @@ Page({
|
|
|
// 如果是第一页,直接替换数据
|
|
|
if (this.data.page === 1) {
|
|
|
this.setData({
|
|
|
- videoList: videoList,
|
|
|
+ videoList: this.data.videoList,
|
|
|
+ originVideoList: this.data.originVideoList,
|
|
|
loading: false,
|
|
|
hasMore: videoList.length >= this.data.size
|
|
|
})
|
|
|
} else {
|
|
|
// 否则追加数据
|
|
|
this.setData({
|
|
|
- videoList: [...this.data.videoList, ...videoList],
|
|
|
+ videoList: this.data.videoList,
|
|
|
+ originVideoList: this.data.originVideoList,
|
|
|
loading: false,
|
|
|
hasMore: videoList.length >= this.data.size
|
|
|
})
|
|
|
@@ -544,7 +549,7 @@ Page({
|
|
|
|
|
|
// 点击视频
|
|
|
onVideoTap(e) {
|
|
|
- const {id, info, index} = e.currentTarget.dataset;
|
|
|
+ const { id, info, index } = e.currentTarget.dataset;
|
|
|
console.log(id, info, index, '视频详情')
|
|
|
if (!info) {
|
|
|
wx.hideLoading();
|
|
|
@@ -554,7 +559,7 @@ Page({
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- SendEvent('click_video_tab_video', {"video_id": id, "tag_id": info.tag_ids[0], "uuid": app.globalData.uuid})
|
|
|
+ SendEvent('click_video_tab_video', { "video_id": id, "tag_id": info.tag_ids[0], "uuid": app.globalData.uuid })
|
|
|
const encodedTitle = encodeURIComponent(info.title || '');
|
|
|
this.unlockUrl = `/pages/video/detail?id=${id}&title=${encodedTitle}&tag_id=${info.tag_ids[0]}`
|
|
|
if (!info.lock) {
|
|
|
@@ -613,7 +618,7 @@ Page({
|
|
|
if (jump === 1) {
|
|
|
url += '&jump=1';
|
|
|
}
|
|
|
- SendEvent('click_list_share', {"video_id": video.id, "tag_id": video.tag_ids[0], "uuid": app.globalData.uuid});
|
|
|
+ SendEvent('click_list_share', { "video_id": video.id, "tag_id": video.tag_ids[0], "uuid": app.globalData.uuid });
|
|
|
return {
|
|
|
title: video.title,
|
|
|
path: url,
|
|
|
@@ -642,7 +647,7 @@ Page({
|
|
|
const jump = wx.getStorageSync('jump');// 是否跳转阅读器
|
|
|
let url = '';
|
|
|
url = `shared_video_id=${video.id}&title=${encodeURIComponent(video.title)}&tag_id=${video.tag_ids[0]}&share_count=1`;
|
|
|
- SendEvent('click_list_share', {"video_id": video.id, "tag_id": video.tag_ids[0], "uuid": app.globalData.uuid});
|
|
|
+ SendEvent('click_list_share', { "video_id": video.id, "tag_id": video.tag_ids[0], "uuid": app.globalData.uuid });
|
|
|
if (jump === 1) {
|
|
|
url += '&jump=1';
|
|
|
}
|