guessLike.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="guess-item">
  3. <view class="guess">猜你喜欢</view>
  4. <view class="guess-scroll flex_item" scroll-x>
  5. <view class="scroll-list" v-for="ls in goodList" @click="navToDetailPage(ls)">
  6. <view class="scoll-img"><image :src="ls.image"></image></view>
  7. <view class="scoll-name ellipsis">{{ ls.store_name }}</view>
  8. <view class="price-list flex">
  9. <view class="tpl">
  10. <view class="red-price">
  11. ¥
  12. <text>{{ ls.price }}</text>
  13. </view>
  14. <view class="grey-price">¥{{ ls.ot_price }}</view>
  15. </view>
  16. <view class="img position-relative" @click.stop="Addcar(ls)">
  17. <image src="/static/img/img13.png"></image>
  18. <view class="corner" v-if="ls.cart_num > 0">
  19. <text>{{ ls.cart_num }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. goodList: {
  31. type: Array,
  32. default: function () {
  33. return []
  34. }
  35. },
  36. },
  37. methods: {
  38. // 跳转到详情页
  39. navToDetailPage(ls){
  40. this.$emit('clickNavTo',ls)
  41. },
  42. // 加入购物车
  43. Addcar(ls){
  44. this.$emit('Addcar',ls)
  45. }
  46. }
  47. };
  48. </script>
  49. <style lang="scss">
  50. //猜你喜欢
  51. .guess-item {
  52. padding: 25rpx 25rpx;
  53. background: #ffffff;
  54. margin-bottom: 15rpx;
  55. padding-bottom: 45rpx !important;
  56. .guess {
  57. color: #000000;
  58. font-size: 35rpx;
  59. font-weight: 500;
  60. padding-bottom: 25rpx;
  61. }
  62. .guess-scroll {
  63. width: 100%;
  64. font-size: 24rpx;
  65. overflow: hidden;
  66. overflow-x: auto;
  67. justify-content: flex-start;
  68. .scroll-list {
  69. border: 2rpx solid #f0f0f0;
  70. border-radius: 25rpx;
  71. margin-right: 15rpx;
  72. .scoll-img {
  73. width: 227rpx;
  74. border-top-right-radius: 25rpx;
  75. border-top-left-radius: 25rpx;
  76. height: 227rpx;
  77. overflow: hidden;
  78. image {
  79. width: 100%;
  80. height: 100%;
  81. }
  82. }
  83. .scoll-name {
  84. height: 80rpx;
  85. width: 227rpx;
  86. font-size: 22rpx;
  87. padding: 15rpx 15rpx;
  88. }
  89. .price-list {
  90. padding: 25rpx 15rpx;
  91. padding-right: 25rpx;
  92. .tpl {
  93. .red-price {
  94. color: #f31d29;
  95. text {
  96. font-size: 35rpx !important;
  97. font-weight: bold;
  98. }
  99. }
  100. .grey-price {
  101. text-decoration: line-through;
  102. color: #999999;
  103. font-size: 10px !important;
  104. }
  105. }
  106. .img {
  107. width: 45rpx;
  108. height: 45rpx;
  109. image {
  110. width: 100%;
  111. height: 100%;
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. </style>