1.diy滚动监听优化

master
sws 2024-12-26 20:54:20 +08:00
parent 98b3d9e38c
commit c52d9ff6cf
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<template>
<view :style="page_style">
<view :style="page_img_style">
<scroll-view :scroll-y="true" class="ht" @scroll="on_scroll_event" @scrolltolower="on_scroll_lower_event" lower-threshold="60" scroll-with-animation>
<scroll-view :scroll-y="true" class="ht" @scroll="on_scroll_event" @scrolltolower="on_scroll_lower_event" @scrolltoupper="on_scroll_upper_event" lower-threshold="60" scroll-with-animation="true">
<!-- 头部小程序兼容 -->
<view class="pr header">
<componentDiyHeader :propKey="header_data.id" :propValue="header_data.com_data" :propScrollTop="head_scroll_top" @onImmersionModelCallBack="immersion_model_call_back" @onLocationBack="choice_location_back"></componentDiyHeader>
@ -462,6 +462,10 @@
this.get_goods_list();
}
},
//
on_scroll_upper_event() {
this.head_scroll_top = 0;
},
//
get_goods_list(is_mandatory) {
@ -567,7 +571,7 @@
//
on_scroll_event(e) {
const scroll_num = e.detail.scrollTop;
const scroll_num = parseInt(e.detail.scrollTop);
if (scroll_num <= 20) {
this.head_scroll_top = 0;
} else {
@ -578,7 +582,6 @@
this.head_scroll_top = this.sticky_top + 100;
}
}
this.scroll_timer_compute(scroll_num);
//
// #ifdef H5 || MP-TOUTIAO
@ -594,6 +597,7 @@
}
}
// #endif
this.scroll_timer_compute(scroll_num);
},
scroll_timer_compute(scroll_num) {