index.vue
6.91 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<template>
<view class="profile-page">
<!-- User Profile Section -->
<view class="user-profile-section">
<image :src="userInfo.avatar" class="user-avatar" mode="aspectFill" />
<text class="user-name">{{ userInfo.name }}</text>
<text class="user-phone">{{ userInfo.phone }}</text>
<nut-button class="edit-profile-btn" @click="onEditProfile">
编辑资料
</nut-button>
<!-- Stats Row -->
<view class="stats-row">
<view class="stat-item">
<text class="stat-number">{{ userStats.following }}</text>
<text class="stat-label">关注</text>
</view>
<view class="stat-item" @click="onOrderManagement">
<text class="stat-number">{{ userStats.orders }}</text>
<text class="stat-label">订单</text>
</view>
<view class="stat-item">
<text class="stat-number">{{ userStats.followers }}</text>
<text class="stat-label">被关注</text>
</view>
</view>
</view>
<!-- Quick Actions -->
<view class="quick-actions">
<view class="action-item" @click="onMyFavorites">
<Heart size="22" color="#6b7280" />
<text class="action-text">我的关注</text>
</view>
<view class="action-item" @click="onOrderManagement">
<Clock size="22" color="#6b7280" />
<text class="action-text">我的订单</text>
</view>
</view>
<!-- Menu Items -->
<view class="menu-section">
<view class="menu-item" @click="onMessages">
<Notice size="20" color="#6b7280" />
<text class="menu-text">我的消息</text>
<Right size="18" color="#9ca3af" />
</view>
<view class="menu-item" @click="onMySoldVehicles">
<Cart size="20" color="#6b7280" />
<text class="menu-text">我卖的车</text>
<Right size="18" color="#9ca3af" />
</view>
<view class="menu-item" @click="onFeedback">
<Message size="20" color="#6b7280" />
<text class="menu-text">意见反馈</text>
<Right size="18" color="#9ca3af" />
</view>
<view class="menu-item" @click="onHelpCenter">
<Tips size="20" color="#6b7280" />
<text class="menu-text">帮助中心</text>
<Right size="18" color="#9ca3af" />
</view>
<view class="menu-item" @click="onSettings">
<Setting size="20" color="#6b7280" />
<text class="menu-text">设置</text>
<Right size="18" color="#9ca3af" />
</view>
</view>
<!-- 自定义TabBar -->
<TabBar />
</view>
</template>
<script setup>
import { ref } from 'vue'
import {
Heart, Clock, Notice, Cart, Message, Tips, Setting, Right
} from '@nutui/icons-vue-taro'
import Taro from '@tarojs/taro'
import TabBar from '@/components/TabBar.vue'
// 用户信息
const userInfo = ref({
name: '张同学',
phone: '138****8888',
avatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100&h=100&fit=crop&crop=face'
})
// 用户统计
const userStats = ref({
following: 12,
orders: 8,
followers: 24
})
/**
* 编辑个人资料
*/
const onEditProfile = () => {
Taro.navigateTo({
url: '/pages/editProfile/index'
})
}
/**
* 我的关注
*/
const onMyFavorites = () => {
Taro.navigateTo({
url: '/pages/my-favorites/index'
})
}
/**
* 订单管理
*/
const onOrderManagement = () => {
Taro.navigateTo({
url: '/pages/order-management/index'
})
}
/**
* 我的消息
*/
const onMessages = () => {
Taro.navigateTo({
url: '/pages/messages/index'
})
}
/**
* 我卖的车
*/
const onMySoldVehicles = () => {
Taro.navigateTo({
url: '/pages/my-sold-vehicles/index'
})
}
/**
* 帮助中心
*/
const onHelpCenter = () => {
Taro.navigateTo({
url: '/pages/help-center/index'
})
}
/**
* 意见反馈
*/
const onFeedback = () => {
Taro.navigateTo({
url: '/pages/feedback/index'
})
}
/**
* 设置
*/
const onSettings = () => {
Taro.navigateTo({
url: '/pages/settings/index'
})
}
</script>
<style lang="less">
.profile-page {
min-height: 100vh;
background-color: #f8fafc;
padding-bottom: 240rpx;
}
.header {
background: #fb923c;
padding: 64rpx 0 32rpx;
position: relative;
.header-content {
padding: 0 48rpx;
display: flex;
justify-content: space-between;
align-items: center;
.header-title {
font-size: 40rpx;
font-weight: 700;
color: white;
}
}
}
.user-profile-section {
background: white;
padding: 64rpx 48rpx;
margin-bottom: 32rpx;
text-align: center;
.user-avatar {
width: 160rpx;
height: 160rpx;
border-radius: 80rpx;
margin-bottom: 32rpx;
}
.user-name {
font-size: 40rpx;
font-weight: 600;
color: #1e293b;
margin-bottom: 8rpx;
display: block;
}
.user-phone {
font-size: 28rpx;
color: #64748b;
margin-bottom: 40rpx;
display: block;
}
.edit-profile-btn {
background-color: #f1f5f9;
color: #475569;
border: none;
border-radius: 40rpx;
padding: 16rpx 48rpx;
font-size: 28rpx;
margin-bottom: 48rpx;
}
.stats-row {
display: flex;
justify-content: space-around;
.stat-item {
text-align: center;
.stat-number {
font-size: 36rpx;
font-weight: 600;
color: #1e293b;
display: block;
margin-bottom: 8rpx;
}
.stat-label {
font-size: 24rpx;
color: #64748b;
}
}
}
}
.quick-actions {
background: white;
padding: 40rpx 48rpx;
margin-bottom: 32rpx;
display: flex;
justify-content: space-around;
.action-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 16rpx;
.action-text {
font-size: 24rpx;
color: #64748b;
}
}
}
.menu-section {
background: white;
.menu-item {
display: flex;
align-items: center;
padding: 32rpx 48rpx;
border-bottom: 1px solid #f1f5f9;
gap: 32rpx;
&:last-child {
border-bottom: none;
}
.menu-text {
flex: 1;
font-size: 32rpx;
color: #1e293b;
}
}
}
</style>