Browse Source

合并远程Xfy分支更改

pull/19/head
徐飞洋 1 month ago
parent
commit
85758134a9
  1. 15
      pages/goods-update/goods-update.wxss
  2. 50
      pages/index/index.js
  3. 27
      pages/index/index.wxml
  4. 94
      pages/index/index.wxss

15
pages/goods-update/goods-update.wxss

@ -22,11 +22,24 @@ page::-webkit-scrollbar {
background-color: #f5f7fa; background-color: #f5f7fa;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
position: relative; position: relative;
overflow: hidden; /* 禁用页面容器滚动,防止iOS整体拖动 */
touch-action: none; /* 防止页面整体拖动 */
} }
/* 商品详情内容区域 */ /* 商品详情内容区域作为主要滚动区域 */
.goods-detail-content { .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; position: relative;
touch-action: pan-y; /* 只允许垂直滚动 */
/* 添加以下属性防止iOS橡皮筋效果 */
overflow-x: hidden;
backface-visibility: hidden;
perspective: 1000px;
} }
/* 隐藏所有scroll-view组件的滚动条 */ /* 隐藏所有scroll-view组件的滚动条 */

50
pages/index/index.js

@ -56,6 +56,7 @@ Page({
showAuthModal: false, showAuthModal: false,
showOneKeyLoginModal: false, showOneKeyLoginModal: false,
showAddToHomeModal: false, showAddToHomeModal: false,
showUserAgreementModal: false, // 用户协议与隐私政策弹窗
userInfo: {}, userInfo: {},
needPhoneAuth: false, needPhoneAuth: false,
testMode: true, testMode: true,
@ -589,6 +590,10 @@ Page({
lastScrollTop: 0, lastScrollTop: 0,
headerElementsHidden: false headerElementsHidden: false
}); });
// 检查用户是否已同意协议
this.checkUserAgreement();
this.checkAndRestoreLoginStatus() this.checkAndRestoreLoginStatus()
this.loadCategories() this.loadCategories()
this.loadGoods() this.loadGoods()
@ -889,6 +894,51 @@ Page({
return region; 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) { formatSpecification: function (spec, yolk) {

27
pages/index/index.wxml

@ -151,6 +151,33 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 用户协议与隐私政策弹窗 -->
<view wx:if="{{showUserAgreementModal}}" class="user-agreement-overlay">
<view class="user-agreement-container" catchtap="stopPropagation">
<view class="agreement-header">
<text class="agreement-title">欢迎使用小程序</text>
</view>
<view class="agreement-content">
<text class="agreement-text">为更好保障您的个人权益,请您在使用本应用前,仔细阅读</text>
<text class="agreement-text">
<text class="agreement-link" bindtap="navigateToUserServiceAgreement">《用户服务协议》</text>
<text class="agreement-text">及</text>
<text class="agreement-link" bindtap="navigateToPrivacyPolicy">《隐私政策》</text>
</text>
<text class="agreement-text">;我们同时提供</text>
<text class="agreement-text">
<text class="agreement-link" bindtap="navigateToPrivacyPolicy">《隐私政策摘要》</text>
</text>
<text class="agreement-text">帮助您快速了解本应用如何收集、使用、传输、存储、对外提供、保护您的个人信息及您的权利如何行使。</text>
<text class="agreement-text">点击"同意",视为您已经充分理解并同意《用户服务协议》、《隐私政策》及上述内容。</text>
</view>
<view class="agreement-footer">
<button class="disagree-btn" bindtap="disagreeUserAgreement">不同意</button>
<button class="agree-btn" bindtap="agreeUserAgreement">同意</button>
</view>
</view>
</view>
<!-- 商品列表区域 --> <!-- 商品列表区域 -->
<view class="goods-section"> <view class="goods-section">

94
pages/index/index.wxss

@ -2423,3 +2423,97 @@ video.product-media {
.modal-button:active { .modal-button:active {
background-color: #40a9ff; 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;
}

Loading…
Cancel
Save