新增用户隐私协议

This commit is contained in:
zhouyanli
2026-04-28 08:50:00 +08:00
parent 5936da5547
commit d02af4a8b4
5 changed files with 199 additions and 117 deletions

View File

@@ -29,20 +29,25 @@
<!-- 协议勾选 + 忘记密码 -->
<view class="agreement-wrap">
<view class="agreement-item" @click="toggleAgreement">
<uni-icons
type="checkbox-filled"
size="24"
color="#007aff"
v-if="agreeAgreement"
></uni-icons>
<uni-icons
type="checkbox"
size="24"
color="#999"
v-else
></uni-icons>
<text class="agreement-text">我已阅读并同意用户隐私政策</text>
<view class="agreement-item">
<view @click="toggleAgreement">
<uni-icons
type="checkbox-filled"
size="24"
color="#007aff"
v-if="agreeAgreement"
></uni-icons>
<uni-icons
type="checkbox"
size="24"
color="#999"
v-else
></uni-icons>
</view>
<text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意
<text class="agreePrivacy" :class="{ active:isClicked }">用户隐私政策</text>
</text>
</view>
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码</navigator>
</view>
@@ -74,6 +79,8 @@ const phoneNumber = ref('');
const password = ref('');
const agreeAgreement = ref(false); // 默认勾选
const placeholderStyle = ref('font-size:24rpx')
// 控制点击变色
const isClicked = ref(false)
// 计算属性:是否可登录(帐号+密码+协议都满足)
const canLogin = computed(() => {
@@ -87,6 +94,15 @@ const toggleAgreement = () => {
agreeAgreement.value = !agreeAgreement.value;
};
// 跳转隐私协议
const goToPrivacy = () => {
// 点击变色
isClicked.value = true
uni.navigateTo({
url:'/pageSubPack/loginSub/privacy',
})
}
// 检查表单
const checkForm = () => {};
@@ -113,7 +129,7 @@ const handleLogin = () => {
uni.showToast({ title: '请勾选协议', icon: 'none' });
return;
}
uni.showLoading({ title: '登录中...', mask: true });
// uni.showLoading({ title: '登录中...', mask: true });
let params = {
username:phoneNumber.value,
password:password.value
@@ -220,6 +236,12 @@ const handleLogin = () => {
color: #666;
margin-left: 10rpx;
}
.agreePrivacy{
color: #666;
}
.agreePrivacy.active{
color: #2F77FD;
}
.forget-pwd {
font-size: 28rpx;