feat: mobile 添加用户协议和隐私政策

This commit is contained in:
zhuoqinglian
2026-03-12 17:34:59 +08:00
parent 48087582c2
commit 1e8960f37c
11 changed files with 1949 additions and 3 deletions
+50 -1
View File
@@ -14,7 +14,7 @@ import type { Language } from '@/store/lang'
import { computed, onMounted, ref } from 'vue'
import { login } from '@/api/auth'
// 导入国际化相关功能
import { changeLanguage, getSupportedLanguages, initI18n, t } from '@/i18n'
import { changeLanguage, getCurrentLanguage, getSupportedLanguages, initI18n, t } from '@/i18n'
import { useConfigStore } from '@/store'
// 导入SM2加密工具
import { getEnvBaseUrl, sm2Encrypt } from '@/utils'
@@ -117,6 +117,22 @@ function goToForgotPassword() {
})
}
// 跳转到用户协议
function goToUserAgreement() {
const lang = getCurrentLanguage() === 'zh_CN' ? 'zh' : 'en'
uni.navigateTo({
url: `/pages/login/user-agreement-${lang}`,
})
}
// 跳转到隐私政策
function goToPrivacyPolicy() {
const lang = getCurrentLanguage() === 'zh_CN' ? 'zh' : 'en'
uni.navigateTo({
url: `/pages/login/privacy-policy-${lang}`,
})
}
// 生成UUID
function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
@@ -387,6 +403,16 @@ onMounted(async () => {
</view>
</view>
<view class="policy-links">
<text class="policy-link" @click="goToUserAgreement">
{{ t('login.userAgreement') }}
</text>
<text class="policy-divider">|</text>
<text class="policy-link" @click="goToPrivacyPolicy">
{{ t('login.privacyPolicy') }}
</text>
</view>
<!-- 登录方式切换 -->
<view v-if="enableMobileLogin" class="login-type-switch">
<view class="switch-tabs">
@@ -681,6 +707,29 @@ onMounted(async () => {
margin-bottom: 30rpx;
}
.policy-links {
display: flex;
justify-content: center;
align-items: center;
gap: 20rpx;
margin-bottom: 30rpx;
.policy-link {
color: #667eea;
font-size: 26rpx;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.policy-divider {
color: #999999;
font-size: 26rpx;
}
}
.forgot-password {
.forgot-text {
color: #667eea;