<template>
  <div class="container">
    <div class="flex-start">
      <div class="img">
        <van-swipe :autoplay="3000" >
          <van-swipe-item v-for="(item,index) in  carousel" :key="index">
            <img :src="item"  />
          </van-swipe-item>
        </van-swipe>
      </div>
      <div class="list">
        <div class="left">
          <img :src="storeInfo.logo" alt="" />
        </div>
        <div class="right">
          <h3>{{storeInfo.name}}</h3>
          <p>{{storeInfo.summaryTitle}}</p>
        </div>
      </div>
      <!-- <div class="ql-container ql-snow">
        <div class="ql-editor fwb" v-html="storeInfo.summary">
        </div>
      </div> -->
      <div v-html="storeInfo.summary" class="fwb ql-editor"></div>
    </div>
    
  </div>
</template>

<script>
  import axios from "axios"
  import { getStoreDetail } from "@/api/sidebar/voucher";
export default {
  data() {
    return {
      oyStallCode: '',
      storeInfo: {
        logo: './img/counter.png',
        name: 'only专柜',
        summaryTitle: 'ONLY是丹麦著名的国际时装公司BESTSELLER拥有的众多著名品牌之一', 
        summary: '<p>ONLY在1996年来到中国,1996年9月28日,品牌诞生之初便富有远见地来到中国</p>'
      },
      carousel:['./img/cswiper.png','./img/cswiper.png','./img/cswiper.png','./img/cswiper.png']
    }
  },
  mounted() {
    this.oyStallCode = sessionStorage.getItem('oyStallCode')
    this.getStore()
  },
  methods: {
    // 获取店铺信息
    getStore() {
      let params = {
        oyStallCode: this.oyStallCode
      }
      getStoreDetail(params).then(res => {
        if(res.data.stallInfo != null) {
          console.log(res,'res');
          this.carousel = res.data.carousel
          this.storeInfo = res.data.stallInfo
        }
      })
    }
  }
}
</script>

<style scoped>
 .container {
  background: #f8f8f8;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
  min-height: 100%;
}
.img {
  width: 100%;
  height: 200px;
  background-color: #fff;
}
.img img {
  width: 100%;
  height: 200px;
}
.img >>> .van-swipe {
  height: 200px;
}
.list {
  height: 80px;
  width: 100%;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(238, 238, 238, 1);
  box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
  border-radius: 2px;
  z-index: 100;
}
.list3 {
  border-bottom: none;
  margin-bottom: 0;
}
.left,
.right {
  height: 80px;
}
.left {
  width: 30%;
  display: flex;
  justify-content: center;
}
.left img {
  height: 80px;
}
.right {
  width: 70%;
  padding: 16px 0 0 10px;
  background-color: #fff;
}
h3 {
  font-size: 14px;
  font-weight: bold;
  color: rgba(45, 71, 106, 1);
}
p {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(45, 71, 106, 0.8);
}
.fwb {
  padding:30px;
}
.fwb >>> p {
  font-size: 14px;
}
.fwb >>> img {
  width: 100%;
}
</style>