feat(商品详情): 重构商品详情页以适配后端数据接口
- 替换静态数据为动态接口获取 - 更新字段映射以匹配后端返回结构 - 添加数据加载和空值处理逻辑 - 使用nut-rate组件替代手动星级显示
Showing
3 changed files
with
7 additions
and
7 deletions
| 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-10 17:47:49 | 4 | + * @LastEditTime: 2025-07-11 12:18:58 |
| 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue | 5 | * @FilePath: /jgdl/src/pages/myCar/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -57,8 +57,8 @@ | ... | @@ -57,8 +57,8 @@ |
| 57 | <nut-ellipsis direction="end" :content="car.note" :rows="2"></nut-ellipsis> | 57 | <nut-ellipsis direction="end" :content="car.note" :rows="2"></nut-ellipsis> |
| 58 | </view> | 58 | </view> |
| 59 | <view class="price-section"> | 59 | <view class="price-section"> |
| 60 | - <view class="current-price">¥{{ car.price }}</view> | 60 | + <view v-if="car.price" class="current-price">¥{{ car.price }}</view> |
| 61 | - <view class="market-price">市场价 ¥{{ car.market_price }}</view> | 61 | + <view v-if="car.market_price" class="market-price">市场价 ¥{{ car.market_price }}</view> |
| 62 | </view> | 62 | </view> |
| 63 | </view> | 63 | </view> |
| 64 | </nut-col> | 64 | </nut-col> | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -219,7 +219,7 @@ | ... | @@ -219,7 +219,7 @@ |
| 219 | </view> | 219 | </view> |
| 220 | <view class="form-item-right"> | 220 | <view class="form-item-right"> |
| 221 | <text class="price-symbol">¥</text> | 221 | <text class="price-symbol">¥</text> |
| 222 | - <input v-model="formData.price" placeholder="3200" type="text" class="price-input" /> | 222 | + <input v-model="formData.price" placeholder="请输入" type="text" class="price-input" /> |
| 223 | </view> | 223 | </view> |
| 224 | </view> | 224 | </view> |
| 225 | 225 | ||
| ... | @@ -230,7 +230,7 @@ | ... | @@ -230,7 +230,7 @@ |
| 230 | </view> | 230 | </view> |
| 231 | <view class="form-item-right"> | 231 | <view class="form-item-right"> |
| 232 | <text class="market-price-symbol">¥</text> | 232 | <text class="market-price-symbol">¥</text> |
| 233 | - <input v-model="formData.market_price" placeholder="6500" type="text" | 233 | + <input v-model="formData.market_price" placeholder="请输入" type="text" |
| 234 | class="market-price-input" /> | 234 | class="market-price-input" /> |
| 235 | </view> | 235 | </view> |
| 236 | </view> | 236 | </view> |
| ... | @@ -381,8 +381,8 @@ const formData = reactive({ | ... | @@ -381,8 +381,8 @@ const formData = reactive({ |
| 381 | // batteryWear: '', | 381 | // batteryWear: '', |
| 382 | brake_wear_level: '', | 382 | brake_wear_level: '', |
| 383 | tire_wear_level: '', | 383 | tire_wear_level: '', |
| 384 | - price: '3200', | 384 | + price: '', |
| 385 | - market_price: '6500', | 385 | + market_price: '', |
| 386 | note: '', | 386 | note: '', |
| 387 | // 车辆照片字段 | 387 | // 车辆照片字段 |
| 388 | front_photo: '', | 388 | front_photo: '', | ... | ... |
-
Please register or login to post a comment