Files
tk-mini-program/pages/Mine/Mine.vue
pengxiaolong cf8728f0d7 优化页面
2025-05-27 13:06:24 +08:00

110 lines
2.0 KiB
Vue

<template>
<view class="container">
<view class="PersonalInformation">
<view class="header">
<image :src="userinfo.headerIcon" mode="scaleToFill" class="headerIcon" />
</view>
<view>
<view class="name">{{ userinfo.nickName }}</view>
</view>
<view class="Settings" @click="goSetting">
<image class="SettingsIcon" src="../../static/Settings.png" mode="scaleToFill" />
</view>
</view>
<view>
<view class="logout" @click="logout">退出登录</view>
</view>
</view>
<view class="tabBar">
<tabBar></tabBar>
</view>
</template>
<script>
import tabBar from "../../components/tabBar/tabBar";
export default {
data() {
return {
userinfo: {},
};
},
onShow() {
uni.getStorage({
key: "userinfo",
success: (res) => {
this.userinfo = res.data;
},
});
},
methods: {
goSetting() {
uni.navigateTo({
url: "/pages/Setting/Setting",
});
},
logout() {
uni.removeStorage({
key: "chatInfo",
});
uni.removeStorage({
key: "userinfo",
});
uni.removeStorage({
key: "userSig",
});
uni.removeStorage({
key: "lastPage",
});
uni.reLaunch({
url: "/pages/login/login",
});
}
},
components: {
tabBar,
},
};
</script>
<style scoped>
.container {
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: 100%;
background: linear-gradient(to bottom, #11cb2a6e, #2574fc6d);
}
.PersonalInformation {
margin-top: 200rpx;
display: flex;
align-items: center;
width: 100%;
}
.header {
background: #ffffff;
margin-left: 50rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.headerIcon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
}
.name {
margin-left: 30rpx;
}
.Settings {
margin-left: 370rpx;
width: 50rpx;
height: 50rpx;
}
.SettingsIcon {
width: 50rpx;
height: 50rpx;
}
</style>