用户反馈:点击"更换车辆"菜单项没有任何反应。
缺少菜单列表样式定义
在精简"我的"页面时,删除了大量菜单项,但同时也删除了 .menu-list 和 .list-cell 的样式定义,导致:
1. 菜单项没有正确的布局和显示
2. 点击区域可能无效
3. 缺少视觉反馈
// 菜单列表样式
.menu-list {
background-color: white;
border-radius: 8px;
margin: 15rpx;
overflow: hidden;
.list-cell {
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
cursor: pointer;
transition: background-color 0.2s;
&:last-child {
border-bottom: none;
}
&:active {
background-color: #f5f5f5; // 点击反馈
}
.menu-item-box {
display: flex;
align-items: center;
justify-content: space-between;
.menu-icon {
font-size: 36rpx;
margin-right: 20rpx;
}
view {
flex: 1;
font-size: 32rpx;
color: #333;
}
.text-red {
color: #ff4d4f; // 退出登录红色
}
}
&.list-cell-arrow .menu-item-box::after {
content: '';
width: 16rpx;
height: 16rpx;
border-top: 2rpx solid #999;
border-right: 2rpx solid #999;
transform: rotate(45deg);
margin-left: 20rpx; // 右箭头指示器
}
}
}
background-color: whiteborder-radius: 8pxmargin: 15rpxpadding: 30rpx 增加点击区域border-bottom: 1rpx solid #f0f0f0&:last-child:active 状态改变背景色transition: background-color 0.2scursor: pointerfont-size: 36rpxmargin-right: 20rpxfont-size: 32rpxcolor: #333 (正常), color: #ff4d4f (警告)::after 绘制transform: rotate(45deg) 向右border-color: #999┌─────────────────┐
│ 更换车辆 │ ← 无样式,点击无效
├─────────────────┤
│ 退出登录 │
└─────────────────┘
┌─────────────────────┐
│ 🚗 更换车辆 > │ ← 有图标、间距、箭头
├─────────────────────┤
│ 🚪 退出登录 > │ ← 红色文字
└─────────────────────┘
↑
点击时有灰色背景反馈
#f5f5f5 (视觉反馈)handleVehicleBinding() 方法/pages/bind-vehicle 页面#f5f5f5 (视觉反馈)handleLogout() 方法<view class="menu-list">
<!-- 绑定/更换车辆 -->
<view class="list-cell list-cell-arrow" @click="handleVehicleBinding">
<view class="menu-item-box">
<view class="iconfont icon-car menu-icon"></view>
<view>{{ boundVehicle && boundVehicle !== '未绑定' ? '更换车辆' : '绑定车辆' }}</view>
</view>
</view>
<!-- 退出登录 -->
<view class="list-cell list-cell-arrow" @click="handleLogout">
<view class="menu-item-box">
<view class="iconfont icon-logout menu-icon text-red"></view>
<view class="text-red">退出登录</view>
</view>
</view>
</view>
methods: {
// 处理车辆绑定操作
handleVehicleBinding() {
this.$tab.navigateTo('/pages/bind-vehicle')
},
// 退出登录
handleLogout() {
this.$modal.confirm('确定退出登录吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/pages/login')
})
})
}
}
| 类名 | 作用 |
|---|---|
.menu-list |
菜单列表容器 |
.list-cell |
单个菜单项 |
.list-cell-arrow |
带箭头的菜单项 |
.menu-item-box |
菜单项内容盒子 |
.menu-icon |
菜单图标 |
.text-red |
红色文字(警告) |
app/pages/mine/index.vueapp/pages/bind-vehicle.vueapp/store/modules/user.js修复时间: 2025-10-26
修复人: AI Assistant
问题类型: 样式缺失导致功能失效
状态: ✅ 已修复