<!-- recommend.vue -->
<template>
	<view class="div ui-recommend-wrapper" v-if="commendList.length > 0">
		<view class="div title">为你推荐</view>
		<view class="div product-list-body">

			<index-product-body
          class="product-item"
					:item="item"
					:index="index"
					v-for="(item, index) in commendList"
					v-bind:key="index"
			></index-product-body>
		</view>

	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import IndexProductBody from '../../index/IndexProductBody'
export default {
  data () {
    return {
      list: [],
      indicatorArray: [],
      currentIndex: 0
    }
  },
  components: { IndexProductBody },
  created () {
  },

  computed: {
    ...mapState({
      commendList: state => state.goodsdetail.commendList,
      currentProductId: state => state.goodsdetail.currentProductId
    })
  },

  methods: {

  }
}
</script>

<style lang="scss" scoped>
	.ui-recommend-wrapper {
		background: #ffffff;
		margin-bottom:$pageSpace;
		.product-list-body{
      display: flex; flex-wrap: wrap;background: #fff;padding-right: $pageSpace;
      .product-item{width:50%;}
    }
		.title{text-align: center;position:relative;font-size:$mainFontSize;color:#000;font-weight:700;padding-top:.5rem;padding-bottom:1rem;}
	}
</style>
