|
@@ -10,25 +10,43 @@
|
|
<!-- 标题内容介绍 -->
|
|
<!-- 标题内容介绍 -->
|
|
<header class="login-header">
|
|
<header class="login-header">
|
|
<div class="login-header-title">欢迎登录</div>
|
|
<div class="login-header-title">欢迎登录</div>
|
|
- <div class="login-header-info">还没有账号?<span @click="openModal('register')">立即注册</span></div>
|
|
|
|
|
|
+ <div class="login-header-introduce">这里有众多的小哥哥小姐姐陪你打游戏</div>
|
|
</header>
|
|
</header>
|
|
|
|
|
|
<!-- 输入内容 -->
|
|
<!-- 输入内容 -->
|
|
<section class="login-section">
|
|
<section class="login-section">
|
|
- <aside
|
|
|
|
- v-for="(item,index) in inputData"
|
|
|
|
- :key="'login-input-'+index"
|
|
|
|
- class="login-input rowACenter"
|
|
|
|
- >
|
|
|
|
- <div class="flex-1 overflow">
|
|
|
|
- <input :type="item.type || 'text'"
|
|
|
|
- :placeholder="item.placeholder"
|
|
|
|
- class="screen login-input-target"
|
|
|
|
- v-model="item.value"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </aside>
|
|
|
|
|
|
+ <aside
|
|
|
|
+ :key="'login-input-'+index"
|
|
|
|
+ v-for="(item,index) in inputData"
|
|
|
|
+ class="login-input rowACenter"
|
|
|
|
+ v-show="item.show === undefined || item.show === loginType"
|
|
|
|
+ >
|
|
|
|
+ <div class="flex-1 overflow">
|
|
|
|
+ <input :type="item.type || 'text'"
|
|
|
|
+ :placeholder="item.placeholder"
|
|
|
|
+ class="screen login-input-target"
|
|
|
|
+ v-model="item.value"
|
|
|
|
+ autocomplete="off"
|
|
|
|
+ disableautocomplete
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.code"
|
|
|
|
+ class="login-code cursor-pointer"
|
|
|
|
+ :class="{
|
|
|
|
+ 'button-active' : !timeFormat,
|
|
|
|
+ 'login-code-disabled': timeFormat
|
|
|
|
+ }"
|
|
|
|
+ @click="triggerTimeDate(item,inputData)"
|
|
|
|
+ >{{ timeFormat || timeConfig.default }}</div>
|
|
|
|
+ </aside>
|
|
</section>
|
|
</section>
|
|
|
|
+ <article class="rowACenter login-control">
|
|
|
|
+ <div class="login-header-info flex-1"><span
|
|
|
|
+ class="cursor-pointer"
|
|
|
|
+ @click="switchLoginType"
|
|
|
|
+ >{{ loginType === loginTypeConst.password ?'验证码':'密码' }}登录</span></div>
|
|
|
|
+ <div class="login-header-info">还没有账号?<span @click="openModal('register')">立即注册</span>或<span @click="openModal('forget')">忘记密码</span></div>
|
|
|
|
+ </article>
|
|
|
|
|
|
<!-- 按钮 -->
|
|
<!-- 按钮 -->
|
|
<v-button class="login-button"
|
|
<v-button class="login-button"
|
|
@@ -52,83 +70,20 @@ import {
|
|
icon,
|
|
icon,
|
|
vButton
|
|
vButton
|
|
} from '$components';
|
|
} from '$components';
|
|
-import inputData from '../data/input';
|
|
|
|
-
|
|
|
|
-import verification from '$utils/verification';
|
|
|
|
|
|
|
|
import props from '../props';
|
|
import props from '../props';
|
|
-
|
|
|
|
-import { InstructionsMessageType } from '$utils/request';
|
|
|
|
-
|
|
|
|
-import user from '$config/user';
|
|
|
|
-import popup from "$utils/tool/popup";
|
|
|
|
-import socket from "$config/plugs/socket";
|
|
|
|
-
|
|
|
|
-import trigger from '$mixins/trigger';
|
|
|
|
-import config from "$config/config";
|
|
|
|
-
|
|
|
|
|
|
+import mixins from '../mixins';
|
|
export default {
|
|
export default {
|
|
name: "login",
|
|
name: "login",
|
|
|
|
|
|
- mixins:[trigger],
|
|
|
|
- data(){
|
|
|
|
- return {
|
|
|
|
- inputData:inputData()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
inject:['openModal'],
|
|
inject:['openModal'],
|
|
|
|
|
|
- methods:{
|
|
|
|
- submitVerify:function (callback) {
|
|
|
|
- return verification.verificationPromise(this.inputData,true).then(callback);
|
|
|
|
- },
|
|
|
|
- submit:function (obj) {
|
|
|
|
- return this.$request({
|
|
|
|
- url:'login/user_login',
|
|
|
|
- data:obj.data,
|
|
|
|
- message: InstructionsMessageType.other
|
|
|
|
- }).then((data)=>{
|
|
|
|
-
|
|
|
|
- if (data.isSuccess) {
|
|
|
|
-
|
|
|
|
- user.user = data.data;
|
|
|
|
- socket.register(config,true);
|
|
|
|
-
|
|
|
|
- this.$request.getUserInfo().then((resultData)=>{
|
|
|
|
- this.$store.commit('setUserInfo',Object.assign({},data.data,resultData));
|
|
|
|
-
|
|
|
|
- popup.$toast(data.msg);
|
|
|
|
- return this.$emit('close');
|
|
|
|
- }).catch(obj.fail);
|
|
|
|
- } else {
|
|
|
|
- return obj.none();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }).catch(obj.fail);
|
|
|
|
- },
|
|
|
|
- setLoginParams:function (data){
|
|
|
|
-
|
|
|
|
- if (data) {
|
|
|
|
- this.inputData.map((item)=>{
|
|
|
|
- if (item.value !== data[item.key]) {
|
|
|
|
- item.value = data[item.key];
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // loginSuccess:function () {
|
|
|
|
- // return this.$emit('close');
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
components:{
|
|
components:{
|
|
icon,
|
|
icon,
|
|
vButton
|
|
vButton
|
|
},
|
|
},
|
|
- props
|
|
|
|
|
|
+ props,
|
|
|
|
+ mixins
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|