| | |
| | | <template> |
| | | <div class="login_page"> |
| | | <headers :mess="loginWay" /> |
| | | <!-- <div class="img_mess"> |
| | | <div class="logo_content animated fadeInRight"> |
| | | <img :src="Logo" alt /> |
| | | </div> |
| | | </div> --> |
| | | <tab-head :leftShow="false" :rightShow="false"> |
| | | <van-popover |
| | | v-model="languageShow" |
| | | trigger="click" |
| | | :actions="actions" |
| | | @select="onSelect" |
| | | placement="bottom-end" |
| | | > |
| | | <template #reference> |
| | | <div class="multilingual"> |
| | | <img src="../../assets/img/language_b.png" alt="" /> |
| | | </div> |
| | | </template> |
| | | </van-popover> |
| | | |
| | | <template #left> |
| | | <img src="@/assets/img/logo_1.png" class="left_icon" /> |
| | | </template> |
| | | </tab-head> |
| | | |
| | | <div class="login_title animated slideInDown"> |
| | | <span>{{ $t("dlan") }}</span> |
| | | </div> |
| | | <div class="logins_content"> |
| | | <div class="login_title animated slideInDown"> |
| | | <span>{{ $t("hj8") }}</span> |
| | | </div> |
| | | <div class="login_forms"> |
| | | <div class="top_forms"> |
| | | <!-- <div class="user_name"> |
| | | <input type="text" :placeholder="placeholder" v-model="userName" /> |
| | | </div> |
| | | <div class="password"> |
| | | <input type="password" placeholder="登录密码" v-model="userPassword" @input="handleInput()" /> |
| | | </div> --> |
| | | <div class="forms_title">{{ $t("hj27") }}</div> |
| | | <el-input |
| | | :placeholder="$t('hj9')" |
| | | :size="medium" |
| | | maxlength="11" |
| | | v-model="userName" |
| | | clearable |
| | | > |
| | | </el-input> |
| | | <div class="forms_title">{{ $t("Password") }}</div> |
| | | <el-input |
| | | style="margin-top: 0.46rem;" |
| | | show-password |
| | | :placeholder="$t('hj10')" |
| | | :size="medium" |
| | |
| | | > |
| | | </el-input> |
| | | </div> |
| | | <div class="bottom_btns" :class="btnClass ? 'on' : 'off'"> |
| | | <button |
| | | class="top_btn " |
| | | v-on:touchstart="loginIN" |
| | | :class="dengl ? 'animated pulse' : ''" |
| | | <div class="bottom_btns"> |
| | | <van-button |
| | | type="info" |
| | | :disabled="!btnClass" |
| | | class="butn" |
| | | @click="loginIN" |
| | | > |
| | | <span>{{ $t("hj11") }}</span> |
| | | </button> |
| | | <div style="display:flex;align-items:center;justify-content: space-between;"> |
| | | <div class="myzh"> |
| | | <span class="mes" style="margin: right 0.2rem;">{{ $t("hj14") }}?</span |
| | | ><span |
| | | @click="$router.push('/register')" |
| | | class="mes" |
| | | style="color: rgb(54,124,248);" |
| | | >{{ $t("hj15") }}</span |
| | | > |
| | | </div> |
| | | <div class="mes" @click="getApp()"> |
| | | <span>{{ $t("hj12") }}</span> |
| | | {{ $t("立即登录") }} |
| | | </van-button> |
| | | <!-- <van-button |
| | | type="info" |
| | | plain |
| | | class="butn_2" |
| | | @click="$router.push('/register')" |
| | | > |
| | | {{ $t("免費註冊") }} |
| | | </van-button> --> |
| | | </div> |
| | | |
| | | <div class="login_footer"> |
| | | <div class="tui-first"> |
| | | <div @click="$router.push('/register')">{{ $t("立即注册") }}</div> |
| | | <div class="symbol"></div> |
| | | <div @click="$store.dispatch('CustomerService')"> |
| | | {{ $t("kf") }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="login_bom" v-if="hideshow"> |
| | | <!-- <div class="line"> |
| | | <div class="left_line"></div> |
| | | <div class="center_line"> |
| | | <span>{{ $t('hj13') }}</span> |
| | | </div> |
| | | <div class="right_line"></div> |
| | | </div> |
| | | <div class="imgDemo"> |
| | | <div class="appImg" @click="getApp()"><img src="@/assets/img/apple.png" /></div> |
| | | <div class="appImg" @click="getApp()"><img src="@/assets/img/google.png" /></div> |
| | | <div class="appImg" @click="getApp()"><img src="@/assets/img/facebook.png" /></div> |
| | | </div> --> |
| | | </div> |
| | | <el-alert |
| | | v-show="alertShow" |
| | | :closable="closable" |
| | | :title="texts" |
| | | :type="eltype" |
| | | center |
| | | ></el-alert> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { Toast } from "mint-ui"; |
| | | import headers from "./components/header.vue"; |
| | | import Logo from "@/assets/img/LOGO2.png"; |
| | | import tabHead from "../../components/tabHead.vue"; |
| | | import * as api from "@/axios/api"; |
| | | import { Notify } from "vant"; |
| | | import { mapActions, mapMutations } from "vuex"; |
| | | |
| | | export default { |
| | | name: "newLogin", |
| | | data() { |
| | | return { |
| | | checked: false, |
| | | loginWay: this.$t("hj8"), |
| | | currentLoginMode: "email", |
| | | placeholder: this.$t("hj16"), |
| | | Logo, |
| | | userPassword: "", |
| | | userName: "", |
| | | btnClass: false, |
| | | medium: "medium", |
| | | alertShow: false, |
| | | closable: false, |
| | | eltype: "warning", |
| | | texts: "", |
| | | dengl: false, |
| | | loginBtn: false, |
| | | docmHeight: document.documentElement.clientHeight, //默认屏幕高度 |
| | | showHeight: document.documentElement.clientHeight, //实时屏幕高度 |
| | | hideshow: true //显示或者隐藏footer |
| | | languageShow: false, // 语言选择 |
| | | // 多语言配置 |
| | | actions: [ |
| | | { |
| | | text: "English", |
| | | lang: "en" |
| | | }, |
| | | { |
| | | text: "中文(繁体)", |
| | | lang: "zh-Hant" |
| | | }, |
| | | { |
| | | text: "中文", |
| | | lang: "zh-CN" |
| | | } |
| | | // { |
| | | // text: "हिंदी", |
| | | // lang: "hi" |
| | | // } |
| | | ] |
| | | }; |
| | | }, |
| | | components: { |
| | | headers |
| | | // headers, |
| | | tabHead |
| | | }, |
| | | mounted() { |
| | | window.onresize = () => { |
| | | return (() => { |
| | | this.showHeight = document.body.clientHeight; |
| | | })(); |
| | | }; |
| | | }, |
| | | watch: { |
| | | showHeight: function() { |
| | | if (this.docmHeight > this.showHeight) { |
| | | this.hideshow = false; |
| | | } else { |
| | | this.hideshow = true; |
| | | } |
| | | const ret = window.localStorage.getItem("login_admin"); |
| | | this.checked = window.localStorage.getItem("login_checked") === "true"; |
| | | if (ret && this.checked) { |
| | | this.userPassword = JSON.parse(ret).userPassword; |
| | | this.userName = JSON.parse(ret).phone; |
| | | this.btnClass = true; |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | ...mapActions(["setUseInfo"]), |
| | | ...mapMutations(["undataToken"]), |
| | | checkboxChange(e) { |
| | | window.localStorage.setItem("login_checked", e); |
| | | }, |
| | | getApp() { |
| | | // Toast('您所在的地区暂未开通此服务') |
| | | //Toast 弹窗大小 |
| | | this.texts = this.$t("hj17"); |
| | | this.alertShow = true; |
| | | setTimeout(() => { |
| | | this.alertShow = false; |
| | | }, 2000); |
| | | Notify({ type: "warning", message: this.$t("hj17") }); |
| | | }, |
| | | handleInput() { |
| | | console.log(this.userPassword !== "" && this.userName !== ""); |
| | | if (this.userPassword !== "" && this.userName !== "") { |
| | | this.btnClass = true; |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | async loginIN() { |
| | | this.dengl = true; |
| | | setTimeout(() => { |
| | | this.dengl = false; |
| | | }, 1000); |
| | | if (this.loginBtn) { |
| | | return; |
| | | } |
| | | this.loginBtn = true; |
| | | let opts = { |
| | | phone: this.userName, |
| | | userPwd: this.userPassword |
| | | }; |
| | | let data = await api.login(opts); |
| | | |
| | | console.log("data.status",data.status); |
| | | |
| | | |
| | | if (data.status === 0) { |
| | | this.setUseInfo(); |
| | | if (this.checked) { |
| | | window.localStorage.setItem( |
| | | "login_admin", |
| | | JSON.stringify({ |
| | | phone: this.userName, |
| | | userPassword: this.userPassword |
| | | }) |
| | | ); |
| | | } else { |
| | | window.localStorage.setItem("login_admin", ""); |
| | | } |
| | | this.$store.state.userInfo.phone = this.userName; |
| | | this.$store.state.userInfo.token = data.data.token; |
| | | this.texts = this.$t("hj36"); |
| | | this.eltype = "success"; |
| | | this.alertShow = true; |
| | | setTimeout(() => { |
| | | this.alertShow = false; |
| | | this.eltype = "warning"; |
| | | this.$router.push("/home"); |
| | | }, 1000); |
| | | this.loginBtn = false; |
| | | // window.localStorage.clear() |
| | | this.undataToken(data.data.token); |
| | | window.localStorage.setItem("USERTOKEN", data.data.token); |
| | | } else { |
| | | this.texts = data.msg; |
| | | this.alertShow = true; |
| | | this.loginBtn = false; |
| | | // Notify({ type: "success", message: this.$t("hj36") }); |
| | | |
| | | setTimeout(() => { |
| | | this.alertShow = false; |
| | | }, 2000); |
| | | //Toast(data.msg) |
| | | // this.$router.push("/home"); |
| | | this.$router.push("/"); |
| | | }, 1000); |
| | | } else { |
| | | Notify({ type: "warning", message: data.msg }); |
| | | } |
| | | if (navigator.vibrate) { |
| | | // 支持 |
| | | navigator.vibrate([55]); |
| | | } |
| | | }, |
| | | // 选择语言 |
| | | onSelect(e) { |
| | | window.localStorage.setItem("language", e.lang); |
| | | this.$i18n.locale = e.lang; |
| | | } |
| | | }, |
| | | beforeDestroy() {}, |
| | |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | .login_page { |
| | | position: relative; |
| | | background-color: #fff !important; |
| | | @green: #0e7ddd; |
| | | @Black1: #13161e; |
| | | |
| | | .login_footer { |
| | | margin-top: 3rem; |
| | | width: 100%; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | overflow-y: auto; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-direction: column; |
| | | |
| | | .tui-first { |
| | | display: flex; |
| | | align-items: center; |
| | | color: @green; |
| | | font-size: 0.4rem; |
| | | } |
| | | .symbol { |
| | | background-color: #ccc; |
| | | width: 1px; |
| | | height: 0.275rem; |
| | | margin: 0 0.225rem; |
| | | } |
| | | } |
| | | |
| | | .password-operate { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 0.53333rem; |
| | | |
| | | .forget { |
| | | font-style: normal; |
| | | font-weight: 400; |
| | | font-size: 0.37333rem; |
| | | line-height: 0.53333rem; |
| | | color: #8c9fad; |
| | | } |
| | | } |
| | | |
| | | /deep/ .van-checkbox__icon--checked .van-icon { |
| | | background: @green; |
| | | border-color: @green; |
| | | } |
| | | |
| | | .register { |
| | | font-style: normal; |
| | | font-weight: 500; |
| | | font-size: 0.37333rem; |
| | | color: #8c9fad; |
| | | margin: 0.4rem auto; |
| | | padding: 0.34667rem 0.4rem; |
| | | width: 100%; |
| | | height: 6rem; |
| | | text-align: center; |
| | | |
| | | span { |
| | | color: rgb(5, 106, 239); |
| | | } |
| | | } |
| | | |
| | | .login_title { |
| | | font-family: "DINPro", serif; |
| | | font-style: normal; |
| | | font-weight: 700; |
| | | font-size: 0.7rem; |
| | | line-height: 0.66667rem; |
| | | padding: 0.6rem 0.6rem 0; |
| | | } |
| | | |
| | | /deep/ .van-checkbox__label { |
| | | font-style: normal; |
| | | font-weight: 500; |
| | | font-size: 0.37333rem; |
| | | line-height: 0.53333rem; |
| | | color: #8c9fad; |
| | | } |
| | | |
| | | /deep/ .van-button__text { |
| | | font-size: 24px; |
| | | font-family: "DINPro"; |
| | | } |
| | | |
| | | .login_page { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: 100vh; |
| | | |
| | | .left_icon { |
| | | width: 112px; |
| | | height: 32px; |
| | | } |
| | | |
| | | .multilingual { |
| | | width: 0.8em; |
| | | height: 0.8em; |
| | | margin-left: 0.25em; |
| | | |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .logo { |
| | | width: 50vw; |
| | | margin: 10vw auto 15vw; |
| | | } |
| | | |
| | | .logins_content { |
| | | display: flex; |
| | | flex-direction: column; |
| | | flex: 1; |
| | | width: 100%; |
| | | height: 9.7436rem; |
| | | margin-top: 0.4359rem; |
| | | padding: 0 0.4564rem; |
| | | |
| | | .login_title { |
| | | width: 100%; |
| | | height: 2.0513rem; |
| | | display: flex; |
| | | |
| | | align-items: center; |
| | | font-size: 0.7023rem; |
| | | color: #000; |
| | | font-weight: 600 !important; |
| | | |
| | | > span { |
| | | font-weight: 600 !important; |
| | | } |
| | | } |
| | | |
| | | .login_forms { |
| | | width: 100%; |
| | | height: auto; |
| | | margin-top: 0.35rem; |
| | | |
| | | border-top-left-radius: 0.26667rem; |
| | | border-top-right-radius: 0.26667rem; |
| | | padding: 0.2rem 0.6rem; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .top_forms { |
| | | width: 100%; |
| | |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | |
| | | .forms_title { |
| | | font-size: 0.3rem; |
| | | margin-top: 0.5rem; |
| | | margin-bottom: 0.2rem; |
| | | font-weight: 300; |
| | | opacity: 0.7; |
| | | } |
| | | |
| | | .user_name, |
| | | .password { |
| | | width: 100%; |
| | | height: 35%; |
| | | background: rgb(246, 246, 247); |
| | | // background: #1e1e1e; |
| | | height: 50px; |
| | | background: #fff; |
| | | border-radius: 0.3564rem; |
| | | |
| | | > input { |
| | |
| | | |
| | | /deep/.el-input__inner { |
| | | width: 100%; |
| | | height: 1.45rem !important; |
| | | background-color: rgb(246, 246, 247) !important; |
| | | // background: #1e1e1e; |
| | | border-radius: 0.3564rem; |
| | | font-size: 0.45rem !important; |
| | | height: 70px; |
| | | background-color: @Black1 !important; |
| | | font-size: 0.3rem !important; |
| | | border: @Black1 solid 1px; |
| | | color: #fff; |
| | | border-bottom: rgba(#fff, 0.7) solid 1px; |
| | | } |
| | | |
| | | .bottom_btns { |
| | | width: 100%; |
| | | height: 3.3333rem; |
| | | margin-top: 0.8528rem; |
| | | |
| | | // margin-top: 0.8528rem; |
| | | .butn { |
| | | width: 100%; |
| | | margin-top: 40px; |
| | | height: 60px; |
| | | border-radius: 8px; |
| | | background: #1f4583; |
| | | border: none; |
| | | } |
| | | |
| | | .butn_2 { |
| | | width: 100%; |
| | | margin-top: 40px; |
| | | height: 60px; |
| | | border-radius: 8px; |
| | | color: @green; |
| | | border-color: @green; |
| | | margin-top: 0.4rem; |
| | | } |
| | | |
| | | .top_btn { |
| | | border: none; |
| | | border: none; |
| | | width: 100%; |
| | | height: 1.25rem; |
| | | border-radius: 0.3564rem; |
| | | background: rgb(154, 197, 250); |
| | | border-radius: 8px; |
| | | background: @green; |
| | | color: #fff; |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | } |
| | | |
| | | .on .top_btn { |
| | | background: #2d8cf0 !important; |
| | | background: @green !important; |
| | | } |
| | | |
| | | /deep/.el-icon-circle-close::before { |