index.vue 2.9 KB

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