|
|
@@ -310,9 +310,10 @@ Page({
|
|
|
|
|
|
// 点击相关推荐视频
|
|
|
onRelatedVideoTap(e) {
|
|
|
+ console.log(e.currentTarget.dataset)
|
|
|
const videoId = e.currentTarget.dataset.id;
|
|
|
const video = this.data.relatedVideos.find(item => item.id === videoId);
|
|
|
-
|
|
|
+ // console.log('video',video)
|
|
|
if (!video) {
|
|
|
wx.showToast({
|
|
|
title: '视频信息获取失败',
|
|
|
@@ -320,7 +321,8 @@ Page({
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ const tag_id = video.tag_id;
|
|
|
+ // console.log('tag_id',tag_id)
|
|
|
// 显示加载中提示
|
|
|
wx.showLoading({
|
|
|
title: '加载中...',
|
|
|
@@ -332,7 +334,7 @@ Page({
|
|
|
|
|
|
// 跳转到视频详情页
|
|
|
wx.navigateTo({
|
|
|
- url: `/pages/video/detail?id=${videoId}&title=${encodedTitle}`,
|
|
|
+ url: `/pages/video/detail?id=${videoId}&title=${encodedTitle}&tag_id=${tag_id}`,
|
|
|
success: () => {
|
|
|
wx.hideLoading();
|
|
|
},
|
|
|
@@ -458,11 +460,12 @@ Page({
|
|
|
// 使用第一个标签ID获取相关视频
|
|
|
const tagId = tagIds && tagIds.length > 0 ? tagIds[0] : 2250;
|
|
|
const relatedVideos = await getRelatedVideos({ tag_id: tagId });
|
|
|
-
|
|
|
+ // console.log('推荐视频',relatedVideos)
|
|
|
// 处理相关视频数据
|
|
|
const formattedVideos = relatedVideos.map(video => ({
|
|
|
id: video.id,
|
|
|
title: video.title,
|
|
|
+ tag_id:video.tag_ids[0],
|
|
|
cover_image: video.cover_image,
|
|
|
playCount: video.views || '0',
|
|
|
likeCount: video.like || '0',
|