<template>
  <div class="reader-operations">
    <span class="operations">
      <span class="operation-item" v-if="like">
        <!-- <svg-icon @click="handleLike" icon-class="like-s" :style="{
          fontSize: iconSize + 'px',
          color: loveCountStatus ? selectColor : '#61666d',
        }"></svg-icon> -->
        <span>{{
            formatNum(loveCount) == 0 ? "点赞" : formatNum(loveCount)
        }}</span>
      </span>
      <span class="operation-item" v-if="collect">
        <!-- <svg-icon icon-class="collect-s-2" :style="{
          fontSize: iconSize + 'px',
          color: collectCountStatus ? selectColor : '#61666d',
        }"></svg-icon> -->
        <span>{{
            formatNum(collectCount) == 0 ? "收藏" : formatNum(collectCount)
        }}</span>
      </span>
      <span v-if="share" class="operation-item">
        <!-- <svg-icon icon-class="share2" :style="{
          fontSize: iconSize + 'px',
        }"></svg-icon> -->
        <span>分享</span>
      </span>
    </span>

  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { debounce, formatNum } from "@/utils/index";
export default {
  name: "ReaderOperations",
  props: {
    // 是否需要点赞,默认需要
    like: {
      type: Boolean,
      default: true,
    },
    // 是否需要收藏，默认需要
    collect: {
      type: Boolean,
      default: true,
    },
    // 是否需要分享，默认需要
    share: {
      type: Boolean,
      default: true,
    },
    // 点赞数量
    loveCount: {
      type: String,
      default: "0",
    },
    // 收藏数量
    collectCount: {
      type: String,
      default: "0",
    },
    // 点赞状态
    loveCountStatus: {
      type: Boolean,
      default: false,
    },
    // 收藏状态
    collectCountStatus: {
      type: Boolean,
      default: false,
    },
    sourceId: {
      type: String,
      default: "",
    },
    // 来源类型 biz_cultural_relic-文物；biz_exhibition-布展；biz_elite_exhibition-精品展
    sourceType: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
    iconSize: {
      type: [Number, String],
      default: 28,
    },
    selectColor: {
      type: String,
      default: "$themeColor",
    },
  },
  data() {
    return {
      loginDialogVisible: false,
      shareDialogVisible: false,
      curLink: "", //当前地址栏的链接
    };
  },
  computed: {
    ...mapGetters(["token", "showLoginDialog"]),
  },
  methods: {

    formatNum(num) {
      return formatNum(num);
    },
  },
};
</script>

<style lang="scss" scoped>
$themeColor: #132c33;

.reader-operations {
  width: 100%;
  max-width: 300px;
}

.operations {
  // margin-top: 22px;
  width: 100%;
  display: flex;
  justify-content: space-between;

  .operation-item {
    display: flex;
    align-items: center;
    // margin-right: 32px;
    cursor: pointer;
    font-size: 14px;
  }

  .svg-icon {
    margin-right: 10px;
    font-size: 24px;
    color: #61666d;
  }

  .like {
    color: #831122;
  }

  .collect {
    color: #831122;
  }
}

.el-button--text {
  color: $themeColor;
}

.copy {
  display: flex;
  align-items: center;
  height: 180px;
}

.qrcode {
  .img-container {
    width: 200px;
    height: 200px;

    img {
      width: 100%;
      height: 100%;
    }
  }
}

::v-deep .el-input-group__append {
  padding: 0 40px;
}

::v-deep .dialog-footer {
  .el-button {
    border-radius: 0;
  }

  .el-button--primary {
    border: none;
    background-color: $themeColor;
  }
}
</style>