<template>
  <view class="Hl-container-item">
    <view class="Hlc-title">失效</view>
    <image lazy-load class="Hlc-item-img" mode="aspectFit" :src="goods.skuImg" />
    <view class="Hlc-item-info">
      <view class="Hlc-item-info-title">
        <text v-if="goods.textTag" class="Hlc-item-info-title-tag">{{ goods.textTag }}</text>
        <text class="Hlc-item-info-title-name"
          ><text class="name"> {{ goods.skuName }}</text></text
        >
      </view>
      <view class="Hlc-item-info-bottom">
        <view class="Hlc-item-info-bottom-des">{{ goods.invalidStatusDesc }}</view>
        <!-- 仅羊小咩展示看相似 2021.11.25  -->
        <view v-if="$config('yxm')" class="Hlc-item-info-bottom-btn"
          ><button class="similar" @click="goSimilar">看相似</button></view
        >
      </view>
    </view>
  </view>
</template>
<script>
import { saTrackEvent } from "@/utils/sa.js";
export default {
  name: "DisabledGoodsCard",
  props: {
    goods: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      options: [
        {
          text: "删除",
          style: {
            backgroundColor: "#F43530"
          }
        }
      ]
    };
  },
  methods: {
    delGood(goods) {
      this.$emit("delGood", goods);
    },
    goSimilar() {
      saTrackEvent("MINI_ShoppingCartPageViewSimilarityBtnClick", {
        sku_no: this.goods.skuId
      });
      uni.navigateTo({
        url: `/pages/product/similar?skuNo=${this.goods.skuId}&goodsName=${this.goods.skuName}&goodsImage=${this.goods.skuImg}&des=${this.goods.invalidStatusDesc}`
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.Hl-container-item {
  display: flex;
  // margin: 40rpx 0;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  padding: 20rpx 0rpx;
  .Hlc-title {
    color: #fff;
    background: #979797;
    border-radius: 30rpx;
    height: 30rpx;
    line-height: 30rpx;
    width: 64rpx;
    text-align: center;
    font-size: 20rpx;
  }
  .Hlc-item-img {
    max-width: 200rpx;
    height: 200rpx;
    border-radius: 12rpx;
    opacity: 0.5;
    margin-left: 12rpx;
    // background: #aaa;
  }
  .Hlc-item-info {
    width: 365rpx;
    height: 200rpx;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0 20rpx;
    position: relative;
    &-title {
      position: relative;
      opacity: 0.5;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;

      &-name {
        .name {
          font-size: 26rpx;
          line-height: 36rpx;
          color: #333333;
        }

        .blank {
          width: 10rpx;
        }
      }
      &-tag {
        font-size: 20rpx;
        color: #fff;
        background: red;
        border-radius: 6rpx;
        padding: 0 6rpx;
        margin-right: 10rpx;
      }
    }
    &-bottom {
      position: absolute;
      bottom: 0rpx;
      display: flex;
      align-items: center;
      justify-content: space-around;
      width: 100%;
      padding-right: 1px;
      &-des {
        font-size: 26rpx;
        // line-height: 36rpx;
        width: 60%;
        color: #333333;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
      }
      &-btn {
        width: 40%;
        .similar {
          height: 60rpx;
          line-height: 60rpx;
          font-size: 28rpx;
          // font-weight: bold;
          border-radius: $border-radius-2;
          border: $border-sm solid $border-color-search;
          // background: $white;
          color: $font-color-search;
          padding: 0 $padding-sm;
          background: #fff;
        }
      }
    }
  }
}
</style>
