exhibit-recommend.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="exhibit-recommend">
  3. <view class="exhibit-list">
  4. <template v-for="(item, index) in [1, 2, 3, 4, 5, 6, 7, 8]">
  5. <view v-if="index < limit" class="exhibit-item" hover-class="active" :key="index" @click="onClickExhibit(item)">
  6. <view class="exhibit-image">
  7. <image src="https://oss.starify.cn/prod/starify/up/0001000075/20241113/67343f1c494de.png?x-oss-process=image/resize,w_400" mode="aspectFit"/>
  8. </view>
  9. <view class="exhibit-name">汽车连接器 86W MLK 1,2 SD-HOLDER</view>
  10. <view class="exhibit-tag">常规产品</view>
  11. </view>
  12. </template>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. options: {
  19. styleIsolation: 'shared'
  20. },
  21. components: {
  22. },
  23. props: {
  24. limit: Number
  25. },
  26. watch: {
  27. limit(val) {
  28. console.log("limit")
  29. if (val === 8) {
  30. this.$emit('show-all')
  31. }
  32. }
  33. },
  34. data() {
  35. return {
  36. }
  37. },
  38. created() {
  39. },
  40. methods: {
  41. onClickExhibit() {
  42. this.navigateTo('/pages/exhibitor/exhibit-detail')
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .exhibit-recommend{
  49. .exhibit-list{
  50. display: grid;
  51. grid-template-columns: 1fr 1fr;
  52. grid-column-gap: 18rpx;
  53. grid-row-gap: 30rpx;
  54. .exhibit-item{
  55. position: relative;
  56. &.active{
  57. .exhibit-tag{
  58. background-color: #FCEDE1;
  59. color: #E57519;
  60. }
  61. .exhibit-name{
  62. color: #E57519;
  63. }
  64. .exhibit-image{
  65. border: 1rpx solid #E57519;
  66. }
  67. }
  68. }
  69. .exhibit-image{
  70. width: 100%;
  71. height: 178rpx;
  72. border: 1rpx solid #D9D9D9;
  73. image{
  74. width: 100%;
  75. height: 100%;
  76. }
  77. }
  78. .exhibit-name {
  79. font-family: Poppins, Poppins;
  80. font-size: $fontSize0;
  81. color: #333333;
  82. margin-top: 12rpx;
  83. }
  84. .exhibit-tag{
  85. position: absolute;
  86. top: 20rpx;
  87. left: 31rpx;
  88. font-size: 10rpx;
  89. color: #333333;
  90. background-color: #E2E8F0;
  91. border-radius: 4rpx;
  92. padding: 5rpx 8rpx;
  93. }
  94. }
  95. }
  96. </style>