index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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' @tap="goDetail(item)">
  10. <view class='pictrue'>
  11. <image :src='item.goodsCover'></image>
  12. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</span>
  13. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</span>
  14. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</span>
  15. </view>
  16. <view class='name line1'>{{item.goodsName}}</view>
  17. <view class='money font-color'>{{$t(`¥`)}}<text class='num'>{{item.salePrice - 0}}</text></view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {mapGetters} from "vuex";
  24. import { goShopDetail } from '@/libs/order.js'
  25. import colors from "@/mixins/color";
  26. export default {
  27. computed: mapGetters(['uid']),
  28. props: {
  29. hostProduct: {
  30. type: Array,
  31. default: function() {
  32. return [];
  33. }
  34. }
  35. },
  36. mixins: [colors],
  37. data() {
  38. return {
  39. };
  40. },
  41. methods: {
  42. goDetail(item){
  43. goShopDetail(item,this.uid).then(res=>{
  44. uni.navigateTo({
  45. url:`/pages/goods_details/index?id=${item.id}`
  46. })
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .recommend {
  54. background-color: #fff;
  55. }
  56. .recommend .title {
  57. height: 135rpx;
  58. font-size: 28rpx;
  59. color: #282828;
  60. }
  61. .recommend .title .name {
  62. margin: 0 28rpx;
  63. }
  64. .recommend .title .iconfont {
  65. font-size: 170rpx;
  66. color: #454545;
  67. }
  68. .recommend .title .iconfont.lefticon {
  69. transform: rotate(180deg);
  70. }
  71. .recommend .recommendList {
  72. padding: 0 30rpx;
  73. }
  74. .recommend .recommendList .item {
  75. width: 335rpx;
  76. margin-bottom: 30rpx;
  77. border-radius: 20rpx 20rpx 0 0;
  78. box-shadow: 0rpx 3rpx 10rpx 2rpx rgba(0, 0, 0, 0.03);;
  79. }
  80. .recommend .recommendList .item .pictrue {
  81. position: relative;
  82. width: 100%;
  83. height: 335rpx;
  84. }
  85. .recommend .recommendList .item .pictrue image {
  86. width: 100%;
  87. height: 100%;
  88. border-radius: 20rpx;
  89. }
  90. .recommend .recommendList .item .name {
  91. font-size: 28rpx;
  92. color: #282828;
  93. margin-top: 20rpx;
  94. padding: 0 10rpx;
  95. }
  96. .recommend .recommendList .item .money {
  97. font-size: 20rpx;
  98. margin-top: 8rpx;
  99. padding: 0 10rpx 10rpx 10rpx;
  100. }
  101. .recommend .recommendList .item .money .num {
  102. font-size: 28rpx;
  103. }
  104. </style>