hotGoods.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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="../../../static/error/errorImage.jpg" mode=""></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. props: ["goodsList"],
  41. mounted() {
  42. // console.log(this.goodsList)
  43. },
  44. methods: {
  45. //详情页
  46. navToDetailPage(item) {
  47. this.$parent.$parent.$parent.navToDetailPage(item)
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .goods-top {
  54. image {
  55. position: absolute;
  56. width: 45rpx;
  57. height: 45rpx;
  58. }
  59. text:nth-child(2) {
  60. margin:0 10rpx 0 60rpx;
  61. color: #333333;
  62. font-size: 32rpx;
  63. font-weight: bold;
  64. font-family: PingFang-SC-Bold;
  65. }
  66. text:nth-child(3) {
  67. color: #95A0B1;
  68. font-size: 18rpx;
  69. }
  70. }
  71. .goods-list-top {
  72. margin-top: 20rpx;
  73. padding: 20rpx;
  74. padding-bottom: 65rpx;
  75. border-radius: 15rpx 15rpx 0 0;
  76. background:-moz-linear-gradient(top,#438BED,#45BDEB);/*火狐*/
  77. background:-webkit-gradient(linear, 0% 0%, 100% 100%,from(#438BED), to(#45BDEB));/*谷歌*/
  78. background: linear-gradient(to right, #438BED, #45BDEB);
  79. color: #fff;
  80. display: flex;
  81. justify-content: space-between;
  82. .goods-list-title {
  83. text:nth-child(1) {
  84. font-size: 32rpx;
  85. }
  86. text:nth-child(3) {
  87. font-size: 20rpx;
  88. }
  89. }
  90. .goods-list-more {
  91. margin: auto 0;
  92. image {
  93. width: 14rpx;
  94. height: 28rpx;
  95. }
  96. }
  97. }
  98. .list {
  99. background-color: #F4F4F4;
  100. height: 300rpx;
  101. .list-g {
  102. border-radius: 15rpx;
  103. position: relative;
  104. top: -50rpx;
  105. background-color: #F4F4F4;
  106. margin: 0 10rpx;
  107. white-space: nowrap;
  108. overflow: hidden;
  109. .goods-item {
  110. border-left:solid 1rpx #F4F4F4;
  111. border-right:solid 1rpx #F4F4F4;
  112. padding: 20rpx;
  113. background-color: #fff;
  114. display: inline-block;
  115. .name {
  116. width: 174rpx;
  117. //超出文字隐藏
  118. overflow: hidden;
  119. //当文本溢出,省略号代替
  120. text-overflow:ellipsis;
  121. font-size: 31rpx;
  122. }
  123. .ot_price {
  124. color: #999999;
  125. font-size: 20rpx;
  126. text-decoration: line-through
  127. }
  128. .price {
  129. color: #EF3A55;
  130. font-size: 35rpx;
  131. }
  132. .item-img {
  133. image {
  134. width: 174rpx;
  135. height: 174rpx;
  136. }
  137. }
  138. }
  139. }
  140. }
  141. </style>