<template>
  <view class="listCardInfo_management">
    <view class="management-dingsss">
      <view class="view-wrapper">
        <view class="management-ding-text"> {{ headerTitle }} </view>
        <view class="view-all" v-if="isShowAll" @click="jiru('all', 0)">
          <text>查看全部</text>
          <image
            src="/static/images/new_ui/arrow-right.png"
            class="icon-img"
          ></image>
        </view>
      </view>
      <view class="management-ding-nei">
        <view class="fullSreen" v-if="fullSreen"  @click="onHandleClick()">
          {{fullSreenTitle}}
        </view>
        <template v-else>
          <view
            class="management-yisdf"
            v-for="(item, index) in cardData"
            :key="index + 'pp' + '__index__'"
            @click="onHandleClick(item, index)"
          >
            <view class="management-img">
              <image :src="item.img" mode="widthFix"></image>
              <view class="management-img-biao" v-if="item.count">
                {{ item.count }}
              </view>
            </view>
            <view class="">
              {{ item.name }}
            </view>
          </view>
        </template>
      </view>
    </view>
  </view>
</template>
<script>
export default {
  props: {
    cardData: {
      type: Array,
      default: () => [],
    },
    headerTitle: {
      type: String,
      default: "商品列表",
    },
    isShowAll: {
      type: Boolean,
      default: false,
    },
    fullSreen: {
      type: Boolean,
      default: false,
    },
    fullSreenTitle:{
      type: String,
      default: "全部商品"
    }
  },
  data() {
    return {};
  },
  methods: {
    jiru(type, index) {},
    onHandleClick(item,index){
      this.$emit('custom-handle-click',item,index)
    }
  },
};
</script>
<style>
page {
  background-color: #f7f8fc;
}
</style>
<style lang="scss" scoped>
.listCardInfo_management {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 50rpx;
  box-sizing: border-box;
  .management-dingsss {
    width: 100%;
    height: 216rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;

    .management-ding-text {
      font-size: 30rpx;
      font-weight: 600;
      color: #333333;
    }

    .management-ding-nei {
      width: 100%;
      height: 160rpx;
      background: #ffffff;
      border-radius: 16rpx;
      display: flex;
      justify-content: space-around;
      align-items: center;

      .management-yisdf {
        height: 96rpx;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        font-size: 24rpx;
        font-weight: 400;
        color: #5f6060;

        .management-img {
          width: 48rpx;
          height: 48rpx;
          position: relative;
          image {
            width: 100%;
            height: 100%;
          }
          .management-img-biao {
            position: absolute;
            left: 40rpx;
            bottom: 31rpx;
            width: 30rpx;
            height: 30rpx;
            border-radius: 50%;
            padding: 5rpx;
            background: #fe0032;
            // word-break: break-all;
            font-size: 20rpx;
            font-weight: 400;
            color: #ffffff;
            display: flex;
            justify-content: center;
            align-items: center;
          }
        }
      }
    }
  }

  .custom_pick-up {
    width: calc(100% - 54rpx);
    margin: 0 26rpx;
  }
}
.view-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.view-all {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 24rpx;
  > text:first-child {
    padding-right: 8rpx;
    color: #999999;
  }
  .icon-img {
    width: 26rpx;
    height: 26rpx;
  }
}
.fullSreen{
    display: flex;
  justify-content: center;
  align-items: center;
  width: 90%;
  height: 80%;
  background: #f8f8f8;
  border-radius: 16rpx;
  cursor: pointer;
  user-select: none;

}
</style>
