Browse Source

优先展示商品规格图片,没有则显示返回的封面图片

lifanagju_citu 4 months ago
parent
commit
90a092dc64
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/views/mall/cart/index.vue

+ 1 - 1
src/views/mall/cart/index.vue

@@ -22,7 +22,7 @@
           <v-checkbox v-model="item.selected" hide-details color="primary" @update:modelValue="val => handleSelect(val, item.id)"></v-checkbox>
         </template>
         <template v-slot:[`item.spuName`]="{ item }">
-          <GoodsItem :item="{ ...item.sku, ...item.spu, spuName: item.spu.name }" :showLine="false" :showPriceCount="false" class="mb-1" />
+          <GoodsItem :item="{ ...item.sku, ...item.spu, spuName: item.spu.name, picUrl: item.sku?.picUrl || item.spu?.picUrl }" :showLine="false" :showPriceCount="false" class="mb-1" />
         </template>
         <template v-slot:[`item.count`]="{ item }">
           <v-number-input