feat: 优化车辆状态显示和审核原因展示
- 修改车辆状态标签样式为边框风格 - 添加NutEllipsis组件用于折叠长文本的审核原因 - 调整页面布局和间距 - 统一认证和卖车审核的操作类型参数 - 更新搜索框和消息图标样式
Showing
9 changed files
with
52 additions
and
23 deletions
| ... | @@ -17,6 +17,7 @@ declare module 'vue' { | ... | @@ -17,6 +17,7 @@ declare module 'vue' { |
| 17 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] | 17 | NutConfigProvider: typeof import('@nutui/nutui-taro')['ConfigProvider'] |
| 18 | NutDatePicker: typeof import('@nutui/nutui-taro')['DatePicker'] | 18 | NutDatePicker: typeof import('@nutui/nutui-taro')['DatePicker'] |
| 19 | NutDialog: typeof import('@nutui/nutui-taro')['Dialog'] | 19 | NutDialog: typeof import('@nutui/nutui-taro')['Dialog'] |
| 20 | + NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis'] | ||
| 20 | NutForm: typeof import('@nutui/nutui-taro')['Form'] | 21 | NutForm: typeof import('@nutui/nutui-taro')['Form'] |
| 21 | NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] | 22 | NutFormItem: typeof import('@nutui/nutui-taro')['FormItem'] |
| 22 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] | 23 | NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] | ... | ... |
| ... | @@ -35,7 +35,7 @@ | ... | @@ -35,7 +35,7 @@ |
| 35 | @click="navigateTo('/pages/messages/index')" | 35 | @click="navigateTo('/pages/messages/index')" |
| 36 | :class="getTabClass('messages')" | 36 | :class="getTabClass('messages')" |
| 37 | > | 37 | > |
| 38 | - <Comment size="20" :color="getIconColor('messages')" /> | 38 | + <Message size="20" :color="getIconColor('messages')" /> |
| 39 | <span class="text-xs mt-1">消息</span> | 39 | <span class="text-xs mt-1">消息</span> |
| 40 | </view> | 40 | </view> |
| 41 | 41 | ||
| ... | @@ -55,7 +55,7 @@ | ... | @@ -55,7 +55,7 @@ |
| 55 | <script setup> | 55 | <script setup> |
| 56 | import { ref, onMounted } from 'vue' | 56 | import { ref, onMounted } from 'vue' |
| 57 | import Taro from '@tarojs/taro' | 57 | import Taro from '@tarojs/taro' |
| 58 | -import { Home, Category, Comment, My } from '@nutui/icons-vue-taro' | 58 | +import { Home, Category, Message, My } from '@nutui/icons-vue-taro' |
| 59 | import { useUserStore } from '@/stores/user' | 59 | import { useUserStore } from '@/stores/user' |
| 60 | import { checkPermission, PERMISSION_TYPES } from '@/utils/permission' | 60 | import { checkPermission, PERMISSION_TYPES } from '@/utils/permission' |
| 61 | 61 | ... | ... |
| 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-16 09:50:03 | 4 | + * @LastEditTime: 2025-07-17 09:58:32 |
| 5 | * @FilePath: /jgdl/src/pages/index/index.vue | 5 | * @FilePath: /jgdl/src/pages/index/index.vue |
| 6 | * @Description: 捡个电驴首页 | 6 | * @Description: 捡个电驴首页 |
| 7 | --> | 7 | --> |
| ... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
| 9 | <view class="flex flex-col bg-orange-50 min-h-screen" style="background-color: #f6f6f6;"> | 9 | <view class="flex flex-col bg-orange-50 min-h-screen" style="background-color: #f6f6f6;"> |
| 10 | <!-- Header --> | 10 | <!-- Header --> |
| 11 | <nut-sticky> | 11 | <nut-sticky> |
| 12 | - <view class="bg-orange-400 px-4"> | 12 | + <view class="bg-orange-400 px-4" style="padding-right: 0;"> |
| 13 | <nut-row type="flex" justify="center" align="center"> | 13 | <nut-row type="flex" justify="center" align="center"> |
| 14 | <nut-col span="6"> | 14 | <nut-col span="6"> |
| 15 | <view class="text-xl font-bold text-white">捡个电驴</view> | 15 | <view class="text-xl font-bold text-white">捡个电驴</view> |
| ... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
| 17 | <nut-col span="18"> | 17 | <nut-col span="18"> |
| 18 | <!-- Search Bar --> | 18 | <!-- Search Bar --> |
| 19 | <nut-searchbar v-model="searchValue" placeholder="搜索更多商品" :disabled="true" @click-input="onSearchHandle" | 19 | <nut-searchbar v-model="searchValue" placeholder="搜索更多商品" :disabled="true" @click-input="onSearchHandle" |
| 20 | - shape="round" background="transparent" input-background="#ffffff"> | 20 | + shape="round" background="transparent" input-background="rgba(255,255,255,0.85)"> |
| 21 | <template #leftin> | 21 | <template #leftin> |
| 22 | <Search2 /> | 22 | <Search2 /> |
| 23 | </template> | 23 | </template> | ... | ... |
| ... | @@ -82,6 +82,9 @@ | ... | @@ -82,6 +82,9 @@ |
| 82 | border-radius: 8rpx; | 82 | border-radius: 8rpx; |
| 83 | padding: 12rpx; | 83 | padding: 12rpx; |
| 84 | margin-top: 8rpx; | 84 | margin-top: 8rpx; |
| 85 | + color: #dc2626; | ||
| 86 | + font-size: 23rpx; | ||
| 87 | + margin-bottom: 8rpx; | ||
| 85 | 88 | ||
| 86 | text { | 89 | text { |
| 87 | font-size: 22rpx; | 90 | font-size: 22rpx; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 17:02:41 | 4 | + * @LastEditTime: 2025-07-17 10:31:45 |
| 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myAuthCar/index.vue |
| 6 | * @Description: 我的认证车页面 | 6 | * @Description: 我的认证车页面 |
| 7 | --> | 7 | --> |
| ... | @@ -46,6 +46,9 @@ | ... | @@ -46,6 +46,9 @@ |
| 46 | <!-- 认证失败原因 --> | 46 | <!-- 认证失败原因 --> |
| 47 | <view v-if="item.verification_status === 7 && item.verification_reason" class="verification-reason mt-1"> | 47 | <view v-if="item.verification_status === 7 && item.verification_reason" class="verification-reason mt-1"> |
| 48 | <text class="text-xs text-red-500">审核结果:{{ item.verification_reason }}</text> | 48 | <text class="text-xs text-red-500">审核结果:{{ item.verification_reason }}</text> |
| 49 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 50 | + <nut-ellipsis :content="item.verification_reason" direction="end" rows="2" expand-text="展开" collapse-text="收起"></nut-ellipsis> | ||
| 51 | + </nut-config-provider> | ||
| 49 | </view> | 52 | </view> |
| 50 | <!-- <view class="mt-2 flex justify-between items-center"> | 53 | <!-- <view class="mt-2 flex justify-between items-center"> |
| 51 | <view> | 54 | <view> |
| ... | @@ -113,6 +116,10 @@ import './index.less' | ... | @@ -113,6 +116,10 @@ import './index.less' |
| 113 | import { getMyListingVehicleAPI } from '@/api/car' | 116 | import { getMyListingVehicleAPI } from '@/api/car' |
| 114 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 117 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 115 | 118 | ||
| 119 | +const themeVars = { | ||
| 120 | + ellipsisExpandCollapseColor: '#f97316' | ||
| 121 | +} | ||
| 122 | + | ||
| 116 | // ==================== API相关 ==================== | 123 | // ==================== API相关 ==================== |
| 117 | 124 | ||
| 118 | // ==================== 响应式数据 ==================== | 125 | // ==================== 响应式数据 ==================== | ... | ... |
| ... | @@ -74,26 +74,32 @@ | ... | @@ -74,26 +74,32 @@ |
| 74 | padding: 8rpx 16rpx; | 74 | padding: 8rpx 16rpx; |
| 75 | border-radius: 24rpx; | 75 | border-radius: 24rpx; |
| 76 | font-size: 22rpx; | 76 | font-size: 22rpx; |
| 77 | - color: white; | 77 | + background: white; |
| 78 | + border: 2rpx solid; | ||
| 78 | 79 | ||
| 79 | &.verified { | 80 | &.verified { |
| 80 | - background: linear-gradient(135deg, #10b981, #059669); | 81 | + color: #10b981; |
| 82 | + border-color: #10b981; | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | &.unverified { | 85 | &.unverified { |
| 84 | - background: linear-gradient(135deg, #6b7280, #4b5563); | 86 | + color: #6b7280; |
| 87 | + border-color: #6b7280; | ||
| 85 | } | 88 | } |
| 86 | 89 | ||
| 87 | &.review { | 90 | &.review { |
| 88 | - background: linear-gradient(135deg, #f59e0b, #d97706); | 91 | + color: #f59e0b; |
| 92 | + border-color: #f59e0b; | ||
| 89 | } | 93 | } |
| 90 | 94 | ||
| 91 | &.failed { | 95 | &.failed { |
| 92 | - background: linear-gradient(135deg, #ef4444, #dc2626); | 96 | + color: #ef4444; |
| 97 | + border-color: #ef4444; | ||
| 93 | } | 98 | } |
| 94 | 99 | ||
| 95 | &.offline { | 100 | &.offline { |
| 96 | - background: linear-gradient(135deg, #ef4444, #dc2626); | 101 | + color: #ef4444; |
| 102 | + border-color: #ef4444; | ||
| 97 | } | 103 | } |
| 98 | } | 104 | } |
| 99 | 105 | ||
| ... | @@ -105,7 +111,7 @@ | ... | @@ -105,7 +111,7 @@ |
| 105 | /* 车辆图片 */ | 111 | /* 车辆图片 */ |
| 106 | .car-image-container { | 112 | .car-image-container { |
| 107 | width: 100%; | 113 | width: 100%; |
| 108 | - aspect-ratio: 1; | 114 | + aspect-ratio: 0.8; |
| 109 | border-radius: 24rpx; | 115 | border-radius: 24rpx; |
| 110 | overflow: hidden; | 116 | overflow: hidden; |
| 111 | } | 117 | } |
| ... | @@ -131,7 +137,7 @@ | ... | @@ -131,7 +137,7 @@ |
| 131 | .car-details { | 137 | .car-details { |
| 132 | display: flex; | 138 | display: flex; |
| 133 | gap: 32rpx; | 139 | gap: 32rpx; |
| 134 | - margin-bottom: 24rpx; | 140 | + margin-bottom: 10rpx; |
| 135 | } | 141 | } |
| 136 | 142 | ||
| 137 | .detail-item { | 143 | .detail-item { |
| ... | @@ -149,6 +155,9 @@ | ... | @@ -149,6 +155,9 @@ |
| 149 | border-radius: 8rpx; | 155 | border-radius: 8rpx; |
| 150 | padding: 12rpx; | 156 | padding: 12rpx; |
| 151 | margin-top: 8rpx; | 157 | margin-top: 8rpx; |
| 158 | + color: #dc2626; | ||
| 159 | + font-size: 23rpx; | ||
| 160 | + margin-bottom: 8rpx; | ||
| 152 | 161 | ||
| 153 | text { | 162 | text { |
| 154 | font-size: 22rpx; | 163 | font-size: 22rpx; |
| ... | @@ -244,6 +253,8 @@ | ... | @@ -244,6 +253,8 @@ |
| 244 | .status-badge { | 253 | .status-badge { |
| 245 | font-size: 20rpx; | 254 | font-size: 20rpx; |
| 246 | padding: 6rpx 12rpx; | 255 | padding: 6rpx 12rpx; |
| 256 | + background: white; | ||
| 257 | + border: 2rpx solid; | ||
| 247 | } | 258 | } |
| 248 | 259 | ||
| 249 | .status-icon { | 260 | .status-icon { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 16:51:29 | 4 | + * @LastEditTime: 2025-07-17 10:42:22 |
| 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -58,8 +58,11 @@ | ... | @@ -58,8 +58,11 @@ |
| 58 | <text class="detail-item">续航 {{ car.range_km }}km | 最高时速 {{ car.max_speed_kmh }}km/h</text> | 58 | <text class="detail-item">续航 {{ car.range_km }}km | 最高时速 {{ car.max_speed_kmh }}km/h</text> |
| 59 | </view> | 59 | </view> |
| 60 | <!-- 审核原因 --> | 60 | <!-- 审核原因 --> |
| 61 | - <view v-if="car.review_reason" class="verification-reason mt-1"> | 61 | + <view v-if="car.review_reason" class="verification-reason mt-2"> |
| 62 | - <text class="text-xs text-red-500">审核结果:{{ car.review_reason }}</text> | 62 | + <!-- <text class="text-xs text-red-500">审核结果:{{ car.review_reason }}</text> --> |
| 63 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 64 | + <nut-ellipsis :content="car.review_reason" direction="end" rows="2" expand-text="展开" collapse-text="收起"></nut-ellipsis> | ||
| 65 | + </nut-config-provider> | ||
| 63 | </view> | 66 | </view> |
| 64 | <view class="price-section"> | 67 | <view class="price-section"> |
| 65 | <view v-if="car.price" class="current-price">¥{{ car.price }}</view> | 68 | <view v-if="car.price" class="current-price">¥{{ car.price }}</view> |
| ... | @@ -70,7 +73,7 @@ | ... | @@ -70,7 +73,7 @@ |
| 70 | </nut-row> | 73 | </nut-row> |
| 71 | 74 | ||
| 72 | <!-- 操作按钮 --> | 75 | <!-- 操作按钮 --> |
| 73 | - <view class="action-buttons mt-4"> | 76 | + <view class="action-buttons mt-2"> |
| 74 | <nut-button size="small" type="default" @click="editCar(car.id)">编辑</nut-button> | 77 | <nut-button size="small" type="default" @click="editCar(car.id)">编辑</nut-button> |
| 75 | <!-- 只有审核状态为3时才显示上架/下架按钮 --> | 78 | <!-- 只有审核状态为3时才显示上架/下架按钮 --> |
| 76 | <nut-button | 79 | <nut-button |
| ... | @@ -128,6 +131,10 @@ import './index.less' | ... | @@ -128,6 +131,10 @@ import './index.less' |
| 128 | // 导入接口 | 131 | // 导入接口 |
| 129 | import { getMyListingVehicleAPI, changeVehicleStatusAPI } from '@/api/car'; | 132 | import { getMyListingVehicleAPI, changeVehicleStatusAPI } from '@/api/car'; |
| 130 | 133 | ||
| 134 | +const themeVars = { | ||
| 135 | + ellipsisExpandCollapseColor: '#f97316' | ||
| 136 | +} | ||
| 137 | + | ||
| 131 | // 认证状态映射 | 138 | // 认证状态映射 |
| 132 | const verifyStatus = ref({ | 139 | const verifyStatus = ref({ |
| 133 | 1: '未认证', | 140 | 1: '未认证', | ... | ... |
| ... | @@ -863,8 +863,8 @@ const createCar = async (data) => { | ... | @@ -863,8 +863,8 @@ const createCar = async (data) => { |
| 863 | 863 | ||
| 864 | const updateCar = async (id, data) => { | 864 | const updateCar = async (id, data) => { |
| 865 | // 只编辑车辆时,op=edit,表示只编辑车辆信息 | 865 | // 只编辑车辆时,op=edit,表示只编辑车辆信息 |
| 866 | - // 编辑车辆,且申请认证时,op=verification,表示申请认证 | 866 | + // 编辑车辆,且申请卖车时,op=review,表示申请卖车审核 |
| 867 | - const { code } = await editVehicleAPI({ id, ...data, op: isAuthMode.value ? 'verification' : 'edit' }) | 867 | + const { code } = await editVehicleAPI({ id, ...data, op: isAuthMode.value ? 'review' : 'edit' }) |
| 868 | if (code) { | 868 | if (code) { |
| 869 | Taro.hideLoading() | 869 | Taro.hideLoading() |
| 870 | Taro.showToast({ | 870 | Taro.showToast({ | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 15:57:39 | 4 | + * @LastEditTime: 2025-07-17 10:36:52 |
| 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/setAuthCar/index.vue |
| 6 | * @Description: 申请认证 | 6 | * @Description: 申请认证 |
| 7 | --> | 7 | --> |
| ... | @@ -468,8 +468,8 @@ const onSubmit = async () => { | ... | @@ -468,8 +468,8 @@ const onSubmit = async () => { |
| 468 | try { | 468 | try { |
| 469 | // 调用真实API | 469 | // 调用真实API |
| 470 | if (isEditMode.value) { | 470 | if (isEditMode.value) { |
| 471 | - // 编辑车辆,且申请卖车时,op=review,表示申请卖车审核 | 471 | + // 编辑车辆,且认证时,op=verification,表示申请认证 |
| 472 | - const { code } = await editVehicleAPI({ id: carId.value, ...formData, op: 'review' }) | 472 | + const { code } = await editVehicleAPI({ id: carId.value, ...formData, op: 'verification' }) |
| 473 | if (!code) { | 473 | if (!code) { |
| 474 | throw new Error('更新失败') | 474 | throw new Error('更新失败') |
| 475 | } | 475 | } | ... | ... |
-
Please register or login to post a comment