odf_new/odf-uniapp/pages/settings/index.vue

126 lines
2.3 KiB
Vue

<template>
<view class="settings-page">
<image class="bg-image" src="/static/images/home_bg.png" mode="aspectFill" />
<view class="content">
<!-- 顶部导航栏 -->
<view class="nav-bar" :style="{ paddingTop: statusBarHeight + 'px' }">
<view class="nav-bar-inner">
<image
class="nav-icon"
src="/static/images/ic_back.png"
mode="aspectFit"
@click="goBack"
/>
<text class="nav-title">设置</text>
<view class="nav-icon-placeholder" />
</view>
</view>
<!-- 设置选项 -->
<view class="settings-list">
<view class="settings-card" @click="goChangePassword">
<text class="settings-label">修改密码</text>
</view>
<view class="settings-card" @click="handleLogout">
<text class="settings-label logout-text">退出登录</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import store from '@/store'
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0
function goBack() {
uni.navigateBack()
}
function goChangePassword() {
uni.navigateTo({ url: '/pages/change-password/index' })
}
function handleLogout() {
store.clearAuth()
uni.reLaunch({ url: '/pages/login/index' })
}
</script>
<style scoped>
.settings-page {
position: relative;
min-height: 100vh;
background-color: #F5F5F5;
}
.bg-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 500rpx;
z-index: 0;
}
.content {
position: relative;
z-index: 1;
}
.nav-bar {
width: 100%;
}
.nav-bar-inner {
display: flex;
align-items: center;
justify-content: space-between;
height: 88rpx;
padding: 0 24rpx;
}
.nav-icon {
width: 44rpx;
height: 44rpx;
}
.nav-icon-placeholder {
width: 44rpx;
height: 44rpx;
}
.nav-title {
font-size: 34rpx;
font-weight: 600;
color: #fff;
}
.settings-list {
padding: 16rpx 24rpx;
}
.settings-card {
display: flex;
align-items: center;
padding: 32rpx 24rpx;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 12rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.settings-label {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.logout-text {
color: #E53935;
}
</style>