diff --git a/pages/navigation/search/search.scss b/pages/navigation/search/search.scss
index 4ed9545..268cce0 100644
--- a/pages/navigation/search/search.scss
+++ b/pages/navigation/search/search.scss
@@ -133,14 +133,23 @@ page {
margin-bottom: 20rpx;
}
}
-.scoll-page,
-.goods-scroll {
+.scoll-page {
flex: 1;
min-height: 0;
height: 100%;
box-sizing: border-box;
}
+/* #ifdef MP */
+.goods-scroll {
+ flex: 1;
+ height: 0;
+ min-height: 0;
+ width: 100%;
+ box-sizing: border-box;
+}
+/* #endif */
+
.search-navbar-wrap {
box-sizing: border-box;
flex-shrink: 0;
@@ -163,6 +172,12 @@ page {
background: $bg-color;
}
+/* #ifdef MP */
+.goods-content {
+ height: 0;
+}
+/* #endif */
+
.content {
background-color: $bg-color;
height: 100vh;
@@ -171,14 +186,16 @@ page {
flex-direction: column;
}
-/* #ifdef H5 */
+/* #ifdef H5 || APP-PLUS */
.content--goods {
+ display: block;
height: auto;
min-height: 100vh;
overflow: visible;
}
.goods-content--h5 {
+ display: block;
flex: none;
min-height: auto;
overflow: visible;
@@ -440,6 +457,7 @@ page {
display: flex;
width: 100%;
height: 80rpx;
+ flex-shrink: 0;
background: #fff;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.06);
z-index: 10;
diff --git a/pages/navigation/search/searchPage.vue b/pages/navigation/search/searchPage.vue
index 6670b42..615e532 100644
--- a/pages/navigation/search/searchPage.vue
+++ b/pages/navigation/search/searchPage.vue
@@ -105,7 +105,7 @@
筛选
-
+
@@ -115,12 +115,11 @@
-
+
(null)
@@ -328,7 +321,6 @@ const sortParams = ref({
const routerVal = ref('')
const capsuleInsetRight = ref(0)
const searchNavbarWidth = ref(0)
-const goodsScrollHeight = ref(0)
const searchNavbarStyle = computed(() => {
if (searchNavbarWidth.value) {
@@ -341,17 +333,7 @@ const searchNavbarStyle = computed(() => {
}
})
-const goodsScrollStyle = computed(() => {
- if (goodsScrollHeight.value > 0) {
- return {
- height: `${goodsScrollHeight.value}px`,
- }
- }
- return {}
-})
-
onPageScroll((e) => {
- console.log(e)
scrollTop.value = e.scrollTop
})
@@ -390,23 +372,6 @@ onLoad((val) => {
onReady(() => {
setSearchNavbarWidth()
- calcGoodsScrollHeight()
-})
-
-onShow(() => {
- calcGoodsScrollHeight()
-})
-
-onMounted(() => {
- // #ifdef H5
- window.addEventListener('resize', calcGoodsScrollHeight)
- // #endif
-})
-
-onBeforeUnmount(() => {
- // #ifdef H5
- window.removeEventListener('resize', calcGoodsScrollHeight)
- // #endif
})
watch(keyword, (val) => {
@@ -427,22 +392,8 @@ watch(sortPopup, (val) => {
}
})
-watch(isShowSeachGoods, (val) => {
- if (val) {
- nextTick(() => {
- calcGoodsScrollHeight()
- })
- }
-})
-
-watch(isSWitch, () => {
- nextTick(() => {
- calcGoodsScrollHeight()
- })
-})
-
onReachBottom(() => {
- // #ifdef H5
+ // #ifdef H5 || APP-PLUS
if (!isShowSeachGoods.value || loadingType.value !== 'more') {
return
}
@@ -450,27 +401,6 @@ onReachBottom(() => {
// #endif
})
-function calcGoodsScrollHeight() {
- nextTick(() => {
- const query = uni.createSelectorQuery().in(proxy)
- query.select('.goods-content').boundingClientRect()
- query.select('.goods-content .navbar').boundingClientRect()
- query.exec((res) => {
- const contentRect = res[0]
- const navbarRect = res[1]
- if (!contentRect) {
- return
- }
- const sortBarHeight = navbarRect ? navbarRect.height : uni.upx2px(80)
- const { windowHeight } = uni.getWindowInfo()
- const height =
- Math.max(contentRect.height, windowHeight - contentRect.top) -
- sortBarHeight
- goodsScrollHeight.value = Math.max(height, 0)
- })
- })
-}
-
function setSearchNavbarWidth() {
// #ifdef MP-WEIXIN
try {
@@ -738,9 +668,6 @@ async function loadData(type?: string, _loading?: number) {
empty.value = goodsListData.value.length === 0
initSortGoods()
- nextTick(() => {
- calcGoodsScrollHeight()
- })
if (store.state.isShowToast) {
uni.hideLoading()
}
@@ -849,7 +776,7 @@ function saveKeyword(saveKey: string) {
@import './search.scss';