13 changed files with 333 additions and 10 deletions
@ -0,0 +1,78 @@
|
||||
<template> |
||||
<view> |
||||
<view class="card"> |
||||
<input type="number" v-model="form.tel" placeholder="请输入账号" /> |
||||
</view> |
||||
<view class="card"> |
||||
<input type="password" v-model="form.old_password" placeholder="请输入旧密码" /> |
||||
</view> |
||||
<view class="card"> |
||||
<input type="password" v-model="form.new_password" placeholder="请输入新密码" /> |
||||
</view> |
||||
<view class="card"> |
||||
<input type="password" v-model="form.algin_pasd" placeholder="请再次输入新密码" /> |
||||
</view> |
||||
<view class="btn-div"> |
||||
<button :disabled="form.old_password&&form.new_password&&form.algin_pasd?false:true" type="primary" @tap="subMitBtn()" >确认修改</button> |
||||
</view> |
||||
|
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import {modifyPassword} from "../../api/user.js" |
||||
export default { |
||||
data() { |
||||
return { |
||||
form:{ |
||||
old_password:'', |
||||
new_password:'', |
||||
algin_pasd:'', |
||||
tel:'' |
||||
} |
||||
}; |
||||
},methods:{ |
||||
subMitBtn(){ |
||||
if(this.form.new_password!=this.form.algin_pasd){ |
||||
this.$functions.error("两次密码不一致,请重新输入"); |
||||
this.form.new_password=''; |
||||
this.form.algin_pasd='' |
||||
return false; |
||||
} |
||||
let parm={ |
||||
tel:this.form.tel, |
||||
password:this.form.new_password |
||||
} |
||||
modifyPassword(parm).then(res=>{ |
||||
this.$functions.success("修改成功").then(()=>{ |
||||
uni.navigateTo({ |
||||
url: '../login/login', |
||||
success: res => {}, |
||||
fail: () => {}, |
||||
complete: () => {} |
||||
}); |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.card{ |
||||
@include wh(750upx,auto); |
||||
padding-top: 30upx; |
||||
padding-bottom: 30upx; |
||||
background: white; |
||||
border-bottom: 2upx solid #f5f5f5; |
||||
input{ |
||||
margin-left: 30upx; |
||||
} |
||||
} |
||||
.btn-div{ |
||||
width: 690upx; |
||||
margin: auto; |
||||
margin-top: 30upx; |
||||
|
||||
} |
||||
</style> |
@ -0,0 +1,59 @@
|
||||
.bg{ |
||||
@include wh(750upx,auto); |
||||
padding-top: 30upx; |
||||
padding-bottom: 30upx; |
||||
background: #008EBC; |
||||
|
||||
.user-info{ |
||||
@include flex(center,flex-start); |
||||
} |
||||
image{ |
||||
@include wh(120upx,120upx); |
||||
border-radius: 50%; |
||||
margin-left: 30upx; |
||||
} |
||||
view{ |
||||
@include fonts(28upx,#fff,500); |
||||
margin-left: 20upx; |
||||
} |
||||
} |
||||
|
||||
.list{ |
||||
@include wh(690upx,auto); |
||||
margin: auto; |
||||
@include flex(center,space-between); |
||||
padding: 30upx; |
||||
border-bottom: 2upx solid #f5f5f5; |
||||
background: white; |
||||
.next-icon{ |
||||
@include wh(28upx,33upx); |
||||
} |
||||
.left{ |
||||
width:400upx; |
||||
@include flex(center,flex-start); |
||||
.grzl{ |
||||
@include wh(45upx,45upx); |
||||
} |
||||
.xgmi{ |
||||
@include wh(39upx,45upx); |
||||
} |
||||
.yjfk{ |
||||
@include wh(39upx,45upx); |
||||
} |
||||
view{ |
||||
@include fonts(28upx,#333,500); |
||||
margin-left: 10upx; |
||||
} |
||||
} |
||||
.right{ |
||||
@include flex(center,flex-start); |
||||
text{ |
||||
font-size: 26upx; |
||||
} |
||||
} |
||||
|
||||
} |
||||
.logout{ |
||||
@include wh(690upx); |
||||
margin-top: 400upx; |
||||
} |
@ -0,0 +1,82 @@
|
||||
<template> |
||||
<view> |
||||
<view class="bg"> |
||||
<view class="user-info"> |
||||
<image src="../../static/def.jpg" mode=""></image> |
||||
<view @tap="login()" v-if="!userInfo.name">未登录,去登录</view> |
||||
<view v-else>欢迎您!{{userInfo.name}}</view> |
||||
</view> |
||||
</view> |
||||
<view> |
||||
<view class="list" @tap="editPsd()"> |
||||
<view class="left"> |
||||
<image class="xgmi" src="../../static/xg.png" mode=""></image> |
||||
<view>修改密码</view> |
||||
</view> |
||||
<image class="next-icon" src="../../static/next.png"></image> |
||||
</view> |
||||
</view> |
||||
<button class="logout" type="primary" v-if="userInfo.name" @tap="logout">退出登录</button> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapGetters, mapMutations } from 'vuex'; |
||||
import {authSee} from "../../api/user.js" |
||||
export default { |
||||
computed: { |
||||
...mapGetters(['userInfo', 'roleType']) |
||||
|
||||
}, |
||||
onShow() { |
||||
|
||||
}, |
||||
onLoad() { |
||||
this.getRz() |
||||
}, |
||||
data() { |
||||
return { |
||||
status:0, |
||||
ifJump:0, |
||||
}; |
||||
},methods:{ |
||||
...mapMutations(['setToken', 'setUserInfo']), |
||||
smrz(){ |
||||
this.ifJump=1 |
||||
console.log("ss",this.ifJump) |
||||
this.getRz() |
||||
}, |
||||
|
||||
|
||||
editPsd(){ |
||||
uni.navigateTo({ |
||||
url: '../editePsd/editePsd', |
||||
success: res => {}, |
||||
fail: () => {}, |
||||
complete: () => {} |
||||
}); |
||||
}, |
||||
login(){ |
||||
uni.navigateTo({ |
||||
url: '../login/login', |
||||
success: res => {}, |
||||
fail: () => {}, |
||||
complete: () => {} |
||||
}); |
||||
}, |
||||
logout(){ |
||||
this.$functions.confirm("是否确认退出登录").then(()=>{ |
||||
this.setToken(""); |
||||
this.setUserInfo({}); |
||||
uni.reLaunch({ |
||||
url:"../login/login" |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "./index.scss" |
||||
</style> |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.8 KiB |
Loading…
Reference in new issue