<template>
    <div class="information_on_the_chain_con">链上信息</div>
    <div v-if="info.txHash">
        <div class="information_on_the_chain">
            <span class="information_on_the_chain_title">Hash地址</span>
            <span class="information_on_the_chain_content"
                >{{ getShort(info.txHash) }}</span
            >
        </div>
        <div class="information_on_the_chain">
            <span class="information_on_the_chain_title">区块高度</span>
            <span class="information_on_the_chain_title">{{ info.blockNumber }}</span>
        </div>
        <div class="information_on_the_chain">
            <span class="information_on_the_chain_title">令牌ID</span>
            <span class="information_on_the_chain_content"
                >{{ getShort(info.tokenId) }}</span
            >
        </div>
    </div>
    <div v-else class="textName">创作者未设置</div>
    <!-- <van-collapse-item name="hashCode" class="goods-info">
        <template #title>
            <div class="page-title"><img src="@assets/icon-lianshangxinxi(3).png" alt="" />链上信息</div>
        </template>
        <div class="page-text">
            <div class="text-info">
                <span class="text1">Hash地址：</span>
                <span class="flex1"></span>
                <img @click="copy(info.txHash)" src="@assets/svgs/copy_icon.svg" alt="" />
                <span class="van-ellipsis"></span>
            </div>
            <div class="text-info">
                <span class="text1">区块高度： </span>
                <span class="flex1"></span>
                <span>{{ info.blockNumber }}</span>
            </div>
            <div class="text-info">
                <span class="text1">令牌ID： </span>
                <span class="flex1"></span>
                <img @click="copy(info.tokenId)" src="@assets/svgs/copy_icon.svg" alt="" />
                <span class="van-ellipsis">{{ getShort(info.tokenId) }}</span>
            </div> -->
    <!-- <div class="text-info" v-if="pageType === 'asset'">
                <span class="text1">IPFS地址： </span>
                <span class="flex1"></span>
                <img @click="copy(info.ipfsUrl)" src="@assets/svgs/copy_icon.svg" alt="" />
                <span class="van-ellipsis">{{ getShort(info.ipfsUrl) }}</span>
            </div> -->
    <!-- </div> -->

    <!-- </van-collapse-item> -->
</template>

<script>
import product from '../../mixins/product';
export default {
    props: {
        info: {
            type: Object,
            default: () => {
                return {};
            }
        }
        // pageType: {
        //     type: String,
        //     default: 'product'
        // }
    },
    mixins: [product],
    methods: {
        copy(text) {
            this.$copyText(text).then(
                e => {
                    this.$toast.success('复制成功');
                    console.log(e);
                },
                e => {
                    this.$toast('复制失败');
                    console.log(e);
                }
            );
        }
    }
};
</script>

<style lang="less" scoped>
.information_on_the_chain_con {
    font-size: 14px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 8px;
}
.information_on_the_chain {
    display: flex;
    justify-content: space-between;
    .information_on_the_chain_title {
        font-size: 14px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #939599;
        line-height: 24px;
    }
    .information_on_the_chain_content {
        // width: 158px;
        font-size: 14px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #939599;
        line-height: 24px;
        overflow: hidden; //超出的文本隐藏
        text-overflow: ellipsis; //溢出用省略号显示
        white-space: nowrap; //溢出则不换行
    }
}
.textName{
    color: #939599;
    // text-align: center;
}
</style>
