瀏覽代碼

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

lifanagju_citu 4 月之前
父節點
當前提交
90a092dc64
共有 1 個文件被更改,包括 1 次插入1 次删除
  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>
           <v-checkbox v-model="item.selected" hide-details color="primary" @update:modelValue="val => handleSelect(val, item.id)"></v-checkbox>
         </template>
         </template>
         <template v-slot:[`item.spuName`]="{ item }">
         <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>
         <template v-slot:[`item.count`]="{ item }">
         <template v-slot:[`item.count`]="{ item }">
           <v-number-input 
           <v-number-input