diff --git a/common/js/util.js b/common/js/util.js index 9829e01..9977c54 100644 --- a/common/js/util.js +++ b/common/js/util.js @@ -1162,5 +1162,47 @@ export default { verifyMobile(mobile) { var parse = /^\d{11}$/.test(mobile); return parse; + }, + /** + * 判断是否为快应用环境 + * @returns {boolean} 是否为快应用 + */ + isQuickApp() { + // #ifndef QUICKAPP-WEBVIEW + let _isQuickApp = false; + try { + const ua = navigator?.userAgent?.toLowerCase(); + console.log('ua = ', ua); + _isQuickApp = ua.indexOf('quickapp') !== -1; + + if (!_isQuickApp) { + // 特殊说明由于网站是嵌入到快应用的Webview组件中,UA中不会包含quickapp字符串, + // 但是会包含uniacid参数,所以这里通过uniacid参数来判断是否为快应用环境 + _isQuickApp = ua.indexOf('uniacid=') !== -1; + } + } catch (e) {} + + if (!_isQuickApp) { + const systemInfo = this.getDeviceInfo(); + _isQuickApp = systemInfo?.platform === 'quickapp' || process?.env?.UNI_PLATFORM === 'quickapp'; + } + return _isQuickApp; + // #endif + + return true; + }, + /** + * 判断是否为华为快应用环境 + * @returns {boolean} 是否为华为快应用 + */ + isHuaweiQuickApp() { + if (!this.isQuickApp()) return false; + + // #ifndef QUICKAPP-WEBVIEW-HUAWEI + const systemInfo = this.getDeviceInfo(); + return systemInfo.brand === 'HUAWEI' || systemInfo.manufacturer === 'HUAWEI' || + (typeof qh !== 'undefined' && qh.platform === 'huawei'); + // #endif + return true; } } \ No newline at end of file diff --git a/components/privacy-popup/privacy-popup.vue b/components/privacy-popup/privacy-popup.vue index 6ed70c8..0a53959 100644 --- a/components/privacy-popup/privacy-popup.vue +++ b/components/privacy-popup/privacy-popup.vue @@ -1,237 +1,385 @@ \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 0a5cad0..cdab934 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -137,10 +137,8 @@ - - + - diff --git a/pages_tool/member/index.vue b/pages_tool/member/index.vue index 5024a06..d45527a 100644 --- a/pages_tool/member/index.vue +++ b/pages_tool/member/index.vue @@ -96,6 +96,7 @@ export default { this.$store.commit('setMemberInfo', ''); this.$store.dispatch('emptyCart'); uni.removeStorageSync('authInfo'); + uni.removeStorageSync('privacyAgreed'); this.$util.redirectTo(this.$util.MEMBER_PAGE_URL); } } @@ -118,7 +119,9 @@ export default { this.$store.commit('setMemberInfo', ''); this.$store.dispatch('emptyCart'); uni.removeStorageSync('authInfo'); + uni.removeStorageSync('privacyAgreed'); this.$util.redirectTo(this.$util.MEMBER_PAGE_URL); + } else { this.$util.showToast({ title: rres.message