index.vue 2.7 KB

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