hotGoods.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="">
  3. <view class="goods-top">
  4. <image src="@/static/icon/jxgoods.png" mode=""></image>
  5. <text>精选好物</text><text>买多赚多</text>
  6. </view>
  7. <view class="goods-list">
  8. <view class="goods-list-top">
  9. <view class="goods-list-title">
  10. <text>精选好货 平台推荐</text><br>
  11. <text>买到就是赚到</text>
  12. </view>
  13. <navigator url="/pages/product/classify?type=1">
  14. <view class="goods-list-more">
  15. <image src="@/static/icon/more.png"></image>
  16. </view>
  17. </navigator>
  18. </view>
  19. <view class="list">
  20. <view class="list-g">
  21. <view class="scroll-boxs">
  22. <scroll-view scroll-x class="right-head" style="white-space: nowrap">
  23. <view class="goods-item" v-for="g in goodsList" @click="navToDetailPage(g)">
  24. <view class="item-img">
  25. <image :src="g.image" onerror="@/static/error/errorImage.jpg"></image>
  26. </view>
  27. <view class="name">{{g.store_name}}</view>
  28. <view class="ot_price">¥{{g.price}}</view>
  29. <view class="price">¥{{g.vip_price}}</view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. errImg: require('@/static/error/errorImage.jpg'),
  43. }
  44. },
  45. props: ["goodsList"],
  46. mounted() {
  47. console.log(this.goodsList)
  48. },
  49. methods: {
  50. //详情页
  51. navToDetailPage(item) {
  52. this.$parent.$parent.$parent.navToDetailPage(item)
  53. },
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .goods-top {
  59. image {
  60. position: absolute;
  61. width: 45rpx;
  62. height: 45rpx;
  63. }
  64. text:nth-child(2) {
  65. margin:0 10rpx 0 60rpx;
  66. color: #333333;
  67. font-size: 32rpx;
  68. font-weight: bold;
  69. font-family: PingFang-SC-Bold;
  70. }
  71. text:nth-child(3) {
  72. color: #95A0B1;
  73. font-size: 18rpx;
  74. }
  75. }
  76. .goods-list-top {
  77. margin-top: 20rpx;
  78. padding: 20rpx;
  79. padding-bottom: 65rpx;
  80. border-radius: 15rpx 15rpx 0 0;
  81. background:-moz-linear-gradient(top,#438BED,#45BDEB);/*火狐*/
  82. background:-webkit-gradient(linear, 0% 0%, 100% 100%,from(#438BED), to(#45BDEB));/*谷歌*/
  83. background: linear-gradient(to right, #438BED, #45BDEB);
  84. color: #fff;
  85. display: flex;
  86. justify-content: space-between;
  87. .goods-list-title {
  88. text:nth-child(1) {
  89. font-size: 32rpx;
  90. }
  91. text:nth-child(3) {
  92. font-size: 20rpx;
  93. }
  94. }
  95. .goods-list-more {
  96. margin: auto 0;
  97. image {
  98. width: 14rpx;
  99. height: 28rpx;
  100. }
  101. }
  102. }
  103. .list {
  104. background-color: #F4F4F4;
  105. height: 300rpx;
  106. .list-g {
  107. border-radius: 15rpx;
  108. position: relative;
  109. top: -50rpx;
  110. background-color: #F4F4F4;
  111. margin: 0 10rpx;
  112. white-space: nowrap;
  113. overflow: hidden;
  114. .goods-item {
  115. border-left:solid 1rpx #F4F4F4;
  116. border-right:solid 1rpx #F4F4F4;
  117. padding: 20rpx;
  118. background-color: #fff;
  119. display: inline-block;
  120. .name {
  121. width: 174rpx;
  122. //超出文字隐藏
  123. overflow: hidden;
  124. //当文本溢出,省略号代替
  125. text-overflow:ellipsis;
  126. font-size: 31rpx;
  127. }
  128. .ot_price {
  129. color: #999999;
  130. font-size: 20rpx;
  131. text-decoration: line-through
  132. }
  133. .price {
  134. color: #EF3A55;
  135. font-size: 35rpx;
  136. }
  137. .item-img {
  138. image {
  139. width: 174rpx;
  140. height: 174rpx;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>