<template>
  <div class="shop-item flex-default" @click="goShop(itemData.merchantId)">
    <div
      class="flex-default"
      style="padding: 20rpx 0; align-items: center; flex-shrink: 0"
      @click.stop="checkedItem(itemData)"
    >
      <div
        class="item-radio flex-default"
        v-show="editList"
        :class="{ active: itemData.checked }"
      />
    </div>
    <div class="item-img">
      <img :src="itemData.shopImage" style="width: 100%; height: 100%" />
    </div>
    <div class="item-describe flex-default">
      <div class="name">
        {{ itemData.shopName }}
      </div>
      <!-- 	<div class="type flex-default">
				<span>自营</span>
			</div> -->
    </div>
  </div>
</template>

<script>
export default {
  props: {
    itemData: Object,
    editList: Boolean,
  },
  data() {
    return {};
  },
  created() {},
  methods: {
    editItem() {
      this.showRadio = true;
    },
    completeItem() {
      this.showRadio = false;
    },
    checkedItem(data) {
      this.$emit("checkedItem", data);
    },
  },
};
</script>

<style lang="less">
.shop-item {
  padding: 0 16px;
  align-items: center;
  overflow: hidden;
  width: 100%;
  .item-radio {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #aeaeae;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    &.active {
      border-color: #2C66F5;
      &::before {
        content: "";
        display: block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #2C66F5;
      }
    }
  }
  .item-img {
    width: 80px;
    height: 30px;
    flex-shrink: 0;
    background-color: #eaeaea;
  }
  .item-describe {
    flex-shrink: 1;
    margin-left: 13px;
    height: 65px;
    border-bottom: 1px solid #f8f8f8;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    .name {
      font-size: 13px;
      color: #140603;
      line-height: 13px;
    }
    .type {
      margin-top: 3px;
      span {
        padding: 0 5px;
        background-color: #dd2e41;
        border-radius: 2px;
        height: 14px;
        line-height: 14px;
        font-size: 10px;
        color: #ffffff;
        display: inline-block;
      }
    }
  }
}
</style>
