451 lines
9.2 KiB
Vue
451 lines
9.2 KiB
Vue
<template>
|
|
<Layout :index="-1" :banner="0" :img="'/'" :titles="'登录'" :title_content="'登录'">
|
|
<view class="bg d-b-c">
|
|
<view class="bgl d-c-c">
|
|
<image class="limg" src="../static/img/login/bgl.png" ></image>
|
|
</view>
|
|
<view class="bgr d-b-c d-c">
|
|
<view class="ftitle">重置密码</view>
|
|
|
|
<view class="input-wrap" >
|
|
<view class="login_input" v-if="l_type==1">
|
|
<image src="../static/img/login/phone.png" mode="widthFix" class="icons"></image>
|
|
<input class="linput" v-model="formData.mobile" type="text" placeholder="请输入注册手机号" maxlength="16" placeholder-class="placeholder-class" >
|
|
</view>
|
|
<view class="login_code" v-if="l_type==1">
|
|
<image src="../static/img/login/yzicon.png" mode="widthFix" class="icons"></image>
|
|
<input class="linput2" v-model="formData.code" type="text" placeholder="请输入手机验证码" maxlength="8" placeholder-class="placeholder-class" />
|
|
<view class="dynacode" @click="sendMobileCode">{{dynacodeData.codeText }}</view>
|
|
</view>
|
|
<view class="login_input" v-if="l_type==2">
|
|
<image src="../static/img/login/licon.png" mode="widthFix" class="icons"></image>
|
|
<el-input class="minput" placeholder="请输入新密码" v-model="formData.password" placeholder-class="placeholder-class" show-password></el-input>
|
|
</view>
|
|
|
|
<view class="login_input" v-if="l_type==2">
|
|
<image src="../static/img/login/licon.png" mode="widthFix" class="icons"></image>
|
|
<el-input class="minput" placeholder="请再次输入新密码" v-model="formData.rpassword" placeholder-class="placeholder-class" show-password></el-input>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="login_bt" @tap="check(2)" v-if="l_type==1">
|
|
重置密码
|
|
</view>
|
|
<view class="login_bt" @tap="doforget()" v-if="l_type==2">
|
|
重置密码
|
|
</view>
|
|
<view class="d-b-c gourls" >
|
|
<view class="go_login" @tap="gologin()" v-if="l_type==1">返回登录</view>
|
|
<view class="go_login" @tap="gob()" v-if="l_type==2">返回上一页</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</Layout>
|
|
</template>
|
|
|
|
<script>
|
|
import Layout from './part/layoutNoh.vue';
|
|
export default {
|
|
components:{
|
|
Layout
|
|
},
|
|
data(){
|
|
return {
|
|
page: 1,
|
|
list_rows: 10,
|
|
listData: [],
|
|
total: 0,
|
|
detail: [],
|
|
nextdetail: [],
|
|
id: '',
|
|
category_id:2,
|
|
checkeds:false,
|
|
checked:true,
|
|
formData:[],
|
|
dynacodeData: {
|
|
seconds: 120,
|
|
timer: null,
|
|
codeText: '发送验证码',
|
|
isSend: false
|
|
},
|
|
l_type:1
|
|
}
|
|
},
|
|
created() {
|
|
},
|
|
onShow() {
|
|
this.l_type = 1;
|
|
this.formData = [];
|
|
},
|
|
watch: {
|
|
'dynacodeData.seconds': {
|
|
handler(newValue, oldValue) {
|
|
if (newValue == 0) {
|
|
clearInterval(this.dynacodeData.timer);
|
|
this.dynacodeData = {
|
|
seconds: 120,
|
|
timer: null,
|
|
codeText: '获取验证码',
|
|
isSend: false
|
|
};
|
|
}
|
|
},
|
|
immediate: true,
|
|
deep: true
|
|
}
|
|
},
|
|
methods:{
|
|
gob(){
|
|
this.l_type=1;
|
|
},
|
|
check(e){
|
|
if(!this.formData.mobile){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入手机号',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(!this.formData.code){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入手机验证码',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
this.l_type=e;
|
|
},
|
|
gologin(){
|
|
this.$router.replace({
|
|
path: 'login'
|
|
});
|
|
},
|
|
|
|
select(){
|
|
if(this.checked==true){
|
|
this.checked=false;
|
|
}else{
|
|
this.checked=true;
|
|
}
|
|
},
|
|
selects(){
|
|
if(this.checkeds==true){
|
|
this.checkeds=false;
|
|
}else{
|
|
this.checkeds=true;
|
|
}
|
|
},
|
|
active(e){
|
|
const path = this.$route.path;
|
|
// const query = this.$route.query;
|
|
if(path=='/'+e.url){
|
|
return;
|
|
}
|
|
if(e.url.includes("http")){
|
|
window.open(e.url, '_blank');
|
|
// window.location.href = '';
|
|
}
|
|
else{
|
|
this.$router.replace({
|
|
path: e.url
|
|
});
|
|
}
|
|
},
|
|
sendMobileCode(){
|
|
if(this.checked==false){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请同意用户协议',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(!this.formData.mobile){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入手机号',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
|
|
this._post('user.Useropen/sendCode',{
|
|
mobile: this.formData.mobile,
|
|
type: 'login',
|
|
},res=>{
|
|
this.dynacodeData.timer = setInterval(() => {
|
|
this.dynacodeData.seconds--;
|
|
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后重发';
|
|
}, 1000);
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '发送成功',
|
|
duration:1500
|
|
})
|
|
}
|
|
,err=>{
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: err.data.msg
|
|
})
|
|
return;
|
|
// this.$message(err.data.msg);
|
|
}
|
|
);
|
|
},
|
|
doforget(){
|
|
if(this.checked==false){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请同意用户协议',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(this.formData.mobile==''){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入手机号',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(this.formData.code==''){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入手机验证码',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(this.formData.password==''){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请输入新密码',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(this.formData.rpassword==''){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '请再次输入新密码',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
|
|
if(this.formData.rpassword!=this.formData.password){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '两次密码不一致',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
if(this.formData.password.length<6){
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '密码不得少于6位',
|
|
duration:1500
|
|
})
|
|
return;
|
|
}
|
|
|
|
|
|
this._post('user.Useropen/resetpassword',{
|
|
mobile: this.formData.mobile,
|
|
password: this.formData.password,
|
|
code: this.formData.code,
|
|
},res=>{
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: '重置成功',
|
|
duration:1500
|
|
})
|
|
setTimeout(() => {
|
|
this.$router.replace({
|
|
path: 'login'
|
|
});
|
|
}, 2000);
|
|
|
|
}
|
|
,err=>{
|
|
uni.showToast({
|
|
icon:'none',
|
|
title: err.data.msg
|
|
})
|
|
return;
|
|
// this.$message(err.data.msg);
|
|
}
|
|
);
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.bg{
|
|
width: 1920px;
|
|
height: 100vh;
|
|
background-image: url('../static/img/login/bgs.png');
|
|
background-size: 100% 100%;
|
|
}
|
|
.bgl ,.bgr{
|
|
width: 50%;
|
|
}
|
|
.bgl .limg{
|
|
width: 752px;
|
|
height: 760px;
|
|
}
|
|
.logo_img{
|
|
width: 471px;
|
|
height: 66px;
|
|
margin-bottom: 54px;
|
|
}
|
|
.input-wrap{
|
|
min-height: 152px;
|
|
}
|
|
.login_input{
|
|
width: 468px;
|
|
height: 54px;
|
|
border-radius: 8px 8px 8px 8px;
|
|
border: 1px solid rgba(102,102,102,0.35);
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 26px;
|
|
// padding: 0 20px;
|
|
}
|
|
.login_code{
|
|
width: 468px;
|
|
height: 56px;
|
|
border-radius: 8px 8px 8px 8px;
|
|
border: 1px solid rgba(102,102,102,0.35);
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 26px;
|
|
}
|
|
.icons{
|
|
width: 24px;
|
|
height: 24px;
|
|
margin-left: 20px;
|
|
}
|
|
|
|
.placeholder-class{
|
|
font-size: 18px;
|
|
color: #939393; /* 你想要的颜色 */
|
|
line-height: 56px;
|
|
}
|
|
.placeholder-class::placeholder {
|
|
color: red; /* 你想要的颜色 */
|
|
}
|
|
|
|
.linput{
|
|
width: 80%;
|
|
height: 54px;
|
|
display: flex;
|
|
align-items: center;
|
|
margin-top: 2px;
|
|
margin-left: 4px;
|
|
font-size: 16px;
|
|
}
|
|
.linput2{
|
|
width: 60%;
|
|
height: 54px;
|
|
display: flex;
|
|
align-items: center;
|
|
margin-top: 2px;
|
|
margin-left: 4px;
|
|
font-size: 16px;
|
|
}
|
|
.minput{
|
|
width: 87% !important;
|
|
height: 54px !important;
|
|
display: flex;
|
|
align-items: center;
|
|
margin-top: 2px;
|
|
margin-left: 4px;
|
|
font-size: 16px;
|
|
}
|
|
.dynacode{
|
|
width: 154px;
|
|
height: 56px;
|
|
background-image: url('../static/img/login/yzbg.png');
|
|
background-size: 100% 100%;
|
|
text-align: center;
|
|
font-size: 16px;
|
|
color: #3B3B3B;
|
|
line-height: 56px;
|
|
cursor: pointer;
|
|
}
|
|
::v-deep .el-input__inner{
|
|
background-color: transparent !important;
|
|
border: none !important;
|
|
padding: 0 !important;
|
|
font-size: 18px;
|
|
color: #939393; /* 你想要的颜色 */
|
|
line-height: 56px;
|
|
}
|
|
::v-deep .uni-radio-input{
|
|
border-radius: unset !important;
|
|
}
|
|
.login_checks{
|
|
font-size: 14px;
|
|
color: #3D3D3D;
|
|
}
|
|
.login_bt{
|
|
width: 468px;
|
|
height: 64px;
|
|
background: #F78A30;
|
|
border-radius: 8px 8px 8px 8px;
|
|
color: #ffffff;
|
|
text-align: center;
|
|
line-height: 64px;
|
|
font-weight: 500;
|
|
font-size: 22px;
|
|
margin-top: 42px;
|
|
cursor: pointer;
|
|
}
|
|
.gourls{
|
|
width: 468px;
|
|
margin-top: 22px;
|
|
}
|
|
.go_login{
|
|
text-align: left;
|
|
font-weight: 400;
|
|
font-size: 16px;
|
|
color: #3D3D3D;
|
|
cursor: pointer;
|
|
}
|
|
.go_forget{
|
|
font-weight: 400;
|
|
font-size: 16px;
|
|
color: #3D3D3D;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.login_type{
|
|
display: flex;
|
|
width: 49%;
|
|
margin-bottom: 44px;
|
|
}
|
|
|
|
.check{
|
|
color: #FF8622;
|
|
border-bottom: 2px solid #FF8622;
|
|
}
|
|
.ftitle{
|
|
font-weight: 400;
|
|
font-size: 24px;
|
|
color: #3B3B3B;
|
|
margin-bottom: 60px;
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|