index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class='recommend'>
  3. <view class='title acea-row row-center-wrapper'>
  4. <text class='iconfont icon-zhuangshixian'></text>
  5. <text class='name'>热门推荐</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.image'></image>
  12. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  13. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
  14. <span class="pictrue_log_big pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
  15. </view>
  16. <view class='name line1'>{{item.store_name}}</view>
  17. <view class='money font-color'>¥<text class='num'>{{item.price}}</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. export default {
  26. computed: mapGetters(['uid']),
  27. props: {
  28. hostProduct: {
  29. type: Array,
  30. default: function() {
  31. return [];
  32. }
  33. }
  34. },
  35. data() {
  36. return {
  37. };
  38. },
  39. methods: {
  40. goDetail(item){
  41. goShopDetail(item,this.uid).then(res=>{
  42. uni.navigateTo({
  43. url:`/pages/goods_details/index?id=${item.id}`
  44. })
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. .recommend {
  52. background-color: #fff;
  53. }
  54. .recommend .title {
  55. height: 135rpx;
  56. font-size: 28rpx;
  57. color: #282828;
  58. }
  59. .recommend .title .name {
  60. margin: 0 28rpx;
  61. }
  62. .recommend .title .iconfont {
  63. font-size: 170rpx;
  64. color: #454545;
  65. }
  66. .recommend .title .iconfont.lefticon {
  67. transform: rotate(180deg);
  68. }
  69. .recommend .recommendList {
  70. padding: 0 30rpx;
  71. }
  72. .recommend .recommendList .item {
  73. width: 335rpx;
  74. margin-bottom: 30rpx;
  75. }
  76. .recommend .recommendList .item .pictrue {
  77. position: relative;
  78. width: 100%;
  79. height: 335rpx;
  80. }
  81. .recommend .recommendList .item .pictrue image {
  82. width: 100%;
  83. height: 100%;
  84. border-radius: 6rpx;
  85. }
  86. .recommend .recommendList .item .name {
  87. font-size: 28rpx;
  88. color: #282828;
  89. margin-top: 20rpx;
  90. }
  91. .recommend .recommendList .item .money {
  92. font-size: 20rpx;
  93. margin-top: 8rpx;
  94. }
  95. .recommend .recommendList .item .money .num {
  96. font-size: 28rpx;
  97. }
  98. </style>