RecommendItem.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!-- recommend.vue -->
  2. <template>
  3. <view class="div ui-recommend-wrapper" v-if="commendList.length > 0">
  4. <view class="div title">为你推荐</view>
  5. <view class="div product-list-body">
  6. <index-product-body
  7. class="product-item"
  8. :item="item"
  9. :index="index"
  10. v-for="(item, index) in commendList"
  11. v-bind:key="index"
  12. ></index-product-body>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import { mapState, mapMutations } from 'vuex'
  18. import IndexProductBody from '../../index/IndexProductBody'
  19. export default {
  20. data () {
  21. return {
  22. list: [],
  23. indicatorArray: [],
  24. currentIndex: 0
  25. }
  26. },
  27. components: { IndexProductBody },
  28. created () {
  29. },
  30. computed: {
  31. ...mapState({
  32. commendList: state => state.goodsdetail.commendList,
  33. currentProductId: state => state.goodsdetail.currentProductId
  34. })
  35. },
  36. methods: {
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .ui-recommend-wrapper {
  42. background: #ffffff;
  43. margin-bottom:$pageSpace;
  44. .product-list-body{
  45. display: flex; flex-wrap: wrap;background: #fff;padding-right: $pageSpace;
  46. .product-item{width:50%;}
  47. }
  48. .title{text-align: center;position:relative;font-size:$mainFontSize;color:#000;font-weight:700;padding-top:.5rem;padding-bottom:1rem;}
  49. }
  50. </style>