Merge branch 'Branch_release/v1.4.1'

This commit was merged in pull request #9.
This commit is contained in:
2026-04-09 15:54:51 +08:00
3 changed files with 127 additions and 127 deletions

View File

@@ -41,7 +41,6 @@ const localDevConfig = ({
'local-2': { // 测试平台 'local-2': { // 测试平台
uniacid: 2, uniacid: 2,
domain: 'http://localhost:8050/', domain: 'http://localhost:8050/',
},
'47': { // 修改弹窗 '47': { // 修改弹窗
uniacid: 47, uniacid: 47,
domain: 'https://5g.aigc-quickapp.com/', domain: 'https://5g.aigc-quickapp.com/',
@@ -51,5 +50,4 @@ const localDevConfig = ({
domain: 'https://xcx.aigc-quickapp.com/', domain: 'https://xcx.aigc-quickapp.com/',
}, },
})['47']; // 选择要使用的环境配置 })['47']; // 选择要使用的环境配置
export default localDevConfig; export default localDevConfig;

View File

@@ -158,22 +158,48 @@ export default {
success: (res) => { success: (res) => {
// console.log(res) // console.log(res)
if (res.needAuthorization) { if (res.needAuthorization) {
// 检查本地存储中是否已经同意过隐私政策
const privacyAgreed = uni.getStorageSync('privacyAgreed');
if (!privacyAgreed) {
this.popUp() this.popUp()
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗 // 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
this.closeOtherPagePopUp(this.disPopUp) this.closeOtherPagePopUp(this.disPopUp)
} else { } else {
this.$emit('agree') this.$emit('agree')
} }
} else {
this.$emit('agree')
}
}, },
}); });
} else { } else {
this.$emit('agree') // 检查本地存储中是否已经同意过隐私政策
const privacyAgreed = uni.getStorageSync('privacyAgreed');
if (privacyAgreed) {
this.$emit('agree');
} else {
this.popUp()
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
this.closeOtherPagePopUp(this.disPopUp)
}
} }
// #endif // #endif
// #ifdef QUICKAPP-WEBVIEW // #ifdef QUICKAPP-WEBVIEW
this.getPrivacySettingByQuickApp(); this.getPrivacySettingByQuickApp();
// #endif // #endif
// #ifdef H5 || WEB
// 检查本地存储中是否已经同意过隐私政策
const privacyAgreed = uni.getStorageSync('privacyAgreed');
if (privacyAgreed) {
this.$emit('agree');
} else {
this.popUp()
// 额外逻辑:当前页面的隐私弹窗弹起的时候,关掉其他页面的隐私弹窗
this.closeOtherPagePopUp(this.disPopUp)
}
// #endif
}, },
//初始化监听程序 //初始化监听程序
curPageShow() { curPageShow() {
@@ -261,6 +287,8 @@ export default {
this.privacyResolves.clear() this.privacyResolves.clear()
//关闭弹窗 //关闭弹窗
this.disPopUp() this.disPopUp()
// 保存用户授权状态到本地存储,无论同意还是不同意,都不再重复弹出
uni.setStorageSync('privacyAgreed', true);
//退出小程序 //退出小程序
uni.showModal({ uni.showModal({
content: '未同意隐私协议,无法使用相关功能', content: '未同意隐私协议,无法使用相关功能',
@@ -281,10 +309,8 @@ export default {
//关闭弹窗 //关闭弹窗
this.disPopUp() this.disPopUp()
// #ifdef QUICKAPP-WEBVIEW || H5 || WEB // 保存用户授权状态到本地存储,用于所有环境
// 保存用户授权状态到本地存储,用于快应用Webview组件中的H5方式处理
uni.setStorageSync('privacyAgreed', true); uni.setStorageSync('privacyAgreed', true);
// #endif
this.$emit('agree') this.$emit('agree')
}, },
//打开弹窗 //打开弹窗

View File

@@ -2,92 +2,68 @@ export default {
data() { data() {
return { return {
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离 minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
wechatQrcode: '', // 公众号二维码 wechatQrcode: "", // 公众号二维码
diyRoute: '/pages/index/index', diyRoute: "/pages/index/index",
showPrivacyModal: false // 新增:控制隐私弹窗显示的变量
}; };
}, },
onLoad(option) { onLoad(option) {
// #ifdef H5 // #ifdef H5
// H5地图选择位置回调数据 // H5地图选择位置回调数据
if (option.module && option.module == 'locationPicker') { if (option.module && option.module == "locationPicker") {
option.name = ''; // 清空地址 option.name = ""; // 清空地址
} }
// #endif // #endif
this.name = option.name || 'DIY_VIEW_INDEX'; // 根据店铺运营模式,打开平台(shop)或者连锁门店(stroe)页面,接口会自行判断 this.name = option.name || "DIY_VIEW_INDEX"; // 根据店铺运营模式,打开平台(shop)或者连锁门店(stroe)页面,接口会自行判断
}, },
onShow() { onShow() {
// 获取关注公众号二维码 // 获取关注公众号二维码
this.getFollowQrcode(); this.getFollowQrcode();
// 检查隐私设置并显示弹窗
// 打开隐私弹窗 this.checkPrivacySetting();
this.openPrivacyModal();
}, },
mounted() { mounted() {
// 监听图片、文字、商品列表等组件的点击事件 // 监听图片、文字、商品列表等组件的点击事件
this.unsubscribe = this.$eventBus?.onMany([ this.unsubscribe = this.$eventBus?.onMany(
'rubik-cube-tap', [
'picture-tap', "rubik-cube-tap",
'text-tap', "picture-tap",
'goods-list-tap', "text-tap",
'presale-tap', "goods-list-tap",
'notes-tap', "presale-tap",
'merch-list-tap', "notes-tap",
'map-tap', "merch-list-tap",
'img-ads-tap', "map-tap",
'many-goods-list-tap', "img-ads-tap",
'search-tap', "many-goods-list-tap",
], this._handleDiyGroupInteractionEvent); "search-tap",
],
this._handleDiyGroupInteractionEvent,
);
}, },
beforeDestroy() { beforeDestroy() {
// 移除图片点击事件监听 // 移除图片点击事件监听
if (this.unsubscribe) this.unsubscribe(); if (this.unsubscribe) this.unsubscribe();
}, },
methods: { methods: {
// 检查隐私设置(保留原有逻辑,如果不需要可删除) // 检查隐私设置
checkPrivacySetting() { checkPrivacySetting() {
// 延迟执行,确保组件已经挂载
setTimeout(() => { setTimeout(() => {
if (this.$refs.privacyPopup) { if (this.$refs.privacyPopup) {
this.$refs.privacyPopup.proactive(); this.$refs.privacyPopup.proactive();
} }
}, 100); }, 100);
}, },
// 新增:打开隐私弹窗的方法
openPrivacyModal() {
// 延迟一点执行,防止页面加载卡顿
setTimeout(() => {
this.showPrivacyModal = true;
}, 500);
},
// 新增:处理用户点击“同意并继续”
handlePrivacyAgree() {
this.showPrivacyModal = false;
// 这里可以添加保存到本地存储的逻辑,表示用户已同意
uni.setStorageSync('hasAgreedPrivacy', true);
},
// 新增:处理用户点击“不同意”
handlePrivacyDisagree() {
this.showPrivacyModal = false;
// 如果不同意,通常退出小程序或关闭页面
uni.navigateBack({
delta: 1
});
},
// 关注公众号 // 关注公众号
getFollowQrcode() { getFollowQrcode() {
if (!this.$util.isWeiXin()) return; if (!this.$util.isWeiXin()) return;
this.$api.sendRequest({ this.$api.sendRequest({
url: '/wechat/api/wechat/followqrcode', url: "/wechat/api/wechat/followqrcode",
success: res => { success: (res) => {
if (res.code >= 0 && res.data) { if (res.code >= 0 && res.data) {
this.wechatQrcode = res.data.qrcode; this.wechatQrcode = res.data.qrcode;
} }
} },
}); });
}, },
officialAccountsOpen() { officialAccountsOpen() {
@@ -114,6 +90,6 @@ export default {
// 阻止事件继续传播 // 阻止事件继续传播
return false; return false;
} },
} },
}; };