新增微信小程序隐私弹窗说明
parent
86b6dcf84d
commit
e14b927369
66
App.vue
66
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: {}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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" : {
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,113 @@
|
|||
<template>
|
||||
<view class="agreement-page bs-bb">
|
||||
<view class="agreement-content border-radius-main bg-white" v-if="is_show_privacy">
|
||||
<view class="tc">
|
||||
<image class="logo circle auto dis-block margin-bottom-lg br" :src="logo" mode="widthFix"></image>
|
||||
<view class="cr-base fw-b text-size-lg">{{title}}温馨提示</view>
|
||||
</view>
|
||||
<view class="margin-top-lg text-size-sm cr-base content-desc">
|
||||
<block v-if="(content || null) == null">
|
||||
尊敬的用户、为了向您提供更优质的服务,在您使用{{title}}小程序前,您需要通过点击【同意】并阅读以下协议内容以表示您充分知悉、理解并同意本温馨提示的相关协议的各项规则,包括我们会在您开启的位置信息提供更契合您需求的页面展示、产品或服务,比如首页向您推荐商品或相关门店及排行榜信息。
|
||||
</block>
|
||||
<block v-else>{{content}}</block>
|
||||
</view>
|
||||
<view class="cr-blue margin-top-lg">
|
||||
<view>
|
||||
<text @tap="agreement_event" data-value="userregister">《{{title}}服务用户协议》</text>
|
||||
</view>
|
||||
<view class="margin-top-sm">
|
||||
<text @tap="agreement_event" data-value="userprivacy">《{{title}}隐私权政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="buttom tc margin-top-xxxl padding-top-lg">
|
||||
<button type="default" size="mini" class="br-base cr-base bg-white text-size-sm round margin-right-xxxl" @tap="exit_event">不同意</button>
|
||||
<button type="default" size="mini" class="br-main cr-white bg-main text-size-sm round margin-left-xxxl" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="agree_privacy_auth_event">同意</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
logo: app.globalData.get_application_logo_square(),
|
||||
title: app.globalData.get_application_title(),
|
||||
is_show_privacy: false,
|
||||
content: null
|
||||
}
|
||||
},
|
||||
|
||||
// 页面加载初始化
|
||||
onLoad() {
|
||||
uni.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
this.setData({
|
||||
is_show_privacy: true,
|
||||
content: app.globalData.get_config('config.common_app_mini_weixin_privacy_content', null),
|
||||
});
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 协议事件
|
||||
agreement_event(e) {
|
||||
var value = e.currentTarget.dataset.value || null;
|
||||
if (value == null) {
|
||||
app.globalData.showToast('协议类型有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 是否存在协议 url 地址
|
||||
var key = 'agreement_' + value + '_url';
|
||||
var url = app.globalData.get_config('config.' + key) || null;
|
||||
if (url == null) {
|
||||
app.globalData.showToast('协议url地址有误');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开 webview
|
||||
app.globalData.open_web_view(url);
|
||||
},
|
||||
|
||||
// 退出小程序
|
||||
exit_event(e) {
|
||||
uni.exitMiniProgram();
|
||||
},
|
||||
|
||||
// 授权回调
|
||||
agree_privacy_auth_event() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.agreement-page {
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
height: 100vh;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.agreement-content {
|
||||
margin-top: 30%;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.agreement-content .logo {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
.agreement-content .content-desc {
|
||||
line-height: 46rpx;
|
||||
}
|
||||
.agreement-content .buttom button {
|
||||
min-width: 200rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<button class="bg-main br-main cr-white round text-size margin-top-xxxl" form-type="submit" type="default" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">确认登录</button>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<button class="bg-main br-main cr-white round text-size margin-top-xxxl" form-type="submit" type="default" hover-class="none" :loading="form_submit_loading" :disabled="form_submit_loading">确认注册</button>
|
||||
|
|
@ -262,7 +262,7 @@
|
|||
</radio-group>
|
||||
</view>
|
||||
<view class="dis-inline-block va-m">
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私政策</text>》
|
||||
阅读并同意 《<text class="cr-main" @tap="agreement_event" data-value="userregister">服务协议</text>》 与 《<text class="cr-main" @tap="agreement_event" data-value="userprivacy">隐私权政策</text>》
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-xxl">
|
||||
|
|
|
|||
Loading…
Reference in New Issue