|
@@ -17,7 +17,7 @@
|
|
|
<view class="content" v-if="tabCurrentIndex === 1">
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input">
|
|
|
- <input type="number" v-model="mobile" maxlength="11" class="input" placeholder="请输入手机号" placeholder-class="placeholder"/>
|
|
|
+ <input type="number" v-model="phoneParams.mobileOrEmail" maxlength="11" class="input" placeholder="请输入手机号" placeholder-class="placeholder"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
@@ -36,7 +36,7 @@
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input code">
|
|
|
- <input type="number" v-model="mobileCode" maxlength="6" class="input" placeholder="请输入短信验证码" placeholder-class="placeholder"/>
|
|
|
+ <input type="number" v-model="phoneParams.smsCode" maxlength="6" class="input" placeholder="请输入短信验证码" placeholder-class="placeholder"/>
|
|
|
</view>
|
|
|
<view class="login-input btn" :class="[isMobileDisabled ? 'disabled' : '']" >
|
|
|
<button type="button"
|
|
@@ -49,15 +49,15 @@
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input pwd">
|
|
|
- <input v-show="isShowEye" type="text" v-model="password" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
- <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="isShowEye" type="text" v-model="phoneParams.password" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="!isShowEye" type="password" v-model="phoneParams.password" :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
<view class="iconfont" :class="isShowEye ? 'icon-kejian1' : 'icon-bukejian'" @click="passwordEye"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input pwd">
|
|
|
- <input v-show="isShowEyes" type="text" v-model="passwordCheck" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
- <input v-show="!isShowEyes" type="password" v-model="passwordCheck" :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="isShowEyes" type="text" v-model="phoneParams.passwordConfirm" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="!isShowEyes" type="password" v-model="phoneParams.passwordConfirm" :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
<view class="iconfont" :class="isShowEyes ? 'icon-kejian1' : 'icon-bukejian'" @click="passwordEyes"></view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -69,12 +69,12 @@
|
|
|
<view class="content" v-else>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input">
|
|
|
- <input class="input" type="text" v-model="email" maxlength="30" placeholder="请输入邮箱地址" placeholder-class="placeholder"/>
|
|
|
+ <input class="input" type="text" v-model="emailParams.mobileOrEmail" maxlength="30" placeholder="请输入邮箱地址" placeholder-class="placeholder"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input code">
|
|
|
- <input class="input" type="number" v-model="emailCode" maxlength="4" placeholder="请输入邮箱验证码" placeholder-class="placeholder"/>
|
|
|
+ <input class="input" type="number" v-model="emailParams.smsCode" maxlength="6" placeholder="请输入邮箱验证码" placeholder-class="placeholder"/>
|
|
|
</view>
|
|
|
<view class="login-input btn" :class="[isEmialDisabled ? 'disabled' : '']">
|
|
|
<button class="input"
|
|
@@ -87,15 +87,15 @@
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input pwd">
|
|
|
- <input v-show="isShowEye" type="text" v-model="password" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
- <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="isShowEye" type="text" v-model="emailParams.password" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="!isShowEye" type="password" v-model="emailParams.password" :password="true" maxlength="16" class="input" placeholder="请输入新密码,必须为8-16位字母数字的组合" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
<view class="iconfont" :class="isShowEye ? 'icon-kejian1' : 'icon-bukejian'" @click="passwordEye"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="login-form clearfix">
|
|
|
<view class="login-input pwd">
|
|
|
- <input v-show="isShowEyes" type="text" v-model="passwordCheck" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
- <input v-show="!isShowEyes" type="password" v-model="passwordCheck" :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="isShowEyes" type="text" v-model="emailParams.passwordConfirm" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
+ <input v-show="!isShowEyes" type="password" v-model="emailParams.passwordConfirm" :password="true" maxlength="16" class="input" placeholder="请确认密码" autocomplete="new-password" placeholder-class="placeholder"/>
|
|
|
<view class="iconfont" :class="isShowEyes ? 'icon-kejian1' : 'icon-bukejian'" @click="passwordEyes"></view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -108,19 +108,11 @@
|
|
|
|
|
|
<script>
|
|
|
import authorize from '@/common/config/authorize.js'
|
|
|
- import { mobilePassword , emailPassword } from "@/api/use.js"
|
|
|
- import { getEmailCode } from "@/api/utils.js"
|
|
|
|
|
|
export default{
|
|
|
data() {
|
|
|
return{
|
|
|
tabCurrentIndex: 1,
|
|
|
- mobile:'', //用户手机号
|
|
|
- email:'', //邮箱地址
|
|
|
- emailCode:'', //油箱验证码
|
|
|
- mobileCode:'', //手机验证码
|
|
|
- password:'', //新密码
|
|
|
- passwordCheck:'', //二次校验新密码
|
|
|
isShowEye:false, //控显
|
|
|
isShowEyes:false, //控显
|
|
|
iconEyes:'icon-yanjing_yincang_o',
|
|
@@ -134,6 +126,20 @@
|
|
|
emailCodeText: '获取验证码',
|
|
|
mobileCodeText: '获取验证码',
|
|
|
codeTime: null,
|
|
|
+ phoneParams: {
|
|
|
+ mobileOrEmail :'',
|
|
|
+ smsCode : '',
|
|
|
+ password : '',
|
|
|
+ passwordConfirm : '',
|
|
|
+ status:1
|
|
|
+ },
|
|
|
+ emailParams: {
|
|
|
+ mobileOrEmail :'',
|
|
|
+ smsCode : '',
|
|
|
+ password : '',
|
|
|
+ passwordConfirm : '',
|
|
|
+ status:2
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -141,15 +147,40 @@
|
|
|
},
|
|
|
methods:{
|
|
|
confirmMobilePassword(){//手机号修改
|
|
|
- let params = {
|
|
|
- mobileOrEmail : this.mobile,
|
|
|
- activateCode : this.mobileCode,
|
|
|
- passWord : this.password,
|
|
|
- confirmPwd : this.passwordCheck,
|
|
|
- status:1
|
|
|
- }
|
|
|
- mobilePassword(params).then(res =>{
|
|
|
- this.$util.msg(res.msg,2000);
|
|
|
+ if( this.phoneParams.mobileOrEmail == ''){
|
|
|
+ this.$util.msg('请输入手机号',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
|
|
|
+ this.$util.msg('手机格式不正确',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.phoneParams.smsCode == ''){
|
|
|
+ this.$util.msg('请输入手机验证码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.isMobileCode(this.phoneParams.smsCode)){
|
|
|
+ this.$util.msg('验证码格式不正确',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.phoneParams.password == ''){
|
|
|
+ this.$util.msg('请输入密码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.checkPwd(this.phoneParams.password)){
|
|
|
+ this.$util.msg('密码必须为8-16位字母数字的组合',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.phoneParams.passwordConfirm == ''){
|
|
|
+ this.$util.msg('请再次确认密码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.phoneParams.passwordConfirm !== this.phoneParams.password){
|
|
|
+ this.$util.msg('两次输入的密码不一致',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.UserService.ModifyMobilePassword(this.phoneParams).then(res =>{
|
|
|
+ this.$util.msg(res.msg,2000,true,'success')
|
|
|
setTimeout(()=>{
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
@@ -160,23 +191,48 @@
|
|
|
})
|
|
|
},
|
|
|
confirmEmailPassword(){//邮箱修改密码
|
|
|
- let params = {
|
|
|
- mobileOrEmail : this.email,
|
|
|
- activateCode : this.emailCode,
|
|
|
- passWord : this.password,
|
|
|
- confirmPwd : this.passwordCheck,
|
|
|
- status:2
|
|
|
- }
|
|
|
- emailPassword(params).then(res =>{
|
|
|
- this.$util.msg(res.msg,2000);
|
|
|
- setTimeout(()=>{
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1
|
|
|
- });
|
|
|
- },2000)
|
|
|
- }).catch( error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
- })
|
|
|
+ if( this.emailParams.mobileOrEmail == ''){
|
|
|
+ this.$util.msg('请输入邮箱',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
|
|
|
+ this.$util.msg('请输入正确的邮箱地址',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.emailParams.smsCode == ''){
|
|
|
+ this.$util.msg('请输入邮箱验证码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.isMobileCode(this.emailParams.smsCode)){
|
|
|
+ this.$util.msg('验证码格式不正确',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.emailParams.password == ''){
|
|
|
+ this.$util.msg('请输入密码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.$reg.checkPwd(this.emailParams.password)){
|
|
|
+ this.$util.msg('密码必须为8-16位字母数字的组合',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.emailParams.passwordConfirm == ''){
|
|
|
+ this.$util.msg('请再次确认密码',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if( this.emailParams.passwordConfirm !== this.emailParams.password){
|
|
|
+ this.$util.msg('两次输入的密码不一致',2000);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.UserService.ModifyMobilePassword(this.emailParams).then(res =>{
|
|
|
+ this.$util.msg(res.msg,2000,true,'success')
|
|
|
+ setTimeout(()=>{
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ });
|
|
|
+ },2000)
|
|
|
+ }).catch( error =>{
|
|
|
+ this.$util.msg(error.msg,2000);
|
|
|
+ })
|
|
|
},
|
|
|
getVerificationCode(){//图形验证
|
|
|
this.PublicService.GetImgVerifyCode().then(res => {
|
|
@@ -185,16 +241,16 @@
|
|
|
})
|
|
|
},
|
|
|
getEmailCodeFn(){//获取邮箱验证码
|
|
|
- if( this.email == ''){
|
|
|
+ if( this.emailParams.mobileOrEmail == ''){
|
|
|
this.$util.msg('请输入邮箱地址',2000);
|
|
|
return
|
|
|
}
|
|
|
- if(!this.$reg.isEmail(this.email)){
|
|
|
+ if(!this.$reg.isEmail(this.emailParams.mobileOrEmail)){
|
|
|
this.$util.msg('请输入正确的邮箱地址',2000);
|
|
|
return
|
|
|
}
|
|
|
this.isEmialDisabled = true;
|
|
|
- getEmailCode({email:this.email,status:3}).then(res =>{
|
|
|
+ this.PublicService.GetUserEmailCode({email:this.emailParams.mobileOrEmail,status:3}).then(res =>{
|
|
|
this.$util.msg('邮箱验证码已发送',2000);
|
|
|
const TIME_COUNT = 60;
|
|
|
if (!this.codeTime) {
|
|
@@ -218,11 +274,11 @@
|
|
|
})
|
|
|
},
|
|
|
getMobileCodeFn(){//获取手机验证码
|
|
|
- if( this.mobile == ''){
|
|
|
+ if( this.phoneParams.mobileOrEmail == ''){
|
|
|
this.$util.msg('请输入手机号',2000);
|
|
|
return
|
|
|
}
|
|
|
- if(!this.$reg.isMobile(this.mobile)){
|
|
|
+ if(!this.$reg.isMobile(this.phoneParams.mobileOrEmail)){
|
|
|
this.$util.msg('请输入正确的手机号',2000);
|
|
|
return
|
|
|
}
|
|
@@ -231,14 +287,14 @@
|
|
|
return
|
|
|
}
|
|
|
let params = {
|
|
|
- mobile:this.mobile,
|
|
|
+ mobile:this.phoneParams.mobileOrEmail,
|
|
|
activateCodeType:1,
|
|
|
platformType:2,
|
|
|
imgCode:this.imageCode,
|
|
|
token:this.imageCodetoken,
|
|
|
}
|
|
|
this.isMobileDisabled = true;
|
|
|
- this.PublicService.GetMobileCode(params).then(res =>{
|
|
|
+ this.PublicService.GetRegisterMobileCode(params).then(res =>{
|
|
|
this.$util.msg('验证短信已发送',2000);
|
|
|
const TIME_COUNT = 60;
|
|
|
if (!this.codeTime) {
|