第一次提交
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>
|
||||
Reference in New Issue
Block a user