1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
| <script setup lang="ts"> const props = defineProps({ loginTitle: { type: String }, loginLabels: { type: Object }, loginForms: { type: Object }, messageCheckEmail: { type: String }, messageCheckPassword: { type: String }, messageCheckVerification: { type: String }, code_box: { type: String }, checkLoginForms: { type: Boolean }, errorCheckEmail: { type: Boolean }, errorCheckPassword: { type: Boolean }, errorCheckVerification: { type: Boolean }, passwordVisible: { type: Boolean }, passwordType: { type: String }, }) const emit = defineEmits(['sendCheckEmail','sendCheckPassword','sendCheckVerification','sendShowCode','sendLoginSubmit','sendShowPassword']) const sendCheckEmail =()=>{ emit('sendCheckEmail') } const sendCheckPassword =()=>{ emit('sendCheckPassword') } const sendCheckVerification=()=>{ emit('sendCheckVerification') } const sendShowCode= ()=>{ emit('sendShowCode') } const sendLoginSubmit= ()=>{ emit('sendLoginSubmit') } const sendShowPassword = ()=>{ emit('sendShowPassword') } </script>
<template> <div class="form login_form mt-5"> <div class="text-center mb-3"> <b data-test="title" >{{ loginTitle }}</b> </div> <div class="input_item"> <label>{{ loginLabels.email }}</label> <input type="text" data-test="email" v-model="loginForms.email" @blur="sendCheckEmail" :placeholder="loginLabels.email" :class="{error:errorCheckEmail}" /> <div class="error_message" data-test="emailMessage" >{{ messageCheckEmail }}</div> </div> <div class="input_item"> <label>{{ loginLabels.password }}</label> <div class="password_input"> <input data-test="password" :type="passwordType" v-model="loginForms.password" @blur="sendCheckPassword" :class="{ error: errorCheckPassword }" :placeholder="loginLabels.password"/> <i class="icon-eye-close" @click.prevent="sendShowPassword" :class="passwordVisible === false ? 'icon-eye-close' : 'icon-eye'" ></i>
</div> <div class="error_message" data-test="passwordMessage">{{ messageCheckPassword }}</div> </div> <div class="input_item verification" > <label>{{ loginLabels.verification }}</label> <input type="text" @blur="sendCheckVerification" data-test="verification" v-model="loginForms.verification" :class="{error:errorCheckVerification}" :placeholder="loginLabels.verification"/> <div class="codeBox">{{ code_box }}</div> <a class="btn_change"> <i @click="sendShowCode" class="icon-spinner11"></i> </a> <div class="error_message" data-test="verificationMessage" >{{ messageCheckVerification }}</div> </div> <div class="flex justify-center"> <div class="flex w-64"> <a class="btn cancel mr-3">取消</a> <a class="btn submit" @click="sendLoginSubmit" :class="{ disabled: checkLoginForms }" >送出</a> </div> </div> </div> </template>
|