更新搜索显示
parent
03c8097f4a
commit
40de907c29
|
|
@ -600,33 +600,39 @@
|
|||
// 实际的swiper切换处理逻辑
|
||||
process_swiper_change(current) {
|
||||
// 先暂停所有视频,确保不会有后台播放
|
||||
this.pause_all_videos_except(current);
|
||||
|
||||
const id = this.display_video_list[current].id;
|
||||
// 更新状态
|
||||
this.setData({
|
||||
current_index: current,
|
||||
paused: false,
|
||||
is_manual_pause: false,
|
||||
current_video_progress: 0,
|
||||
current_video_duration: 1,
|
||||
is_seeking: false,
|
||||
current_video_id: id, // 更新当前播放视频的ID
|
||||
});
|
||||
//#ifdef H5
|
||||
// 使用URLSearchParams处理当前查询参数
|
||||
const url = new URL(location.href);
|
||||
url.searchParams.set('id', id);
|
||||
// 替换URL路径,保持查询参数不变
|
||||
const pathname = location.href.split('?')[0];
|
||||
history.replaceState(null, '', pathname + url.search);
|
||||
//#endif
|
||||
const index = this.video_data_list.findIndex(item => item.id == id);
|
||||
|
||||
// 数据预加载逻辑
|
||||
if (index < 2 && this.direction == 'prev') {
|
||||
this.get_last_or_next_data_list(this.video_data_list[0].id, 1, 0);
|
||||
} else if (index < this.video_data_list.length - 3 && this.direction == 'next') {
|
||||
this.pause_all_videos_except(current);
|
||||
|
||||
const id = this.display_video_list[current].id;
|
||||
// 更新状态
|
||||
this.setData({
|
||||
current_index: current,
|
||||
paused: false,
|
||||
is_manual_pause: false,
|
||||
current_video_progress: 0,
|
||||
current_video_duration: 1,
|
||||
is_seeking: false,
|
||||
current_video_id: id, // 更新当前播放视频的ID
|
||||
});
|
||||
//#ifdef H5
|
||||
// 使用URLSearchParams处理当前查询参数
|
||||
const url = new URL(location.href);
|
||||
url.searchParams.set('id', id);
|
||||
// 替换URL路径,保持查询参数不变
|
||||
const pathname = location.href.split('?')[0];
|
||||
history.replaceState(null, '', pathname + url.search);
|
||||
|
||||
// 更新页面标题
|
||||
const currentVideo = this.video_data_list.find(item => item.id == id);
|
||||
if (currentVideo && currentVideo.videoContent) {
|
||||
document.title = currentVideo.videoContent;
|
||||
}
|
||||
//#endif
|
||||
const index = this.video_data_list.findIndex(item => item.id == id);
|
||||
|
||||
// 数据预加载逻辑
|
||||
if (index < 2 && this.direction == 'prev') {
|
||||
this.get_last_or_next_data_list(this.video_data_list[0].id, 1, 0);
|
||||
} else if (index < this.video_data_list.length - 3 && this.direction == 'next') {
|
||||
this.get_last_or_next_data_list(this.video_data_list[this.video_data_list.length - 1].id, 0, 1);
|
||||
}
|
||||
// 获取视频详细信息
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ export default {
|
|||
/* 热门搜索 */
|
||||
.hot-search {
|
||||
padding: 40rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.hot-tabs {
|
||||
|
|
|
|||
Loading…
Reference in New Issue