hookehuyr

✨ feat: 搜索结果页-产品显示一行4个,图片可以点击

李琛需求
1 <!-- 1 <!--
2 * @Date: 2024-10-20 16:57:48 2 * @Date: 2024-10-20 16:57:48
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-28 15:03:14 4 + * @LastEditTime: 2024-10-28 15:53:43
5 * @FilePath: /hager/src/views/search.vue 5 * @FilePath: /hager/src/views/search.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
14 <div slot="label" class="customer-label">产品&nbsp;&nbsp;<span>{{ count_product }}</span></div> 14 <div slot="label" class="customer-label">产品&nbsp;&nbsp;<span>{{ count_product }}</span></div>
15 <div class="search-product-list"> 15 <div class="search-product-list">
16 <div :class="['search-product-item', is_xs ? 'xs' : '']" v-for="(item, index) in product_list" :key="index"> 16 <div :class="['search-product-item', is_xs ? 'xs' : '']" v-for="(item, index) in product_list" :key="index">
17 - <div :class="['search-product-item-img', is_xs ? 'xs' : '']" :style="{ 'background-image': 'url('+ item.cover +')' }"> 17 + <div @click="goToDetail(item)" :class="['search-product-item-img', is_xs ? 'xs' : '']" :style="{ 'background-image': 'url('+ item.cover +')' }">
18 <!-- <div :class="['search-product-item-img', is_xs ? 'xs' : '']"> --> 18 <!-- <div :class="['search-product-item-img', is_xs ? 'xs' : '']"> -->
19 <!-- <img style="width: 100%; height: auto;" :src="item.cover"> --> 19 <!-- <img style="width: 100%; height: auto;" :src="item.cover"> -->
20 </div> 20 </div>
...@@ -288,7 +288,7 @@ export default { ...@@ -288,7 +288,7 @@ export default {
288 margin-top: 1rem; 288 margin-top: 1rem;
289 } 289 }
290 .search-product-item { 290 .search-product-item {
291 - width: calc(33.54% - 1rem); 291 + width: calc(25.25% - 1rem);
292 &.xs { 292 &.xs {
293 width: calc(50% - 1rem); 293 width: calc(50% - 1rem);
294 } 294 }
...@@ -313,6 +313,10 @@ export default { ...@@ -313,6 +313,10 @@ export default {
313 width: 100%; 313 width: 100%;
314 } 314 }
315 } 315 }
316 +
317 + &:hover {
318 + cursor: pointer;
319 + }
316 } 320 }
317 .search-product-item-title { 321 .search-product-item-title {
318 text-align: left; 322 text-align: left;
......