|
|
- <template>
- <view class="container">
- <!-- 用户信息 -->
- <view class="user-info">
- <text class="username">李晓春</text>
- </view>
-
- <!-- 功能列表 -->
- <view class="menu">
- <view class="menu-item" >
- <image class="arrow" src="/static/arrow-right.png"></image>
- <text>关于我们</text>
- </view>
- <view class="menu-item" >
- <image class="arrow" src="/static/arrow-right.png"></image>
- <text>修改密码</text>
- </view>
- <view class="menu-item">
- <image class="arrow" src="/static/arrow-right.png"></image>
- <text>服务协议</text>
- </view>
- <view class="menu-item" >
- <image class="arrow" src="/static/arrow-right.png"></image>
- <text>隐私政策</text>
- </view>
- <view class="menu-item" @click="logout">
- <image class="arrow" src="/static/arrow-right.png"></image>
- <text>退出登录</text>
- </view>
- </view>
-
- </view>
- </template>
-
- <script>
- export default {
- methods: {
- logout() {
- uni.showModal({
- title: '提示',
- content: '确定要退出登录吗?',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({
- title: '退出登录成功',
- icon: 'success',
- success: () => {
- // 这里可以添加退出登录的逻辑,例如清除用户登录状态
- setTimeout(() => {
- uni.navigateTo({ url: '/pages/index/index' });
- }, 1500);
- }
- });
- }
- }
- });
- }
- }
- };
- </script>
-
- <style>
- .container {
- display: flex;
- flex-direction: column;
- height: 300vh;
- background-color: #f5f5f5;
- }
-
- .user-info {
- padding: 20px;
- height: 200px;
- background-color: #007aff;
- color: #fff;
- text-align: center;
- }
-
- .username {
- font-size: 20px;
- font-weight: bold;
- margin: 0 auto;
- line-height: 200px;
- }
-
- .menu {
- flex: 1;
- padding: 20px;
- background-color: #fff;
- }
-
- .menu-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 15px 0;
- border-bottom: 1px solid #eee;
- }
-
- .menu-item text {
- font-size: 16px;
- }
-
- .arrow {
- width: 20px;
- height: 20px;
- }
-
- .footer {
- display: flex;
- justify-content: space-around;
- padding: 10px;
- background-color: #fff;
- border-top: 1px solid #ccc;
- }
-
- .nav-item {
- text-align: center;
- }
-
- .nav-item text {
- font-size: 14px;
- }
- </style>
|