From d026bb61804d2e699602c3d081493ea531570892 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Sat, 25 Apr 2026 16:15:17 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E5=A2=9E=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=90=8E=E5=8F=B0=E6=8E=A7=E5=88=B6=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E7=9A=84=E9=9A=90=E7=A7=81=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local.config.js | 22 +++++++++++++--------- components/privacy-popup/privacy-popup.vue | 19 +++++++++++++++++-- pages/index/public/js/index.js | 18 +++++++++++++++++- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/.local.config.js b/.local.config.js index 5cf40f6..7949dbf 100644 --- a/.local.config.js +++ b/.local.config.js @@ -42,14 +42,18 @@ const localDevConfig = ({ uniacid: 2, domain: 'http://localhost:8050/', }, - '100': { - uniacid: 100, - domain: 'https://5g.aigc-quickapp.com/', - }, - '1': { - uniacid: 1, - domain: 'https://5g.aigc-quickapp.com/', - }, -})['1']; // 选择要使用的环境配置 + '100': { + uniacid: 100, + domain: 'https://5g.aigc-quickapp.com/', + }, + '1': { + uniacid: 1, + domain: 'https://5g.aigc-quickapp.com/', + }, + '115': { + uniacid: 115, + domain: 'https://5g.aigc-quickapp.com/', + }, +})['100']; // 选择要使用的环境配置 export default localDevConfig; \ No newline at end of file diff --git a/components/privacy-popup/privacy-popup.vue b/components/privacy-popup/privacy-popup.vue index 35fb347..8a76baa 100644 --- a/components/privacy-popup/privacy-popup.vue +++ b/components/privacy-popup/privacy-popup.vue @@ -53,8 +53,15 @@ export default { } }, mounted() { - this.listenPrivacySettingChange() - this.curPageShow() + // 检查配置,决定是否显示隐私协议 + const shopInfo = uni.getStorageSync('shopInfo'); + if (shopInfo?.ischina == 1 && shopInfo?.index_login_auth == 1) { + this.listenPrivacySettingChange() + this.curPageShow() + } else { + // 如果不需要显示隐私协议,直接触发同意事件 + this.$emit('agree'); + } }, created() { try { @@ -152,6 +159,14 @@ export default { }, // 主动查询用户隐私政策授权状态 proactive() { + // 检查配置,决定是否显示隐私协议 + const shopInfo = uni.getStorageSync('shopInfo'); + if (!(shopInfo?.ischina == 1 && shopInfo?.index_login_auth == 1)) { + // 如果不需要显示隐私协议,直接触发同意事件 + this.$emit('agree'); + return; + } + // #ifdef MP-WEIXIN if (wx.getPrivacySetting) { wx.getPrivacySetting({ diff --git a/pages/index/public/js/index.js b/pages/index/public/js/index.js index 71f7513..77af006 100644 --- a/pages/index/public/js/index.js +++ b/pages/index/public/js/index.js @@ -3,7 +3,8 @@ export default { return { minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离 wechatQrcode: '', // 公众号二维码 - diyRoute: '/pages/index/index' + diyRoute: '/pages/index/index', + shopInfo: null // 店铺信息 }; }, onLoad(option) { @@ -15,10 +16,15 @@ export default { // #endif this.name = option.name || 'DIY_VIEW_INDEX'; // 根据店铺运营模式,打开平台(shop)或者连锁门店(stroe)页面,接口会自行判断 + // 获取店铺信息 + this.shopInfo = uni.getStorageSync('shopInfo'); }, onShow() { // 获取关注公众号二维码 this.getFollowQrcode(); + + // 重新获取店铺信息 + this.shopInfo = uni.getStorageSync('shopInfo'); }, mounted() { // 监听图片、文字、商品列表等组件的点击事件 @@ -59,6 +65,11 @@ export default { officialAccountsClose() { this.$refs.officialAccountsPopup.close(); }, + // 判断是否需要登录授权 + _needLoginAuth() { + // 检查 index_login_auth 都开启时才需要登录授权 + return this.shopInfo?.index_login_auth == 1; + }, // 统一处理点击及触摸事件 _handleDiyGroupInteractionEvent(payload) { // #ifdef H5 @@ -66,6 +77,11 @@ export default { return true; // #endif + // 如果不需要登录授权,直接返回 true 继续传播 + if (!this._needLoginAuth()) { + return true; + } + // 如果已登录,直接返回 true 继续传播 if (this.storeToken) { return true;