package com.sheep.gamegroup.util;

import android.text.TextUtils;

import com.sheep.gamegroup.model.entity.CreditCardProgressQuery;

/**
 * Created by realicing on 2018/4/27.
 * realicing@sina.com
 */
public class BtStatusUtil {
    /**
     * CreditCardProgressQuery.status
     * status; 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线
     * @return
     */
    public static boolean getEnabled(int status) {
        return 1 == status || 2 == status || 6 == status;
    }
    /**
     * CreditCardProgressQuery.status
     * status; 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线
     * @return
     */
    public static String getUploadText(int status) {
        switch (status){
            case 7:
                return "正在审核";
            case 8:
                return "任务已下线";
        }
        return "上传截图";
    }
    /**
     * CreditCardProgressQuery.status
     * status; 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线
     * @return
     */
    public static String getUploadText(CreditCardProgressQuery creditCardProgressQuery) {
        return TextUtils.isEmpty(creditCardProgressQuery.getRemarks()) ? getUploadText(creditCardProgressQuery.getStatus()) : creditCardProgressQuery.getRemarks();
    }
}
