From 569702324f5befaf4b982fbdfc55d644d828196e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Wed, 7 Jan 2026 15:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.wxss | 16 +++++++ pages/goods-update/goods-update.wxss | 65 ++++++++++++++++++++-------- pages/goods/index.wxml | 2 + pages/goods/index.wxss | 32 ++++++++++++++ 4 files changed, 96 insertions(+), 19 deletions(-) diff --git a/app.wxss b/app.wxss index 770f3de..5ef45b1 100644 --- a/app.wxss +++ b/app.wxss @@ -1,4 +1,20 @@ /**app.wxss**/ +/* Global scrollbar hiding */ +::-webkit-scrollbar { + display: none !important; + width: 0 !important; + height: 0 !important; + opacity: 0 !important; + background: transparent !important; +} + +::-webkit-scrollbar-track { + background: transparent !important; +} + +::-webkit-scrollbar-thumb { + background: transparent !important; +} .container { display: flex; flex-direction: column; diff --git a/pages/goods-update/goods-update.wxss b/pages/goods-update/goods-update.wxss index 174cdaa..4e77db9 100644 --- a/pages/goods-update/goods-update.wxss +++ b/pages/goods-update/goods-update.wxss @@ -1,28 +1,45 @@ /* pages/goods-update/goods-update.wxss */ /* 页面容器 */ -.goods-update-page { - min-height: 100vh; - background-color: #f5f7fa; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; - overflow-y: auto; - -webkit-overflow-scrolling: touch; +/* 强制隐藏所有可能的滚动条 */ + +/* 页面级滚动条隐藏 */ +page { + overflow: hidden; scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* IE/Edge */ } -.goods-update-page::-webkit-scrollbar { +page::-webkit-scrollbar { display: none; + width: 0; + height: 0; } -/* 隐藏所有页面滚动条 */ -page::-webkit-scrollbar { - display: none; +/* 页面容器设置 */ +.goods-update-page { + min-height: 100vh; + background-color: #f5f7fa; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; + overflow: hidden; /* 禁用页面容器滚动 */ + position: relative; } -page { +/* 商品详情内容区域作为主要滚动区域 */ +.goods-detail-content { + height: calc(100vh - 140px); /* 减去底部按钮和顶部区域的高度 */ + overflow-y: auto; + -webkit-overflow-scrolling: touch; scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* IE/Edge */ + position: relative; +} + +/* 强制隐藏滚动条 */ +.goods-detail-content::-webkit-scrollbar { + display: none; + width: 0; + height: 0; } /* 隐藏所有scroll-view组件的滚动条 */ @@ -33,25 +50,35 @@ scroll-view { scroll-view::-webkit-scrollbar { display: none; + width: 0; + height: 0; } -/* 隐藏商品详情内容区域的滚动条 */ -.goods-detail-content { +/* 隐藏模态框中scroll-view的滚动条 */ +.modal-scroll-view { scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* IE/Edge */ } -.goods-detail-content::-webkit-scrollbar { +.modal-scroll-view::-webkit-scrollbar { display: none; + width: 0; + height: 0; } -/* 隐藏模态框中scroll-view的滚动条 */ -.modal-scroll-view { - scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE/Edge */ +/* 添加额外的滚动条隐藏样式,覆盖可能的系统默认样式 */ +::-webkit-scrollbar { + display: none; + width: 0 !important; + height: 0 !important; + -webkit-appearance: none; } -.modal-scroll-view::-webkit-scrollbar { +::-webkit-scrollbar-track { + display: none; +} + +::-webkit-scrollbar-thumb { display: none; } diff --git a/pages/goods/index.wxml b/pages/goods/index.wxml index 0dbdda8..c8e498c 100644 --- a/pages/goods/index.wxml +++ b/pages/goods/index.wxml @@ -5,6 +5,8 @@ class="goods-list" bindscrolltolower="onReachBottom" scroll-y="true" + enhanced="true" + show-scrollbar="{{false}}" refresher-enabled="{{true}}" refresher-triggered="{{isRefreshing}}" refresher-default-style="black" diff --git a/pages/goods/index.wxss b/pages/goods/index.wxss index 18ab497..f1b9783 100644 --- a/pages/goods/index.wxss +++ b/pages/goods/index.wxss @@ -4,6 +4,13 @@ background-color: #f5f5f5; height: 100vh; overflow: hidden; + /* 隐藏滚动条 */ + scrollbar-width: none; + -ms-overflow-style: none; +} + +.container::-webkit-scrollbar { + display: none; } .page-title { @@ -158,6 +165,14 @@ width: 100%; height: 100vh; box-sizing: border-box; + /* 隐藏滚动条 */ + scrollbar-width: none; + -ms-overflow-style: none; + overflow: hidden; +} + +.goods-section::-webkit-scrollbar { + display: none; } /* 滚动视图样式 */ @@ -166,6 +181,23 @@ overflow: hidden; } +/* 隐藏滚动条 */ +.goods-list::-webkit-scrollbar { + width: 0; + height: 0; + opacity: 0; + display: none; +} + +/* 兼容不同设备的滚动条隐藏 */ +.goods-list::-webkit-scrollbar-track { + background: transparent; +} + +.goods-list::-webkit-scrollbar-thumb { + background: transparent; +} + .goods-list-container { width: 100%; padding: 20rpx;