Landscape.uvue
6.04 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
<template>
<view class="home-tabbar home-tabbar-landscape">
<!-- <image class="home-tabbar-bg-img"
mode="aspectFill"
src="/static/images/home/left-bg.png" /> -->
<view class="hf-landscape-column">
<view class="user-box user-box-clickable hf-landscape-user"
@click="emit('jumpPersonCenter')">
<view class="hf-landscape-profile">
<un-avatar :text="avatarText"
shape="circle"
size="42"
bgColor="#2f6af7"
color="#ffffff"
fontSize="20" />
<text class="hf-landscape-name">{{ userName }}</text>
</view>
</view>
</view>
<view class="landscape-tabbar-wrap">
<view class="landscape-un-tabbar landscape-vertical-tabs">
<view v-for="(item, index) in tabs"
:key="index"
class="landscape-vertical-tabs__item"
:class="index === currentTabIndex ? 'landscape-vertical-tabs__item--active' : ''"
@click="onTabItemClick(index)">
<view class="landscape-vertical-tabs__inner">
<image class="landscape-vertical-tabs__icon"
mode="aspectFit"
:src="index === currentTabIndex ? item.iconSrcActive : item.iconSrcInactive" />
<text class="landscape-vertical-tabs__label">{{ item.label }}</text>
</view>
</view>
</view>
</view>
<view class="home-tabbar-footer flex-col hf-landscape-footer">
<!-- ✅ 分隔线,与上方 Tab 区域区分 -->
<view class="hf-landscape-footer-divider"></view>
<!-- ✅ 切换门店按钮 -->
<view class="hf-landscape-footer-btn"
@tap="emit('switchStore')">
<image class="hf-landscape-footer-icon"
mode="aspectFit"
src="/static/images/home/scene-change.png" />
<text class="hf-landscape-footer-label">切换</text>
</view>
<!-- ✅ 设置按钮 -->
<view class="hf-landscape-footer-btn"
@tap="emit('setting')">
<image class="hf-landscape-footer-icon"
mode="aspectFit"
src="/static/images/home/setting.png" />
<text class="hf-landscape-footer-label">设置</text>
</view>
</view>
</view>
</template>
<script setup lang="uts">
import { useTabbarCommon, useLandscapeUserInfo } from "./hooks";
const props = defineProps<{
currentTabIndex: number
}>();
const emit = defineEmits<{
tabChange: [name: string | number]
setting: []
jumpPersonCenter: []
switchStore: []
}>();
const { tabs } = useTabbarCommon();
const { userName, avatarText } = useLandscapeUserInfo();
function onTabItemClick(index: number): void {
emit("tabChange", index);
}
</script>
<style scoped lang="scss">
@import "../styles/common.scss";
/* 顶部用户区:仅内容高度,不把中间 Tab 区挤没 */
.hf-landscape-column {
flex-shrink: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
padding: 14px 10px 0;
position: relative;
z-index: 1;
}
/* 横屏侧栏:用户区 / Tab / 底按钮同一竖直中轴 */
.hf-landscape-user {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
padding-top: 0;
flex-shrink: 0;
}
.hf-landscape-profile {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
/* 与 MyCenterMain .name 一致;与 Tab 文案同宽便于视觉对齐 */
.hf-landscape-name {
margin-top: 10px;
font-size: 14px;
font-weight: 600;
color: #1a2433;
line-height: 24px;
text-align: center;
width: 100%;
max-width: 104px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.hf-landscape-footer {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: border-box;
flex-shrink: 0;
padding: 24px 10px 4px; /* ✅ 增加上下内边距 */
}
/* ✅ 分隔线:与上方 Tab 区域明确区分 */
.hf-landscape-footer-divider {
width: 40px;
height: 1px; /* ✅ 改为 1px,更细腻 */
background-color: #e5edf8;
// margin-bottom: 10px; /* ✅ 分隔线与按钮的间距 */
}
.hf-landscape-footer-btn {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
// padding: 2px 0; /* ✅ 按钮内边距 */
margin-top: 8px; /* ✅ 按钮之间的间距 */
border-radius: 8px;
transition: background-color 0.2s;
}
.hf-landscape-footer-btn:active {
background-color: #f5f7fa; /* ✅ 点击反馈 */
}
.hf-landscape-footer-icon {
width: 24px; /* ✅ 缩小图标,与导航图标(28px)形成层次 */
height: 24px;
flex-shrink: 0;
opacity: 0.7; /* ✅ 降低透明度,与导航图标区分 */
}
.hf-landscape-footer-label {
margin-top: 4px;
font-size: 11px; /* ✅ 小字号 */
color: #8a98b5; /* ✅ 灰色文字 */
text-align: center;
line-height: 16px;
}
.hf-landscape-footer-switch {
font-size: 13px;
font-weight: 600;
color: #3773f8;
line-height: 20px;
text-align: center;
}
/* 横屏侧栏 Tab:占满中间 landscape-tabbar-wrap,条目在剩余高度内垂直居中 */
.landscape-vertical-tabs {
flex: 1;
min-height: 0;
width: 100%;
padding-left: var(--tabbar-padding, 16px);
padding-right: var(--tabbar-padding, 16px);
padding-top: 8px;
padding-bottom: 8px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.landscape-vertical-tabs__item {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 18px 0;
box-sizing: border-box;
}
.landscape-vertical-tabs__item + .landscape-vertical-tabs__item {
margin-top: 10px;
}
.landscape-vertical-tabs__inner {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.landscape-vertical-tabs__icon {
width: var(--tabbar-icon-size, 28px);
height: var(--tabbar-icon-size, 28px);
flex-shrink: 0;
}
.landscape-vertical-tabs__label {
margin-top: 6px;
font-size: 12px;
color: #8a98b5;
text-align: center;
width: 100%;
max-width: 104px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.landscape-vertical-tabs__item--active .landscape-vertical-tabs__label {
color: #3773f8;
font-weight: 500;
}
</style>