3
tj
2025-05-22 14764dd7679369a650ad1d60be62aacc863755a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
  <view class="settings-page">
    <!-- 设置列表 -->
    <view class="section" v-for="(section, index) in menuList" :key="index">
      <view class="cell-group">
        <u-cell-group :border="false">
          <u-cell v-for="(item, i) in section" :key="i" :title="item.title" :icon="item.icon" isLink :value="item.value"
            :border="true" @click="onItemClick(item)">
            <u-icon slot="icon" size="32" :name="item.icon"></u-icon>
          </u-cell>
        </u-cell-group>
      </view>
    </view>
 
    <!-- 底部操作 -->
    <view class="bottom-actions">
      <u-cell-group :border="false" class="cell-group">
        <u-cell @click="onItemClick('switch')" :border="true">
          <template #title>
            <view class="center-cell-text">切换账号</view>
          </template>
        </u-cell>
 
        <u-cell @click="onItemClick('logout')" :border="false">
          <template #title>
            <view class="center-cell-text">退出登录</view>
          </template>
        </u-cell>
      </u-cell-group>
    </view>
 
    <view class="portotal-actions">
      <view class="action-row">
        <u--text  size="20" :bold="true" text="《个人信息收集清单》"  color="#38516E" />
        <u--text  size="20" :bold="true" text="《第三方信息共享清单》"  color="#38516E" />
      </view>
      <view class="action-row">
        <u--text  size="20" :bold="true" text="《用户服务协议》" color="#38516E" />
        <u--text  size="20" :bold="true" text="《用户隐私政策》" color="#38516E" />
      </view>
    </view>
 
  </view>
</template>
 
<script>
export default {
  data() {
    return {
      menuList: [
        [
          { title: '账号与安全', icon: 'account' },
          { title: '通用设置', icon: 'setting' },
          { title: '通知设置', icon: 'bell' },
          { title: '隐私设置', icon: 'lock' }
        ],
        [
          { title: '存储空间', icon: 'trash', value: '1.12 GB' },
          { title: '内容偏好调节', icon: 'file-text' },
          { title: '收货地址', icon: 'map' },
          { title: '添加小组件', icon: 'grid' },
          { title: '未成年人模式', icon: '/static/common/umbrella.png', value: '未开启' }
        ],
        [
          { title: '帮助与客服', icon: 'kefu-ermai' },
          { title: '关于小红书', icon: 'info-circle' }
        ]
      ]
    };
  },
  methods: {
    onBack() {
      uni.navigateBack();
    },
    onItemClick(item) {
      uni.showToast({
        title: `点击了 ${item.title}`,
        icon: 'none'
      });
    },
    onSwitchAccount() {
      uni.showToast({
        title: '切换账号',
        icon: 'none'
      });
    },
    onLogout() {
      uni.showModal({
        title: '退出登录',
        content: '确定要退出登录吗?',
        success: (res) => {
          if (res.confirm) {
            uni.showToast({ title: '已退出登录', icon: 'success' });
          }
        }
      });
    }
  }
};
</script>
 
<style lang="scss" scoped>
.settings-page {
  min-height: 100vh;
  margin: 10rpx;
 
  .section {
    margin-top: 20rpx;
 
    .cell-group {
      background-color: #fff;
      border-radius: 10px;
      overflow: hidden;
    }
  }
 
  .bottom-actions {
    margin-top: 30rpx;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 20rpx;
    border-radius: 10px;
    overflow: hidden;
  }
 
  .center-cell-text {
    width: 100%;
    text-align: center;
    font-size: 30rpx;
    color: #333;
  }
 
  .portotal-actions {
    margin-top: 30rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20rpx;
    /* 每行之间间距 */
  }
 
  .action-row {
    display: flex;
    justify-content: center;
    gap: 40rpx;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
 
}
</style>