export const orderStatus = {
    "1": "待付款",
    "2": "待发货",
    "3": "待收货",
    "4": "待评价",
    "5": "已完成",
    "6": "已退款",
    "7": "已删除",
    "0": "全部"
}

export const logisticStatus = {
    "1": "已发货",
    "2": "已揽收",
    "3": "运输中",
    "4": "配送中",
    "5": "已签收"
}
/**
 * 
 * @param {*} paid 支付类型paid == 1   paid == 0 支付状态
 * @param {*} pay_type 
 * @returns 
 */
export function getUserPayType(paid, pay_type) {
    if (paid == 1) { //支付类型paid == 1
        // console.log(paid,pay_type, "pay_typepay_typepay_typepay_type")
        return { //pay_type
            0: '虚拟支付',
            1: '微信支付',
            2: '小程序支付',
            3: '银行卡支付',
            4: '支付宝支付',
            5: '红积分兑换'
        } [pay_type] || "--"

    } else if (paid == 0) { //支付状态
        return paid == 0 ? "未支付" : "已支付"
    } else {
        return "--"
    }
}


export function getOrderListStatus(status) {
    return {
        "5": '待付款',
        "0": '待发货',
        "1": '待收货',
        "2": '待评价',
        "3": '已完成',
        "4": '已申请退款',
        "-1": '已退款',
        "6": '已取消',
    } [status] || ""
}

export function getOrderDetailStatus(item, type = "image") {
    const textMap = {
        "5": '等待买家付款',//待付款
        "0": '等待卖家发货',
        "1": '等待买家收货',
        "2": '等待买家评价',
        "3": '订单已完成',
        "4": '买家已申请退款',
        "-1": '卖家已退款',
        "6": '买家已取消订单',
    }
    const imageMap = {
        "0": '/static/images/new_ui/daifahuo.png',
        "1": '/static/images/new_ui/daishouhuo.png',
        "2": '/static/images/new_ui/daipingjia.png',
        "5": '/static/images/new_ui/daifukuan.png',
        "3": '/static/images/new_ui/yiwancheng.png',
        "4": '/static/images/new_ui/yishenqinftuikuan.png',
        "-1": '/static/images/new_ui/yituikuan.png',
        "6": '/static/images/new_ui/yiquxiao.png',
    }
    if (item.paid == 0) { //未付款
        if (item.status == 0) { //待付款
            return type == "image" ? imageMap['5'] : textMap['5']
        }else{
             return type == "image" ? imageMap[item.status] : textMap[item.status]
        }
    } else if (item.paid == 1) { //已付款
        return type == "image" ? imageMap[item.status] : textMap[item.status]
    }





}


/**
 * @description 退款单状态 售后状态
 */
export function orderRefundFilter(status) {
    const statusMap = {
        '0': '审核中',
        '-1': '审核未通过',
        '1': '待退货',
        '2': '退货中',
        '3': '退款完成',
        '4': '退款失败',
        '5': '部分退款',
        '6': '申请已取消'
    }
    return statusMap[status]
}
/**
 * @description 退款单状态 售后状态
 */
export function orderRefundFilterText(status) {
    const statusMap = {
        '0': '退货审核中',
        '-1': '退货审核未通过',
        '1': '待退货',
        '2': '退货中',
        '3': '退款完成',
        '4': '退款失败',
        '5': '部分退款',
        '6': '申请已取消'
    }
    return statusMap[status]
}



/**
 * @description 
 */
export function orderRefundText(status) {
    const statusMap = {
        '0': '48小时未审核，系统将自动通过该申请',
        '-1': '退货审核未通过',
        '1': '待退货',
        '2': '买家已寄出',
        '3': '退货退款已完成，查看具体退款金额',
        '4': '退货退款失败，请查看失败原因',
        '5': '退货退款已完成，查看具体退款金额',
        '6': '申请已取消'
    }
    return statusMap[status]
}



/**
 * @description 自提订单状态
 */
export function takeOrderStatusFilter(status) {
    const statusMap = {
        '0': '待提货',
        '1': '待提货',
        '2': '待评价',
        '3': '已完成',
        '-1': '已退款'
    }
    return statusMap[status]
}


// < el - table - column label = "养老金状态"
// min - width = "100" >
//     <
//     template slot - scope = "scope" >
//     <
//     span v -
//     if = "scope.row.is_red_ylj=='0'" > 未结算 < /span> <
//     span v -
//     if = "scope.row.is_red_ylj=='2'" > 已失效 < /span> <
//     span v -
//     if = "scope.row.is_red_ylj=='1'" > 已结算 < /span> <
//     /template> <
//     /el-table-column>