using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using JwKdsV.Core.Utils; using Newtonsoft.Json; namespace JwKdsV.Core.Bean { [Serializable] [JsonObject(MemberSerialization.OptIn)] public class ProductItem : IEquatable { private ProductShowType _showType = ProductShowType.全称和零售价; /// /// 呈现方式 /// [JsonProperty(PropertyName = "type")] public ProductShowType ShowType { get { return this._showType; } set { this._showType = value; } } private ProductShowCase _showCase = ProductShowCase.自定义; /// /// 推荐 /// [JsonProperty(PropertyName = "case")] public ProductShowCase ShowCase { get { return this._showCase; } set { this._showCase = value; } } private string _backColor1 = "#FFFBF6"; /// /// 品类显示颜色1 /// [JsonProperty(PropertyName = "color1")] public string BackColor1 { get { return this._backColor1; } set { this._backColor1 = value; } } private string _backColor2 = "#FFFBF6"; /// /// 品类显示颜色2 /// [JsonProperty(PropertyName = "color2")] public string BackColor2 { get { return this._backColor2; } set { this._backColor2 = value; } } private string _textColor = "#444444"; /// /// 字体显示颜色 /// [JsonProperty(PropertyName = "tcolor")] public string TextColor { get { return this._textColor; } set { this._textColor = value; } } private SystemFont _productFont = SystemFont.正常; /// /// 品项的字体 /// [JsonProperty(PropertyName = "font")] public SystemFont ProductFont { get { return this._productFont; } set { this._productFont = value; } } private int _itemWidth = 280; /// /// 宽度 /// [JsonProperty(PropertyName = "width")] public int ItemWidth { get { return this._itemWidth; } set { this._itemWidth = value; } } private int _itemHeight = 80; /// /// 行高度 /// [JsonProperty(PropertyName = "height")] public int ItemHeight { get { return this._itemHeight; } set { this._itemHeight = (value <= 0 ? 1 : value); } } private int _columns = 6; /// /// 大类每行显示的数量 /// [JsonProperty(PropertyName = "cols")] public int Columns { get { return this._columns; } set { this._columns = (value <= 0 ? 1 : value); } } private string _color1 = "#625C56"; /// /// 品类显示颜色1 /// [JsonProperty(PropertyName = "pcolor1")] public string PagerColor1 { get { return this._color1; } set { this._color1 = value; } } private string _color2 = "#625C56"; /// /// 品类显示颜色2 /// [JsonProperty(PropertyName = "pcolor2")] public string PagerColor2 { get { return this._color2; } set { this._color2 = value; } } /// /// 沽清品类显示颜色 /// [JsonProperty(PropertyName = "sccolor")] public string SaleClearColor { get; set; } = ColorTranslator.ToHtml(Color.DimGray); /// /// 沽清品类提醒颜色 /// [JsonProperty(PropertyName = "snfcolor")] public string SaleClearNotifyColor { get; set; } = ColorTranslator.ToHtml(Color.DimGray); /// /// 沽清字体显示颜色 /// [JsonProperty(PropertyName = "sctcolor")] public string SaleClearTextColor { get; set; } = ColorTranslator.ToHtml(Color.White); /// /// 沽清的字体大小 /// [JsonProperty(PropertyName = "scfont")] public SystemFont SaleClearFont { get; set; } = SystemFont.默认; /// /// 沽清停售显示颜色 /// [JsonProperty(PropertyName = "sscolor")] public string SaleStopColor { get; set; } = ColorTranslator.ToHtml(Color.DimGray); /// /// 选中品项显示颜色 /// [JsonProperty(PropertyName = "selcolor")] public string SelBackColor { get; set; } = ColorTranslator.ToHtml(Color.DarkRed); /// /// 选中字体显示颜色 /// [JsonProperty(PropertyName = "seltcolor")] public string SelTextColor { get; set; } = ColorTranslator.ToHtml(Color.White); /// /// 选中品项的字体 /// [JsonProperty(PropertyName = "selfont")] public SystemFont SelProductFont { get; set; } = SystemFont.默认; /// /// 品项的显示样式 /// [JsonProperty(PropertyName = "corner")] public CornerType ProductCornerType { get; set; } = CornerType.圆角; public bool Equals(ProductItem other) { if (other == null) { return false; } return JsonUtils.Serialize(this).Equals(JsonUtils.Serialize(other)); } } public enum ProductShowType { 品项全称 = 0, 品项简称 = 1, 全称和零售价 = 2, 简称和零售价 = 3, } public enum ProductShowCase { 分辨率1920X1080 = 0, 分辨率1024X768 = 1, 自定义 = 2 } public enum CornerType { 默认 = 1, 圆角 = 2, 棱角 = 3 } }