import imgInfo from './imgInfo';
export default {
    mixins: [imgInfo],
    data() {
        return {
            auctionTypeOptions: [
                { label: '虚拟藏品', value: 'NFT' },
                { label: '实物', value: 'ENTITY' }
            ],
            statusOptions: [
                { label: '未开始', value: 'NOTSTARTED' },
                { label: '进行中', value: 'ONGOING' },
                { label: '成交', value: 'PURCHASED' },
                { label: '一口价成交', value: 'FIXED_PRICE_PURCHASED' },
                { label: '流拍', value: 'PASS' },
                { label: '完成', value: 'FINISH' }
            ],
            sourceOptions: [
                { label: '官方拍卖', value: 'OFFICIAL' },
                { label: '转让拍卖', value: 'TRANSFER' }
            ]
        };
    },
    computed: {
        //是否数字藏品
        isNFT() {
            return this.info.auctionType === 'NFT';
        },
        timeText() {
            if (this.info.status === 'NOTSTARTED') {
                return '距开始';
            } else if (this.info.status === 'ONGOING') {
                return '距结束';
            } else {
                return '已结束';
            }
        },
        //是否结束
        isEnd() {
            if (this.info.status !== 'NOTSTARTED' && this.info.status !== 'ONGOING') {
                return true;
            }
            return false;
        },
        priceText() {
            if (
                this.info.status === 'PURCHASED' ||
                this.info.status === 'FINISH' ||
                (this.info.status === 'PASS' && !this.recordInfo.payDeposit)
            ) {
                return '成交价';
            } else if (this.info.purchasePrice) {
                return '当前价';
            } else if (this.info.startingPrice) {
                return '起拍价';
            } else {
                return '一口价';
            }
        },
        showPrice() {
            return this.info.purchasePrice || this.info.startingPrice || this.info.fixedPrice || 0;
        },
        isLeader() {
            return this.isLogin && this.info.purchaserId === this.$store.state.userInfo.id;
        },
        isbidder() {
            return this.isLeader && this.info.status === 'PURCHASED';
        }
    },
    methods: {
        getTime(endTime) {
            console.log('2726');
            let time = this.dayjs(endTime).diff(this.dayjs());
            return time;
        },
        showTime(time) {
            return this.dayjs(time, 'YYYY-MM-DD HH:mm:ss').format('MM-DD HH:mm:ss');
        }
    }
};
