|
|
@ -3,7 +3,7 @@ |
|
|
|
<div class="modal_content"> |
|
|
|
<div class="modal_header"> |
|
|
|
<p class="title">登陆</p> |
|
|
|
<img :src="Close" alt="关闭" class="close_img" /> |
|
|
|
<img @click="handleCancel" :src="Close" alt="关闭" class="close_img" /> |
|
|
|
</div> |
|
|
|
<div class="main_form"> |
|
|
|
<div class="form_wrap"> |
|
|
@ -22,8 +22,8 @@ |
|
|
|
alt="" |
|
|
|
@click="inputType = !inputType" |
|
|
|
/> |
|
|
|
<div class="login_btn"></div> |
|
|
|
<div class="cancel_btn"></div> |
|
|
|
<div class="login_btn" @click="handleLogin"></div> |
|
|
|
<div class="cancel_btn" @click="handleCancel"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -40,11 +40,44 @@ |
|
|
|
import Close from '@/assets/img/close.png' |
|
|
|
import Eye from '@/assets/img/eye.png' |
|
|
|
import CloseEye from '@/assets/img/close_eye.png' |
|
|
|
import { useTabStore } from '@/store' |
|
|
|
import { ref } from 'vue' |
|
|
|
import { showSuccessToast, showFailToast } from 'vant' |
|
|
|
import { useRouter } from 'vue-router' |
|
|
|
|
|
|
|
const tabStore = useTabStore() |
|
|
|
const router = useRouter() |
|
|
|
const inputType = ref(false) |
|
|
|
const password = ref('') |
|
|
|
const show = ref(false) |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
handleModalVisible: { |
|
|
|
type: Function, |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
const handleCancel = () => { |
|
|
|
props.handleModalVisible() |
|
|
|
// 将底部tab高亮至操作 |
|
|
|
tabStore.updateActiveTab(1) |
|
|
|
} |
|
|
|
|
|
|
|
const handleLogin = () => { |
|
|
|
const val = password.value |
|
|
|
if (val == '9527') { |
|
|
|
// 登陆成功 |
|
|
|
showSuccessToast('登陆成功') |
|
|
|
tabStore.updateIsLogin(true) |
|
|
|
tabStore.updatePreActiveTab(2) |
|
|
|
props.handleModalVisible() |
|
|
|
router.push('/test') |
|
|
|
} else { |
|
|
|
// 登陆失败 |
|
|
|
showFailToast('登陆失败') |
|
|
|
tabStore.updateIsLogin(false) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|