完成40%
This commit is contained in:
+91
-11
@@ -62,7 +62,19 @@
|
||||
<image class="login-submit__skin" src="/static/assets/foundation/opaque/a01-primary-button.png" mode="scaleToFill" />
|
||||
<text class="login-submit__content">登录</text>
|
||||
</view>
|
||||
<text class="agreement-reminder">请先在登录引导页阅读并确认协议</text>
|
||||
<view class="agreement-row" @click="toggleAgreement">
|
||||
<image class="agreement-icon" :src="agreed ? '/static/assets/modules/auth/transparent/a02-agreement-checked.png' : '/static/assets/modules/auth/transparent/a02-agreement-unchecked.png'" mode="aspectFit" />
|
||||
<view class="agreement-copy">
|
||||
<text>我已阅读并同意</text>
|
||||
<text class="agreement-link" @click.stop="prepareAgreement">《用户协议》</text>
|
||||
<text>与</text>
|
||||
<text class="agreement-link" @click.stop="prepareAgreement">《隐私政策》</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="register-entry">
|
||||
<text>还没有账号?</text>
|
||||
<view class="register-link" hover-class="text-hover" @click="prepareRegister">注册账号</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -71,32 +83,61 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
|
||||
const activeTab = ref('password')
|
||||
const account = ref('')
|
||||
const password = ref('')
|
||||
const smsPhone = ref('')
|
||||
const verificationCode = ref('')
|
||||
const agreedFromEntry = ref(false)
|
||||
const agreed = ref(false)
|
||||
|
||||
onLoad((options) => {
|
||||
agreedFromEntry.value = options?.agreed === '1'
|
||||
const isAgreedRoute = () => {
|
||||
if (typeof location !== 'undefined') {
|
||||
const query = new URLSearchParams(location.hash.split('?')[1] || '')
|
||||
return query.get('agreed') === '1'
|
||||
}
|
||||
|
||||
const pages = getCurrentPages()
|
||||
const currentPage = pages[pages.length - 1]
|
||||
return currentPage?.options?.agreed === '1'
|
||||
}
|
||||
|
||||
const syncAgreementFromRoute = () => {
|
||||
agreed.value = isAgreedRoute()
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
syncAgreementFromRoute()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
syncAgreementFromRoute()
|
||||
})
|
||||
|
||||
const goBack = () => {
|
||||
uni.navigateBack()
|
||||
}
|
||||
|
||||
const prepareRegister = () => uni.navigateTo({ url: '/pages/auth/a04-register' })
|
||||
|
||||
const prepareForgotPassword = () => uni.navigateTo({ url: '/pages/auth/a05-reset-password' })
|
||||
|
||||
const prepareGetCode = () => {
|
||||
uni.showToast({ title: '获取验证码功能待接入', icon: 'none' })
|
||||
}
|
||||
|
||||
const toggleAgreement = () => {
|
||||
agreed.value = !agreed.value
|
||||
}
|
||||
|
||||
const prepareAgreement = () => {
|
||||
uni.showToast({ title: '协议页面准备中', icon: 'none' })
|
||||
}
|
||||
|
||||
const canSubmit = () => {
|
||||
if (agreedFromEntry.value) return true
|
||||
uni.showToast({ title: '请先返回登录引导确认协议', icon: 'none' })
|
||||
if (agreed.value) return true
|
||||
uni.showToast({ title: '请先阅读并同意相关协议', icon: 'none' })
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -356,11 +397,50 @@ const submitLogin = () => {
|
||||
|
||||
.button-hover { opacity: 0.84; }
|
||||
|
||||
.agreement-reminder {
|
||||
display: block;
|
||||
margin-top: 34rpx;
|
||||
color: #9a8773;
|
||||
.agreement-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 88rpx;
|
||||
margin-top: 22rpx;
|
||||
padding: 0 4rpx;
|
||||
color: #6b5a4a;
|
||||
font-size: 24rpx;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.agreement-icon {
|
||||
flex: 0 0 auto;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.agreement-copy {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.agreement-link {
|
||||
color: #a7160c;
|
||||
}
|
||||
|
||||
.register-entry {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 2rpx;
|
||||
color: #6b5a4a;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.register-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 88rpx;
|
||||
margin-left: 8rpx;
|
||||
color: #a7160c;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user