OtherProductItem.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div class="item" :class="{'float-item': float}" style="cursor: pointer;position: relative;" @click="goPage('/product-detail/'+productSummary.skuGroupId)">
  3. <v-lazy-image class="logo" :src="productSummary.imageUrl" src-placeholder="https://photoprism.hichinatravel.com/api/v1/t/2bfc32550ae040956f7e861566d26c487c0143e7/32mcf2k4/tile_224" alt="" />
  4. <div class="overlay" v-if="showIcon">
  5. <el-icon size="24">
  6. <svg-icon icon-class="money" color="#FFF033"/>
  7. </el-icon>
  8. </div>
  9. <div class="item-content">
  10. <p class="time">Start from ¥ {{ productSummary.minPrice }}</p>
  11. <p class="title mt-20"><a :href="'./product-detail/'+productSummary.skuGroupId">{{ productSummary.skuGroupName }}</a></p>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup>
  16. import VLazyImage from "v-lazy-image";
  17. import router from "../../../router";
  18. const props = defineProps({
  19. float: Boolean,
  20. showIcon: Boolean,
  21. productSummary: {
  22. type: Object
  23. }
  24. })
  25. function goPage(val){
  26. router.push({path: val})
  27. }
  28. </script>
  29. <style scoped lang="scss">
  30. .item {
  31. margin-bottom: 30px;
  32. width: 314px;
  33. height: 295px;
  34. border-radius: 4px;
  35. box-shadow: 0 0 10px 0 rgba(204, 204, 204, 1);
  36. overflow: hidden;
  37. background: white;
  38. &.float-item {
  39. display: inline-block;
  40. float: left;
  41. margin-left: 10px;
  42. margin-right: 10px;
  43. }
  44. .logo {
  45. display: block;
  46. width: 100%;
  47. height: 151px;
  48. transition: .3s;
  49. &:hover {
  50. transform: scale(1.05);
  51. }
  52. }
  53. &-content {
  54. padding: 22px 20px 35px;
  55. }
  56. .time {
  57. color: blue;
  58. font-size: 17px;
  59. text-align: center;
  60. }
  61. .title {
  62. color: rgba(86, 85, 85, 1);
  63. font-size: 17px;
  64. font-weight: bold;
  65. }
  66. }
  67. .overlay {
  68. position: absolute;
  69. top: 0;
  70. left: 0;
  71. width: 100%;
  72. height: 100%;
  73. display: flex;
  74. justify-content: left;
  75. align-items: left;
  76. background-color: rgba(0, 0, 0, 0.1); /* Adjust the background color and transparency as needed */
  77. }
  78. .overlay i {
  79. color: #fff; /* Adjust the icon color as needed */
  80. font-size: 24px; /* Adjust the icon size as needed */
  81. }
  82. </style>