using Edu.Common.Plugin;
using Edu.Model.Entity.Customer;
using System.Collections.Generic;

namespace Edu.Model.ViewModel.Customer
{
    /// <summary>
    /// 客户任务完成扩展实体类
    /// </summary>
    public class RB_Customer_Finishtask_Extend : RB_Customer_Finishtask
    {
        /// <summary>
        /// 任务编号
        /// </summary>
        public string QTaskIds { get; set; }

        /// <summary>
        /// 完成类型
        /// </summary>
        public int FinishType { get; set; }

        /// <summary>
        /// 完成值
        /// </summary>
        public decimal FinishValue { get; set; }

        /// <summary>
        /// 领取时间
        /// </summary>
        public string ReceiveTimeStr { get { return Common.ConvertHelper.FormatTime(this.ReceiveTime); } }

        /// <summary>
        /// 兑换时间
        /// </summary>
        public string ExchangeTimeStr { get { return Common.ConvertHelper.FormatTime(this.ExchangeTime); } }

        /// <summary>
        /// 奖品名称
        /// </summary>
        public string TaskKudo { get; set; }

        /// <summary>
        /// 奖品图片
        /// </summary>
        public string TaskKudoImg { get; set; }

        /// <summary>
        /// 奖品图片数组
        /// </summary>
        public List<string> TaskKudoImgList
        {
            get
            {
                List<string> list = new List<string>();
                if (!string.IsNullOrEmpty(this.TaskKudoImg))
                {
                    list = JsonHelper.DeserializeObject<List<string>>(this.TaskKudoImg);
                }
                return list;
            }
        }

        /// <summary>
        /// 奖品描述
        /// </summary>
        public string KudoDescription { get; set; }

        /// <summary>
		/// 兑换状态(0-默认，1-已领取，2-已兑换，3-已过期）
		/// </summary>
		public string ExchangeStatusStr
        {
            get
            {
                string str = "";
                if (this.ExchangeStatus == 1)
                {
                    str = "已领取";
                }
                else if (this.ExchangeStatus == 2)
                {
                    str = "已兑换";
                }
                else if (ExchangeStatus == 3)
                {
                    str = "已过期";
                }
                return str;
            }
        }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        public string TaskName { get; set; }
    }
}
