登录界面的修正

This commit is contained in:
minimaxagent1 2025-08-04 15:16:25 +08:00
parent cc9768acc4
commit 9c189af1bd

View File

@ -6,7 +6,7 @@
<view class="imgbox"> <view class="imgbox">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGPwljIaEppyKAT1iQaW" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uGPwljIaEppyKAT1iQaW" mode=""></image>
</view> </view>
<button class="button" :disabled="!hasAgreed" :class="{ 'button-disabled': !hasAgreed }" @click="getPhoneNumber" > <button class="button" @click="getPhoneNumber">
授权登录 授权登录
</button> </button>
<view class="tip"> <view class="tip">
@ -31,6 +31,7 @@
<rich-text :nodes="serviceTermsContent"></rich-text> <rich-text :nodes="serviceTermsContent"></rich-text>
</scroll-view> </scroll-view>
<view class="popup-footer"> <view class="popup-footer">
<text class="popup-tip">请仔细阅读服务条款阅读完毕后点击同意</text>
<button class="popup-btn" @click="agreeServiceTerms">同意</button> <button class="popup-btn" @click="agreeServiceTerms">同意</button>
</view> </view>
</view> </view>
@ -47,6 +48,7 @@
<rich-text :nodes="privacyPolicyContent"></rich-text> <rich-text :nodes="privacyPolicyContent"></rich-text>
</scroll-view> </scroll-view>
<view class="popup-footer"> <view class="popup-footer">
<text class="popup-tip">请仔细阅读隐私政策阅读完毕后点击同意</text>
<button class="popup-btn" @click="agreePrivacyPolicy">同意</button> <button class="popup-btn" @click="agreePrivacyPolicy">同意</button>
</view> </view>
</view> </view>
@ -162,16 +164,30 @@ import { getServiceTerms, getPrivacyPolicy } from "@/api/article/article.js";
this.showPrivacyPolicyPopup = false; this.showPrivacyPolicyPopup = false;
}, },
// //
agreeServiceTerms() { async agreeServiceTerms() {
this.hasReadServiceTerms = true; this.hasReadServiceTerms = true;
this.closeServiceTermsPopup(); this.closeServiceTermsPopup();
this.checkAgreementStatus(); this.checkAgreementStatus();
//
if (!this.hasReadPrivacyPolicy) {
setTimeout(() => {
this.showPrivacyPolicy();
}, 500); // 500ms
}
}, },
// //
agreePrivacyPolicy() { async agreePrivacyPolicy() {
this.hasReadPrivacyPolicy = true; this.hasReadPrivacyPolicy = true;
this.closePrivacyPolicyPopup(); this.closePrivacyPolicyPopup();
this.checkAgreementStatus(); this.checkAgreementStatus();
//
if (!this.hasReadServiceTerms) {
setTimeout(() => {
this.showServiceTerms();
}, 500); // 500ms
}
}, },
// //
checkAgreementStatus() { checkAgreementStatus() {
@ -180,13 +196,32 @@ import { getServiceTerms, getPrivacyPolicy } from "@/api/article/article.js";
this.hasAgreed = true; this.hasAgreed = true;
} }
}, },
//
async showUnreadTerms() {
//
if (!this.hasReadServiceTerms) {
await this.showServiceTerms();
return;
}
//
if (!this.hasReadPrivacyPolicy) {
await this.showPrivacyPolicy();
return;
}
},
getPhoneNumber() { getPhoneNumber() {
// //
if (!this.hasAgreed) { if (!this.hasReadServiceTerms || !this.hasReadPrivacyPolicy) {
uni.showToast({ uni.showToast({
title: '请先同意服务条款和隐私政策', title: '请先阅读服务条款和隐私政策',
icon: 'none' icon: 'none',
duration: 2000
}); });
//
this.showUnreadTerms();
return; return;
} }
@ -299,10 +334,7 @@ import { getServiceTerms, getPrivacyPolicy } from "@/api/article/article.js";
font-size: 40rpx; font-size: 40rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.button-disabled {
background: #CCCCCC !important;
color: #999999 !important;
}
.tip{ .tip{
margin-top:128rpx ; margin-top:128rpx ;
display: flex; display: flex;
@ -396,6 +428,15 @@ import { getServiceTerms, getPrivacyPolicy } from "@/api/article/article.js";
background: #f8f8f8; background: #f8f8f8;
} }
.popup-tip {
display: block;
font-size: 24rpx;
color: #666;
text-align: center;
margin-bottom: 20rpx;
line-height: 1.4;
}
.popup-btn { .popup-btn {
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;