新版梦工厂手机端官网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="line_cards">
  3. <div
  4. class="card"
  5. v-for="item in caseList"
  6. :key="item.id"
  7. @click="toDetail(item.id, item.classify)"
  8. >
  9. <p class="title">{{ item.title }}</p>
  10. <div class="img_box">
  11. <img :src="item.picUrl" class="img" />
  12. <div class="bottom_text">
  13. <p>工业设计</p>
  14. <p>软硬件研发</p>
  15. <p>样机制作</p>
  16. <p>量产</p>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import { useRouter } from 'vue-router'
  24. const router = useRouter()
  25. const props = defineProps({
  26. caseList: {
  27. type: Array,
  28. },
  29. classify: {
  30. type: String,
  31. },
  32. })
  33. const toDetail = (productId, classify) => {
  34. // detail
  35. router.push({
  36. path: `/detail`,
  37. query: {
  38. t: props.classify || classify,
  39. p: productId,
  40. },
  41. })
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .line_cards {
  46. display: grid;
  47. grid-template-columns: repeat(2, 1fr);
  48. grid-template-rows: repeat(5, 1fr);
  49. column-gap: 7px;
  50. padding: 0 7px;
  51. box-sizing: border-box;
  52. row-gap: 7px;
  53. .card {
  54. background: #ffffff;
  55. border-radius: 3px;
  56. flex: 1;
  57. box-sizing: border-box;
  58. display: flex;
  59. flex-direction: column;
  60. padding: 11px 7px 7px 7px;
  61. .title {
  62. width: 150px;
  63. overflow: hidden;
  64. white-space: nowrap;
  65. text-overflow: ellipsis;
  66. font-size: 8px;
  67. height: 16px;
  68. font-family: Source Han Sans CN;
  69. font-weight: 400;
  70. color: #2f2f2f;
  71. padding-left: 2px;
  72. margin-bottom: 6px;
  73. }
  74. .img_box {
  75. width: 100%;
  76. height: 100%;
  77. position: relative;
  78. .img {
  79. width: 100%;
  80. height: 100%;
  81. object-fit: cover;
  82. }
  83. .bottom_text {
  84. position: absolute;
  85. left: -50%;
  86. bottom: -7px;
  87. background: rgba(0, 0, 0, 0.2);
  88. display: flex;
  89. padding: 5px 0;
  90. align-items: center;
  91. justify-content: space-evenly;
  92. font-size: 16px;
  93. font-family: Source Han Sans CN;
  94. font-weight: 400;
  95. color: #ffffff;
  96. width: 200%;
  97. transform: scale(0.5);
  98. }
  99. }
  100. }
  101. }
  102. </style>