From 3e321e309a9a4029748b848d30e9c82c8852410f Mon Sep 17 00:00:00 2001 From: Default User Date: Fri, 23 Jan 2026 16:55:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 50 ++++++++++++++++++++++ pages/index/index.wxml | 27 ++++++++++++ pages/index/index.wxss | 94 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 171 insertions(+) diff --git a/pages/index/index.js b/pages/index/index.js index 0beb1bc..24caf5d 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -56,6 +56,7 @@ Page({ showAuthModal: false, showOneKeyLoginModal: false, showAddToHomeModal: false, + showUserAgreementModal: false, // 用户协议与隐私政策弹窗 userInfo: {}, needPhoneAuth: false, testMode: true, @@ -589,6 +590,10 @@ Page({ lastScrollTop: 0, headerElementsHidden: false }); + + // 检查用户是否已同意协议 + this.checkUserAgreement(); + this.checkAndRestoreLoginStatus() this.loadCategories() this.loadGoods() @@ -889,6 +894,51 @@ Page({ return region; }, + + // 检查用户是否已同意协议 + checkUserAgreement: function() { + const hasAgreed = wx.getStorageSync('userAgreementAgreed'); + if (!hasAgreed) { + this.setData({ + showUserAgreementModal: true + }); + } + }, + + // 同意用户协议 + agreeUserAgreement: function() { + wx.setStorageSync('userAgreementAgreed', true); + this.setData({ + showUserAgreementModal: false + }); + }, + + // 不同意用户协议 + disagreeUserAgreement: function() { + // 可以选择关闭小程序或继续显示弹窗 + wx.showToast({ + title: '您需要同意协议才能使用小程序', + icon: 'none' + }); + }, + + // 跳转到用户服务协议页面 + navigateToUserServiceAgreement: function() { + // 这里可以跳转到具体的协议页面,暂时使用提示 + wx.showToast({ + title: '跳转至用户服务协议', + icon: 'none' + }); + }, + + // 跳转到隐私政策页面 + navigateToPrivacyPolicy: function() { + // 这里可以跳转到具体的隐私政策页面,暂时使用提示 + wx.showToast({ + title: '跳转至隐私政策', + icon: 'none' + }); + }, // 格式化商品规格显示 - 只显示前两个,后面加... formatSpecification: function (spec, yolk) { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index d60756d..dd07d02 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -151,6 +151,33 @@ + + + + + + 欢迎使用小程序 + + + 为更好保障您的个人权益,请您在使用本应用前,仔细阅读 + + 《用户服务协议》 + + 《隐私政策》 + + ;我们同时提供 + + 《隐私政策摘要》 + + 帮助您快速了解本应用如何收集、使用、传输、存储、对外提供、保护您的个人信息及您的权利如何行使。 + 点击"同意",视为您已经充分理解并同意《用户服务协议》、《隐私政策》及上述内容。 + + + + + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 32e243c..54d9d52 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -2423,3 +2423,97 @@ video.product-media { .modal-button:active { background-color: #40a9ff; } + +/* 用户协议与隐私政策弹窗样式 */ +.user-agreement-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 1000; + display: flex; + justify-content: center; + align-items: center; +} + +.user-agreement-container { + background: white; + border-radius: 20rpx; + width: 90%; + max-height: 80vh; + overflow: hidden; + display: flex; + flex-direction: column; + box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1); +} + +.agreement-header { + padding: 32rpx; + text-align: center; + border-bottom: 2rpx solid #f5f5f5; +} + +.agreement-title { + font-size: 36rpx; + font-weight: bold; + color: #333; +} + +.agreement-content { + padding: 32rpx; + flex: 1; + overflow-y: auto; + line-height: 1.6; +} + +.agreement-text { + font-size: 30rpx; + color: #666; + display: block; + margin-bottom: 20rpx; +} + +.agreement-link { + color: #1890ff; + text-decoration: underline; + font-size: 30rpx; +} + +.agreement-footer { + padding: 32rpx; + border-top: 2rpx solid #f5f5f5; + display: flex; + gap: 24rpx; +} + +.disagree-btn { + flex: 1; + background: #f5f5f5; + color: #666; + border: none; + border-radius: 12rpx; + padding: 20rpx; + font-size: 32rpx; + font-weight: bold; +} + +.agree-btn { + flex: 1; + background: #1890ff; + color: white; + border: none; + border-radius: 12rpx; + padding: 20rpx; + font-size: 32rpx; + font-weight: bold; +} + +.disagree-btn:active { + background: #e0e0e0; +} + +.agree-btn:active { + background: #096dd9; +} From 1cd06b2680f5d562d90802d93aab813ef6dcc253 Mon Sep 17 00:00:00 2001 From: Default User Date: Fri, 23 Jan 2026 17:00:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DiOS=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E5=8F=AF?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods-update/goods-update.wxss | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pages/goods-update/goods-update.wxss b/pages/goods-update/goods-update.wxss index ffc1ef0..bff7c8f 100644 --- a/pages/goods-update/goods-update.wxss +++ b/pages/goods-update/goods-update.wxss @@ -22,11 +22,24 @@ page::-webkit-scrollbar { background-color: #f5f7fa; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; position: relative; + overflow: hidden; /* 禁用页面容器滚动,防止iOS整体拖动 */ + touch-action: none; /* 防止页面整体拖动 */ } -/* 商品详情内容区域 */ +/* 商品详情内容区域作为主要滚动区域 */ .goods-detail-content { + height: calc(100vh - 140px); /* 减去底部按钮和顶部区域的高度 */ + overflow-y: auto; + /* 优化iOS滚动行为,防止页面整体拖动 */ + -webkit-overflow-scrolling: touch; + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE/Edge */ position: relative; + touch-action: pan-y; /* 只允许垂直滚动 */ + /* 添加以下属性防止iOS橡皮筋效果 */ + overflow-x: hidden; + backface-visibility: hidden; + perspective: 1000px; } /* 隐藏所有scroll-view组件的滚动条 */