修改我的车辆审核状态、问卷调查、登录添加用户隐私协议弹窗

This commit is contained in:
zhouyanli
2026-06-18 16:38:56 +08:00
parent 1efa212d26
commit 36ee7c3562
7 changed files with 734 additions and 453 deletions

View File

@@ -56,7 +56,11 @@
v-else
></uni-icons>
</view>
<text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意<text class="agreePrivacy">用户隐私政策</text></text>
<text class="agreement-text" >
我已阅读并同意
<text class="agreePrivacy">用户协议</text>
<text @click.stop="goToPrivacy" class="agreePrivacy">隐私政策</text>
</text>
</view>
<!-- 登录按钮 -->
@@ -72,12 +76,16 @@
<navigator class="link-item" url="/pageSubPack/loginSub/pwd-login">账号密码登录</navigator>
<navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator>
</view>
<!-- 隐私协议弹窗 -->
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" @close="showPrivacyPopup = false" />
</view>
</template>
<script setup>
import { ref, computed, onUnmounted } from 'vue';
import {getLoginBySms,getSendCode} from '../api/api.js'
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
// ========== 响应式数据 ==========
// 手机号
@@ -91,6 +99,9 @@ const agreeAgreement = ref(false); // 默认不勾选
const countDown = ref(0);
// 定时器
let timer = null;
// 隐私弹窗
const showPrivacyPopup = ref(false)
const pendingAction = ref('')
// ========== 计算属性 ==========
// 是否可以获取验证码(手机号格式正确)
@@ -124,6 +135,28 @@ const goToPrivacy = () => {
})
}
// 打开隐私弹窗
const openPrivacyPopup = (action) => {
pendingAction.value = action || ''
showPrivacyPopup.value = true
}
// 同意隐私协议
const agreePrivacy = () => {
showPrivacyPopup.value = false
agreeAgreement.value = true
if (pendingAction.value === 'login') {
doLogin()
}
pendingAction.value = ''
}
// 不同意隐私协议
const disagreePrivacy = () => {
showPrivacyPopup.value = false
pendingAction.value = ''
}
// 获取验证码
const getVerifyCode = () => {
if (!canGetVerify.value) return;
@@ -183,9 +216,13 @@ const handleLogin = () => {
return;
}
if (!agreeAgreement.value) {
uni.showToast({ title: '请勾选协议', icon: 'none' });
openPrivacyPopup('login')
return;
}
doLogin()
};
const doLogin = () => {
uni.showLoading({ title: '登录中...', mask: true });
const push_cid = uni.getStorageSync('push_cid')
let params = {
@@ -246,7 +283,7 @@ const handleLogin = () => {
// #endif
// setTimeout(() =>{
// uni.switchTab({ url: '/pages/index/index' });
// uni.switchTab({ url: '/pages/index/index' });
// },1500)
uni.hideLoading()
};