| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <view class="account-settings" :class="{ 'dark-mode': darkMode }">
- <!-- 顶部导航栏 -->
- <view class="header">
- <view class="back-btn" @click="goBack">
- <text class="back-icon">←</text>
- </view>
- <text class="header-title">账户设置</text>
- <view class="placeholder"></view>
- </view>
- <scroll-view scroll-y class="content">
- <!-- 账号安全 -->
- <view class="group-block">
- <text class="group-title">账户安全</text>
- <view class="card">
- <view class="setting-item" @click="goTo('changePassword')">
- <view class="item-left">
- <text class="item-icon shield">🛡️</text>
- <text class="item-text">修改密码</text>
- </view>
- <text class="item-arrow">›</text>
- </view>
- <view class="setting-item" @click="goTo('phone')">
- <view class="item-left">
- <text class="item-icon phone">📱</text>
- <text class="item-text">手机号码</text>
- </view>
- <view class="item-right">
- <text class="item-value">{{ phoneNumber }}</text>
- <text class="item-arrow">›</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 功能设置 -->
- <view class="group-block">
- <text class="group-title">功能设置</text>
- <view class="card">
- <view class="setting-item">
- <view class="item-left">
- <text class="item-icon bell">🔔</text>
- <text class="item-text">新消息通知</text>
- </view>
- <switch :checked="notifyNewMessage" @change="e => notifyNewMessage = e.detail.value" color="#9C27B0" />
- </view>
- <view class="setting-item">
- <view class="item-left">
- <text class="item-icon heart">💜</text>
- <text class="item-text">匹配成功通知</text>
- </view>
- <switch :checked="notifyMatchSuccess" @change="e => notifyMatchSuccess = e.detail.value" color="#9C27B0" />
- </view>
- <view class="setting-item">
- <view class="item-left">
- <text class="item-icon horn">📣</text>
- <text class="item-text">系统公告通知</text>
- </view>
- <switch :checked="notifySystem" @change="e => notifySystem = e.detail.value" color="#9C27B0" />
- </view>
- </view>
- </view>
- <!-- 显示设置 -->
- <view class="group-block">
- <text class="group-title">显示设置</text>
- <view class="card">
- <view class="setting-item">
- <view class="item-left">
- <text class="item-icon moon">🌙</text>
- <text class="item-text">深色模式</text>
- </view>
- <switch :checked="darkMode" @change="onToggleDarkMode" color="#9C27B0" />
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- name: 'matchmaker-account-settings',
- data() {
- return {
- phoneNumber: '138****5678',
- notifyNewMessage: true,
- notifyMatchSuccess: true,
- notifySystem: true,
- darkMode: false
- }
- },
- onLoad() {
- // 读取本地存储的深色模式状态
- const stored = uni.getStorageSync('matchmakerDarkMode')
- if (stored === true || stored === false) {
- this.darkMode = stored
- }
- },
- methods: {
- goBack() {
- uni.navigateBack()
- },
- goTo(type) {
- // 这里预留具体跳转逻辑
- uni.showToast({
- title: '功能开发中',
- icon: 'none'
- })
- },
- onToggleDarkMode(e) {
- const value = e.detail.value
- this.darkMode = value
- uni.setStorageSync('matchmakerDarkMode', value)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .account-settings {
- min-height: 100vh;
- background: #F5F5F5;
- display: flex;
- flex-direction: column;
- color: #333;
- }
- .header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 25rpx 30rpx;
- padding-top: calc(25rpx + env(safe-area-inset-top));
- background: #E9D7F5;
- .back-btn {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- .back-icon {
- font-size: 40rpx;
- color: #333;
- font-weight: bold;
- }
- }
- .header-title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- }
- .placeholder {
- width: 60rpx;
- }
- }
- .content {
- flex: 1;
- background: #F5F5F5;
- }
- .group-block {
- margin-top: 20rpx;
- .group-title {
- padding: 30rpx 30rpx 10rpx;
- font-size: 26rpx;
- color: #999;
- }
- .card {
- margin: 0 20rpx;
- background: #FFFFFF;
- border-radius: 20rpx;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04);
- overflow: hidden;
- }
- }
- .setting-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 28rpx 26rpx;
- border-bottom: 1rpx solid #F5F5F5;
- &:last-child {
- border-bottom: none;
- }
- .item-left {
- display: flex;
- align-items: center;
- flex: 1;
- .item-icon {
- font-size: 34rpx;
- margin-right: 18rpx;
- }
- .item-text {
- font-size: 30rpx;
- color: #333;
- }
- }
- .item-right {
- display: flex;
- align-items: center;
- .item-value {
- font-size: 26rpx;
- color: #999;
- margin-right: 10rpx;
- }
- }
- .item-arrow {
- font-size: 34rpx;
- color: #CCC;
- }
- }
- </style>
|