|
|
|
@ -4,30 +4,32 @@ |
|
|
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#010101" class="select"></uni-segmented-control> |
|
|
|
<view class="body"> |
|
|
|
<view class="login" v-show="current==0"> |
|
|
|
<input type="text" class="login_input" placeholder="eamil address"> |
|
|
|
<input type="text" class="login_input" placeholder="password"> |
|
|
|
<view class="tips">The email address or password you enterde is incorrect.</view> |
|
|
|
<input type="text" class="login_input" placeholder="eamil address" v-model="loginDate.username" @input="verificationLogin"> |
|
|
|
<input type="text" class="login_input" placeholder="password" v-model="loginDate.password" @input="verificationLogin"> |
|
|
|
<view class="tips" v-show="loginErr">{{errMsg}}</view> |
|
|
|
<navigator url="/pages/login/verifyEmail" > |
|
|
|
<view class="forgot">Forgot your Password?</view> |
|
|
|
</navigator> |
|
|
|
<button class="login_submit" >SIGN IN</button> |
|
|
|
<button class="login_submit" :disabled="isLogin" @click="login()">SIGN IN</button> |
|
|
|
<view class="agreement"> |
|
|
|
<image src="../../static/img/select2.png" mode="" class="agreement_image"></image> |
|
|
|
<view class=""> |
|
|
|
<image src="../../static/img/select2.png" mode="" class="agreement_image" @click="loginSelect=!loginSelect,loginErr=false" v-show="!loginSelect"></image> |
|
|
|
<image src="../../static/img/select1.png" mode="" class="agreement_image" @click="loginSelect=!loginSelect" v-show="loginSelect"></image> |
|
|
|
<view class="agreement_right"> |
|
|
|
by continuong, you agree to be <text class="text"> terms of use </text> and <text class="text"> privacy policy</text>. |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="login" v-show="current==1"> |
|
|
|
<input type="text" class="login_input" placeholder="name"> |
|
|
|
<input type="text" class="login_input" placeholder="eamil address"> |
|
|
|
<input type="text" class="login_input" placeholder="password"> |
|
|
|
|
|
|
|
<button class="login_submit">REGISTER</button> |
|
|
|
<input type="text" class="login_input" placeholder="name" @input="verificationReg" v-model="regDate.username"> |
|
|
|
<input type="text" class="login_input" placeholder="eamil address" @input="verificationReg" v-model="regDate.email"> |
|
|
|
<input type="text" class="login_input" placeholder="password" @input="verificationReg" v-model="regDate.password1"> |
|
|
|
<view class="tips" v-show="regErr">{{errMsg}}</view> |
|
|
|
<button class="login_submit" :disabled="isReg" @click="Reg()">REGISTER</button> |
|
|
|
<view class="agreement"> |
|
|
|
<image src="../../static/img/select2.png" mode="" class="agreement_image"></image> |
|
|
|
<view class=""> |
|
|
|
<image src="../../static/img/select2.png" mode="" class="agreement_image" @click="regSelect=!regSelect" v-show="!regSelect"></image> |
|
|
|
<image src="../../static/img/select1.png" mode="" class="agreement_image" @click="regSelect=!regSelect" v-show="regSelect"></image> |
|
|
|
<view class="agreement_right"> |
|
|
|
by continuong, you agree to be <text class="text"> terms of use </text> and <text class="text"> privacy policy</text>. |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -42,19 +44,42 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<uni-popup ref="alertDialog" type="dialog"> |
|
|
|
<uni-popup-dialog type="error" cancelText="Close" confirmText="Activation" title="Tips" content="Please activate the mailbox first" |
|
|
|
@confirm="dialogConfirm" ></uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {defaultRequest} from '../../api/index.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
items: ['SIGN IN', 'REGISTER'], |
|
|
|
current: 0, |
|
|
|
dynamicFormData:{ |
|
|
|
loginDate:{ |
|
|
|
username:'', |
|
|
|
password:'', |
|
|
|
_action:'loginbyun' |
|
|
|
}, |
|
|
|
regDate:{ |
|
|
|
username:'', |
|
|
|
email:'', |
|
|
|
pwd:'' |
|
|
|
password1:'', |
|
|
|
password2:'', |
|
|
|
_action:'registerun' |
|
|
|
}, |
|
|
|
// 是否填写完成信息 |
|
|
|
isLogin:true, |
|
|
|
isReg:true, |
|
|
|
// 是否勾选 |
|
|
|
regSelect:false, |
|
|
|
loginSelect:false, |
|
|
|
// 是否显示错误信息 |
|
|
|
loginErr:false, |
|
|
|
regErr:false, |
|
|
|
errMsg:'The email address or password you enterde is incorrect.', |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
@ -62,8 +87,87 @@ |
|
|
|
if (this.current != e.currentIndex) { |
|
|
|
this.current = e.currentIndex; |
|
|
|
} |
|
|
|
}, |
|
|
|
//获取页面配置 |
|
|
|
configuration(){ |
|
|
|
let data={_action:'getpagedata',pagecode:'PAGE-LOGIN'} |
|
|
|
defaultRequest(data).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 登录 |
|
|
|
login(){ |
|
|
|
if(!this.loginSelect){ |
|
|
|
this.errMsg='Please read and tick the terms of service and privacy policy first.' |
|
|
|
this.loginErr=true |
|
|
|
return |
|
|
|
} |
|
|
|
defaultRequest(this.loginDate).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
if(res.error==0){ |
|
|
|
this.loginErr=false |
|
|
|
|
|
|
|
}else{ |
|
|
|
if(res.data){ |
|
|
|
this.$refs.alertDialog.open() |
|
|
|
}else{ |
|
|
|
this.loginErr=true |
|
|
|
this.errMsg=res.message |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
dialogConfirm(){ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'verifyEmail?email='+this.loginDate.username |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 注册 |
|
|
|
Reg(){ |
|
|
|
if(!this.regSelect){ |
|
|
|
uni.showToast({ |
|
|
|
title:'请先同意并勾选用户协议', |
|
|
|
icon:'none', |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.regDate.password2=this.regDate.password1 |
|
|
|
defaultRequest(this.regDate).then(res=>{ |
|
|
|
console.info(res) |
|
|
|
if(res.error==0){ |
|
|
|
this.regErr=false |
|
|
|
uni.showToast({ |
|
|
|
title:'注册成功', |
|
|
|
icon:'success', |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.regErr=true |
|
|
|
this.errMsg=res.message |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 验证是否填写登录信息 |
|
|
|
verificationLogin(){ |
|
|
|
if(this.loginDate.username && this.loginDate.password){ |
|
|
|
this.isLogin=false |
|
|
|
}else{ |
|
|
|
this.isLogin=true |
|
|
|
} |
|
|
|
}, |
|
|
|
// 验证是否填写注册信息 |
|
|
|
verificationReg(){ |
|
|
|
if(this.regDate.username && this.regDate.password1 && this.regDate.email){ |
|
|
|
this.isReg=false |
|
|
|
}else{ |
|
|
|
this.isReg=true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.configuration() |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -126,4 +230,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.agreement_right{ |
|
|
|
width: 582rpx; |
|
|
|
} |
|
|
|
</style> |