feat: 新增特价好车和最新上架页面功能
添加特价好车和最新上架两个新页面,包含以下主要变更: 1. 新增页面路由配置 2. 实现车辆列表展示、筛选和收藏功能 3. 优化页面样式和交互体验 4. 添加页面间导航逻辑
Showing
10 changed files
with
814 additions
and
8 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-06-28 10:33:00 | 2 | * @Date: 2025-06-28 10:33:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-02 18:16:09 | 4 | + * @LastEditTime: 2025-07-02 22:18:10 |
| 5 | * @FilePath: /jgdl/src/app.config.js | 5 | * @FilePath: /jgdl/src/app.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -16,6 +16,8 @@ export default { | ... | @@ -16,6 +16,8 @@ export default { |
| 16 | 'pages/register/index', | 16 | 'pages/register/index', |
| 17 | 'pages/authCar/index', | 17 | 'pages/authCar/index', |
| 18 | 'pages/setAuthCar/index', | 18 | 'pages/setAuthCar/index', |
| 19 | + 'pages/newCarList/index', | ||
| 20 | + 'pages/goodCarList/index', | ||
| 19 | 'pages/auth/index', | 21 | 'pages/auth/index', |
| 20 | ], | 22 | ], |
| 21 | subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 | 23 | subpackages: [ // 配置在tabBar中的页面不能分包写到subpackages中去 | ... | ... |
src/pages/goodCarList/index.config.js
0 → 100755
| 1 | +/* | ||
| 2 | + * @Date: 2025-07-02 22:18:16 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-07-02 23:00:27 | ||
| 5 | + * @FilePath: /jgdl/src/pages/goodCarList/index.config.js | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | + */ | ||
| 8 | +export default { | ||
| 9 | + navigationBarTitleText: '', | ||
| 10 | + usingComponents: { | ||
| 11 | + }, | ||
| 12 | +} |
src/pages/goodCarList/index.less
0 → 100644
| 1 | +/* 特价好车页面样式 */ | ||
| 2 | +.good-car-list { | ||
| 3 | + width: 100%; | ||
| 4 | + overflow-y: auto; | ||
| 5 | + -webkit-overflow-scrolling: touch; | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +/* 车辆卡片样式 */ | ||
| 9 | +.good-car-list .bg-white { | ||
| 10 | + background-color: #ffffff; | ||
| 11 | + border: 1px solid #f0f0f0; | ||
| 12 | + transition: all 0.3s ease; | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +.good-car-list .bg-white:hover { | ||
| 16 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +/* 图片容器 */ | ||
| 20 | +.good-car-list .w-32 { | ||
| 21 | + width: 200rpx; | ||
| 22 | + height: 150rpx; | ||
| 23 | + flex-shrink: 0; | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +.good-car-list image { | ||
| 27 | + border-radius: 8rpx; | ||
| 28 | + object-fit: cover; | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +/* 信息区域 */ | ||
| 32 | +.good-car-list .flex-1 { | ||
| 33 | + flex: 1; | ||
| 34 | + min-width: 0; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +/* 价格样式 */ | ||
| 38 | +.good-car-list .text-orange-500 { | ||
| 39 | + color: #f97316; | ||
| 40 | + font-weight: bold; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +.good-car-list .line-through { | ||
| 44 | + text-decoration: line-through; | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +/* 特价标签 */ | ||
| 48 | +.good-car-list .text-red-600 { | ||
| 49 | + color: #dc2626; | ||
| 50 | + font-weight: 500; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +/* 折扣标签 */ | ||
| 54 | +.good-car-list .bg-red-500 { | ||
| 55 | + background-color: #ef4444; | ||
| 56 | + padding: 2rpx 6rpx; | ||
| 57 | + border-radius: 4rpx; | ||
| 58 | + font-size: 20rpx; | ||
| 59 | + line-height: 1; | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +/* 加载状态 */ | ||
| 63 | +.loading-container { | ||
| 64 | + display: flex; | ||
| 65 | + justify-content: center; | ||
| 66 | + align-items: center; | ||
| 67 | + padding: 32rpx 0 100rpx 0; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +.loading-text { | ||
| 71 | + color: #9ca3af; | ||
| 72 | + font-size: 28rpx; | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | +/* 无更多数据提示 */ | ||
| 76 | +.no-more-container { | ||
| 77 | + display: flex; | ||
| 78 | + justify-content: center; | ||
| 79 | + align-items: center; | ||
| 80 | + padding: 32rpx 0 100rpx 0; | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +.no-more-container text { | ||
| 84 | + color: #9ca3af; | ||
| 85 | + font-size: 24rpx; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +/* NutUI 组件样式覆盖 */ | ||
| 89 | +:deep(.nut-menu) { | ||
| 90 | + background-color: #ffffff; | ||
| 91 | + border-bottom: 1px solid #f0f0f0; | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | +:deep(.nut-menu-item) { | ||
| 95 | + color: #333333; | ||
| 96 | + font-size: 28rpx; | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +:deep(.nut-menu-item.active) { | ||
| 100 | + color: #f97316; | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +// .nut-searchbar{ | ||
| 104 | +// background: transparent !important; | ||
| 105 | +// } | ||
| 106 | + | ||
| 107 | +// :deep(.nut-searchbar .nut-searchbar__input-inner) { | ||
| 108 | +// background-color: #ffffff; | ||
| 109 | +// border-radius: 20rpx; | ||
| 110 | +// font-size: 28rpx; | ||
| 111 | +// } | ||
| 112 | + | ||
| 113 | +:deep(.nut-sticky) { | ||
| 114 | + z-index: 999; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +/* 响应式适配 */ | ||
| 118 | +@media screen and (max-width: 750rpx) { | ||
| 119 | + .good-car-list .w-32 { | ||
| 120 | + width: 180rpx; | ||
| 121 | + height: 135rpx; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + .good-car-list .text-xl { | ||
| 125 | + font-size: 32rpx; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + .good-car-list .text-sm { | ||
| 129 | + font-size: 24rpx; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + .good-car-list .text-xs { | ||
| 133 | + font-size: 20rpx; | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | + | ||
| 137 | +/* 深色模式适配 */ | ||
| 138 | +@media (prefers-color-scheme: dark) { | ||
| 139 | + .good-car-list .bg-white { | ||
| 140 | + background-color: #1f2937; | ||
| 141 | + border-color: #374151; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + .good-car-list .text-gray-600 { | ||
| 145 | + color: #9ca3af; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + .good-car-list .text-gray-500 { | ||
| 149 | + color: #6b7280; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + .good-car-list .text-gray-400 { | ||
| 153 | + color: #9ca3af; | ||
| 154 | + } | ||
| 155 | +} | ||
| 156 | + | ||
| 157 | +/* 动画效果 */ | ||
| 158 | +.good-car-list .bg-white { | ||
| 159 | + animation: fadeInUp 0.3s ease-out; | ||
| 160 | +} | ||
| 161 | + | ||
| 162 | +@keyframes fadeInUp { | ||
| 163 | + from { | ||
| 164 | + opacity: 0; | ||
| 165 | + transform: translateY(20rpx); | ||
| 166 | + } | ||
| 167 | + to { | ||
| 168 | + opacity: 1; | ||
| 169 | + transform: translateY(0); | ||
| 170 | + } | ||
| 171 | +} | ||
| 172 | + | ||
| 173 | +/* 收藏按钮动画 */ | ||
| 174 | +.good-car-list .absolute { | ||
| 175 | + transition: transform 0.2s ease; | ||
| 176 | +} | ||
| 177 | + | ||
| 178 | +.good-car-list .absolute:active { | ||
| 179 | + transform: scale(0.9); | ||
| 180 | +} | ||
| 181 | + | ||
| 182 | +/* 卡片点击效果 */ | ||
| 183 | +.good-car-list .bg-white:active { | ||
| 184 | + transform: scale(0.98); | ||
| 185 | + transition: transform 0.1s ease; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +/* 滚动条样式 */ | ||
| 189 | +.good-car-list::-webkit-scrollbar { | ||
| 190 | + width: 0; | ||
| 191 | + background: transparent; | ||
| 192 | +} | ||
| 193 | + | ||
| 194 | +/* 特价标识样式优化 */ | ||
| 195 | +.good-car-list .absolute.bottom-3.right-3 { | ||
| 196 | + background: linear-gradient(45deg, #ef4444, #dc2626); | ||
| 197 | + box-shadow: 0 2rpx 4rpx rgba(239, 68, 68, 0.3); | ||
| 198 | +} | ||
| 199 | + | ||
| 200 | +.good-car-list .absolute.top-3.left-3 { | ||
| 201 | + background: linear-gradient(45deg, #ef4444, #dc2626); | ||
| 202 | + box-shadow: 0 2rpx 4rpx rgba(239, 68, 68, 0.3); | ||
| 203 | +} | ||
| 204 | + | ||
| 205 | +/* 价格区域样式优化 */ | ||
| 206 | +.good-car-list .flex.items-center { | ||
| 207 | + align-items: baseline; | ||
| 208 | + gap: 8rpx; | ||
| 209 | +} | ||
| 210 | + | ||
| 211 | +/* 文字省略 */ | ||
| 212 | +.good-car-list .font-medium { | ||
| 213 | + overflow: hidden; | ||
| 214 | + text-overflow: ellipsis; | ||
| 215 | + white-space: nowrap; | ||
| 216 | + max-width: 100%; | ||
| 217 | +} | ||
| 218 | + | ||
| 219 | +/* 间距调整 */ | ||
| 220 | +.good-car-list .space-y-4 > * + * { | ||
| 221 | + margin-top: 16rpx; | ||
| 222 | +} | ||
| 223 | + | ||
| 224 | +.good-car-list .mb-3 { | ||
| 225 | + margin-bottom: 12rpx; | ||
| 226 | +} |
src/pages/goodCarList/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-06-28 10:33:00 | 2 | * @Date: 2025-06-28 10:33:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-02 20:49:05 | 4 | + * @LastEditTime: 2025-07-02 22:58:32 |
| 5 | * @FilePath: /jgdl/src/pages/index/index.vue | 5 | * @FilePath: /jgdl/src/pages/index/index.vue |
| 6 | * @Description: 捡个电驴首页 | 6 | * @Description: 捡个电驴首页 |
| 7 | --> | 7 | --> |
| ... | @@ -40,13 +40,13 @@ | ... | @@ -40,13 +40,13 @@ |
| 40 | <!-- Category Icons --> | 40 | <!-- Category Icons --> |
| 41 | <view class="px-4 mt-2"> | 41 | <view class="px-4 mt-2"> |
| 42 | <view class="flex justify-around py-4"> | 42 | <view class="flex justify-around py-4"> |
| 43 | - <view class="flex flex-col items-center"> | 43 | + <view class="flex flex-col items-center" @tap="onNewCarClick"> |
| 44 | <view class="w-12 h-12 rounded-full bg-orange-100 flex items-center justify-center"> | 44 | <view class="w-12 h-12 rounded-full bg-orange-100 flex items-center justify-center"> |
| 45 | <Clock size="20" color="#f97316" /> | 45 | <Clock size="20" color="#f97316" /> |
| 46 | </view> | 46 | </view> |
| 47 | <text class="text-xs mt-1 text-gray-700">最新上架</text> | 47 | <text class="text-xs mt-1 text-gray-700">最新上架</text> |
| 48 | </view> | 48 | </view> |
| 49 | - <view class="flex flex-col items-center"> | 49 | + <view class="flex flex-col items-center" @tap="onGoodCarClick"> |
| 50 | <view class="w-12 h-12 rounded-full bg-orange-100 flex items-center justify-center"> | 50 | <view class="w-12 h-12 rounded-full bg-orange-100 flex items-center justify-center"> |
| 51 | <Star size="20" color="#f97316" /> | 51 | <Star size="20" color="#f97316" /> |
| 52 | </view> | 52 | </view> |
| ... | @@ -111,7 +111,7 @@ | ... | @@ -111,7 +111,7 @@ |
| 111 | <view class="px-4 mt-6 mb-20"> | 111 | <view class="px-4 mt-6 mb-20"> |
| 112 | <view class="flex justify-between items-center mb-2"> | 112 | <view class="flex justify-between items-center mb-2"> |
| 113 | <text class="text-lg font-medium">最新上架</text> | 113 | <text class="text-lg font-medium">最新上架</text> |
| 114 | - <view class="text-sm text-gray-500 flex items-center"> | 114 | + <view class="text-sm text-gray-500 flex items-center" @tap="onNewCarClick"> |
| 115 | <text>更多</text> | 115 | <text>更多</text> |
| 116 | <RectRight size="12" /> | 116 | <RectRight size="12" /> |
| 117 | </view> | 117 | </view> |
| ... | @@ -295,6 +295,21 @@ const onCertifiedClick = () => { | ... | @@ -295,6 +295,21 @@ const onCertifiedClick = () => { |
| 295 | }) | 295 | }) |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | +/** | ||
| 299 | + * 点击特价好车 | ||
| 300 | + */ | ||
| 301 | +const onGoodCarClick = () => { | ||
| 302 | + Taro.navigateTo({ | ||
| 303 | + url: '/pages/goodCarList/index' | ||
| 304 | + }) | ||
| 305 | +} | ||
| 306 | + | ||
| 307 | +const onNewCarClick = () => { | ||
| 308 | + Taro.navigateTo({ | ||
| 309 | + url: '/pages/newCarList/index' | ||
| 310 | + }) | ||
| 311 | +} | ||
| 312 | + | ||
| 298 | // 生命周期钩子 | 313 | // 生命周期钩子 |
| 299 | useDidShow(() => { | 314 | useDidShow(() => { |
| 300 | console.warn('index onShow') | 315 | console.warn('index onShow') | ... | ... |
src/pages/newCarList/index.config.js
0 → 100755
| 1 | +/* | ||
| 2 | + * @Date: 2025-07-02 22:16:48 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-07-02 22:17:11 | ||
| 5 | + * @FilePath: /jgdl/src/pages/newCarList/index.config.js | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | + */ | ||
| 8 | +export default { | ||
| 9 | + navigationBarTitleText: '', | ||
| 10 | + usingComponents: { | ||
| 11 | + }, | ||
| 12 | +} |
src/pages/newCarList/index.less
0 → 100644
| 1 | +/* 最新上架页面样式 */ | ||
| 2 | +.new-car-list { | ||
| 3 | + width: 100%; | ||
| 4 | + box-sizing: border-box; | ||
| 5 | + | ||
| 6 | + /* 滚动条样式 */ | ||
| 7 | + &::-webkit-scrollbar { | ||
| 8 | + width: 6rpx; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + &::-webkit-scrollbar-track { | ||
| 12 | + background: #f1f1f1; | ||
| 13 | + border-radius: 3rpx; | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + &::-webkit-scrollbar-thumb { | ||
| 17 | + background: #c1c1c1; | ||
| 18 | + border-radius: 3rpx; | ||
| 19 | + | ||
| 20 | + &:hover { | ||
| 21 | + background: #a8a8a8; | ||
| 22 | + } | ||
| 23 | + } | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +/* 车辆卡片样式 */ | ||
| 27 | +.new-car-list .bg-white { | ||
| 28 | + background-color: #ffffff; | ||
| 29 | + border: 1px solid #f0f0f0; | ||
| 30 | + border-radius: 16rpx; | ||
| 31 | + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); | ||
| 32 | + overflow: hidden; | ||
| 33 | + margin-bottom: 24rpx; | ||
| 34 | + transition: all 0.3s ease; | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +.new-car-list .bg-white:hover { | ||
| 38 | + transform: translateY(-2rpx); | ||
| 39 | + box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12); | ||
| 40 | + border-color: #e5e7eb; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +.new-car-list .bg-white:active { | ||
| 44 | + transform: scale(0.98); | ||
| 45 | + transition: transform 0.1s ease; | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +/* 车辆图片容器 */ | ||
| 49 | +.new-car-list .w-32 { | ||
| 50 | + width: 200rpx; | ||
| 51 | + height: 150rpx; | ||
| 52 | + flex-shrink: 0; | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +.new-car-list image { | ||
| 56 | + border-radius: 12rpx; | ||
| 57 | + object-fit: cover; | ||
| 58 | +} | ||
| 59 | + | ||
| 60 | +/* 新车标识样式优化 */ | ||
| 61 | +.new-car-list .absolute.bottom-3.right-3 { | ||
| 62 | + background: linear-gradient(45deg, #ef4444, #dc2626); | ||
| 63 | + box-shadow: 0 2rpx 4rpx rgba(239, 68, 68, 0.3); | ||
| 64 | + border-radius: 8rpx; | ||
| 65 | + padding: 4rpx 8rpx; | ||
| 66 | + font-size: 20rpx; | ||
| 67 | + font-weight: 600; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +/* 车辆信息区域 */ | ||
| 71 | +.new-car-list .flex-1 { | ||
| 72 | + flex: 1; | ||
| 73 | + min-width: 0; | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +/* 收藏按钮样式 */ | ||
| 77 | +.new-car-list .absolute { | ||
| 78 | + transition: transform 0.2s ease; | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | +.new-car-list .absolute:active { | ||
| 82 | + transform: scale(0.9); | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +/* 价格样式 */ | ||
| 86 | +.new-car-list .text-orange-500 { | ||
| 87 | + color: #f97316; | ||
| 88 | + font-weight: bold; | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +/* 上架时间样式 */ | ||
| 92 | +.new-car-list .text-green-600 { | ||
| 93 | + color: #10b981; | ||
| 94 | + font-weight: 500; | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +/* 文字省略 */ | ||
| 98 | +.new-car-list .font-medium { | ||
| 99 | + overflow: hidden; | ||
| 100 | + text-overflow: ellipsis; | ||
| 101 | + white-space: nowrap; | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +/* 加载状态样式 */ | ||
| 105 | +.loading-container { | ||
| 106 | + padding: 32rpx 0 100rpx 0; /* 增加底部间距避免被TabBar遮挡 */ | ||
| 107 | + text-align: center; | ||
| 108 | + | ||
| 109 | + .loading-text { | ||
| 110 | + color: #9ca3af; | ||
| 111 | + font-size: 28rpx; | ||
| 112 | + } | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +/* 无更多数据样式 */ | ||
| 116 | +.no-more-container { | ||
| 117 | + padding: 32rpx 0 100rpx 0; /* 增加底部间距避免被TabBar遮挡 */ | ||
| 118 | + text-align: center; | ||
| 119 | + | ||
| 120 | + text { | ||
| 121 | + color: #d1d5db; | ||
| 122 | + font-size: 24rpx; | ||
| 123 | + } | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +/* 动画效果 */ | ||
| 127 | +.new-car-list .bg-white { | ||
| 128 | + animation: fadeInUp 0.3s ease-out; | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | +@keyframes fadeInUp { | ||
| 132 | + from { | ||
| 133 | + opacity: 0; | ||
| 134 | + transform: translateY(20rpx); | ||
| 135 | + } | ||
| 136 | + to { | ||
| 137 | + opacity: 1; | ||
| 138 | + transform: translateY(0); | ||
| 139 | + } | ||
| 140 | +} | ||
| 141 | + | ||
| 142 | +/* 响应式适配 */ | ||
| 143 | +@media screen and (max-width: 750rpx) { | ||
| 144 | + .new-car-list .w-32 { | ||
| 145 | + width: 180rpx; | ||
| 146 | + height: 135rpx; | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + .new-car-list .text-xl { | ||
| 150 | + font-size: 32rpx; | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + .new-car-list .text-sm { | ||
| 154 | + font-size: 24rpx; | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + .new-car-list .text-xs { | ||
| 158 | + font-size: 20rpx; | ||
| 159 | + } | ||
| 160 | +} | ||
| 161 | + | ||
| 162 | +/* 深色模式适配 */ | ||
| 163 | +@media (prefers-color-scheme: dark) { | ||
| 164 | + .new-car-list .bg-white { | ||
| 165 | + background-color: #1f2937; | ||
| 166 | + border-color: #374151; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + .new-car-list .text-gray-600 { | ||
| 170 | + color: #9ca3af; | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + .new-car-list .text-gray-500 { | ||
| 174 | + color: #6b7280; | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + .new-car-list .text-gray-400 { | ||
| 178 | + color: #9ca3af; | ||
| 179 | + } | ||
| 180 | +} | ||
| 181 | + | ||
| 182 | +/* NutUI组件样式覆盖 */ | ||
| 183 | +:deep(.nut-sticky) { | ||
| 184 | + z-index: 999; | ||
| 185 | +} | ||
| 186 | + | ||
| 187 | +:deep(.nut-searchbar) { | ||
| 188 | + .nut-searchbar__content { | ||
| 189 | + border-radius: 50rpx; | ||
| 190 | + background: #fff; | ||
| 191 | + | ||
| 192 | + .nut-searchbar__input { | ||
| 193 | + font-size: 28rpx; | ||
| 194 | + color: #374151; | ||
| 195 | + | ||
| 196 | + &::placeholder { | ||
| 197 | + color: #9ca3af; | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | +} | ||
| 202 | + | ||
| 203 | +:deep(.nut-menu) { | ||
| 204 | + background: #fff; | ||
| 205 | + border-bottom: 1rpx solid #e5e7eb; | ||
| 206 | + | ||
| 207 | + .nut-menu__item { | ||
| 208 | + font-size: 28rpx; | ||
| 209 | + color: #374151; | ||
| 210 | + | ||
| 211 | + &.active { | ||
| 212 | + color: #f97316; | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + .nut-menu__title { | ||
| 217 | + font-size: 28rpx; | ||
| 218 | + | ||
| 219 | + &::after { | ||
| 220 | + border-color: #9ca3af; | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | +} | ||
| 224 | + | ||
| 225 | +:deep(.nut-toast) { | ||
| 226 | + .nut-toast__inner { | ||
| 227 | + background: rgba(0, 0, 0, 0.8); | ||
| 228 | + color: #fff; | ||
| 229 | + border-radius: 16rpx; | ||
| 230 | + font-size: 28rpx; | ||
| 231 | + } | ||
| 232 | +} | ||
| 233 | + | ||
| 234 | +/* 响应式适配 */ | ||
| 235 | +@media (max-width: 750rpx) { | ||
| 236 | + .car-image-container { | ||
| 237 | + width: 200rpx; | ||
| 238 | + height: 150rpx; | ||
| 239 | + padding: 12rpx; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + .car-info { | ||
| 243 | + padding: 20rpx; | ||
| 244 | + | ||
| 245 | + .car-name { | ||
| 246 | + font-size: 26rpx; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + .car-details { | ||
| 250 | + font-size: 22rpx; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + .car-price { | ||
| 254 | + font-size: 28rpx; | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + .car-school { | ||
| 258 | + font-size: 20rpx; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + .listing-time { | ||
| 262 | + font-size: 20rpx; | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | +} | ||
| 266 | + | ||
| 267 | +/* 深色模式适配 */ | ||
| 268 | +@media (prefers-color-scheme: dark) { | ||
| 269 | + .car-card { | ||
| 270 | + background: #1f2937; | ||
| 271 | + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3); | ||
| 272 | + | ||
| 273 | + &:hover { | ||
| 274 | + box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.4); | ||
| 275 | + } | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + .car-info { | ||
| 279 | + .car-name { | ||
| 280 | + color: #f9fafb; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + .car-details { | ||
| 284 | + color: #d1d5db; | ||
| 285 | + } | ||
| 286 | + | ||
| 287 | + .car-school { | ||
| 288 | + color: #9ca3af; | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + .loading-container .loading-text { | ||
| 293 | + color: #6b7280; | ||
| 294 | + } | ||
| 295 | + | ||
| 296 | + .no-more-container text { | ||
| 297 | + color: #4b5563; | ||
| 298 | + } | ||
| 299 | +} |
src/pages/newCarList/index.vue
0 → 100644
This diff is collapsed. Click to expand it.
src/pages/post/index.less
0 → 100644
| 1 | +// Post页面样式 | ||
| 2 | +.post-page { | ||
| 3 | + // 车辆卡片样式 | ||
| 4 | + .vehicle-list { | ||
| 5 | + // 图片容器尺寸优化 | ||
| 6 | + .w-32 { | ||
| 7 | + width: 200rpx !important; | ||
| 8 | + height: 150rpx !important; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + // 卡片样式增强 | ||
| 12 | + .bg-white { | ||
| 13 | + border: 1px solid #f0f0f0; | ||
| 14 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| 15 | + transition: all 0.3s ease; | ||
| 16 | + | ||
| 17 | + &:hover { | ||
| 18 | + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); | ||
| 19 | + transform: translateY(-2px); | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + &:active { | ||
| 23 | + transform: translateY(0); | ||
| 24 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + // 收藏按钮样式 | ||
| 29 | + .absolute.top-2.right-2 { | ||
| 30 | + transition: transform 0.2s ease; | ||
| 31 | + | ||
| 32 | + &:hover { | ||
| 33 | + transform: scale(1.1); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + &:active { | ||
| 37 | + transform: scale(0.95); | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + // 价格样式优化 | ||
| 42 | + .text-orange-500 { | ||
| 43 | + color: #f97316; | ||
| 44 | + font-weight: 700; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + // 认证标识样式 | ||
| 48 | + .bg-orange-500 { | ||
| 49 | + background: linear-gradient(135deg, #f97316, #ea580c); | ||
| 50 | + box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + // 文字省略 | ||
| 54 | + .font-medium { | ||
| 55 | + overflow: hidden; | ||
| 56 | + text-overflow: ellipsis; | ||
| 57 | + white-space: nowrap; | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + // 精品推荐区域 | ||
| 62 | + .grid { | ||
| 63 | + // 图片容器 | ||
| 64 | + .w-full.h-36 { | ||
| 65 | + height: 280rpx; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + // 卡片样式 | ||
| 69 | + .bg-white { | ||
| 70 | + border: 1px solid #f0f0f0; | ||
| 71 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | ||
| 72 | + transition: all 0.3s ease; | ||
| 73 | + | ||
| 74 | + &:hover { | ||
| 75 | + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); | ||
| 76 | + transform: translateY(-2px); | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + // 加载状态样式 | ||
| 82 | + .load-more-container { | ||
| 83 | + padding: 40rpx 0; | ||
| 84 | + | ||
| 85 | + .loading-container { | ||
| 86 | + display: flex; | ||
| 87 | + align-items: center; | ||
| 88 | + justify-content: center; | ||
| 89 | + color: #666; | ||
| 90 | + | ||
| 91 | + .loading-spinner { | ||
| 92 | + width: 40rpx; | ||
| 93 | + height: 40rpx; | ||
| 94 | + border: 4rpx solid #f3f3f3; | ||
| 95 | + border-top: 4rpx solid #f97316; | ||
| 96 | + border-radius: 50%; | ||
| 97 | + animation: spin 1s linear infinite; | ||
| 98 | + margin-right: 16rpx; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + .loading-text { | ||
| 102 | + font-size: 28rpx; | ||
| 103 | + color: #666; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + .no-more-data { | ||
| 108 | + text-align: center; | ||
| 109 | + color: #999; | ||
| 110 | + font-size: 28rpx; | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +// NutUI组件样式覆盖 | ||
| 116 | +.nut-menu { | ||
| 117 | + border-bottom: 1px solid #f0f0f0; | ||
| 118 | + | ||
| 119 | + .nut-menu-item { | ||
| 120 | + font-size: 28rpx; | ||
| 121 | + | ||
| 122 | + &.active { | ||
| 123 | + color: #f97316; | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +.nut-searchbar { | ||
| 129 | + .nut-searchbar__input { | ||
| 130 | + font-size: 28rpx; | ||
| 131 | + } | ||
| 132 | +} | ||
| 133 | + | ||
| 134 | +.nut-button { | ||
| 135 | + &[type="default"] { | ||
| 136 | + border-color: #f97316; | ||
| 137 | + color: #f97316; | ||
| 138 | + | ||
| 139 | + &:hover { | ||
| 140 | + background-color: #f97316; | ||
| 141 | + color: white; | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | +} | ||
| 145 | + | ||
| 146 | +// 响应式适配 | ||
| 147 | +@media (max-width: 750rpx) { | ||
| 148 | + .post-page { | ||
| 149 | + .vehicle-list { | ||
| 150 | + .w-32 { | ||
| 151 | + width: 180rpx !important; | ||
| 152 | + height: 135rpx !important; | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + .grid { | ||
| 157 | + .w-full.h-36 { | ||
| 158 | + height: 240rpx; | ||
| 159 | + } | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + .font-medium { | ||
| 163 | + font-size: 26rpx; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + .text-xs { | ||
| 167 | + font-size: 22rpx; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | +} | ||
| 171 | + | ||
| 172 | +// 深色模式适配 | ||
| 173 | +@media (prefers-color-scheme: dark) { | ||
| 174 | + .post-page { | ||
| 175 | + .bg-white { | ||
| 176 | + background-color: #1f2937; | ||
| 177 | + border-color: #374151; | ||
| 178 | + color: #f9fafb; | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + .text-gray-600 { | ||
| 182 | + color: #9ca3af; | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + .text-gray-500 { | ||
| 186 | + color: #6b7280; | ||
| 187 | + } | ||
| 188 | + } | ||
| 189 | +} | ||
| 190 | + | ||
| 191 | +// 动画效果 | ||
| 192 | +@keyframes spin { | ||
| 193 | + 0% { | ||
| 194 | + transform: rotate(0deg); | ||
| 195 | + } | ||
| 196 | + 100% { | ||
| 197 | + transform: rotate(360deg); | ||
| 198 | + } | ||
| 199 | +} | ||
| 200 | + | ||
| 201 | +@keyframes fadeInUp { | ||
| 202 | + from { | ||
| 203 | + opacity: 0; | ||
| 204 | + transform: translateY(30rpx); | ||
| 205 | + } | ||
| 206 | + to { | ||
| 207 | + opacity: 1; | ||
| 208 | + transform: translateY(0); | ||
| 209 | + } | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | +// 卡片进入动画 | ||
| 213 | +.post-page .vehicle-list > .space-y-4 > view { | ||
| 214 | + animation: fadeInUp 0.6s ease-out; | ||
| 215 | +} | ||
| 216 | + | ||
| 217 | +.post-page .grid > view { | ||
| 218 | + animation: fadeInUp 0.6s ease-out; | ||
| 219 | +} | ||
| 220 | + | ||
| 221 | +// 滚动条样式 | ||
| 222 | +::-webkit-scrollbar { | ||
| 223 | + width: 8rpx; | ||
| 224 | +} | ||
| 225 | + | ||
| 226 | +::-webkit-scrollbar-track { | ||
| 227 | + background: #f1f1f1; | ||
| 228 | + border-radius: 4rpx; | ||
| 229 | +} | ||
| 230 | + | ||
| 231 | +::-webkit-scrollbar-thumb { | ||
| 232 | + background: #c1c1c1; | ||
| 233 | + border-radius: 4rpx; | ||
| 234 | + | ||
| 235 | + &:hover { | ||
| 236 | + background: #a8a8a8; | ||
| 237 | + } | ||
| 238 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <template> | 1 | <template> |
| 2 | - <view> | 2 | + <view class="post-page"> |
| 3 | <view class="flex flex-col bg-white min-h-screen"> | 3 | <view class="flex flex-col bg-white min-h-screen"> |
| 4 | <!-- Header --> | 4 | <!-- Header --> |
| 5 | <nut-sticky> | 5 | <nut-sticky> |
| ... | @@ -44,7 +44,7 @@ | ... | @@ -44,7 +44,7 @@ |
| 44 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | <view class="flex-1 p-3 relative"> | 46 | <view class="flex-1 p-3 relative"> |
| 47 | - <view class="absolute top-2 right-2" @tap.stop="() => toggleFavorite(scooter.id)"> | 47 | + <view class="absolute top-3 right-4" @tap.stop="() => toggleFavorite(scooter.id)"> |
| 48 | <Addfollow v-if="!favoriteIds.includes(scooter.id)" size="16" color="#9ca3af" /> | 48 | <Addfollow v-if="!favoriteIds.includes(scooter.id)" size="16" color="#9ca3af" /> |
| 49 | <HeartFill v-else size="16" color="#ef4444" /> | 49 | <HeartFill v-else size="16" color="#ef4444" /> |
| 50 | </view> | 50 | </view> |
| ... | @@ -132,7 +132,7 @@ | ... | @@ -132,7 +132,7 @@ |
| 132 | <script setup> | 132 | <script setup> |
| 133 | import { ref } from 'vue' | 133 | import { ref } from 'vue' |
| 134 | import Taro from '@tarojs/taro' | 134 | import Taro from '@tarojs/taro' |
| 135 | -import { Search2, Right, RectRight, Check, Addfollow, HeartFill } from '@nutui/icons-vue-taro' | 135 | +import { Search2, RectRight, Check, Addfollow, HeartFill } from '@nutui/icons-vue-taro' |
| 136 | import TabBar from '@/components/TabBar.vue' | 136 | import TabBar from '@/components/TabBar.vue' |
| 137 | 137 | ||
| 138 | // 响应式数据 | 138 | // 响应式数据 |
| ... | @@ -393,6 +393,8 @@ const loadMoreData = async () => { | ... | @@ -393,6 +393,8 @@ const loadMoreData = async () => { |
| 393 | </script> | 393 | </script> |
| 394 | 394 | ||
| 395 | <style lang="less"> | 395 | <style lang="less"> |
| 396 | +@import './index.less'; | ||
| 397 | + | ||
| 396 | // 使用Tailwind CSS类,只保留必要的自定义样式 | 398 | // 使用Tailwind CSS类,只保留必要的自定义样式 |
| 397 | .space-y-4>view:not(:first-child) { | 399 | .space-y-4>view:not(:first-child) { |
| 398 | margin-top: 1rem; | 400 | margin-top: 1rem; | ... | ... |
-
Please register or login to post a comment