6 changed files with 433 additions and 160 deletions
@ -0,0 +1,25 @@ |
|||||
|
<template> |
||||
|
<web-view :src="url"></web-view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
const DEFAULT_URL = 'https://hbkuaishi.com/yinsi.html' |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
url: DEFAULT_URL |
||||
|
} |
||||
|
}, |
||||
|
onLoad(options) { |
||||
|
if (options && options.url) { |
||||
|
this.url = decodeURIComponent(options.url) |
||||
|
} |
||||
|
if (options && options.title) { |
||||
|
uni.setNavigationBarTitle({ |
||||
|
title: decodeURIComponent(options.title) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,152 @@ |
|||||
|
<template> |
||||
|
<view class="privacy-page"> |
||||
|
<view class="privacy-card"> |
||||
|
<view class="privacy-title">隐私政策提示</view> |
||||
|
<scroll-view class="privacy-content" scroll-y> |
||||
|
<text> |
||||
|
欢迎使用半径里商家端!我们非常重视您的个人信息和隐私保护。在您使用本应用前,请认真阅读 |
||||
|
</text> |
||||
|
<text class="privacy-link" @click="openPrivacyPolicy">《隐私政策》</text> |
||||
|
<text> |
||||
|
,了解我们如何收集、使用、存储和保护您的个人信息,以及您享有的相关权利。点击“同意并进入”表示您已阅读并同意隐私政策内容。 |
||||
|
</text> |
||||
|
</scroll-view> |
||||
|
<view class="privacy-actions"> |
||||
|
<button class="privacy-button privacy-button-cancel" @click="reject">不同意</button> |
||||
|
<button class="privacy-button privacy-button-confirm" @click="agree">同意并进入</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
const PRIVACY_POLICY_URL = 'https://hbkuaishi.com/yinsi.html' |
||||
|
|
||||
|
export default { |
||||
|
onLoad() { |
||||
|
if (uni.getStorageSync('privacyPolicyAgreed')) { |
||||
|
this.goHome() |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
openPrivacyPolicy() { |
||||
|
uni.navigateTo({ |
||||
|
url: '/pages/common/webview?title=' + encodeURIComponent('隐私政策') + '&url=' + |
||||
|
encodeURIComponent(PRIVACY_POLICY_URL) |
||||
|
}) |
||||
|
}, |
||||
|
agree() { |
||||
|
uni.setStorageSync('privacyPolicyAgreed', true) |
||||
|
const app = getApp() |
||||
|
const appVm = app && (app.$vm || app) |
||||
|
if (appVm && appVm.initAfterPrivacyAgreement) { |
||||
|
appVm.initAfterPrivacyAgreement() |
||||
|
} else if (app && app.globalData && app.globalData.initAfterPrivacyAgreement) { |
||||
|
app.globalData.initAfterPrivacyAgreement() |
||||
|
} |
||||
|
this.goHome() |
||||
|
}, |
||||
|
reject() { |
||||
|
uni.showModal({ |
||||
|
title: '提示', |
||||
|
content: '需要同意《隐私政策》后才能继续使用本应用。', |
||||
|
confirmText: '查看政策', |
||||
|
cancelText: '退出应用', |
||||
|
success: (res) => { |
||||
|
if (res.confirm) { |
||||
|
this.openPrivacyPolicy() |
||||
|
} else { |
||||
|
this.quitApp() |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
quitApp() { |
||||
|
// #ifdef APP-PLUS |
||||
|
if (typeof plus !== 'undefined' && plus.runtime && plus.runtime.quit) { |
||||
|
plus.runtime.quit() |
||||
|
return |
||||
|
} |
||||
|
// #endif |
||||
|
uni.showToast({ |
||||
|
title: '请同意隐私政策后继续使用', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
}, |
||||
|
goHome() { |
||||
|
uni.reLaunch({ |
||||
|
url: '/pages/index/index' |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
page { |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.privacy-page { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
width: 100%; |
||||
|
height: 100%; |
||||
|
background: rgba(0, 0, 0, 0.45); |
||||
|
} |
||||
|
|
||||
|
.privacy-card { |
||||
|
width: 620rpx; |
||||
|
padding: 40rpx 32rpx 32rpx; |
||||
|
border-radius: 20rpx; |
||||
|
background: #fff; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.privacy-title { |
||||
|
color: #333; |
||||
|
font-size: 34rpx; |
||||
|
font-weight: 700; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.privacy-content { |
||||
|
max-height: 420rpx; |
||||
|
margin-top: 28rpx; |
||||
|
color: #555; |
||||
|
font-size: 28rpx; |
||||
|
line-height: 46rpx; |
||||
|
} |
||||
|
|
||||
|
.privacy-link { |
||||
|
color: #FF5725; |
||||
|
font-weight: 700; |
||||
|
} |
||||
|
|
||||
|
.privacy-actions { |
||||
|
display: flex; |
||||
|
flex-direction: row; |
||||
|
margin-top: 36rpx; |
||||
|
} |
||||
|
|
||||
|
.privacy-button { |
||||
|
flex: 1; |
||||
|
height: 78rpx; |
||||
|
border-radius: 39rpx; |
||||
|
font-size: 28rpx; |
||||
|
line-height: 78rpx; |
||||
|
} |
||||
|
|
||||
|
.privacy-button-cancel { |
||||
|
margin-right: 20rpx; |
||||
|
color: #666; |
||||
|
background: #f2f2f2; |
||||
|
} |
||||
|
|
||||
|
.privacy-button-confirm { |
||||
|
color: #fff; |
||||
|
background: #FF5725; |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue