<template>
  <view class="storeCategory">
    <scroll-view class="category_left" scroll-y>
      <view
        v-for="(item, index) in categoryMenu"
        :class="[
          'item',
          {
            current: categoryMenuIndex === index,
          },
        ]"
        @click="categoryMenuClick(index, $event)"
      >
        {{ item.name }}
      </view>
    </scroll-view>
    <scroll-view class="category_right" scroll-y v-if="categoryList.length > 0" >
      <view  v-for="(item, index) in categoryList" class="box" :key="index">
        <view class="tit">{{ item.name }}</view>
        <view class="list">
            <navigator class="item"  :url="`/pagesub/index/store?store_id=${shop.store_id}`" v-if="item.storeList!=null"  v-for="(shop, cur) in item.storeList.items" :key="cur">
                  <image lazy-load class="img" :src="shop.store_logo"></image>
                  <view class="desc">{{ shop.store_name }}</view>
            </navigator>
        </view>
        <view class="nodata" v-if="item.storeList.items.length==0">该分类暂无店铺数据</view>
      </view>
    </scroll-view>
    <view v-if="categoryList.length == 0" class="nodata2"><image
				src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAATCElEQVR4Xu1dC5Bb5XU+/5VWsvXwrrz4bWODH5J2jQen5uXWroV3BaQltGnLZNpMJ01SHEhIQmjaUDoTmMnQmSbBhATKIxSS6fQBbUMaTzyWdi0zzeDGWddgsqsr72IM+AnYu/i1Zr17T+fT6ipa7Ur3IWmv7uqeGY3X0v84/znf/R/nnP9cQQ41tAREQ4/eGTw5AGhwEDgAcADQ4BJo8OE7M4ADgAaXQIMP35kBHAA0uAQafPjODOAAYPol0NfXt5aITre1tZ2Y/t6dHgslYMkMIMvy3zHzzmg0ut9Rh7USsAoAP2fm16PR6APWDt/pfdoBIMvyBiL6FRF9pCjKxra2tv9z1GCdBKYNAAcOHGiZNWvWpyVJ+jYzz8oN+aQQ4p5z587t2LBhw2XrxNC4PU8LAHp7e6+VJOlPiOg2IcT6InHvIaIuRVF2WjEbyLL8bSJaTkQvRSKRlxoNCtMCAFWoPT09vmAw+C1mvg/fMfPD0Wj0IauELssyM/MBIcReIrqHmWPRaBSAbBiaVgC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12a85AE6fPj3H4/EsHR0dnT8V883Nzc9evHhxFTyC8N4hoQMieE24SKstm7pqb2hoaNLbPvQw6HK5TgaDwWNCiGx2tmKqKQCGhobuyl0RL8srvH4mMmbrGb/tyyB8Xm/klMZgt4dCoUnvdawZAAYHB79KRPkbKFqaQNiXnpBvrXZm0u9wbGFWrCK9FAqFJr5LoIqN55saHBzEa2XV6+O6uwAA4CBpZCDgxVh46qH8qbKg6RZmiYLM/Gdz5879F/XnmswAg4ODOKc+apZZhJY3EggQFwnF41MLpRfqQQixs6WlJf9CiVoBAE9/YUIos1hw6tVAAqFQKK/3mgDgzJkzeEfNIzXg3WmycglMyBFQEwAMDQ3FmXlX5bw6LVRbArjH2dramr/DWRMAgOnBwcG6SBVTbQHavL1XQ6FQNmdjTTeBauNnzpy5WwhRMtGEzYVpN/a3e73eR30+Xz5EDwOo2QygSkfLEmg3KdqNX0stgXYTViPyW/MZoBGFaqcxOwCwk7ZqwKsDgBoI1U5NOgCwk7ZqwKsDgBoI1U5NOgCwk7ZqwKsDgBoI1U5NOgCwk7ZqwOv/AzV4J7GGZh/vAAAAAElFTkSuQmCC"
				class="icon_nodata"
				mode="aspectFit"
			></image>暂无分类数据</view>
  </view>
</template>

<script>
import { mapState } from "vuex";

export default {
  data() {
    return {
      categoryMenu: [],
      categoryList: [],
      categoryMenuIndex: 0,
    };
  },
  computed: mapState([
    "Config",
    "StateCode",
    "notice",
    "plantformInfo",
    "shopInfo",
    "userInfo",
    "hasLogin",
  ]),
  mounted() {
    const _this = this;
    const params = {
      openFindStore: true,
      pageSize: 9999,
    };
    this.$.request({
      url: this.Config.URL.store.category,
      data: params,
      dataType: "json",
      success(data, status, msg, code) {
        const items = data.items
        _this.categoryMenu = items;
         _this.categoryList = items[_this.categoryMenuIndex]?.sub || [];
      },
    });
  },
  methods: {
    categoryMenuClick(index) {
      this.categoryMenuIndex = index;
      this.categoryList = this.categoryMenu[index]?.sub || []; 
      console.log(this.categoryList,'categoryList');
      
    },
  },
};
</script>

<style lang="scss" scoped>
.category_left {
  width: 200rpx;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  background: #fff;
  .item {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    font-size: 28rpx;
    padding: 24rpx 0;
    box-sizing: border-box;
    text-align: center;
    &.current {
      color: #fe411b;
      background: #f4f4f4;
      font-weight: bold;
      position: relative;
      &::after{
        display: block;
        content: " ";
        width: 4rpx;
        height: 100%;
        position: absolute;
        left:0;
        top: 0;
        background: #fe411b;
      }
    }
  }
}
.category_right {
  width: calc(100vw - 212rpx - 10rpx);
  position: absolute;
  top: 12rpx;
  bottom: 12rpx;
  left: 212rpx;
  z-index: 1;
   .box {
    min-height: 180rpx;
    padding: 24rpx 12rpx 24rpx 30rpx;
    border-radius: 12rpx;
    margin-bottom: 12rpx;
    background: #fff;
    .list{
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 30rpx;
    }
    .tit{
        padding-bottom: 10rpx;
    }
    .item{
         display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
         width: 140rpx;
        .img{
            width: 140rpx;
            height: 140rpx;
            border-radius: 8rpx;
            margin-bottom: 8rpx;
        }
        .desc{
            width: 140rpx;
            text-align: center;
            font-size: 24rpx;
            color: #666;
             white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }
  }

    .nodata{
        text-align: center;
        color: #999;
        padding: 50rpx;
        font-size: 24rpx;
        background: #fff;
    }
}
 .nodata2{
   width: calc(100vw - 212rpx - 10rpx);
  position: absolute;
  top: 12rpx;
  bottom: 12rpx;
  left: 212rpx;
  z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        color: #999;
        font-size: 24rpx;
        background: #fff;
        .icon_nodata{
          display: block;
          width: 300rpx;
        }
    }

</style>
