diff --git a/App.vue b/App.vue index adea5520..f687d36f 100644 --- a/App.vue +++ b/App.vue @@ -60,7 +60,10 @@ // 商品分类页面搜索进入独立搜索页面(0否, 1是) is_goods_category_search_alone: 0, // 分销页面地图分布是否强制获取当前位置(0否, 1是) - is_distribution_map_force_location: 0, + is_distribution_map_force_location: 0, + // 是否开启微信隐私弹窗授权提示、仅首页展示(0否, 1是) + is_weixin_privacy_setting: 1, + weixin_privacy_setting_timer: null, // tabbar页面 tabbar_pages: [ "/pages/index/index", @@ -1505,6 +1508,11 @@ logo = this.get_config('config.home_site_logo_wap'); } return logo + }, + + // 正方形logo + get_application_logo_square() { + return this.get_config('config.home_site_logo_square'); }, // 分享内容处理 @@ -1588,7 +1596,10 @@ }, // 页面地址处理 - page_url_handle(page) { + page_url_handle(page) { + if((page || null) == null) { + return ''; + } var route = page.route; var options = page.options || {}; var query = ''; @@ -1791,17 +1802,37 @@ object[method]({status: 1, lng: res.longitude, lat: res.latitude, data: res}); } }); + }, + + // 微信隐私弹窗提示 + weixin_privacy_setting() { + if(this.data.is_weixin_privacy_setting == 1) { + var self = this; + self.weixin_privacy_setting_timer = setInterval(function() { + var page = self.get_page_url(false); + if('/'+page == self.data.tabbar_pages[0]) { + uni.getPrivacySetting({ + success: res => { + if (res.needAuthorization) { + // 需要弹出隐私协议 + uni.navigateTo({ + url: '/pages/common/agreement/agreement' + }); + } + } + }); + // 已执行隐私方法清除定时任务 + clearInterval(self.weixin_privacy_setting_timer); + } + }, 100); + } } }, - /** - * 小程序初始化 - */ + // 初始化完成时触发(全局只触发一次) onLaunch(params) {}, - /** - * 小程序页面显示 - */ + // 启动,或从后台进入前台显示 onShow(params) { // 初始化配置 this.globalData.init_config(); @@ -1813,7 +1844,24 @@ this.globalData.set_launch_cache_info(params); // 场景值 - this.globalData.set_scene_data(params); + this.globalData.set_scene_data(params); + + // #ifdef MP-WEIXIN + // 协议验证处理 + this.globalData.weixin_privacy_setting(); + // #endif + }, + + // 从前台进入后台 + onHide() { + // 清除微信隐私方法定时任务 + clearInterval(this.weixin_privacy_setting_timer); + }, + + // 监听应用退出 + onExit() { + // 清除微信隐私方法定时任务 + clearInterval(this.weixin_privacy_setting_timer); }, methods: {} diff --git a/components/user-base/user-base.vue b/components/user-base/user-base.vue index 7c59443b..c11177be 100644 --- a/components/user-base/user-base.vue +++ b/components/user-base/user-base.vue @@ -116,10 +116,15 @@ .interval_time)) { status = false; } - this.setData({ - popup_status: status, - user: user - }); + + // 1秒后再提示用户填写信息 + var self = this; + setTimeout(function() { + self.setData({ + popup_status: status, + user: user + }); + }, 1000); } }, diff --git a/manifest.json b/manifest.json index 0371c3da..26960209 100644 --- a/manifest.json +++ b/manifest.json @@ -62,6 +62,7 @@ "desc" : "你的位置将用于小程序中相应业务位置服务使用" } }, + "__usePrivacyCheck__": true, "plugins" : { // 直播(需要开通权限 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/liveplayer/live-player-plugin.html) // "live-player-plugin" : { diff --git a/pages.json b/pages.json index 074dd5c1..e3d9b7b4 100644 --- a/pages.json +++ b/pages.json @@ -233,6 +233,15 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/common/agreement/agreement", + "style": { + // #ifndef MP-TOUTIAO + "navigationStyle": "custom", + // #endif + "enablePullDownRefresh": false + } + }, { "path": "pages/design/design", "style": { diff --git a/pages/common/agreement/agreement.vue b/pages/common/agreement/agreement.vue new file mode 100644 index 00000000..5b87d9e1 --- /dev/null +++ b/pages/common/agreement/agreement.vue @@ -0,0 +1,113 @@ + + + \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 4bd521d8..30e2f522 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -113,7 +113,7 @@ - 阅读并同意 《服务协议》 与 《隐私政策》 + 阅读并同意 《服务协议》 与 《隐私权政策 @@ -192,7 +192,7 @@ - 阅读并同意 《服务协议》 与 《隐私政策》 + 阅读并同意 《服务协议》 与 《隐私权政策 @@ -262,7 +262,7 @@ - 阅读并同意 《服务协议》 与 《隐私政策》 + 阅读并同意 《服务协议》 与 《隐私权政策