index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 line2'>{{item.store_name}}</view>
  21. <view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.price}}</text></view>
  22. </view>
  23. </view> -->
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. mapGetters
  29. } from "vuex";
  30. import {
  31. goShopDetail
  32. } from '@/libs/order.js'
  33. import colors from "@/mixins/color";
  34. export default {
  35. computed: mapGetters(['uid']),
  36. props: {
  37. hostProduct: {
  38. type: Array,
  39. default: function() {
  40. return [];
  41. }
  42. }
  43. },
  44. mixins: [colors],
  45. data() {
  46. return {
  47. };
  48. },
  49. methods: {
  50. goDetail(item) {
  51. goShopDetail(item, this.uid).then(res => {
  52. uni.navigateTo({
  53. url: `/pages/goods_details/index?id=${item.id}`
  54. })
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .recommend {
  62. background-color: #fff;
  63. }
  64. .recommend .title {
  65. height: 135rpx;
  66. font-size: 28rpx;
  67. color: #282828;
  68. }
  69. .recommend .title .name {
  70. margin: 0 28rpx;
  71. }
  72. .recommend .title .iconfont {
  73. font-size: 170rpx;
  74. color: #454545;
  75. }
  76. .recommend .title .iconfont.lefticon {
  77. transform: rotate(180deg);
  78. }
  79. .recommend .recommendList {
  80. padding: 0 30rpx;
  81. }
  82. .recommend .recommendList .item {
  83. width: 335rpx;
  84. margin-bottom: 30rpx;
  85. border-radius: 20rpx 20rpx 0 0;
  86. box-shadow: 0rpx 3rpx 10rpx 2rpx rgba(0, 0, 0, 0.03);
  87. padding-bottom: 10rpx;
  88. }
  89. .recommend .recommendList .item .pictrue {
  90. position: relative;
  91. width: 100%;
  92. height: 335rpx;
  93. }
  94. .recommend .recommendList .item .pictrue {
  95. /deep/,
  96. /deep/image,
  97. /deep/.easy-loadimage,
  98. /deep/uni-image {
  99. width: 100%;
  100. height: 335rpx;
  101. border-radius: 20rpx;
  102. }
  103. }
  104. .recommend .recommendList .item .name {
  105. font-size: 28rpx;
  106. color: #282828;
  107. margin-top: 20rpx;
  108. padding: 0 10rpx;
  109. line-height: 34rpx;
  110. height: 68rpx;
  111. }
  112. .recommend .recommendList .item .money {
  113. font-size: 20rpx;
  114. margin-top: 8rpx;
  115. padding: 0 10rpx 0rpx 10rpx;
  116. }
  117. .recommend .vip-money {
  118. font-size: 24rpx;
  119. color: #282828;
  120. font-weight: bold;
  121. display: flex;
  122. align-items: center;
  123. padding: 0rpx 0 0 10rpx;
  124. image {
  125. width: 46rpx;
  126. height: 21rpx;
  127. margin-left: 4rpx;
  128. }
  129. }
  130. .recommend .recommendList .item .money .num {
  131. font-size: 28rpx;
  132. }
  133. </style>