using AllBase.Model.Param.FissionManage; using CefSharp.WinForms; using NaiBa.Util.Extension; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Script.Serialization; using System.Xml.Serialization; namespace AllBase.Model.Result { public class ShopLoginInfo { public string DbId { get; set; } public string LoginName { get; set; } public string Password { get; set; } public string ShopId { get; set; } = ""; public string ShopAccount { get; set; } = ""; public string Mobile { get; set; } /// /// 备注 /// public string Notes { get; set; } public string CompanyName { get; set; } public string ShopToken { get; set; } public string Signature { get; set; } public string TouTiaoId { get; set; } public string Cookies { get; set; } = ""; public string Cookies2 { get; set; } = ""; public Dictionary DictMultiCookies { get; set; } = new Dictionary(); public string LoginStatus { get; set; } public string LoginStatus2 { get; set; } public string ApiAuthStatus { get; set; } public List LstBrand { get; set; } /// /// 客服账户 /// public string ChatAccount { get { string accountStr = ""; foreach (var sub in this.ShopSubAccountList) { if (sub.group_name == "客服") accountStr += sub.user_name + ","; } return accountStr.TrimEnd(','); } } /// /// 上货账户 /// public string UploadAccount { get { string accountStr = ""; foreach (var sub in this.ShopSubAccountList) { if (sub.group_name == "上货") accountStr += sub.user_name + ","; } return accountStr.TrimEnd(','); } } /// /// 拍单(采购)用户账户 /// public string BuyAccount { get { string accountStr = ""; foreach (var sub in this.ShopSubAccountList) { if (sub.group_name == "采购") accountStr += sub.user_name + ","; } return accountStr.TrimEnd(','); } } public string GroupName { get; set; } public string LastRefreshDate { get; set; } public string AccessToken { get { return CurrentAuthInfo?.AccessToken; } } public string RefreshToken { get { return CurrentAuthInfo?.RefreshToken; } } public string AppKey { get { return CurrentAuthInfo?.AppKey; } } public DateTime AddTime { get { return CurrentAuthInfo?.AddTime == null ? new DateTime() : CurrentAuthInfo.AddTime; } } public DateTime ExpiresTime { get { return CurrentAuthInfo?.ExpiresTime == null ? new DateTime() : CurrentAuthInfo.ExpiresTime; } } /// /// 店铺运费模板 /// public long ExpressId { get; set; } /// /// 店铺是否可上传 /// public bool CanUpload = true; /// /// 店铺状态信息 /// public string Message; public List ApiAuthInfoList { get; set; } = new List(); public AuthInfo CurrentAuthInfo { get { return this.ApiAuthInfoList.OrderBy(a => a.ExpiresTime).LastOrDefault(); } } /// /// 拍单Api授权信息 /// public AuthInfo BuyApiAuth { get; set; } = new AuthInfo(); /// /// 主账户 /// public string UserName { get; set; } /// /// 子账户 /// public string SubUserName { get; set; } /// /// 分管二级账户 /// public string OperateSubSaName { get; set; } /// /// 子账户列表(抖店用) /// public List ShopSubAccountList { get; } = new List(); public int OnlineProductCount { get; set; } = -1; public int OfflineProductCount { get; set; } = -1; [JsonIgnore] [ScriptIgnore] [XmlIgnore] public ChromiumWebBrowser Chat { get; set; } = null; public int PayStatus { get; set; } = 0; /// /// 试用版最大上货计数,超过100限制 /// public int TrialUploadCount { get; set; } = 0; /// /// 试用版最大操作计数,超过100限制 /// public int TrialOperateCount { get; set; } = 0; /// /// 月选品上传限额剩余,默认40 /// public int AddProductRemaining { get; set; } [JsonIgnore] [ScriptIgnore] [XmlIgnore] public int UploadCount { get; set; } = 0; public int X { get; set; } public int Y { get; set; } public List LstShopCategory { get; set; } = new List(); //在一次检测中是否已检测同一个账户下的不同店铺,如果已检测,使用相同cookie即可,不用多次检测 public bool isCheckLogin { get; set; } } public class AuthInfo { public string AccessToken { get; set; } = ""; public string RefreshToken { get; set; } = ""; public string AppKey { get; set; } = ""; public DateTime ExpiresTime { get; set; } public DateTime AddTime { get; set; } public string ApiAuthStatus { get; set; } = "未授权"; } public class SubAccountInfo { public string user_name { get; set; } public string nick_name { get; set; } public string mobile { get; set; } public string group_id { get; set; } public string group_name { get { var s = "未定义"; if (group_id == "3") s = "主账户"; if (group_id == "4") s = "客服"; if (group_id == "9") s = "采购"; if (group_id == "5") s = "加盟"; if (group_id == "10") s = "上货"; if (group_id == "11") s = "数据"; if (group_id == "8") s = "登录"; return s; } } public int shop_count { get; set; } public int sa_level { get; set; } public string sa_level_name { get { var s = "普通用户"; if (sa_level == 1) s = "一级超管"; if (sa_level == 2) s = "二级超管"; return s; } } public int id { get; set; } } public class DouShopSubAccountInfo : SubAccountInfo { public string shop_login_name { get; set; } public string sub_user_id { get { return id.ToString(); } set { id = value.ParseToInt(); } } public string sub_user_name { get { return user_name; } set { user_name = value; } } public string status { get; set; } = "1"; public string company_id { get; set; } public string company_name { get; set; } } public class BrandInfo { public string brand_chinese_name { get; set; } public string brand_english_name { get; set; } public string brand_reg_num { get; set; } public long id { get; set; } } // temu 一个登录账号下可以有多个店铺 public class ShopCompany { public string UserName { get; set; } public string LoginName { get; set; } public string AccountId { get; set; } public string AccountName { get; set; } public string LoginStatus { get; set; } } }