修改页面显示处理

master
于肖磊 2026-02-26 17:57:34 +08:00
parent 6f0764eaee
commit 8e7ff38443
2 changed files with 19 additions and 17 deletions

View File

@ -542,14 +542,6 @@
this.update_display_data();
setTimeout(() => {
//#ifdef H5
//
const current_video = this.video_data_list.find(item => item.id == id);
if (current_video && current_video.title) {
document.title = current_video.title;
}
//#endif
// //
this.update_share_info(this.display_video_list[this.current_index]);
@ -628,12 +620,6 @@
// URL
const pathname = location.href.split('?')[0];
history.replaceState(null, '', pathname + url.search);
//
const current_video = this.video_data_list.find(item => item.id == id);
if (current_video && current_video.title) {
document.title = current_video.title;
}
//#endif
const index = this.video_data_list.findIndex(item => item.id == id);

View File

@ -1,7 +1,7 @@
<template>
<view class="wh-auto ht-auto pr video-container bottom-line-exclude-bottom">
<template v-if="tabs.length > 0">
<scroll-view scroll-y :show-scrollbar="false" class="ht" lower-threshold="60" scroll-with-animation="true">
<scroll-view scroll-y :show-scrollbar="false" class="ht" lower-threshold="60" scroll-with-animation="true" @scroll="on_scroll_event">
<view class="wh-auto ht-auto pr">
<!-- 搜索框 -->
<view class="header-top">
@ -23,7 +23,7 @@
</view>
<template v-if="tabs.length > 0">
<!-- 导航栏 -->
<view class="nav-tabs">
<view class="nav-tabs" :class="{ 'nav-tabs-sticky': is_nav_sticky }">
<scroll-view scroll-x :show-scrollbar="false" class="tabs-scroll" style="white-space: nowrap;">
<view class="tabs-scroll-content">
<view v-for="(item, index) in tabs" :key="index" class="tab-item flex-row align-c gap-5" :class="{ active: current_tabs_index === index }" :data-index="index" :data-id="item.id" @tap="switch_tab">
@ -109,6 +109,8 @@ export default {
menu_button_info: '',
header_padding_left: '',
slider_list: [],
is_nav_sticky: false, // nav-tabs
nav_sticky_threshold: 50 // CSStop
};
},
onShow() {
@ -237,6 +239,14 @@ export default {
handle_back() {
app.globalData.page_back_prev_event();
},
//
on_scroll_event(e) {
const scrollTop = e.detail.scrollTop;
// nav-tabs
this.setData({
is_nav_sticky: scrollTop >= this.nav_sticky_threshold
});
}
}
};
</script>
@ -254,8 +264,14 @@ export default {
top: 110rpx;
width: 100%;
padding: 0 16rpx 20rpx 16rpx;
background: #fff;
z-index: 9;
background: transparent; //
transition: background-color 0.3s ease; //
&.nav-tabs-sticky {
background: #fff; //
}
.tabs-scroll-content {
display: flex;
align-items: center;