登录添加隐私协议弹窗
This commit is contained in:
157
wuye-manager-uniapp/components/privacy-popup/privacy-popup.vue
Normal file
157
wuye-manager-uniapp/components/privacy-popup/privacy-popup.vue
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<template>
|
||||||
|
<view class="privacy-mask" v-if="show" @click="handleMaskClick">
|
||||||
|
<view class="privacy-popup" @click.stop>
|
||||||
|
<view class="popup-header">
|
||||||
|
<text class="popup-title">请先阅读并同意协议</text>
|
||||||
|
<view class="popup-close" @click="handleClose">✕</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view class="popup-body" scroll-y>
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="section-text">
|
||||||
|
我已仔细阅读并同意
|
||||||
|
<text class="privacy-link" @click="goToPrivacy">《用户协议》和《隐私政策》</text>
|
||||||
|
全部内容。
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="popup-footer">
|
||||||
|
<button class="popup-btn disagree-btn" @click="handleDisagree">不同意</button>
|
||||||
|
<button class="popup-btn agree-btn" @click="handleAgree">同意</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['agree', 'disagree', 'close', 'update:show'])
|
||||||
|
|
||||||
|
const handleAgree = () => {
|
||||||
|
emit('agree')
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDisagree = () => {
|
||||||
|
emit('disagree')
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
emit('update:show', false)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleMaskClick = () => {
|
||||||
|
emit('close')
|
||||||
|
emit('update:show', false)
|
||||||
|
}
|
||||||
|
|
||||||
|
const goToPrivacy = () => {
|
||||||
|
uni.navigateTo({ url: '/pageSubPack/loginSub/privacy' })
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.privacy-mask {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
z-index: 9999;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.privacy-popup {
|
||||||
|
width: 640rpx;
|
||||||
|
max-height: 80vh;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 28rpx 30rpx 16rpx;
|
||||||
|
border-bottom: 1rpx solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-close {
|
||||||
|
width: 48rpx;
|
||||||
|
height: 48rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #999;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-body {
|
||||||
|
flex: 1;
|
||||||
|
padding: 24rpx 30rpx;
|
||||||
|
max-height: 50vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-content .section-text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 1.8;
|
||||||
|
color: #666;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.privacy-link {
|
||||||
|
color: #007aff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-footer {
|
||||||
|
display: flex;
|
||||||
|
padding: 20rpx 30rpx 30rpx;
|
||||||
|
gap: 20rpx;
|
||||||
|
border-top: 1rpx solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-btn::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disagree-btn {
|
||||||
|
background: #f5f5f5;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agree-btn {
|
||||||
|
background: #007aff;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "花开管家",
|
"name" : "花开管家",
|
||||||
"appid" : "__UNI__29C3D60",
|
"appid" : "__UNI__5F224F3",
|
||||||
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
@@ -60,8 +60,7 @@
|
|||||||
"push" : {
|
"push" : {
|
||||||
"unipush" : {
|
"unipush" : {
|
||||||
"version" : "2",
|
"version" : "2",
|
||||||
"offline" : true,
|
"offline" : false,
|
||||||
"hms" : {},
|
|
||||||
"oppo" : {},
|
"oppo" : {},
|
||||||
"vivo" : {},
|
"vivo" : {},
|
||||||
"mi" : {},
|
"mi" : {},
|
||||||
|
|||||||
@@ -67,10 +67,14 @@
|
|||||||
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<text class="agreement-text" @click.stop="goToPrivacy"
|
<!-- <text class="agreement-text" @click.stop="goToPrivacy"
|
||||||
>我已阅读并同意
|
>我已阅读并同意
|
||||||
<text class="agreePrivacy">《用户隐私政策》</text>
|
<text class="agreePrivacy">《用户隐私政策》</text>
|
||||||
</text>
|
</text> -->
|
||||||
|
<text class="agreement-text" >我已阅读并同意
|
||||||
|
<text class="agreePrivacy" @click.stop="">《用户协议》</text>和
|
||||||
|
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
@@ -81,12 +85,16 @@
|
|||||||
<navigator class="link-item" url="/pageSubPack/loginSub/pwd-login">账号密码登录</navigator>
|
<navigator class="link-item" url="/pageSubPack/loginSub/pwd-login">账号密码登录</navigator>
|
||||||
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 隐私协议弹窗 -->
|
||||||
|
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onUnmounted } from 'vue'
|
import { ref, computed, onUnmounted } from 'vue'
|
||||||
import { getLoginBySms, getSendCode } from '../../api/api.js'
|
import { getLoginBySms, getSendCode } from '../../api/api.js'
|
||||||
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||||
|
|
||||||
// ========== 响应式数据 ==========
|
// ========== 响应式数据 ==========
|
||||||
// 手机号
|
// 手机号
|
||||||
@@ -96,6 +104,7 @@ const verifyCode = ref('')
|
|||||||
const placeholderStyle = ref('font-size:24rpx')
|
const placeholderStyle = ref('font-size:24rpx')
|
||||||
// 是否同意协议
|
// 是否同意协议
|
||||||
const agreeAgreement = ref(false) // 默认勾选
|
const agreeAgreement = ref(false) // 默认勾选
|
||||||
|
const showPrivacyPopup = ref(false)
|
||||||
// 倒计时(秒)
|
// 倒计时(秒)
|
||||||
const countDown = ref(0)
|
const countDown = ref(0)
|
||||||
// 定时器
|
// 定时器
|
||||||
@@ -130,13 +139,16 @@ const checkForm = () => {
|
|||||||
const toggleAgreement = () => {
|
const toggleAgreement = () => {
|
||||||
agreeAgreement.value = !agreeAgreement.value
|
agreeAgreement.value = !agreeAgreement.value
|
||||||
}
|
}
|
||||||
// 跳转隐私协议
|
// 打开隐私协议弹窗
|
||||||
const goToPrivacy = () => {
|
const goToPrivacy = () => {
|
||||||
// 点击变色
|
showPrivacyPopup.value = true
|
||||||
// isClicked.value = true
|
}
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageSubPack/loginSub/privacy'
|
|
||||||
})
|
// 不同意隐私协议
|
||||||
|
const disagreePrivacy = () => {
|
||||||
|
agreeAgreement.value = false
|
||||||
|
showPrivacyPopup.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
@@ -201,7 +213,7 @@ const handleLogin = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!agreeAgreement.value) {
|
if (!agreeAgreement.value) {
|
||||||
uni.showToast({ title: '请勾选协议', icon: 'none' })
|
showPrivacyPopup.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -260,6 +272,13 @@ const handleLogin = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 同意隐私协议(弹窗中点击同意 → 直接登录)
|
||||||
|
const agreePrivacy = () => {
|
||||||
|
agreeAgreement.value = true
|
||||||
|
showPrivacyPopup.value = false
|
||||||
|
handleLogin()
|
||||||
|
}
|
||||||
|
|
||||||
// ========== 生命周期 ==========
|
// ========== 生命周期 ==========
|
||||||
// 页面卸载时清除定时器
|
// 页面卸载时清除定时器
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -45,9 +45,10 @@
|
|||||||
<uni-icons type="checkbox-filled" size="24" color="#4D5DFA" v-if="agreeAgreement"></uni-icons>
|
<uni-icons type="checkbox-filled" size="24" color="#4D5DFA" v-if="agreeAgreement"></uni-icons>
|
||||||
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
<uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意
|
<text class="agreement-text" >我已阅读并同意
|
||||||
<text class="agreePrivacy">《用户隐私政策》</text>
|
<text class="agreePrivacy" @click.stop="">《用户协议》</text>和
|
||||||
</text>
|
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
||||||
</view>
|
</view>
|
||||||
@@ -63,6 +64,8 @@
|
|||||||
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
<!-- <navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 隐私协议弹窗 -->
|
||||||
|
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" @close="showPrivacyPopup = false" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -76,6 +79,7 @@
|
|||||||
import {
|
import {
|
||||||
getLoginPassword
|
getLoginPassword
|
||||||
} from '../../api/api.js'
|
} from '../../api/api.js'
|
||||||
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const phoneNumber = ref('');
|
const phoneNumber = ref('');
|
||||||
@@ -83,6 +87,7 @@
|
|||||||
const agreeAgreement = ref(false); // 默认勾选
|
const agreeAgreement = ref(false); // 默认勾选
|
||||||
const rememberPwd = ref(false);
|
const rememberPwd = ref(false);
|
||||||
const placeholderStyle = ref('font-size:24rpx')
|
const placeholderStyle = ref('font-size:24rpx')
|
||||||
|
const showPrivacyPopup = ref(false)
|
||||||
// 控制点击变色
|
// 控制点击变色
|
||||||
// const isClicked = ref(false)
|
// const isClicked = ref(false)
|
||||||
|
|
||||||
@@ -101,13 +106,16 @@
|
|||||||
const toggleRemember = () => {
|
const toggleRemember = () => {
|
||||||
rememberPwd.value = !rememberPwd.value;
|
rememberPwd.value = !rememberPwd.value;
|
||||||
};
|
};
|
||||||
// 跳转隐私协议
|
// 打开隐私协议弹窗
|
||||||
const goToPrivacy = () => {
|
const goToPrivacy = () => {
|
||||||
|
showPrivacyPopup.value = true
|
||||||
|
}
|
||||||
|
|
||||||
// isClicked.value = true
|
|
||||||
uni.navigateTo({
|
// 不同意隐私协议
|
||||||
url:'/pageSubPack/loginSub/privacy',
|
const disagreePrivacy = () => {
|
||||||
})
|
agreeAgreement.value = false
|
||||||
|
showPrivacyPopup.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查表单
|
// 检查表单
|
||||||
@@ -146,7 +154,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!agreeAgreement.value){
|
if(!agreeAgreement.value){
|
||||||
uni.showToast({ title: '请勾选协议', icon: 'none' });
|
showPrivacyPopup.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uni.showLoading({ title: '登录中...', mask: true });
|
uni.showLoading({ title: '登录中...', mask: true });
|
||||||
@@ -198,6 +206,13 @@
|
|||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 同意隐私协议(弹窗中点击同意 → 直接登录)
|
||||||
|
const agreePrivacy = () => {
|
||||||
|
agreeAgreement.value = true
|
||||||
|
showPrivacyPopup.value = false
|
||||||
|
handleLogin()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -292,12 +307,15 @@
|
|||||||
.agreement-item {
|
.agreement-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-text {
|
.agreement-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.agreePrivacy{
|
.agreePrivacy{
|
||||||
color: #4D5DFA;
|
color: #4D5DFA;
|
||||||
@@ -310,6 +328,9 @@
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn {
|
.login-btn {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false" />
|
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false" />
|
||||||
<scroll-view class="page" scroll-y>
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="user-card">
|
<view class="user-card">
|
||||||
<image :src="avatar || defaultAvatar" class="avatar" />
|
<image src="https://wuyeadmin.bugtc.com/images/logo-app.png" class="avatar" />
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<text class="user-name">{{ loginName }}</text>
|
<text class="user-name">{{ loginName }}</text>
|
||||||
<text class="user-phone">{{ phoneNum }}</text>
|
<text class="user-phone">{{ phoneNum }}</text>
|
||||||
@@ -31,7 +31,7 @@ import { ref } from 'vue'
|
|||||||
import { onShow } from '@dcloudio/uni-app'
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
import { getSettingInfo } from '../../api/api.js'
|
import { getSettingInfo } from '../../api/api.js'
|
||||||
|
|
||||||
const defaultAvatar = 'https://wuyeadmin.bugtc.com/images/imgs/default-avatar.png'
|
// const defaultAvatar = 'https://wuyeadmin.bugtc.com/images/imgs/default-avatar.png'
|
||||||
|
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{ icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png', title: '上报记录' },
|
{ icon: 'https://wuyeadmin.bugtc.com/images/imgs/shangbao.png', title: '上报记录' },
|
||||||
|
|||||||
Reference in New Issue
Block a user