import {AuditStatusEnum} from "@/utils/constants";
import i18n from '@/i18n'
export const getStatusName = (row) => {
    //判断价格是否过期
    let validateStartDate = row.validateStartDate;
    let validateEndDate = row.validateEndDate;
    let notSetPrice = false;
    let nowDate = new Date().getTime();
    if(validateStartDate && validateStartDate > nowDate) {
        notSetPrice = true;
    }
    if(validateEndDate && validateEndDate < nowDate) {
        notSetPrice = true;
    }
    let setPriceText = notSetPrice ? '(' + i18n.t('已过期') + ')' : '';
    if(row.blacklist) return i18n.t('黑名单') //  + setPriceText;
    if(row.auditStatus === AuditStatusEnum.PASS) return i18n.t('已上架') // + setPriceText;
    return i18n.t('已下架') + setPriceText;
}
