|
@@ -10,8 +10,8 @@
|
|
|
<el-option
|
|
|
v-for='item,index in areaOptions'
|
|
|
:key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
+ :label="item.ch_name"
|
|
|
+ :value="item.code">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-input>
|
|
@@ -19,7 +19,7 @@
|
|
|
<template slot="prepend"><i class="prepend-icon iconfont"></i> </template>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
- <div v-if="checkBoxState('','login','code',2)||checkBoxState('phone','find','','')" class="code-container">
|
|
|
+ <div v-if="checkBoxState('','login','code',2)||checkBoxState('phone','find','','')||checkBoxState('','set','','')" class="code-container">
|
|
|
<div class="code-input-inner">
|
|
|
<el-input class="special-input" placeholder="请输入验证码" v-model="loginInfo.code"></el-input>
|
|
|
<button class="send-code-button" @click="sendMessage" :class="{'disabled':disableSend}">{{sendButtonText}}</button>
|
|
@@ -27,8 +27,8 @@
|
|
|
<p class="no-code-notice" v-if="showNoCodeNotice&&checkBoxState('','set','','')">收不到短信?试试 <a class="notice-link" href="#">语音验证码</a></p>
|
|
|
|
|
|
</div>
|
|
|
- <div v-if="checkBoxState('','login','pwd',2)||checkBoxState('phone','find','','')" class="password-container">
|
|
|
- <el-input class="special-input" type="password" placeholder="请输入内容" v-model="loginInfo.password">
|
|
|
+ <div v-if="checkBoxState('','login','pwd',2)||checkBoxState('phone','find','','')||checkBoxState('','set','','')" class="password-container">
|
|
|
+ <el-input class="special-input" type="password" placeholder="请输入内容" @change="disableAction=!loginInfo.password" v-model="loginInfo.password">
|
|
|
<template slot="prepend"><i class="prepend-icon iconfont"></i> </template>
|
|
|
<i slot="suffix" class="el-input__icon iconfont"></i>
|
|
|
</el-input>
|
|
@@ -36,7 +36,7 @@
|
|
|
<div class="action-container">
|
|
|
<div class="login-action" v-if="checkBoxState('','login','',2)">
|
|
|
<div class="login-action__phone" v-if="checkBoxState('phone','login','code',2)">
|
|
|
- <el-checkbox label="我已了解风险提示!" v-model="loginInfo.checkItem"></el-checkbox>
|
|
|
+ <el-checkbox label="我已了解风险提示!" @change="disableAction=!loginInfo.checkItem" v-model="loginInfo.checkItem"></el-checkbox>
|
|
|
</div>
|
|
|
<div class="login-action__pwd" v-if="checkBoxState('','login','pwd',2)">
|
|
|
<el-checkbox label="记住密码" v-model="loginInfo.rememberPwd"></el-checkbox>
|
|
@@ -44,11 +44,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="set-action" v-if="checkBoxState('','set','',2)">
|
|
|
- <p class="go-back" @click="buttonTextChange();switchNoticeTextChange();">返回</p>
|
|
|
+ <p class="go-back" @click="handleGoBack">返回</p>
|
|
|
</div>
|
|
|
<div class="find-action" v-if="checkBoxState('','find','','')">
|
|
|
<p class="go-back" @click="handleGoBack">返回</p>
|
|
|
</div>
|
|
|
+ <div class="register-action" v-if="checkBoxState('','login','',1)">
|
|
|
+ <a class="register" @click="handleRegister">立即注册</a>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="button-container">
|
|
|
<p class="top-notice no-code-notice" v-if="showNoCodeNotice&&checkBoxState('','login','','')">收不到短信?试试 <a class="notice-link" href="#">语音验证</a></p>
|
|
@@ -117,15 +120,12 @@
|
|
|
},
|
|
|
},
|
|
|
areaOptions:[
|
|
|
- {
|
|
|
- label:'中国',
|
|
|
- value:'+86'
|
|
|
- }
|
|
|
+
|
|
|
],
|
|
|
buttonText:'',
|
|
|
switchNoticeText:'',
|
|
|
loginInfo:{
|
|
|
- selectArea:'+86',
|
|
|
+ selectArea:'86',
|
|
|
account:'',
|
|
|
code:'',
|
|
|
password:'',
|
|
@@ -164,15 +164,11 @@
|
|
|
mounted(){
|
|
|
this.buttonText=this.buttonTextChange();
|
|
|
this.switchNoticeText=this.switchNoticeTextChange();
|
|
|
+ this.$http.get(this._ajaxAdress.getCountryList).then((response)=>{
|
|
|
+ this.areaOptions=response.data.data;
|
|
|
+ })
|
|
|
// this.type.password='psw';
|
|
|
},
|
|
|
- // watch:{
|
|
|
- // type:function () {
|
|
|
- // this.setTypeFullCode()
|
|
|
- // },
|
|
|
- // deep:true
|
|
|
- //
|
|
|
- // },
|
|
|
methods:{
|
|
|
changeTab(id){
|
|
|
if(this.tabList.length<2){
|
|
@@ -257,6 +253,11 @@
|
|
|
this.textChange();
|
|
|
|
|
|
},
|
|
|
+ handleRegister(){
|
|
|
+ this.type.action='set';
|
|
|
+ this.type.step=2;
|
|
|
+ this.textChange();
|
|
|
+ },
|
|
|
handleGoBack(){
|
|
|
this.type.action='login';
|
|
|
this.textChange();
|
|
@@ -300,13 +301,147 @@
|
|
|
}
|
|
|
return ''
|
|
|
},
|
|
|
+ setUrlParams(obj){
|
|
|
+ let param = new URLSearchParams();
|
|
|
+ for(let item in obj){
|
|
|
+ param.append(item,obj[item]);
|
|
|
+ }
|
|
|
+ return param
|
|
|
+ },
|
|
|
handleActionClick(){
|
|
|
if(this.disableAction)return;
|
|
|
- if(this.checkBoxState('email','find','','')){
|
|
|
- console.log(123)
|
|
|
+ this.disableAction=true;
|
|
|
+ if(this.checkBoxState('','login','',2)){//登录
|
|
|
+ let params={
|
|
|
+ 'email':'',
|
|
|
+ 'password':'',
|
|
|
+ 'redirect_uri':'https://dev407.33.cn',
|
|
|
+ 'os':'web',
|
|
|
+ 'type':'',
|
|
|
+ 'area':'',
|
|
|
+ 'logintype':'',
|
|
|
+ 'code':'',
|
|
|
+ 'mobile':'',
|
|
|
+ 'platform':'fx66',
|
|
|
+ 'broker_code':'04031632e48cd96e',
|
|
|
+ }
|
|
|
+ if(this.checkBoxState('','login','pwd',2)){
|
|
|
+ params.password=this.loginInfo.password
|
|
|
+ params.logintype='password'
|
|
|
+ }else{
|
|
|
+ params.code=this.loginInfo.code
|
|
|
+ params.logintype='code'
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.checkBoxState('email','login','pwd',2)){
|
|
|
+ params.email=this.loginInfo.account;
|
|
|
+ params.type='email';
|
|
|
+ }else{
|
|
|
+ params.mobile=this.loginInfo.account;
|
|
|
+ params.type='sms';
|
|
|
+ params.area=this.loginInfo.selectArea;
|
|
|
+ }
|
|
|
+ if(this.checkBoxState('email','login','code',2)){
|
|
|
+ params.email=this.loginInfo.account;
|
|
|
+ params.type='email';
|
|
|
+ }else{
|
|
|
+ params.mobile=this.loginInfo.account;
|
|
|
+ params.type='sms';
|
|
|
+ params.area=this.loginInfo.selectArea;
|
|
|
+ }
|
|
|
+ this.$http.post(this._ajaxAdress.postLogin,this.setUrlParams(params)).then((response)=>{//todo 将get改为post
|
|
|
+ if(response.data.code==200){
|
|
|
+ this.$emit('loginSuccess');
|
|
|
+ localStorage.setItem('token',response.data.data.access_token);
|
|
|
+ localStorage.setItem('username',(this.checkBoxState('phone','','','')?this.loginInfo.selectArea:'')+this.loginInfo.account)
|
|
|
+ }else{
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: response.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.disableAction=false;
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
- if(this.checkBoxState('phone','login','',2)){
|
|
|
- console.log(this.loginInfo.selectArea+this.loginInfo.account);
|
|
|
+ if(this.checkBoxState('','find','','')){//密码找回
|
|
|
+ let params={
|
|
|
+ 'email':'',
|
|
|
+ 'os':'web',
|
|
|
+ 'type':'',
|
|
|
+ 'area':'',
|
|
|
+ 'mobile':'',
|
|
|
+ 'platform':'fx66',
|
|
|
+ }
|
|
|
+ if(this.checkBoxState('email','find','','')){
|
|
|
+ params.email=this.loginInfo.account;
|
|
|
+ }else{
|
|
|
+ params.mobile=this.loginInfo.account;
|
|
|
+ params.area=this.loginInfo.selectArea;
|
|
|
+ }
|
|
|
+ this.$http.post(this._ajaxAdress.findPwd,this.setUrlParams(params)).then((response)=>{
|
|
|
+ if(response.data.code==200){
|
|
|
+ if(this.checkBoxState('email','find','','')){
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message: '你的邮箱验证码已经发送到你的邮箱\n请前往修改密码!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: response.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.disableAction=false;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ if(this.checkBoxState('','set','','')){
|
|
|
+ let params={
|
|
|
+ 'email':'',
|
|
|
+ 'password':'',
|
|
|
+ 'type':'',
|
|
|
+ 'area':'',
|
|
|
+ 'code':'',
|
|
|
+ 'mobile':'',
|
|
|
+ }
|
|
|
+ params.code=this.loginInfo.code;
|
|
|
+ params.password=this.loginInfo.password;
|
|
|
+ if(this.checkBoxState('email','set','','')){
|
|
|
+ params.email=this.loginInfo.account;
|
|
|
+ params.type='email';
|
|
|
+ }else{
|
|
|
+ params.mobile=this.loginInfo.account;
|
|
|
+ params.type='sms';
|
|
|
+ params.area=this.loginInfo.selectArea;
|
|
|
+ }
|
|
|
+ this.$http.post(this._ajaxAdress.postRegister,this.setUrlParams(params)).then((response)=>{//todo 将get改为post
|
|
|
+ if(response.data.code==200){
|
|
|
+ this.$notify({
|
|
|
+ title: '成功',
|
|
|
+ message:'注册成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: response.data.message,
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.disableAction=false;
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
if(this.checkBoxState('','','',1)&&!this.checkBoxState('email','find','','')){
|
|
|
this.type.step+=1;
|
|
@@ -458,12 +593,27 @@
|
|
|
|
|
|
}
|
|
|
& .find-action{
|
|
|
+ & .go-back{
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ text-align: right;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ & .set-action{
|
|
|
+ & .go-back{
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
text-align: right;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .register{
|
|
|
+ float: left;
|
|
|
+ cursor: pointer;
|
|
|
+ color:@primaryBlue;
|
|
|
+ }
|
|
|
.disabled{
|
|
|
background-color: #dcdcdc!important;
|
|
|
cursor: default!important;
|