123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <template>
- <div class="login-view">
- <img
- class="title"
- src="@/assets/images/login-page-title.png"
- alt=""
- draggable="false"
- >
- <div class="interaction-area">
- <div class="row-1">
- <div class="input-wrap">
- <input
- v-model="nickName"
- type="text"
- maxlength="6"
- placeholder="请输入昵称"
- >
- <div class="count">
- {{ nickName.length }}/6
- </div>
- </div>
- <button
- class="as-visitor"
- :disabled="!nickName"
- @click="onClickAsVisitor"
- >
- 游客模式
- </button>
- </div>
- <button class="as-wx-user" />
- </div>
- </div>
- </template>
- <script setup>
- import { ref, computed, watch, onMounted } from "vue"
- import { useRoute, useRouter } from "vue-router"
- import { useStore } from "vuex"
- const route = useRoute()
- const router = useRouter()
- const store = useStore()
- const nickName = ref('')
- nickName.value = `云城居民${utils.getRandomString(2)}`
- function onClickAsVisitor() {
- store.commit('setLoginStatus', store.getters.loginStatusEnum.visitor)
- store.commit('setUserName', nickName.value)
- if (route.query.redirect && !route.query.redirect.includes('login')) {
- router.push({
- path: decodeURI(route.query.redirect)
- })
- } else {
- router.push({
- name: 'HomeView'
- })
- }
- }
- </script>
- <style lang="less" scoped>
- .login-view{
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-image: url(@/assets/images/login-bg.jpg);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center center;
- >img.title{
- position: absolute;
- left: 50%;
- bottom: 50%;
- transform: translate(-50%, 0);
- width: 30vw;
- }
- >.interaction-area{
- position: absolute;
- left: 50%;
- bottom: calc(107 / 972 * 100%);
- transform: translate(-50%, 0);
- >.row-1{
- display: flex;
- align-items: center;
- margin-bottom: 4px;
- >.input-wrap{
- width: 283px;
- height: 75px;
- background: rgba(0,0,0,0.25);
- border-radius: 8px 8px 8px 8px;
- border: 2px solid #FFFFFF;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-left: 27px;
- padding-right: 22px;
- margin-right: 7px;
- >input{
- width: 170px;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 24px;
- color: #FFFFFF;
- line-height: 28px;
- &::placeholder {
- font-size: 24px;
- color: rgba(255, 255, 255, 0.5);
- line-height: 28px;
- }
- }
- >.count{
- flex: 0 0 auto;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 24px;
- color: #FFFFFF;
- line-height: 28px;
- opacity: 0.5;
- }
- }
- >button.as-visitor{
- width: 135px;
- height: 88px;
- background-image: url(@/assets/images/visitor-login-button-bg.png);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center center;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 24px;
- color: #FFFFFF;
- line-height: 28px;
- text-shadow: 0px 1px 1px rgba(135,111,82,0.5);
- &[disabled] {
- opacity: 0.7;
- cursor: not-allowed;
- }
- }
- }
- >button.as-wx-user{
- width: 422px;
- height: 75px;
- background-image: url(@/assets/images/button-wechat.png);
- background-size: cover;
- background-repeat: no-repeat;
- background-position: center center;
- }
- }
- }
- </style>
|