/* * 主要基类 * 肖俊 * 2012-5-9 */ using AllBase.DouYinModel.Result; using AllBase.Model.Config; using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.IO; using System.Security.Cryptography; using System.Text; 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; /// /// 礼品单oem额外价格 /// public static decimal OemGiftAmount { get; set; } = 0; #endregion /// /// 版本ID /// public static int VersionCount = 331; public static string ServerUrl { get; set; } = "http://1.13.195.131:9000"; public static string DebugUrl { get; set; } = "http://localhost:9000"; /// /// 版本号 /// public static string Varsion = (VersionCount / 100.0).ToString("f2"); public static bool isUseSimGetOrder = false; /// /// 是否开启模拟解密 /// public static bool isUseSimGetRealAddress = false; /// /// 当前使用的路由 /// public static string routeInUse = "buy_order_api"; public static string ApiUrl { get; set; } = "http://xiaohuomao.nai8.net"; //"http://xiaohuomao.nai8.net";//"http://192.168.8.191"; //" "http://192.168.8.191" http://ddapi.nai8.net:29999"; public static bool UserApi { get; set; } = true; public static string PddUid = ""; public static string TaoBaoUid = ""; public static string ALUid = ""; public static string Jxsid = ""; /// /// 代理版本号 /// public static int oem_version = 0; public static string ProgramName = "29供应链-微信小店订单管理"; public static string ProgromLogo = ""; public static string ProgromLogoIco = ""; public static string ToolName = "29供应链-微信小店订单管理工具"; //public static string MainPath = "douyin"; public static string MainPath = "29wx"; public static string ServiceQQ = "569588500"; public static Image LoginImage = null; public static Image LogoImage = null; public static Icon Ico = null; public static int bili = 5; public static FontFamily font = null;//字体 public static IntPtr pati; /// /// IP地址和名称 /// public static string IPAddress = "127.0.0.1"; public static string IPAddressName = "127.0.0.1"; /// /// 是否操作总公司 /// public static bool IsMainCompany = false; public static bool IsBuyer = false; /// /// 外部版本开启拼多多 /// public static bool IsPinduoduo = false; public static bool IsJinBao = false; public static bool IsTaoKe = false; public static bool IsPinbaobao = false; public static bool IsXiaoNaiNiu = false; public static bool IsJingXi = false; public static bool SafeModel = false; public static string AlimamaDomain = ""; public static string AlimamaPid = ""; //public static string ClientId = "9558f920cf77403bb475243fe44482ad"; public static string ApiKey = "a55ef8306263e335d3c0d332a94c9dbc24347cc1"; public static List ClientIdx = new List(); /// /// 启用新版签名验证算法 /// public static bool NewSignatureAuth = true; public static Dictionary serverDic = new Dictionary();//存放服务地址 //public static string ServerUrl = "http://psbx.9u99.com/index.php?s=/"; public static string PXServerUrl = "http://px.jindouduo.com/";//螃蟹工具 public static string NbAssistantUrl = "http://nbzlw.e57.cn/";//奶爸助理 public static string TutuGateUrlx = "http://tt.deifei.cn/";//途途上货助手 public static string MicrowoodUrlx = "http://dd.pinsubao.com/";//微木REP public static string BullUrlx = "http://wdt.qimake.cn/";//蛮牛工具 public static string MicrowoodOrderUrlx = "http://wnm.pinsubao.com/";//微木订单 public static string OrderGoldUrlx = "http://dianjin.6nt.cn/";//点金工具箱 public static string KaiDaToolUrlx = "http://kd.qimake.cn/";//凯达工具 public static string JfGjUrlx = "http://jfgj.qixiaoker.com/";//飓风管家 public static string JfDeliverUrlx = "http://jffh.qixiaoker.com/";//飓风发货 public static string TaoBaoLoginUrl = "https://login.taobao.com/member/login.jhtml"; // public static string AL1688LoginUrl = "https://work.1688.com/home/buyer.htm?_path_=buyer2017Base/2017buyerbase_trade/buyList&spm=a262jm.9273823.wkalibar.d8.5d884aadnN1j9G"; public static string PddMobileUrl = "https://yangkeduo.com/"; public static string PddMobileUrlx = "http://yangkeduo.com/"; public static string duoduojinbaoURL = ""; public static string taobaolianmengURL = ""; #region 设置参数 /// /// 是否读取佣金 0是读取 1不读取 /// public static int is_read_commission = 0; #endregion /// /// 店铺子账号字典 /// public static Dictionary dousubaccountDic = new Dictionary(); public static int readOrderTime = 0; /// /// 巨量百应用户cookies /// public static string baiyincookies = ""; /// /// 订单开始时间 /// 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 int OrderStep = 5; public static int RankPage = 3; /// /// 采集最低销量 /// public static int MinSales = 0; public static int MinPercent = 0; public static int MinLevel = 0; public static int Points { get; set; } /// /// 店铺充值月费 /// public static int ShopPointsPerMonth { get; set; } = 30; public static decimal RechargeAmountTotal { get; set; } = 0; public static decimal Balance { get; set; } = 0; public static decimal PostagePerOrder { get; set; } = 2.2m; public static decimal PostagePerOrderDiff { get { return Math.Max(0, PostagePerOrder - 2.2m); } } public static decimal RefundPostagePerOrder { get; set; } = 2.5m; public static decimal RefundPostagePerOrderDiff { get { return Math.Max(0, RefundPostagePerOrder - 2.5m); } } 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 bool ImageSheild = true; /// /// 内部版 /// public static bool InSideVersion = false; public static decimal MaxPrice = 0; public static decimal MinPrice = 0; public static decimal MinBackMoney = 0; public static decimal Price = 5; public static int TimeOut = 45; public static int ThreadCount = 3; public static int MainCatId = 0; public static int GroupId = 0; /// /// 所在企业ID /// public static int CompanyId = 0; /// /// 企业名称 /// public static string CompanyName = ""; /// /// 到期时间 /// public static string EndDate = ""; /// /// 图片API /// public static string LoginApiUrl = ServerUrl; public static string ImageApiUrl = "https://new.qixiaoke.com/index.php?obj=api/image"; //public static string LoginApiUrl = "http://order.qixiaoke.com/";//"http://192.168.8.9:8080/"; //public static string LoginApiUrl = "http://127.0.0.1:81/"; public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/"; public static string UserAgentUrl = LoginApiUrl + "userAgent.php"; public static string GateApi = ""; public static string ExpressSite = "http://www.1064kk.com/"; public static string NewExpSite = "http://xinfen.xmby.tech/"; public static string QqGroupNum = ""; public static string QqGroupUrl = ""; public static string WechatUrl = ""; public static string IeUrlShow = ""; public static string JinBaoJump = ""; /// /// 店铺旺旺名 /// public static string ShopName = ""; public static string ShopId = ""; /// /// 拼多多店铺ID /// public static int MallId = 0; 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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"; public static string PddShopChromeUserAgent = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.4.45 Safari/537.36 PddWorkbench-Online PddBrowser pdd_windows_version/2.6.0.26"; public static string ChromeCookies = ""; public static string ChromeJinBaoCookies = ""; public static string ChromeTbLmCookies = ""; public static string ChromeJdLmCookies = ""; public static string OrderId = "";//限制的订单 public static string PayMobile = "";//当前买手账号 public static bool SlideFormIsClose = true;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体) //针对淘宝模拟接口限制 public static bool SlideIsClose = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体) public static bool SlideCookiesReplace = false;//限制的窗体是否关闭(未关闭不允许弹出新的滑动窗体) public static string SlideUrl = "";//限制的url public static string x5Sec = ""; //针对淘宝cef限制 public static string SlideUrlx = "";//限制的url public static string x5Secx = ""; public static string loadUrl = "";//限制的买手号订单列表 public static string verify_auth_token = ""; public static string verify_auth_token_prodetails = ""; public static bool isverfiy_finish = true; //public static bool startGetRefundOrder = false; public static bool IsUpdateExp = false;//修改物流 public static bool IsBuyEmptyBagSuccess = true;//购买空包是否成功标识 public static string EmptyBagType = "LPD";//快递网类型 public static string EmptyBagExp = "";//快递单快递 public static string SendErrorExpTime = "11";//发错误单的开始时间 public static string UpdateErrorExpTime = "10";//修改错误单的开始时间 public static bool PhonePay = true;//是否通过手机端购买 public static bool IsFinishSpellOrder = true;//是否已完成拼团--一键拼团使用 //public static bool IsFinishBuyOrder = true;//是否已完成拍单--连续拍单使用 public static string payPwd = "";//支付密码 public static bool IsRandomBuyer = false;//是否随机买手号 public static int sendOrderMin = 5;//发货初始倒计时分钟 public static int sendOrderSecond = 60;//发货倒计时秒 public static int StartReadOrderMin = 8;//读取订单倒计时分钟 public static int StartReadOrderSecond = 10;//读取订单倒计时秒 public static bool IsCloudBuyOrder = false;//云拍单(拼多多批发,多买手) public static bool IsFactory = false; // 是否工厂模式 public static bool IsContinueBuy = false;//是否连续拍单 public static string DuoduoJinbaoUrl = "";//手动填写的多多进宝推广url public static string DuoduoJinbaoDefaultUrl = "";//多多进宝推广url 默认 public static bool IsLoadDdJinBao = false;//拍单时是否用多多进宝的url public static bool IsUpdateMobile = true;//是否修改收货人的手机号 public static string AntiContent = "";//发货用 public static bool AfterSaleTip = false;//售后提醒--默认关闭 public static bool IsFilterWord = true;//自动回复过滤违禁词--默认开启 public static string FilterWord = "";//过滤的违禁词 public static bool AutoReply = false;//客服集成是否自动回复 public static bool IsCustomService = false;//是否开启客服集成--默认关闭 public static bool IsOrderManage = true;//是否开启订单管理 public static bool NewCusSystem = false;//是否新方式的客服集成 public static bool IsSearchSame = true;//是否开启搜同款功能 public static bool IsOpenSound = false;//是否开启声音提醒 public static int AfterSaleTime = 30;//读取售后单的时间--默认30天 public static int WorkOrderTime = 30;//读取工单的时间--默认30天 public static bool IsLoginFinish = false;//是否登录完成 public static bool sOenVideoGuidance = true;//是否有视频指南 public static int UpdChoice = 1;//防滥发修改选项 1:都修改 2:不修改手机号 public static bool isOpenPangxie = false;//是否开启螃蟹 public static bool isEasyOrder = false;//开启分批发货 public static bool LoseMoneyNoBuy = true;//亏本单不拍 默认开启 public static bool IsImgShow = true;//是否显示规格图 默认开启 public static bool IsAutoSend = true;//是否拼多多自动发货 默认开启 public static bool IsAutoSendTb = true;//是否淘宝自动发货 默认开启 public static bool IsLoadByDefaultWeb = true;//是否通过电脑默认自身的浏览器打开商品详情 默认开启 public static bool isHljArear = false;//是否是黑龙江地区 默认关闭 public static bool testtb = true;//测试淘宝 public static bool IsSaveNote = false;//是否保存后台备注 public static bool IsAutoApplyRefund = false;//是否自动去上家申请退款 public static bool IsRefund = false;//店铺自动同意退款 退款后买手去上家退款 public static bool IsHasReceipt = false;//是否开启已有揽收信息再发货 public static bool TbLimitShow = true;//开启时淘宝买手号限制时自定弹框 public static bool DesSwitch = false;//是否开启随机解密方式 默认关闭 以服务端为准 public static int DesRsvTypeRate = 5;//开启RSV解密方式比例 默认50% 以服务端为准 public static bool SendSet = false;//开启发货时间设置开关 public static int SendTime = 13;//开启发货时间设置 public static bool SwitchBuyer = false;//点击拍单订单详情自动切换买手号 默认关闭 public static int ModeType = 0;//查看拍单订单详情方式 默认模式一 public static int GetTbExpressModeType = 0;//获取淘宝物流详情方式 默认模式一 public static int GetOrderPice = 0;//设置不读单的金额 public static int OrderDisplay = 0;//0全部 1单 2双 订单显示 #region 防滥发设置 public static string AddressDetailFormat = ""; public static string MobileFormat = ""; public static string Address_add = "拨打姓名后括号的电话";//拍单时追加地址的后面 public static bool Address_Add_Specialword = false; public static long Mobile_Change; #region 新版泛滥发设置 public static string OwerSetMobile;//自定义拍单号码 public static bool SpecCodeName;//名字加特殊字符 public static bool AddRealMobile;//添加真实号码 #endregion #endregion /// /// 所有店铺的clientId token的过期时间 /// public static Dictionary ShopTokenTime = new Dictionary(); /// /// 当前所有cookies /// public static Dictionary> CookiesAll = 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 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 NickName = ""; /// /// 注册用户名 /// public static int UserId = 0; /// /// 注册用户名 /// public static int UserKey = 0; /// /// 注册用户名 /// public static int SiteBuildThreadCount = 0; /// /// 注册用户名 /// public static int UserVersion = 0; /// /// 注册用户名 /// public static string UserVersionString = ""; /// /// 注册密码 /// public static string PassWord = ""; /// /// 间隔时间 /// public static int WaitTime = 300; /// /// 注册密码 /// public static string LogPatch = ""; public static bool Remember = false; public static bool AutoLogin = false; /// /// 拼多多防滥发 /// public static bool PreveSpam = 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 PassWordBak { get; set; } public static string Mobile { get; set; } public static string ParentAuthority { get; set; } public static string ForbiddenPage { get; set; } public static string UserAuthority { get; set; } public static string ParentUserName { get; set; } public static string MainUserName { get { return string.IsNullOrEmpty(ParentUserName) ? UserName : ParentUserName; } } public static int SaLevel { get; set; } public static bool IsLoginSuccess { get; set; } public static SettingConfig Setting { get; set; } /// /// 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; } } /// /// DateTime时间格式转换为Unix时间戳格式 /// /// /// public static int ConvertDateTimeInt(DateTime time) { System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); return (int)(time - startTime).TotalSeconds; } /// /// DateTime时间格式转换为Unix时间戳格式 13位 /// /// /// public static long ConvertDateTimeLong(DateTime time) { //TimeSpan ts = time - new DateTime(1970, 1, 1, 0, 0, 0, 0); TimeSpan ts = time - TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); return Convert.ToInt64(ts.TotalMilliseconds); } /// /// 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; } /// /// 计算字节长度 /// /// /// public static int GetCharLength(string word) { if (string.IsNullOrEmpty(word)) return 0; return Encoding.GetEncoding("gbk").GetBytes(word).Length; } /// /// 时间戳转为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); } /// /// 时间戳转为C#格式时间 /// /// /// public static DateTime StampToDateTimex(long timeStamp) { DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); long lTime = long.Parse(timeStamp + "0000"); TimeSpan toNow = new TimeSpan(lTime); return dateTimeStart.Add(toNow); } /// /// 设置粘贴板 /// /// public static void SetClipboard(string message) { try { Clipboard.SetDataObject(message); } catch { } } /// /// 获取服务器的精准时间 /// /// public static DateTime GetServerTimeString() { int time = GetTime(); DateTime t = StampToDateTime(time); return t; } /// /// 获取绝对时间 /// /// public static int GetTime() { return ConvertDateTimeInt(DateTime.Now) + TimeDifferent; } /// /// 获取绝对时间 /// /// public static int GetTime(DateTime t) { return ConvertDateTimeInt(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 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); } /// /// 获取文件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(); } } /// /// 签名算法 /// /// 随机数 /// 加密签名结果 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结果 } /// /// 生成OBJ路径 /// /// /// public static string BuildObjString(string file) { if (IsJingXi) return LoginApiUrl + "index.php?obj=jingxi/" + file; if (IsXiaoNaiNiu) return LoginApiUrl + "index.php?obj=littlecow/" + file; if (IsPinbaobao) return LoginApiUrl + "index.php?obj=pinbaobao/" + file; if (IsBuyer) return LoginApiUrl + "index.php?obj=findgoldcat_buyer/" + file; if (IsMainCompany) return LoginApiUrl + "index.php?obj=findgoldcat_main/" + file; return LoginApiUrl + "index.php?obj=findgoldcat/" + file; } public static string DouYinBuildObjString(string file) { return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file; } public static string BuildDefaultObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/" + file + "?obj=" + "/" + file; } public static string Build29WxObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file; } public static string Build29PDDObjString(string file, bool IsLoginDef = false) { return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file; } /// /// 返回固定字节长度 /// /// /// /// 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; } } public class KeyValueBase { public KeyValueBase(string key, string value) { Key = key; Value = value; } public string Key; public string Value; /// /// 店铺ID /// public string Id = ""; public string CatName = ""; } public class BuyOrderTemp { public string ShopName;//店铺名称 public string OrderId;//客户单号 public string BuyOrderId;//拍单单号 public string BuyUser;//拍单账户 public string BuyTime;//拍单账户 public string PayAccountZFB;//拍单支付宝账户 } 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) { Key = key; Value1 = value1; Value2 = value2; } public string Key; public string Value1; public string Value2; public string Value3; 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 class ProductCollectBase { /// /// 更新SKU是否成功 /// public bool UpdateSuccess = false; public long id = 0; public int cat_id = 0; public int main_cid = 0; public string main_cat_name = ""; public int 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; 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 string name = ""; public string name_share = ""; public string content_pinduoduo = ""; public string hd_thumb_url_pinduoduo = ""; public string thumb_url_pinduoduo = ""; public int cost_template_id_pinduoduo = 0; public string name_shot = ""; public List Prop = new List(); public List Props = new List(); public List Packs = new List(); public List SkuMaps = new List(); public List Images = new List(); public string sell_pt = ""; public string from_url = ""; public string from_shop_name = ""; public string item_size = ""; public string city = ""; public string state = ""; public string content = ""; public string from = ""; public string from_title = ""; public string message = ""; /// /// 邮费 /// public decimal express_price = 0; public long nameMd5 = 0; public long upShopId = 0; public ProductCollectBase Clone() { string html = JsonHelper.SerializeObject(this); ProductCollectBase tp = JsonHelper.DeserializeJsonToObject(html); 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 id = ""; public string image = ""; public string image_path = ""; public string image_from_url = ""; //public string image_pinduoduo_url = ""; public int number = 0; //public decimal pinduoduo_price = 0; public string name_pinduoduo = ""; } public class PackBase { public string name = ""; public string value_count = ""; public int sort = 0; } public class SkuMapBase { public long id = 0; public string name = ""; public decimal price = 0; public decimal before_price = 0; public decimal no_group_price = 0; public decimal new_price = 0; public int number = 0; public int sale_count = 0; public decimal online_price = 0; public string prop_image = ""; public string pinduoduo_image = ""; public string size = ""; public string sizename = ""; public string spec_pinduoduo = ""; } public class ReceiveAddress { public string Provincial; public string City; public string Area; } }