This commit is contained in:
xingyy 2025-02-24 14:54:10 +08:00
parent cd14a92b0b
commit 5ca8394297

View File

@ -7,6 +7,7 @@ import { message } from '@/components/x-message/useMessage.js'
// ... ...
import FingerprintJS from '@fingerprintjs/fingerprintjs'
import {checkPhone, mobileLogin, userSend} from "@/api-collect-code/auth/index.js";
const {userInfo, token, fingerprint} = codeAuthStore()
const router = useRouter();
const route = useRoute();
@ -105,7 +106,11 @@ const goLogin = async () => {
}
loadingRef.value.loading2 = false
}
const showPassword = ref(false)
const togglePasswordVisibility = () => {
showPassword.value = !showPassword.value
}
</script>
<template>
@ -129,12 +134,26 @@ const goLogin = async () => {
</div>
<div class="border-b-[1.7px] mt-[8px]" v-show="loginType === 1">
<van-field v-model="password" clearable placeholder="请输入密码">
<van-field
v-model="password"
:type="showPassword ? 'text' : 'password'"
clearable
placeholder="请输入密码"
>
<template #label>
<div class="text-[16px] text-[#1A1A1A] flex align-center justify-start">
密码
</div>
</template>
<template #button>
<div class="flex justify-center items-center">
<van-icon
size="20"
:name="showPassword ? 'eye-o' : 'closed-eye'"
@click="togglePasswordVisibility"
/>
</div>
</template>
</van-field>
</div>
@ -148,12 +167,14 @@ const goLogin = async () => {
<div class="mt-[55px]">
<div v-if="loginType === 0">
<van-button :loading="loadingRef.loading1" v-if="phoneNum" loading-text="获取验证码"
type="primary" block style="height: 48px" @click="getCode">获取验证码</van-button>
type="primary" block style="height: 48px" @click="getCode">获取验证码
</van-button>
<van-button v-else type="primary" color="#D3D3D3" block style="height: 48px">获取验证码</van-button>
</div>
<div v-else>
<van-button type="primary" v-if="password" block :loading="loadingRef.loading2" loading-text="登录"
style="height: 48px;margin-top:10px" @click="goLogin">登录</van-button>
style="height: 48px;margin-top:10px" @click="goLogin">登录
</van-button>
<van-button v-else type="primary" color="#D3D3D3" block style="height: 48px">登录</van-button>
</div>
</div>
@ -178,10 +199,12 @@ const goLogin = async () => {
<van-button v-if="code.length === 6" type="primary" block :loading="loadingRef.loading2"
:loading-text="$t('login.login')" style="height: 48px" @click="goLogin">{{
$t('login.login')
}}</van-button>
}}
</van-button>
<van-button v-else type="primary" color="#D3D3D3" block style="height: 48px">{{
$t('login.login')
}}</van-button>
}}
</van-button>
</div>
</div>
</van-swipe-item>