Browse Source

强制隐藏所有页面和组件的滚动条

pull/1/head
徐飞洋 3 months ago
parent
commit
1f8f7505b3
  1. 35
      app.wxss
  2. 6
      pages/seller/index.wxml
  3. 56
      pages/seller/index.wxss

35
app.wxss

@ -1,4 +1,39 @@
/**app.wxss**/ /**app.wxss**/
/* 全局滚动条隐藏 - 强制覆盖所有页面 */
::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
opacity: 0 !important;
-webkit-appearance: none !important;
}
::-webkit-scrollbar-track {
display: none !important;
width: 0 !important;
height: 0 !important;
}
::-webkit-scrollbar-thumb {
display: none !important;
width: 0 !important;
height: 0 !important;
}
/* 针对微信小程序scroll-view组件的强制滚动条隐藏 */
scroll-view {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
overflow-scrolling: touch;
overflow: auto !important;
}
/* 强制页面根元素不显示滚动条 */
page {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
overflow-x: hidden !important;
}
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

6
pages/seller/index.wxml

@ -545,7 +545,7 @@
<view bindtap="saveEdit" style="font-size: 32rpx; color: #07c160;">提交</view> <view bindtap="saveEdit" style="font-size: 32rpx; color: #07c160;">提交</view>
</view> </view>
<scroll-view scroll-y="true" style="height: calc(100vh - 90rpx); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40rpx 60rpx; box-sizing: border-box;"> <scroll-view scroll-y="true" style="height: calc(100vh - 90rpx); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40rpx 60rpx; box-sizing: border-box; -webkit-scrollbar: none; scrollbar-width: none;">
<view> <view>
<!-- 照片上传区域 --> <!-- 照片上传区域 -->
@ -713,7 +713,7 @@
<!-- 商品名称列表 --> <!-- 商品名称列表 -->
<scroll-view <scroll-view
scroll-y="true" scroll-y="true"
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;" style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none;"
enable-back-to-top="false" enable-back-to-top="false"
> >
<view <view
@ -763,7 +763,7 @@
<!-- 规格列表 --> <!-- 规格列表 -->
<scroll-view <scroll-view
scroll-y="true" scroll-y="true"
style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch;" style="max-height: 60vh; padding: 0; -webkit-overflow-scrolling: touch; -webkit-scrollbar: none; scrollbar-width: none;"
enable-back-to-top="false" enable-back-to-top="false"
> >
<view <view

56
pages/seller/index.wxss

@ -1,12 +1,60 @@
/* pages/seller/index.wxss */ /* pages/seller/index.wxss */
/* 隐藏页面滚动条 */ /* 隐藏页面滚动条 - 完整强制解决方案 */
/* 全局滚动条隐藏 - 强制覆盖所有元素 */
::-webkit-scrollbar { ::-webkit-scrollbar {
display: none; display: none !important;
width: 0 !important;
height: 0 !important;
opacity: 0 !important;
-webkit-appearance: none !important;
}
::-webkit-scrollbar-track {
display: none !important;
width: 0 !important;
height: 0 !important;
} }
::-webkit-scrollbar-thumb {
display: none !important;
width: 0 !important;
height: 0 !important;
}
/* 针对微信小程序scroll-view组件的强制滚动条隐藏 */
scroll-view { scroll-view {
-webkit-scrollbar: none; -webkit-scrollbar: none !important;
scrollbar-width: none; scrollbar-width: none !important;
overflow-scrolling: touch;
/* 确保滚动区域不显示滚动条 */
overflow: auto !important;
}
/* 容器元素滚动条隐藏 */
.container {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
overflow-x: hidden !important;
overflow-y: auto !important;
}
/* 确保常用滚动容器隐藏滚动条 */
.scrollable-container {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
}
/* 强制页面根元素不显示滚动条 */
page {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
overflow-x: hidden !important;
}
/* 为所有可能滚动的元素添加滚动条隐藏 */
.view, text, image, button, input, textarea, swiper, navigator, picker, slider, switch {
-webkit-scrollbar: none !important;
scrollbar-width: none !important;
} }
/* 重置默认样式,确保不继承父类样式 */ /* 重置默认样式,确保不继承父类样式 */

Loading…
Cancel
Save