|
|
@@ -22,11 +22,9 @@
|
|
|
搜索
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
|
|
|
<view class="btn-container">
|
|
|
-
|
|
|
<view class="btn-item" @click="handleExpress('1')">
|
|
|
<image class="button-icon" src="/static/img/index-un-time.png" />
|
|
|
<view class="button-right">
|
|
|
@@ -35,29 +33,41 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- <view class="btn-item" @click="handleExpress('2')">
|
|
|
- <image class="button-icon" src="/static/img/index-time.png" />
|
|
|
- <view class="button-right">
|
|
|
- <view class="button-title">瑞鲸速达(顺丰)</view>
|
|
|
- <view class="button-desc">一小时下单取件</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view class="btn-item" @click="showExpressDialog">
|
|
|
<image class="button-icon" src="/static/img/index-personal.png" />
|
|
|
<view class="button-right">
|
|
|
<view class="button-title">个人寄件</view>
|
|
|
<view class="button-desc">支持顺丰和京东</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
|
|
|
- <!-- 使用 u-popup 弹框组件 -->
|
|
|
+ <!-- 使用 u-popup 弹框组件(个人寄件) -->
|
|
|
<PersonalExpressDialog :visible="showDialog" @update:visible="showDialog = $event"
|
|
|
@select="handleExpressSelect" />
|
|
|
+
|
|
|
+ <!-- ========== 新增:隐私协议弹框 ========== -->
|
|
|
+ <u-popup :show="showPrivacyDialog" mode="center" :round="10" :closeable="false" :safeAreaInsetBottom="false">
|
|
|
+ <view class="privacy-dialog">
|
|
|
+ <view class="title">温馨提示</view>
|
|
|
+ <view class="content">
|
|
|
+ 欢迎使用本小程序。在使用我们的服务前,请您仔细阅读并同意以下协议:
|
|
|
+ </view>
|
|
|
+ <view class="protocol-links">
|
|
|
+ <text class="link" @click="goToProtocol('user')">《用户协议》</text>
|
|
|
+ <text class="and">与</text>
|
|
|
+ <text class="link" @click="goToProtocol('privacy')">《隐私协议》</text>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+ 点击“同意”即表示您已阅读并同意上述协议的全部条款。
|
|
|
+ </view>
|
|
|
+ <view class="btn-group">
|
|
|
+ <button class="btn reject" @click="onReject">拒绝</button>
|
|
|
+ <button class="btn agree" @click="onAgree">同意</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <!-- ========== 新增结束 ========== -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -79,6 +89,77 @@
|
|
|
quickLogin
|
|
|
} from "@/utils/util.js";
|
|
|
|
|
|
+ // ========== 新增:隐私协议相关常量和方法 ==========
|
|
|
+ // 协议远程地址(请替换为实际线上地址)
|
|
|
+ const USER_PROTOCOL_URL = 'https://rjsd.mychery.com/user_agreement.html'
|
|
|
+ const PRIVACY_PROTOCOL_URL = 'https://rjsd.mychery.com/privacy_policy.html'
|
|
|
+
|
|
|
+ // 控制协议弹框显示
|
|
|
+ const showPrivacyDialog = ref(false)
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 显示协议弹框
|
|
|
+ */
|
|
|
+ function showPrivacyModal() {
|
|
|
+ showPrivacyDialog.value = true
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 关闭弹框
|
|
|
+ */
|
|
|
+ function closeDialog() {
|
|
|
+ showPrivacyDialog.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转到协议详情页(使用 WebView)
|
|
|
+ * @param {string} type 'user' 或 'privacy'
|
|
|
+ */
|
|
|
+ function goToProtocol(type) {
|
|
|
+ const url = type === 'user' ? USER_PROTOCOL_URL : PRIVACY_PROTOCOL_URL
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户点击“同意”
|
|
|
+ */
|
|
|
+ function onAgree() {
|
|
|
+ try {
|
|
|
+ uni.setStorageSync('privacyAgreed', true)
|
|
|
+ closeDialog()
|
|
|
+ } catch (e) {
|
|
|
+ console.error('存储失败', e)
|
|
|
+ uni.showToast({ title: '操作失败,请重试', icon: 'none' })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户点击“拒绝”
|
|
|
+ */
|
|
|
+ function onReject() {
|
|
|
+ closeDialog()
|
|
|
+ uni.exitMiniProgram({
|
|
|
+ success: function() {
|
|
|
+ console.log('退出小程序成功');
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log('退出小程序失败', err);
|
|
|
+ uni.showToast({
|
|
|
+ title: '无法退出,请同意协议',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ // 重新弹出协议框
|
|
|
+ setTimeout(() => {
|
|
|
+ showPrivacyModal()
|
|
|
+ }, 300)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ // ========== 新增结束 ==========
|
|
|
+
|
|
|
const showDialog = ref(false)
|
|
|
|
|
|
// 轮播图数据
|
|
|
@@ -90,6 +171,19 @@
|
|
|
|
|
|
onShow(() => {
|
|
|
getBannerList()
|
|
|
+
|
|
|
+ // ========== 新增:每次显示首页时检查协议状态 ==========
|
|
|
+ try {
|
|
|
+ const agreed = uni.getStorageSync('privacyAgreed')
|
|
|
+ if (!agreed) {
|
|
|
+ // 首次使用或未同意,显示协议弹框
|
|
|
+ showPrivacyModal()
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('读取存储失败', error)
|
|
|
+ showPrivacyModal()
|
|
|
+ }
|
|
|
+ // ========== 新增结束 ==========
|
|
|
})
|
|
|
|
|
|
const getBannerList = () => {
|
|
|
@@ -367,4 +461,73 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ .privacy-dialog {
|
|
|
+ width: 600rpx;
|
|
|
+ padding: 40rpx 30rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 30rpx;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #666;
|
|
|
+ line-height: 1.6;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .protocol-links {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin: 20rpx 0;
|
|
|
+ font-size: 30rpx;
|
|
|
+
|
|
|
+ .link {
|
|
|
+ color: #1B64F0;
|
|
|
+ // text-decoration: underline;
|
|
|
+ padding: 0 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .and {
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btn-group {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 40rpx;
|
|
|
+
|
|
|
+ .btn {
|
|
|
+ flex: 1;
|
|
|
+ height: 80rpx;
|
|
|
+ line-height: 80rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 40rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin: 0 15rpx;
|
|
|
+
|
|
|
+ &.reject {
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ color: #999;
|
|
|
+ border: 1px solid #ddd;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.agree {
|
|
|
+ background-color: #1B64F0;
|
|
|
+ color: #fff;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|