|
|
@@ -21,6 +21,24 @@
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
|
|
|
+ <!-- 密码 -->
|
|
|
+ <van-cell-group inset class="grop">
|
|
|
+ <van-field
|
|
|
+ class="input"
|
|
|
+ v-model="formData.password"
|
|
|
+ placeholder="请输入密码"
|
|
|
+ clearable
|
|
|
+ :type="passwordType"
|
|
|
+ maxlength="30"
|
|
|
+ >
|
|
|
+ <template #right-icon>
|
|
|
+ <span @click="switchPasswordType">
|
|
|
+ <van-icon :name="passwordType === 'password' ? 'eye' : 'closed-eye'" />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
<!-- 验证码输入 + 按钮 -->
|
|
|
<van-cell-group inset class="grop">
|
|
|
<van-field
|
|
|
@@ -36,6 +54,7 @@
|
|
|
{{ isCounting ? countDown + 's后重发' : '获取验证码' }}
|
|
|
</button>
|
|
|
</van-cell-group>
|
|
|
+ <div class="tips">如忘记密码,请下载电子税务局APP进行密码找回</div>
|
|
|
|
|
|
<!-- 同意协议 -->
|
|
|
<div class="agree">
|
|
|
@@ -113,16 +132,23 @@ const userStore = useUserStore()
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
|
|
|
|
+const passwordType = ref<'text' | 'password'>('password')
|
|
|
+const switchPasswordType = () => {
|
|
|
+ passwordType.value = passwordType.value === 'password' ? 'text' : 'password'
|
|
|
+}
|
|
|
+
|
|
|
/* 表单数据 */
|
|
|
const formData = reactive<LoginEtssmsRequest>({
|
|
|
mobile: '',
|
|
|
code: '',
|
|
|
pushRecordId: '',
|
|
|
+ password: '',
|
|
|
})
|
|
|
|
|
|
const sendEtsSms = reactive<SendTtsSmsRequest>({
|
|
|
mobile: '',
|
|
|
pushRecordId: '',
|
|
|
+ password: '',
|
|
|
})
|
|
|
|
|
|
/* 限制手机号只能输入数字,最多 30 位 */
|
|
|
@@ -162,9 +188,14 @@ const sendCode = async () => {
|
|
|
showToast('请输入正确的手机号')
|
|
|
return
|
|
|
}
|
|
|
+ if (!formData.password) {
|
|
|
+ showToast('密码不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
sending.value = true
|
|
|
const toast = showLoadingToast({ message: '发送中…', forbidClick: true, duration: 3000 })
|
|
|
sendEtsSms.mobile = formData.mobile
|
|
|
+ sendEtsSms.password = formData.password
|
|
|
try {
|
|
|
const res = await sendEtsSmsApi(sendEtsSms)
|
|
|
if (res.code === 0 && res.data) {
|
|
|
@@ -219,6 +250,10 @@ const loginBtn = useDebounceFn(async () => {
|
|
|
showFailToast('请输入手机号')
|
|
|
return
|
|
|
}
|
|
|
+ if (!formData.password) {
|
|
|
+ showFailToast('密码不能为空')
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!formData.code) {
|
|
|
showFailToast('验证码不能为空')
|
|
|
return
|
|
|
@@ -330,11 +365,9 @@ const resetLoginState = () => {
|
|
|
formData.mobile = ''
|
|
|
formData.code = ''
|
|
|
agree.value = false
|
|
|
-
|
|
|
isCounting.value = false
|
|
|
countDown.value = 60
|
|
|
sending.value = false
|
|
|
-
|
|
|
showDialog.value = false
|
|
|
loginDialog.value = false
|
|
|
changePasswordDialog.value = false
|
|
|
@@ -358,19 +391,19 @@ onActivated(() => {
|
|
|
})
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
- userStore.LogOut()
|
|
|
registerUrlParams.value.returnUrl = `${location.origin}/h5${route.fullPath}`
|
|
|
- const pushRecordId = route?.query.pushRecordId || ''
|
|
|
- console.log('pushRecordId', pushRecordId)
|
|
|
-
|
|
|
- if (pushRecordId) {
|
|
|
- sendEtsSms.pushRecordId = pushRecordId as string
|
|
|
- userStore.setPushRecordId(pushRecordId as string)
|
|
|
- formData.pushRecordId = pushRecordId as string
|
|
|
- getPubName()
|
|
|
- } else {
|
|
|
- showToast('登录链接存在不完整或者输入错误,请重新复制链接登录')
|
|
|
+ const pushRecordId = route.query.pushRecordId
|
|
|
+ if (!pushRecordId) {
|
|
|
+ userStore.setPushRecordId('')
|
|
|
+ formData.pushRecordId = ''
|
|
|
+ sendEtsSms.pushRecordId = ''
|
|
|
+ showToast('登录链接存在不完整或者输入错误')
|
|
|
+ return
|
|
|
}
|
|
|
+ userStore.setPushRecordId(pushRecordId as string)
|
|
|
+ sendEtsSms.pushRecordId = pushRecordId as string
|
|
|
+ formData.pushRecordId = pushRecordId as string
|
|
|
+ getPubName()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
@@ -467,6 +500,12 @@ onBeforeMount(() => {
|
|
|
cursor: not-allowed;
|
|
|
}
|
|
|
}
|
|
|
+ .tips {
|
|
|
+ font-size: 3vw;
|
|
|
+ color: #999;
|
|
|
+ margin-top: 3vw;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
|
|
|
.agree {
|
|
|
text-align: left;
|