Browse Source

隐藏页面滚动条和滚动提示

pull/1/head
徐飞洋 3 months ago
parent
commit
2abf5dffa0
  1. 29
      pages/seller/index.js
  2. 12
      pages/seller/index.wxml
  3. 10
      pages/seller/index.wxss

29
pages/seller/index.js

@ -1625,12 +1625,7 @@ Page({
draftSupplies
});
// 显示搜索结果提示
wx.showToast({
title: `找到${filteredSupplies.length}个货源`,
icon: 'none',
duration: 1500
});
},
// 下拉刷新处理函数
@ -1798,12 +1793,7 @@ Page({
draftSupplies
});
// 显示搜索结果提示
wx.showToast({
title: `找到${filteredSupplies.length}个货源`,
icon: 'none',
duration: 1500
});
},
// 修改图片URL处理函数
@ -2561,9 +2551,9 @@ Page({
}, 500)
},
// 导航到全屏创建货源页面
// 显示添加货源弹窗
showAddSupply(e) {
console.log('点击创建新货源按钮,导航到全屏页面');
console.log('点击创建新货源按钮');
// 阻止事件冒泡,防止触发父元素的点击事件
if (e && e.stopPropagation) {
@ -2573,10 +2563,15 @@ Page({
// 从本地存储加载之前保存的货源数据
const savedSupply = wx.getStorageSync('newSupplyDraft') || { name: '', price: '', minOrder: '', yolk: '', spec: '', imageUrls: [] };
// 导航到新的全屏创建货源页面
wx.navigateTo({
url: '/pages/create-supply/index'
// 直接显示创建货源弹窗,无需登录验证
this.setData({
showImagePreview: false,
showModal: true,
newSupply: savedSupply
});
// 锁定页面滚动
this.disablePageScroll();
},
// 隐藏弹窗

12
pages/seller/index.wxml

@ -472,11 +472,11 @@
<!-- 创建货源弹窗 -->
<view class="modal" wx:if="{{showModal}}" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 999;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<view class="modal-content" style="width: 92%; max-width: 600rpx; background: white; padding: 40rpx; border-radius: 20rpx; max-height: 85vh; position: relative; box-shadow: 0 10rpx 40rpx rgba(0,0,0,0.15); transform: translateZ(0); -webkit-transform: translateZ(0);">
<view class="modal-content" style="width: 100%; height: 100%; background: white; border-radius: 0; position: relative; box-shadow: none; transform: translateZ(0); -webkit-transform: translateZ(0);">
<!-- 固定的关闭按钮 -->
<view style="position: absolute; top: 20rpx; right: 20rpx; background-color: #f5f5f5; color: #666; width: 60rpx; height: 60rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36rpx; z-index: 10;" bindtap="hideModal">×</view>
<scroll-view scroll-y="true" style="height: 950rpx; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0);" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<scroll-view scroll-y="true" style="height: 100vh; padding: 40rpx; box-sizing: border-box; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0); -webkit-scrollbar: none; scrollbar-width: none;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<view class="title" style="text-align: center; font-size: 36rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; margin-top: 10rpx;">创建货源</view>
<!-- 照片上传区域 -->
@ -545,6 +545,8 @@
<button bindtap="hideModal" style="flex: 1; height: 90rpx; line-height: 90rpx; background-color: #f5f5f5; color: #666; font-size: 30rpx; border-radius: 12rpx; margin: 0; display: flex; align-items: center; justify-content: center;">取消</button>
<button bindtap="addSupply" style="flex: 1; height: 90rpx; line-height: 90rpx; background-color: #07c160; color: white; font-size: 30rpx; border-radius: 12rpx; margin: 0; display: flex; align-items: center; justify-content: center;">创建</button>
</view>
<!-- 增加1/7屏幕高度的空白页,防止按钮被遮挡 -->
<view style="height: 14.28vh;"></view>
</scroll-view>
</view>
</view>
@ -555,7 +557,7 @@
<!-- 固定的关闭按钮 -->
<view style="position: absolute; top: 20rpx; right: 20rpx; background-color: #f5f5f5; color: #666; width: 60rpx; height: 60rpx; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36rpx; z-index: 10;" bindtap="hideEditModal">×</view>
<scroll-view scroll-y="true" style="height: 950rpx; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0);" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<scroll-view scroll-y="true" style="height: 950rpx; overflow-y: scroll; -webkit-overflow-scrolling: touch; transform: translateZ(0); -webkit-transform: translateZ(0); -webkit-scrollbar: none; scrollbar-width: none;" catchtouchmove="true" bindtouchstart="onModalTouchStart" bindtouchmove="onModalTouchMove">
<view class="title" style="text-align: center; font-size: 36rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; margin-top: 10rpx;">编辑货源</view>
<!-- 照片上传区域 -->
@ -695,7 +697,7 @@
<!-- 蛋黄列表 -->
<scroll-view
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"
>
<view
@ -893,7 +895,7 @@
<!-- 搜索结果区域 -->
<scroll-view
wx:if="{{showSearchResults}}"
style="max-height: 200rpx; border-bottom: 1rpx solid #eee;"
style="max-height: 200rpx; border-bottom: 1rpx solid #eee; -webkit-scrollbar: none; scrollbar-width: none;"
scroll-y
>
<view

10
pages/seller/index.wxss

@ -1,4 +1,14 @@
/* pages/seller/index.wxss */
/* 隐藏页面滚动条 */
::-webkit-scrollbar {
display: none;
}
scroll-view {
-webkit-scrollbar: none;
scrollbar-width: none;
}
/* 重置默认样式,确保不继承父类样式 */
button {
margin: 0;

Loading…
Cancel
Save