index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class='recommend' :style="colorStyle">
  3. <view class='title acea-row row-center-wrapper'>
  4. <text class='iconfont icon-zhuangshixian'></text>
  5. <text class='name'>{{$t(`热门推荐`)}}</text>
  6. <text class='iconfont icon-zhuangshixian lefticon'></text>
  7. </view>
  8. <view class='recommendList acea-row row-between-wrapper'>
  9. <view class='item' v-for="(item,index) in hostProduct" :key="index" hover-class='none'
  10. @tap="goDetail(item)">
  11. <view class='pictrue'>
  12. <easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
  13. <span class="pictrue_log_big pictrue_log_class"
  14. v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  15. <span class="pictrue_log_big pictrue_log_class"
  16. v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  17. <span class="pictrue_log_big pictrue_log_class"
  18. v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  19. </view>
  20. <view class='name line1'>{{item.store_name}}</view>
  21. <view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.price}}</text></view>
  22. <view class='vip-money' v-if="item.vip_price && item.vip_price > 0 && item.base">
  23. {{$t(`¥`)}}{{item.vip_price}}
  24. <image src='/static/images/jvip.png' class="jvip"></image>
  25. </view>
  26. <view class='vip-money' v-if="item.vip_price && item.vip_price > 0 && item.is_vip">
  27. {{$t(`¥`)}}{{item.vip_price}}
  28. <image src='/static/images/vip.png'></image>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. mapGetters
  37. } from "vuex";
  38. import {
  39. goShopDetail
  40. } from '@/libs/order.js'
  41. import colors from "@/mixins/color";
  42. export default {
  43. computed: mapGetters(['uid']),
  44. props: {
  45. hostProduct: {
  46. type: Array,
  47. default: function() {
  48. return [];
  49. }
  50. }
  51. },
  52. mixins: [colors],
  53. data() {
  54. return {
  55. };
  56. },
  57. methods: {
  58. goDetail(item) {
  59. goShopDetail(item, this.uid).then(res => {
  60. uni.navigateTo({
  61. url: `/pages/goods_details/index?id=${item.id}`
  62. })
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .recommend {
  70. background-color: #fff;
  71. }
  72. .recommend .title {
  73. height: 135rpx;
  74. font-size: 28rpx;
  75. color: #282828;
  76. }
  77. .recommend .title .name {
  78. margin: 0 28rpx;
  79. }
  80. .recommend .title .iconfont {
  81. font-size: 170rpx;
  82. color: #454545;
  83. }
  84. .recommend .title .iconfont.lefticon {
  85. transform: rotate(180deg);
  86. }
  87. .recommend .recommendList {
  88. padding: 0 30rpx;
  89. }
  90. .recommend .recommendList .item {
  91. width: 335rpx;
  92. margin-bottom: 30rpx;
  93. border-radius: 20rpx 20rpx 0 0;
  94. box-shadow: 0rpx 3rpx 10rpx 2rpx rgba(0, 0, 0, 0.03);
  95. padding-bottom: 10rpx;
  96. }
  97. .recommend .recommendList .item .pictrue {
  98. position: relative;
  99. width: 100%;
  100. height: 335rpx;
  101. }
  102. .recommend .recommendList .item .pictrue {
  103. /deep/,
  104. /deep/image,
  105. /deep/.easy-loadimage,
  106. /deep/uni-image {
  107. width: 100%;
  108. height: 335rpx;
  109. border-radius: 20rpx;
  110. }
  111. }
  112. .recommend .recommendList .item .name {
  113. font-size: 28rpx;
  114. color: #282828;
  115. margin-top: 20rpx;
  116. padding: 0 10rpx;
  117. }
  118. .recommend .recommendList .item .money {
  119. font-size: 20rpx;
  120. margin-top: 8rpx;
  121. padding: 0 10rpx 0rpx 10rpx;
  122. }
  123. .recommend .vip-money {
  124. font-size: 24rpx;
  125. color: #282828;
  126. font-weight: bold;
  127. display: flex;
  128. align-items: center;
  129. padding: 0rpx 0 0 10rpx;
  130. image {
  131. width: 46rpx;
  132. height: 21rpx;
  133. margin-left: 4rpx;
  134. }
  135. }
  136. .recommend .recommendList .item .money .num {
  137. font-size: 28rpx;
  138. }
  139. </style>