diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index e8394e6..d4f40c8 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -213,18 +213,13 @@ Component({ // 如果idcardstatus不是1,提示用户并跳转到入驻页面 if (idcardstatus !== 1) { - wx.showToast({ - title: '请先完成身份认证', - icon: 'none', - duration: 3000 - }) - + // 3秒后自动跳转到认证页面 setTimeout(() => { wx.navigateTo({ url: '/pages/profile/authentication/index' }) - }, 3000) + }) return } diff --git a/pages/chat-detail/index.js b/pages/chat-detail/index.js index 6f1b95c..c26840e 100644 --- a/pages/chat-detail/index.js +++ b/pages/chat-detail/index.js @@ -260,7 +260,7 @@ Page({ isNew: false })); this.setData({ messages: updatedMessages }); - }, 300); + }, 1000); }); }, diff --git a/pages/goods-detail/goods-detail.js b/pages/goods-detail/goods-detail.js index d81c209..b80613d 100644 --- a/pages/goods-detail/goods-detail.js +++ b/pages/goods-detail/goods-detail.js @@ -3085,14 +3085,9 @@ Page({ console.log('用户身份证认证状态:', idcardstatus); if (idcardstatus !== 1) { - console.log('用户未完成身份证认证,显示提示并跳转至认证页面'); - wx.showToast({ - title: '请先完成身份认证后使用该功能', - icon: 'none', - duration: 2000 - }); + - // 延迟2秒跳转到认证页面 + //跳转到认证页面 setTimeout(() => { wx.navigateTo({ url: '/pages/profile/authentication/index', @@ -3103,7 +3098,7 @@ Page({ console.error('跳转到认证页面失败:', error); } }); - }, 2000); + }); return; } diff --git a/pages/index/index.js b/pages/index/index.js index cc703fb..e1cad01 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -2604,11 +2604,28 @@ Page({ }); }, - // 阻止事件冒泡 + // 阻止事件冒泡和默认行为,防止iOS下拉拖动 stopPropagation: function (e) { // 安全检查,防止TypeError - if (e && typeof e.stopPropagation === 'function') { - e.stopPropagation(); + if (e) { + if (typeof e.stopPropagation === 'function') { + e.stopPropagation(); + } + if (typeof e.preventDefault === 'function') { + e.preventDefault(); + } + } + }, + + // iOS专用的触摸事件处理,防止下拉拖动 + handleTouchMove: function (e) { + // 在iOS上,当scrollTop为0时,阻止下拉拖动 + const scrollTop = e.detail.scrollTop || 0; + if (scrollTop === 0) { + // 阻止默认行为,防止iOS弹性滚动 + if (e && typeof e.preventDefault === 'function') { + e.preventDefault(); + } } }, diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 51e4cfd..854039f 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,6 +1,6 @@ - + @@ -186,6 +186,7 @@ id="goodsScrollView" bindscrolltolower="onReachBottom" bindscroll="onScroll" + bindtouchmove="handleTouchMove" scroll-y="true" scroll-top="{{scrollTop}}" refresher-enabled="{{true}}" diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 2eca8fb..2f9e5ff 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -199,6 +199,9 @@ page { box-shadow: none; background: transparent; z-index: 1; + /* 防止iOS弹性滚动 */ + -webkit-overflow-scrolling: touch; + overflow: hidden; } /* 标题样式调整 */ @@ -236,12 +239,13 @@ page { flex: 1; padding-top: 0; padding-bottom: 20rpx; - height: auto; - min-height: calc(100vh - 400rpx); /* 调整最小高度 */ + height: 100%; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch; background: transparent; + /* 防止iOS弹性滚动 */ + overscroll-behavior: contain; } /* 品种筛选区域调整 - 确保在商品图层之上,搜索框之下 */