|
|
|
@ -71,6 +71,11 @@ |
|
|
|
class="frozen-content-scroll" |
|
|
|
scroll-y |
|
|
|
:scroll-top="scrollTop" |
|
|
|
:enable-flex="true" |
|
|
|
:scroll-anchoring="false" |
|
|
|
:enhanced="true" |
|
|
|
:bounces="false" |
|
|
|
:scroll-with-animation="false" |
|
|
|
> |
|
|
|
<view class="frozen-content"> |
|
|
|
<!-- 时间模式 --> |
|
|
|
@ -132,6 +137,11 @@ |
|
|
|
scroll-x |
|
|
|
scroll-y |
|
|
|
:scroll-top="scrollTop" |
|
|
|
:enable-flex="true" |
|
|
|
:scroll-anchoring="false" |
|
|
|
:enhanced="true" |
|
|
|
:bounces="false" |
|
|
|
:scroll-with-animation="false" |
|
|
|
@scroll="onScroll" |
|
|
|
> |
|
|
|
<view class="schedule-container-inner" :style="{ width: tableWidth + 'rpx', minWidth: '1260rpx' }"> |
|
|
|
@ -429,6 +439,7 @@ export default { |
|
|
|
|
|
|
|
// 滚动相关 |
|
|
|
scrollTop: 0, |
|
|
|
scrollTimer: null, // 滚动防抖定时器 |
|
|
|
|
|
|
|
// 表格配置 |
|
|
|
tableWidth: 1500, // 表格总宽度,确保7天都能显示 (7*180+120=1380rpx) |
|
|
|
@ -537,6 +548,12 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
beforeDestroy() { |
|
|
|
// 清理滚动定时器 |
|
|
|
if (this.scrollTimer) { |
|
|
|
clearTimeout(this.scrollTimer) |
|
|
|
this.scrollTimer = null |
|
|
|
} |
|
|
|
|
|
|
|
// 移除事件监听(仅在H5环境下) |
|
|
|
// #ifndef MP-WEIXIN |
|
|
|
if (typeof window !== 'undefined') { |
|
|
|
@ -1155,12 +1172,19 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 滚动事件处理函数 - 只处理垂直滚动同步 |
|
|
|
// 滚动事件处理函数 - 优化垂直滚动同步 |
|
|
|
onScroll(e) { |
|
|
|
// 使用防抖优化滚动同步性能 |
|
|
|
if (this.scrollTimer) { |
|
|
|
clearTimeout(this.scrollTimer) |
|
|
|
} |
|
|
|
|
|
|
|
this.scrollTimer = setTimeout(() => { |
|
|
|
// 只需要同步垂直滚动位置给左侧时间列 |
|
|
|
if (e.detail.scrollTop !== undefined) { |
|
|
|
if (e.detail.scrollTop !== undefined && e.detail.scrollTop !== this.scrollTop) { |
|
|
|
this.scrollTop = e.detail.scrollTop |
|
|
|
} |
|
|
|
}, 16) // 约60fps的更新频率 |
|
|
|
}, |
|
|
|
|
|
|
|
// 单元格点击 |
|
|
|
@ -1492,6 +1516,10 @@ export default { |
|
|
|
.frozen-content-scroll { |
|
|
|
flex: 1; |
|
|
|
overflow: hidden; |
|
|
|
/* 优化滚动性能 */ |
|
|
|
-webkit-overflow-scrolling: touch; |
|
|
|
scroll-behavior: auto; |
|
|
|
overscroll-behavior: none; |
|
|
|
} |
|
|
|
|
|
|
|
.frozen-content { |
|
|
|
@ -1578,6 +1606,10 @@ export default { |
|
|
|
.schedule-scroll { |
|
|
|
flex: 1; |
|
|
|
overflow: scroll; |
|
|
|
/* 优化滚动性能 */ |
|
|
|
-webkit-overflow-scrolling: touch; |
|
|
|
scroll-behavior: auto; |
|
|
|
overscroll-behavior: none; |
|
|
|
} |
|
|
|
|
|
|
|
.schedule-grid { |
|
|
|
|