第一次提交
This commit is contained in:
53
Seting/pages/index/index.scss
Normal file
53
Seting/pages/index/index.scss
Normal file
@@ -0,0 +1,53 @@
|
||||
.seting-body{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
padding: 15rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
.seting-footer{
|
||||
position: absolute;
|
||||
bottom: env(safe-area-inset-bottom);
|
||||
text-align: center;
|
||||
width: 100vw;
|
||||
.seting-footer-button{
|
||||
width: 464rpx;
|
||||
height: 80rpx;
|
||||
background: #F83D3D;
|
||||
box-shadow: 0rpx 3rpx 2rpx 0rpx rgba(13,13,13,0.0118);
|
||||
border-radius: 60rpx 60rpx 60rpx 60rpx;
|
||||
opacity: 1;
|
||||
color: #FFFFFF;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
.cell-container{
|
||||
margin-top: 25rpx;
|
||||
background-color: #ffffff;
|
||||
width: 100%;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132,132,132,0.05);
|
||||
// padding: 16rpx;
|
||||
box-sizing: border-box;
|
||||
.cell-item:last-child{
|
||||
border: 0rpx;
|
||||
}
|
||||
.cell-item{
|
||||
.cell-label{
|
||||
|
||||
font-size: 34rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.cell-value{
|
||||
text-align: right;
|
||||
color: #999999;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
border-bottom: solid 1rpx #F0F0F0;
|
||||
padding: 26rpx;
|
||||
}
|
||||
|
||||
}
|
||||
75
Seting/pages/index/index.vue
Normal file
75
Seting/pages/index/index.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<view class="seting-body">
|
||||
<view class="cell-container">
|
||||
<view class="cell-item flex ac">
|
||||
<view class="cell-label">头像</view>
|
||||
<view class="cell-value oneflex">
|
||||
<image style="width: 60rpx;height: 60rpx;border-radius: 20rpx;" :src="user.headPhoto"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-item flex">
|
||||
<view class="cell-label">账号</view>
|
||||
<view class="cell-value oneflex">
|
||||
{{user.username}}
|
||||
<uni-icons type="right" size="20" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell-item flex">
|
||||
<view class="cell-label">昵称</view>
|
||||
<view class="cell-value oneflex">
|
||||
{{user.name}}
|
||||
<uni-icons type="right" size="20" color="#999999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="cell-container">
|
||||
<view class="cell-item flex ac">
|
||||
<view class="cell-label">版本号</view>
|
||||
<view class="cell-value oneflex">1.0.0</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="seting-footer flex jc">
|
||||
<view @click="OUT" class="seting-footer-button flex ac jc">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import loginApi from '@/api/login.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: uni.getStorageSync('user'),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
loginOut() {
|
||||
loginApi.logoutAuthSystem().then((res) => {
|
||||
if (res.code === 20000) {
|
||||
uni.clearStorage();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/index'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
OUT() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '确认要退出登录吗?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.loginOut();
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import 'index.scss';
|
||||
</style>
|
||||
156
Seting/pages/setingAccount/setingAccount.vue
Normal file
156
Seting/pages/setingAccount/setingAccount.vue
Normal file
@@ -0,0 +1,156 @@
|
||||
<!-- 修改密码 -->
|
||||
<template>
|
||||
<view class="setingAccount-body">
|
||||
<view class="form-container">
|
||||
<view class="form-item">
|
||||
<view class="form-item-label">
|
||||
请输入旧密码
|
||||
</view>
|
||||
<view class="form-item-content">
|
||||
<uni-easyinput v-model="form.pwd" type="password" placeholder="请输入旧密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-item-label">
|
||||
请输入新密码
|
||||
</view>
|
||||
<view class="form-item-content">
|
||||
<uni-easyinput v-model="form.pwd1" type="password" placeholder="请输入新密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="form-item-label">
|
||||
确认密码
|
||||
</view>
|
||||
<view class="form-item-content">
|
||||
<uni-easyinput v-model="form.pwd2" type="password" placeholder="请再次确认密码" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="seting-footer flex jc">
|
||||
<view @click="save" class="seting-footer-button flex ac jc">确定</view>
|
||||
<!-- <button type="primary" @tap="save">保存</button> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import md5 from 'js-md5'
|
||||
// import userApi from "@/api/user-service/user.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save(){
|
||||
let that = this
|
||||
if(!that.form.pwd){
|
||||
uni.showToast({
|
||||
title: '请输入旧密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(!that.form.pwd1){
|
||||
uni.showToast({
|
||||
title: '请输入新密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
if(!that.form.pwd2){
|
||||
uni.showToast({
|
||||
title: '请输入确认新密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(that.form.pwd1!==that.form.pwd2){
|
||||
uni.showToast({
|
||||
title: '两次输入新密码不一致!',
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
userId:uni.getStorageSync('loginUser').user.userId,
|
||||
password:md5(this.form.pwd1),
|
||||
oldPassword:md5(this.form.pwd)
|
||||
}
|
||||
userApi.resetPwd(data).then(res=>{
|
||||
if(res.code===20000){
|
||||
// uni.navigateBack()
|
||||
uni.showToast({
|
||||
title:'修改成功',
|
||||
icon:'none',
|
||||
success() {
|
||||
setTimeout(()=>{
|
||||
uni.reLaunch({
|
||||
url:'/pages/login/index'
|
||||
})
|
||||
},2000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '../index/index.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
.form-item{
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
.form-item-label{
|
||||
|
||||
font-size: 32rpx;
|
||||
color: #000000;
|
||||
}
|
||||
::v-deep .uni-easyinput__content{
|
||||
background-color: #FAFAFA !important;
|
||||
|
||||
font-size: 28rpx !important;
|
||||
}
|
||||
::v-deep .uni-easyinput__content-input{
|
||||
height: 104rpx !important;
|
||||
font-size: 28rpx !important;
|
||||
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx !important;
|
||||
}
|
||||
::v-deep .is-input-border{
|
||||
border:0rpx !important;
|
||||
}
|
||||
.setingAccount-body{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 15rpx;
|
||||
}
|
||||
.form-item-content{
|
||||
margin-top: 38rpx;
|
||||
width: 100%;
|
||||
height: 104rpx;
|
||||
background: #FAFAFA;
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
opacity: 1;
|
||||
}
|
||||
.form-container{
|
||||
width: 100%;
|
||||
/* height: 644rpx; */
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(132,132,132,0.05);
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
opacity: 1;
|
||||
box-sizing: border-box;
|
||||
padding: 50rpx 35rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user