<template>
  <div class="shop">
    <div class="shop-top">
      <p><i class="iconfont icon-dianpu1"></i><span>{{list.numberOfElements}}</span>家店铺</p>
      <span>全部 <i class="iconfont icon-jiantoushang"></i></span>
    </div>
    <div class="shop-list" v-for="item in list.content">
      <h3>{{item.storeName}}</h3>
      <div class="list-item">
        <div class="item-img">
          <i></i>
          <img :src="item.bannerUrl || '/images/component/default.png'" alt="">
        </div>
        <div class="list-item-phone">
          <p>电话：<span>{{item.enterprise.enTel}}</span></p>
          <p>传真：<span>{{item.enterprise.enFax}}</span></p>
          <p>商家介绍： <a href="#">点击查看</a></p>
          <i class="iconfont icon-shoucang"></i>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    layout: 'main',
    data () {
      return {
        page: '',
        count: '',
        types: ''
      }
    },
    fetch ({ store }) {
      return Promise.all([
        store.dispatch('provider/findStoreList', { page: 1, count: 10, types: 'ORIGINAL_FACTORY' })
      ])
    },
    computed: {
      list () {
        return this.$store.state.provider.stores.storeList.data
      }
    }
  }
</script>

<style scoped lang="scss">
  .shop{
    margin-top:1rem;
    min-height: 10rem;
    background: #e2e4e6;
  .shop-top{
    display:inline-flex;
    justify-content: space-between;
    align-items: center;
    width:100%;
    height:1.14rem;
    padding:0 .3rem;
    background:#fff;
    p{
      font-size:.24rem;
      color:#000;
      i{
        font-size: .53rem;
        color:#418ef7;
      }
      span{
        font-size:.3rem;
        color:#f94f28;
        margin:0 .1rem;
      }
    }
    >span{
      font-size:.28rem;
      color:#53a0f7;
    }
  }
  .shop-list {
    background:#fff;
    margin-top:.12rem;
    padding-bottom:.28rem;
    h3{
      font-size:.32rem;
      line-height: .8rem;
      margin:0;
      margin-left:.27rem;
      margin-bottom:.14rem;
    }
    .list-item{
      width:6.77rem;
      margin-left:.39rem;
      justify-content: space-around;
      display:inline-flex;
      .item-img{
        position:relative;
        width:2.42rem;
        height:1.69rem;
        i{
          display:block;
          position:absolute;
          width:.65rem;
          height:.33rem;
          background: url(/imgs/shop/daili@2x.png)no-repeat;
          background-size: .65rem .33rem;
        }
        img{
          display:inline-block;
          width:100%;
          height:100%;
        }
      }
      .list-item-phone{
        width:3.95rem;
        padding-top:.18rem;
        position:relative;
        p{
          font-size:.28rem;
          line-height: .45rem;
          margin:0;
        }
        i{
          display:block;
          position:absolute;
          top:.1rem;
          right:.1rem;
          font-size:.4rem;
          color:#ff7800;
        }
      }
    }
    }
  }

</style>
