<template>
  <div>
    <!-- <div class="no-sale">
        <img
              width="205px"
              src="../../../assets/market/hero/no-sale.png"
              alt=""
            />
    </div> -->
    <div @click="ChipDialog(chip)">
      <div class="chip-bg">
        <img
          v-if="chip.c_id"
          width="147px"
          :src="require('@/assets/market/chip/' + chip.c_id + '.png')"
          alt=""
        />
        <img
          v-if="chip.item_id"
          width="147px"
          :src="require('@/assets/market/chip/' + chip.item_id + '.png')"
          alt=""
        />
      </div>
      <div class="level-content">
        <div class="level-lv">
          Lv <span class="level-number">{{ chip.detail.chip_grade }}</span>
        </div>
        <div class="tree-guard">{{ chip.detail.chip_name }}</div>
      </div>
      <div class="lease-listing" v-if="isType == 'mynft'">
        <div class="rent"></div>
        <div class="sell">Sell</div>
      </div>
      <div class="price-content" v-else>
        <div class="price-left">
          <div>
            <img
              width="32px"
              src="../../../assets/market/chip/t-icon.png"
              alt=""
            />
          </div>

          <div class="price">{{ chip.s_price ? chip.s_price : " " }}</div>
        </div>
        <div class="buy">
          <img width="78px" src="../../../assets/market/chip/buy.png" alt="" />
        </div>
      </div>
    </div>
    <Chipdialog
      :dialogVisible="dialogVisible"
      @on-close="ChipDialoghide"
      @on-click="ChipDialog"
      :type="type"
      :isBuy="isBuy"
      @handPutShow="handPutShow"
      @handPutHide="handPutHide"
      @handBuyShow="handBuyShow"
      @handBuyHide="handBuyHide"
      :data="chip"
      :isType="isType"
      :isPiecePut="isPiecePut"
    ></Chipdialog>
    <ChipBuyDialog
      :type="type"
      :isBuy="isBuy"
      @handBuyShow="handBuyShow"
      @handBuyHide="handBuyHide"
    ></ChipBuyDialog>
    <PriceSetting
      :type="type"
      :isPiecePut="isPiecePut"
      @handPutShow="handPutShow"
      @handPutHide="handPutHide"
    />
  </div>
</template>

<script>
import Chipdialog from "../Chipdialog.vue";
import ChipBuyDialog from "../ChipBuyDialog.vue";
import PriceSetting from "../TheSellDialog.vue";
export default {
  props: ["chip", "isType"],
  components: {
    Chipdialog,
    PriceSetting,
    ChipBuyDialog,
  },
  data() {
    return {
      dialogVisible: false,
      isPiecePut: false,
      type: "chip",
      isBuy: false,
      chipList: [
        {
          level: 15,
          chipid: "01",
          price: 9999,
        },
        {
          level: 7,
          chipid: "02",
          price: 9999,
        },
        {
          level: 3,
          chipid: "03",
          price: 9999,
        },
        {
          level: 4,
          chipid: "04",
          price: 9999,
        },
        {
          level: 9,
          chipid: "05",
          price: 9999,
        },
        {
          level: 10,
          chipid: "06",
          price: 9999,
        },
      ],
    };
  },
  methods: {
    ChipDialoghide() {
      this.dialogVisible = false;
      console.log("ChipDialoghide");
    },
    ChipDialog() {
      this.dialogVisible = true;
      console.log("ChipDialog");
    },
    handPutShow() {
      this.isPiecePut = true;
      console.log("");
    },
    handPutHide() {
      this.isPiecePut = false;
    },
    handBuyShow() {
      this.isBuy = true;
      console.log("99999999999999999");
    },
    handBuyHide() {
      this.isBuy = false;
    },
  },
};
</script>

<style lang="scss" scoped>
// .container {
//   display: flex;
//   width: 1406px;
//   cursor: pointer;
//   flex-direction: row;
//   margin-top: 43px;
//   margin-left: 54px;
//   align-items: center;
//   flex-wrap: wrap;
// }
// .list-content {
//   display: flex;
//   flex-direction: column;
//   margin-right: 23px;
//   width: 205px;
//   padding-top: 23px;
//   padding-left: 23px;
//   padding-right: 23px;
//   margin-bottom: 20px;
//   height: 277px;
//   background: url("../../../assets/market/chip/bg.png") no-repeat;
// }
.price-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: 32px;
}
.level-number {
  font-size: 29px;
  // font-family: 'MEurostile';
  font-weight: 400;
  font-style: italic;
  color: #454545;
}
.level-lv {
  font-size: 25px;
  // font-family: 'MEurostile';
  font-weight: 400;
  font-style: italic;
  color: #454545;
}
.price {
  font-size: 25px;
  font-family: "Arciform";
  font-weight: 400;
  margin-left: 7px;
  color: #454545;
}
.price-left {
  display: flex;
}
.buy {
  cursor: pointer;
}

.level-content {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;

  .level-img {
    display: flex;
  }

  .level-levelList {
    display: flex;
    margin-left: 14px;
  }
  .item-Image {
    margin-left: 6px;
    display: flex;
  }
}
.chip-bg {
  width: 205px;
  height: 182px;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 182px;
  background: url("../../../assets/market/chip/bg-there.png") no-repeat;
}
.tree-guard {
  font-size: 21px;
  // font-family: "OPPOSans";
  font-weight: normal;
  color: #454545;
}
.no-sale {
  position: absolute;
  left: 0;
  top: 0;
  width: 242px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 292px;
  background: #3c3c3c;
  border: 4px solid #cdd8fd;
  opacity: 0.8;
  border-radius: 16px;
}
.lease-listing {
  display: flex;
  justify-content: center;
  align-items: center;
  // margin-top: 11px;
  font-size: 24px;
  .rent {
    width: 97px;
    height: 40px;
    // text-align: center;
    // line-height: 40px;
    // color: #fff;
    // background: url("../../../assets/market/hero/rent-btn.png") no-repeat;
    // background-size: contain;
  }
  .sell {
    width: 97px;
    height: 40px;
    color: #fff;
    text-align: center;
    margin-left: 14px;
    line-height: 40px;
    background: url("../../../assets/market/hero/sell-btn.png") no-repeat;
    background-size: contain;
  }
}
</style>
