/* * 主要基类 * 肖俊 * 2012-5-9 */ using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.IO; using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Windows.Forms; namespace AllBase { public static class BaseClass { #region oem贴牌参数 public static string OemId { get; set; } = ""; public static string OemName { get; set; } = ""; public static bool IsOemOwner { get; set; } = false; public static string AgentName { get; set; } = ""; public static string AgentCode { get; set; } = ""; public static bool IsShowRegister { get; set; } = true; public static bool IsShowOpenAccount { get; set; } = true; #endregion /// /// 版本ID /// public static int VersionCount = 1332; public static string MainPath = "29wx"; //public static string MainPath = "29wx"; //public static string MainPath = "29pdd"; //public static string MainPath = "kuajingda"; //public static int VersionCount = 613; /// /// 版本号 /// public static string Varsion = (VersionCount / 100.0).ToString("f2"); public static string WebbrowerUrl = ""; public static string ToolName = "跨境达-管理工具"; public static string ServiceQQ = ""; public static Image LoginImage = null; public static Image LogoImage = null; public static Icon Ico = null; public static bool UsePddWorkbanch = true; public static bool NoRegedit = false; public static bool IsPinduoduo = false; public static bool UserApi = true; public static bool GroupMarket = false; public static bool IsLoginSuccess = false; /// /// 微店Api地址 /// public static string VDianApi = "https://api.vdian.com/"; /// /// IP地址和名称 /// public static string IPAddress = ""; public static string IPAddressName = ""; /// /// 优先使用API /// public static bool UseApiFirst = false; public static string PddUid = ""; /// /// 启用新版签名验证算法 /// public static bool NewSignatureAuth = true; public static string IeFormCookies = ""; /// /// 订单开始时间 /// public static DateTime OrderBeginTime = DateTime.Now.AddDays(-60); /// /// 用于判断唯一性 /// public static Dictionary Products = new Dictionary(); /// /// 用于循环输出 /// public static List ProductUse = new List(); /// /// 进度条矩阵 /// public static Dictionary ProcessList = new Dictionary(); /// /// 上传过的 /// public static List ProductIds = new List(); //public static int MaxValue, MinValue, ThisValue; public static bool GetProductsSuccess = false; public static bool SetProductView = false; public static int TempSecond = 86400; public static string OriginUrl = "http://mobile.yangkeduo.com"; public static string NewUrl = "https://yangkeduo.com"; //public static string ServerUrl = "http://localhost:9000"; public static string ServerUrl = "http://1.13.195.131:9000"; /// /// 订单监控延迟 /// public static int OrderStep = 5; public static int RankPage = 3; public static int Points { get; set; } = 0; public static int ShopPointsPerMonth { get; set; } = 30; public static decimal Balance { get; set; } = 0; public static decimal PostagePerOrder { get; set; } = 2.2m; public static decimal RefundPostagePerOrder { get; set; } = 2.5m; public static decimal GiftOemAmountPerOrder { get; set; } = 0m; /// /// 采集最低销量 /// public static int MinSales = 0; public static int MinPercent = 0; public static int MinLevel = 0; public static int AlimamaPageCount = 0; public static bool CloudTitle = false; public static bool CloudBrand = false; public static bool CloudSellerNick = false; public static bool CloudProduct = false; public static string NoKeyword = ""; public static bool ImageSheild = true; public static string Conn = "";//"Max Pool Size = 512;Database='content';Data Source='sh-cdbrg-b674qssm.sql.tencentcdb.com';Port=62300;User Id='pinbaobao_user';Password='pinbaobao_pass_word123ZFd-';Charset=gbk;"; public static decimal MaxPrice = 0; public static decimal MinPrice = 0; public static decimal MinBackMoney = 0; public static decimal Price = 5; public static int TimeOut = 60; public static int ThreadCount = 3; public static int MainCatId = 0; /// /// 用户分组 3主号 4客服 5加盟 8登录 9采购 10加盟 11上货 /// public static int GroupId = 0; public static bool DarenYaoyue = false; public static bool DyProductCollect = false; public static bool IsCloudBuyOrder = false; /// /// 所在企业ID /// public static int CompanyId = 0; /// /// 企业名称 /// public static string CompanyName = ""; /// /// 到期时间 /// public static string EndDate = ""; /// /// 开户到期时间 /// public static string OpenEndDate = ""; public static string ExpressSite = "http://shisilou.6677kb.com/"; /// /// 图片API /// //public static string LoginApiUrl = "http://new.qixiaoke.com/"; public static string LoginApiUrl = ServerUrl; public static string ImgApiUrl = "http://119.45.29.75:9000"; // ServerUrl; public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/"; public static string GateApi = ""; public static string QqGroupNum = ""; public static string QqGroupUrl = ""; public static string WechatUrl = ""; public static string IeUrlShow = ""; public static string AlimamaDomain = ""; public static string AlimamaPid = ""; public static string FissionPicUrl = "https://img1.deifei.com/upload_xnn.php"; /// /// 店铺旺旺名 /// public static string ShopName = ""; public static string ShopId = ""; public static string AccessToken = ""; /// /// 拼多多店铺ID /// public static int MallId = 0; public static DateTime LoginTime = DateTime.Now; public static int ReceiverId = 0; //////public static string TbTokenUrl = ""; public static string NewCookies = ""; public static bool MustGetShopInfo = false; public static bool MustGetFormAlive = false; public static string ChromeChatHtml = ""; public static string ChromeUserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"; public const string AndroidUserAgent = "android Mozilla/5.0 (Linux; Android 6.0.1; MuMu Build/V417IR; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.100 Mobile Safari/537.36 phh_android_version/4.70.0 phh_android_build/f92e2036701996362fb6f938b7f085b01695de5d phh_android_channel/gw_pc"; public static string ChromeCookies = ""; public static string ChromeJinBaoCookies = ""; public static bool IsMainCompany = false; /// /// 当前所有cookies /// public static Dictionary> CookiesAll = new Dictionary>(); /// /// 对应多个店铺的所有cookies /// public static Dictionary> MulitCookiesAll = new Dictionary>(); /// /// 对应多个店铺的所有cookies字符串 /// public static Dictionary> MulitCookiesAllString = new Dictionary>(); /// /// 当前所有cookies对应字符串 /// public static Dictionary CookiesAllString = new Dictionary(); /// /// API接口是否可用 /// public static bool ApiCanUse = false; /// /// 启用昨日订单 /// public static bool OrderYesterday = false; /// /// 店铺名 /// public static string ShopNameString = ""; /// /// 店铺网址 /// public static string ShopUrl = ""; /// /// 1:正在获取token,2:结束,3:执行,0:空闲 /// //public static int TbTokenGeting = 0; /// /// 代理列表 /// public static List Proxy = new List(); /// /// 标题中不能包含的词 /// public static List CantTitleKeywords = new List(); /// /// 不能使用的分类 /// public static List CantCatId = new List(); /// /// 不能使用的标题 /// public static List CantTitle = new List(); /// /// 不能使用的品牌 /// public static List CantBrand = new List(); public static string x5Sec = ""; /// /// 所有违规上家Id /// public static List UpIds = new List(); public static string HadNoteId = ""; /// /// 网址正则 /// public static string LinkRegex = @"]*href[\s]*=[\s]*[""']{0,1}([^\s^>^""^']*)[^>]*>(.*?)"; /// /// 网址正则 /// public static string LinkRegexOut = @"]*href[\s]*=[\s]*[""']{0,1}(http[s]*://[^\s^>^""^']*)[^>]*>(.*?)"; /// /// Api对接密码 /// public static string ApiKeyword = "xiaojun&find_gold_cat"; /// /// 接口缓存信息 /// public static string UserAgent = null; /// /// 接口缓存信息 /// public static string ViewCode = null; /// /// 百度权重缓存信息 /// public static string ViewCodex = null; /// /// 是否暂停 /// public static bool IsStop = false; /// /// 是否测试 /// public static bool IsTest = false; /// /// 是否正在执行 /// public static bool IsRunning = false; /// /// 权重更新时间 /// public static int TimeBaiduRank = 0; /// /// 排名更新时间 /// public static int TimeKeywordRank = 0; /// /// 时间差 /// public static int TimeDifferent = 0; /// /// 硬件信息 /// public static string MacInfo = ""; /// /// 注册用户名 /// public static string UserName = ""; /// /// 子账号所属主账号 /// public static string ParentUserName { get; set; } //public static bool IsSa; /// /// 超管等级 0 普通用户 1 超级管理员 /// public static int SaLevel = 0; public static string UserAuthority = ""; public static string ParentAuthority = ""; public static string ForbiddenPage = ""; public static decimal? AuthorizedAmount = null; /// /// 注册昵称 /// public static string NickName = ""; public static string Mobile = ""; public static string ClientId = ""; public static List ClientIdx = new List(); /// /// 安全接口 /// public static List ClientIdSave = new List(); public static string ApiKey = ""; public static string ApiKeyx = ""; /// /// 代理权限 /// public static Dictionary AgentAuth = new Dictionary(); /// /// 注册用户名 /// public static int UserId = 0; /// /// 注册用户名 /// public static int UserKey = 0; /// /// 注册用户名 /// public static int SiteBuildThreadCount = 0; /// /// 用户版本 99:拼多多测试版,100,定制版 /// public static int UserVersion = 0; /// /// 注册用户名 /// public static string UserVersionString = ""; /// /// 注册密码 /// public static string PassWord = ""; public static string PassWordBak = ""; /// /// 间隔时间 /// public static int WaitTime = 300; /// /// 注册密码 /// public static string LogPatch = ""; public static bool Remember = false; public static bool AutoLogin = false; /// /// 获取数据库链接 /// /// //public static string GetDataString() //{ // if (IsMysqlDataBase) // { // return "Max Pool Size = 512;Database='" + DataBase + "';Data Source='" + DataIp + // "';Port=3306;User Id='" + DataUser + "';Password='" + DataPass + "';Charset=gbk;"; // } // return "server=" + DataIp + ";database=" + DataBase + ";uid=" + DataUser + ";pwd=" + DataPass; //} /// /// 接口程序 /// public static List ApiList = new List(); /// /// 国内代理列表 /// public static List ProxyIn = new List(); /// /// 美国代理列表 /// public static List ProxyOut = new List(); /// /// 美国代理列表 /// public static List ProxyHttps = new List(); /// /// 指数代理列表 /// public static List IpChangeList = new List(); /// /// CPU使用率 /// public static int CpuUser = 0; /// /// CPU温度 /// public static int CpuTemperature = 0; /// /// 数据库正在执行线程数 /// public static int DataUpdateThread = 0; public static string ImageApiUrl = LoginApiUrl + "index.php?obj=api/image"; /// /// 产品公告内容 /// public static string Annoucement = string.Empty; /// /// 是否显示公告 /// public static bool Announce = true; /// /// 是否显示视频指南 /// public static bool ShowVideoGuidance = true; /// /// CPU使用率更新线程 /// public static void UpdateCpuThread() { PerformanceCounter CpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total"); int i; double all; while (true) { all = 0; for (i = 1; i < 6; i++) { all += CpuCounter.NextValue(); Thread.Sleep(50); } CpuUser = (int)all / i; } } /// /// 计算字节长度 /// /// /// public static int GetCharLength(string word) { if (string.IsNullOrEmpty(word)) return 0; return Encoding.GetEncoding("gbk").GetBytes(word).Length; } /// /// 返回固定字节长度 /// /// /// /// public static string SubCharLength(string word, int len) { if (string.IsNullOrEmpty(word)) return word; word = word.Trim(); word = word.Replace("..", ".").Replace("..", "."); word = word.Replace(" ", " ").Replace(" ", " "); if (GetCharLength(word) <= len) return word; while (GetCharLength(word) > len) { word = word.Substring(0, word.Length - 1); } return word; } /// /// 判断字符串是否为汉字 by ttzhao 2020.9.25 /// /// /// /// public static bool IsChinese(string str, bool allMatch) { string pattern; if (allMatch) pattern = @"^[\u4e00-\u9fa5]+$"; else pattern = @"[\u4e00-\u9fa5]"; if (Regex.IsMatch(str, pattern)) return true; else return false; } /// /// 获取字符串长度:其中,1个汉字占两个字符的情况 by ttzhao 2020.9.25 /// /// /// public static int GetStrLength(string str) { int sum = 0; for (int i = 0; i < str.Length; i++) { bool isChs = IsChinese(str[i].ToString(), true); if (isChs) sum += 2; else sum += 1; } return sum; } /// /// C#格式时间转换为Unix时间戳(秒) /// /// /// public static int DateTimeToTimestampSeconds(DateTime time) { System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); return (int)(time - startTime).TotalSeconds; } /// /// C#格式时间转换为Unix时间戳(毫秒) /// /// /// public static long DateTimeToTimestampMilliseconds(DateTime time) { System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); return (long)(time - startTime).TotalMilliseconds; } /// /// Unix时间戳(秒)转为C#格式时间 /// /// /// public static DateTime StampToDateTime(int timeStamp) { DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(timeStamp + "0000000"); TimeSpan toNow = new TimeSpan(lTime); return dateTimeStart.Add(toNow); } /// /// 获取服务器的精准时间 /// /// public static DateTime GetServerTimeString() { int time = GetTime(); DateTime t = StampToDateTime(time); return t; } /// /// 获取服务器的精准时间 /// /// public static string GetServerTimeString(int addSecond) { int time = GetTime() + addSecond; DateTime t = StampToDateTime(time); return t.ToString("yyyy-MM-dd HH:mm:ss"); } /// /// 设置粘贴板 /// /// public static void SetClipboard(string message) { try { Clipboard.SetDataObject(message); } catch { } } /// /// 获取绝对时间 /// /// public static int GetTime() { return DateTimeToTimestampSeconds(DateTime.Now) + TimeDifferent; } /// /// 获取绝对时间 /// /// public static int GetTime(DateTime t) { return DateTimeToTimestampSeconds(t) + TimeDifferent; } /// /// MD5加密 /// /// /// public static string GetMd5(string instring) { byte[] result = Encoding.UTF8.GetBytes(instring.Trim()); MD5 md5 = new MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); return BitConverter.ToString(output).Replace("-", ""); } /// /// MD5加密 /// /// public static string GetMd5(byte[] result) { MD5 md5 = new MD5CryptoServiceProvider(); byte[] output = md5.ComputeHash(result); return BitConverter.ToString(output).Replace("-", ""); } /// /// 获取文件MD5值 /// /// /// public static string GetFileMd5(string FilePath) { try { FileStream get_file = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read); System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] hash_byte = get_md5.ComputeHash(get_file); string resule = System.BitConverter.ToString(hash_byte); resule = resule.Replace("-", ""); get_file.Close(); return resule; } catch (Exception e) { return e.ToString(); } } /// /// MD5加密 /// /// public static long GetLong(byte[] result) { return Convert.ToInt64( BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(result), 4, 8).Replace("-", ""), 16); } /// /// MD5 16位加密转long /// /// /// public static long GetLong(string url) { if (string.IsNullOrEmpty(url)) return 0; return Convert.ToInt64(BitConverter.ToString(new MD5CryptoServiceProvider().ComputeHash(Encoding.Default.GetBytes(url)), 4, 8).Replace("-", ""), 16); } /// /// 返回表ID /// /// /// public static int GetTableId(long id) { return (int)Math.Abs(id % 1024); } /// /// 签名算法 /// /// 随机数 /// 加密签名结果 public static string Encryption(int s) { string ss = s.ToString(); if (ss.Length > 8) { ss = ss.Substring(ss.Length - 8); s = int.Parse(ss); if (s < 100000000) s += 100000000; } byte[] kb = Encoding.ASCII.GetBytes(s.ToString()); double y = s * 1.8061825125; y += 4852095.48659959; y += kb[3] * 943579.486548; y += kb[7] + 4889894.30184; byte[] k = Encoding.ASCII.GetBytes(y.ToString()); y -= 458735.48548; y -= k[6] * 458720.454545; y -= k[2] * 5447826.96889; byte[] k1 = Encoding.ASCII.GetBytes(y.ToString()); y += 34779810.2455; y -= k1[1] * 57942.0564845; y -= k1[5] * 1548.487866; string c = ((int)y).ToString(); return GetMd5(c); //返回签名的MD5结果 } public static string BuildDefaultObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/" + file + "?obj=" + "/" + file; } /// /// 生成OBJ路径 /// /// /// public static string BuildObjString(string file, bool IsLoginDef = false) { //if (IsLoginDef) //{ // return "http://new.taojinhu.com/" + "?obj=pinbaobao/" + file; //} //return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file; //http://localhost:8000/user/user_login if (BaseClass.MainPath == "29pdd") { return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file; } if (BaseClass.MainPath == "29dy") { return LoginApiUrl + "/dyxd_" + file + "?obj=" + BaseClass.MainPath + "/dyxd_" + file; } if (BaseClass.MainPath == "29wx") { return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file; } return LoginApiUrl + "/" + file+ "?obj=" + BaseClass.MainPath + "/" + file; } public static string BuildPDDObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file; } public static string BuildWXObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file; } public static string BuildWXImgObjString(string file, bool IsLoginDef = false) { return ImgApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file; } private static char[] constant = { '0','1','2','3','4','5','6','7','8','9', 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' }; /// /// 随机返回指定位数的字母数字组合 /// /// /// public static string GetRandomAlphanumeric(int iLength) { System.Text.StringBuilder newRandom = new System.Text.StringBuilder(62); for (int i = 0; i < iLength; i++) { newRandom.Append(constant[Randomx.GetId(62)]); } return newRandom.ToString(); } public static long ConvertDateTimeLong(DateTime time) { System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); return (long)(time - startTime).TotalMilliseconds; } /// /// 获取Unix毫秒级时间戳 /// /// 当前时间戳 public static long ConvertDateTimeLong() { return (GetServerTimeString().ToUniversalTime().Ticks - 621355968000000000) / 10000; } /// /// 获取两个标题相似度 /// /// 参照标题 /// 检测标题 /// 相似度 public static double GetSimularityBetween2Text(string refererTitle, string checkTitle) { double sameCnt = 0; for (int i = 0; i < refererTitle.Length; i++) { if (checkTitle.IndexOf(refererTitle.Substring(i, 1)) != -1) { sameCnt += 1; } } return Math.Round(sameCnt / Convert.ToDouble(refererTitle.Length), 2); } } public class KeyValueBase { public KeyValueBase() { } public KeyValueBase(string key, string value) { Key = key; Value = value; } public KeyValueBase(string key, string value, string cat) { Key = key; Value = value; CatName = cat; } public string Key; public string Value; /// /// 店铺ID /// public string Id = ""; public string CatName = ""; } public class KeyValuesBase { public KeyValuesBase(string key, string value1) { Key = key; Value1 = value1; } public KeyValuesBase(string key, string value1, string value2, string value3) { Key = key; Value1 = value1; Value2 = value2; Value3 = value3; } public KeyValuesBase(string key, string value1, string value2, string value3, string value4) { Key = key; Value1 = value1; Value2 = value2; Value3 = value3; Value4 = value4; } public KeyValuesBase(string key, string value1, string value2) { Key = key; Value1 = value1; Value2 = value2; } public string Key; public string Value1; public string Value2; public string Value3; public string Value4; public int Rank = 0; } public class CatProudctBase { public int CatId = 0; public Dictionary Products = new Dictionary(); } public class MarketProductBase { public string ProductId = ""; public string Title = ""; public string CatIds = ""; public string Image = ""; public string CampaignId = ""; public string Token = ""; } public class ProcessBase { public int Min = 0; public int Max = 0; public int Value = 0; } public class ProductBase { public long Id; public long UpId; public string Title; public string OuterId; public decimal Price; public bool HadFastCar = false; /// /// 需要上传 /// public bool MustUpdate = false; public int CatId = 0; public int MainCatId = 0; public DateTime SetTime = DateTime.Now.AddDays(-1); public bool SetOk = false; public string ShopName = ""; public int SoldCount = 0; public int onSale; } public class ProductTaoKeBase { public string Title = ""; public long TaoKeId = 0; public string TaoKeUrl = ""; public long toId = 0; public string taoBaoUrl = ""; public string quanHou = ""; public string yuanPrice = ""; public string xiaoLiang = ""; public string yongJin = ""; public string youHuei = ""; } public class ProductMeiLiZhe { public long TaobaoId { get { long id = 0; long.TryParse(TaobaoIdStr, out id); return id; } } public string TaobaoIdStr { get; set; } public string ProductId { get; set; } public string ProductName { get; set; } public string SourceUrl { get; set; } public string Url { get; set; } public double Price { get { return Convert.ToDouble(PriceStr); } } public string PriceStr { get; set; } public double PriceWidthTicket { get { return Convert.ToDouble(PriceWidthTicketStr); } } public string PriceWidthTicketStr { get; set; } public double TicketPrice { get { return Convert.ToDouble(TicketPriceStr); } } public string TicketPriceStr { get; set; } public int SaleCount { get; set; } /// /// 前4位表示页码,后三位表示在该页面位置 /// public int PageOrder { get; set; } } public class ProductCollectBase { /// /// 更新SKU是否成功 /// public bool UpdateSuccess = false; /// /// 是否预售 /// public bool IsPreSale = false; /// /// 是否在售 /// public bool IsOnSale = true; public bool UpToStock = false; public long id = 0; public int cat_id = 0; public int main_cid = 0; public string main_cat_name = ""; public long mall_id = 0; public int cat1 = 0; public int cat2 = 0; public int cat3 = 0; public int cat4 = 0; public long from_id = 0; public int from_shop_id = 0; public int from_cat_id = 0; /// /// 1:淘宝,2:拼多多,3:阿里巴巴,4:京喜,6:微店,7:抖音 /// public int from_site_id = 0; public int item_weight = 1; public int saleCount = 0; public int num = 0; public decimal price = -1; public decimal before_price = -1; public decimal discount = -1; public decimal discountPrice = -1; public decimal onlinePrice = -1; public decimal market_price = 0; public int shopAddPercent = 0; public decimal shopAddPriceMin = 0; public decimal shopAddPriceMax = 0; public string image = ""; public string image_path = ""; public string image_from_url = ""; public string from_name = ""; public List fission_names = new List(); public string name = ""; public string name_share = ""; public string content_pinduoduo = ""; public string thumb_url_pinduoduo = ""; public string hd_thumb_url_pinduoduo = ""; public long cost_template_id_pinduoduo = 0; public string name_shot = ""; public List Prop = new List(); public List Props = new List(); public List Props_bak = new List(); public List Packs = new List(); public List SkuMaps = new List(); public List SkuMaps_bak = new List(); public List Images = new List(); public List Images_bak = new List(); public string sell_pt = ""; public string from_url = ""; public string from_title = ""; public string to_shop_name = ""; public string from_shop_name = ""; public string item_size = ""; public string city = ""; public string state = ""; public string content = ""; public string out_id = ""; public string content_bak = ""; public string shop_id = ""; public string content_alibaba = ""; public string from = ""; public string message = ""; public string up_url = ""; public string country = ""; /// /// 外部上家ID /// public string out_goods_sn = string.Empty; /// /// 邮费 /// public decimal express_price = 0; public long nameMd5 = 0; public long upShopId = 0; public string deliver_template = "408运费模板"; public string logisticsTime = ""; /// ///商品资质中的内容(目前只有两种): 3C证书 /工业许可证 /// public string authCode = string.Empty; /// /// 提示信息 /// public string message_alert = string.Empty; /// /// 是否已经单独加价 /// public string is_changeprice = ""; /// /// 自定义单品加价比例 /// public decimal addPricePercent = 0; /// /// 自定义单品加价 /// public decimal baseAddPrice = 0; /// /// 是否是净化数据数据 /// public bool isFission = false; /// /// 产品数据库对应Id /// public int fissionDataBaseId = 0; /// /// 商品资质信息文件列表 /// public List qualifications { get; set; } public ProductCollectBase Clone() { var prop = new List(); foreach (KeyValueBase p in Prop) { prop.Add(p); } Prop.Clear(); string html = JsonHelper.SerializeObject(this); ProductCollectBase tp = JsonHelper.DeserializeJsonToObject(html); foreach (KeyValueBase p in prop) { tp.Prop.Add(p); Prop.Add(p); } return tp; } } public class PropBase { public long id; public string name = ""; public string pinduoduo_name = ""; public string pinduoduo_id = ""; public int sort = 0; public List Values = new List(); } public class PropValueBase { public string value = ""; public string name = ""; public string name_pinduoduo = ""; public string id = ""; public string image = ""; public string image_path = ""; public string image_from_url = ""; //public string image_pinduoduo_url = ""; public int number = 0; public bool is_used = false; //public decimal pinduoduo_price = 0; } public class PackBase { public string name = ""; public string value_count = ""; public int sort = 0; } public class SkuMapBase { public long id = 0; public string name = ""; private string _nameLite = ""; public string nameLite { get { if (!string.IsNullOrEmpty(_nameLite)) return _nameLite; var strArr = name.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); foreach (var item in strArr) { var colonIndex = item.IndexOf(':'); colonIndex = colonIndex < 0 ? 0 : colonIndex; _nameLite += item.Substring(colonIndex).Trim(':') + ";"; } return _nameLite; } set { _nameLite = value; } } public decimal price = 0; public decimal before_price = 0; /// /// 团购价 /// public int new_price = 0; public int number = 0; public int sale_count = 0; /// /// 单买价 /// public int online_price = 0; public decimal no_group_price = 0; public string prop_image = ""; public string pinduoduo_image = ""; public string spec_pinduoduo = ""; public string outer_id = ""; public string skuPreSaleTip = ""; public long skuPreTime = 0; public decimal quanPrice = 0M; } //抖店sku详情 public class spec_prices { public string outer_sku_id; public long price; public long step_stock_num; public long stock_num; public string spec_detail_name1; public string spec_detail_name2; public string spec_detail_name3; public string picurl; public string code; } public class quality { public string quality_key; public string quality_name; public List quality_attachments; } public class quality_file : quality { /// /// 资质证书编号 /// public string quality_number; } public class quality_attachment { /// /// 凭证文件类型 1-图片,2-pdf /// public int media_type; /// /// 凭证url /// public string url; } }