修改消费记录总金额计算方法

This commit is contained in:
chfei committed 2026-09-20 18:49:33 +08:00
1 parent 107bf82f97
commit d8064b95ef
5 files changed
+626 -534

No files matched your search

+12 -2
View File
@@ -1147,7 +1147,14 @@ Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.89+Safari/537.1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.1+(KHTML,+like+Gecko)+Chrome/21.0.1180.89+Safari/537.1
Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/45.0.2454.101+Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400"; Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.2372.400 QQBrowser/9.5.10548.400";
public static async Task<string> PostJsonAsync(string url, object postData, int timeOut = 0)
{
return await PostUtf8Async(url, JsonHelper.SerializeObject(postData), contentType: "application/json", timeOut: timeOut);
}
public static async Task<string> PostJsonAsync(string url, string postData, int timeOut = 0)
{
return await PostUtf8Async(url, postData, contentType: "application/json", timeOut: timeOut);
}
/// <summary> /// <summary>
/// post 数据 /// post 数据
/// </summary> /// </summary>
@@ -1309,7 +1316,10 @@ Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom
request.Method = "POST"; request.Method = "POST";
request.ServicePoint.Expect100Continue = false; request.ServicePoint.Expect100Continue = false;
if (!string.IsNullOrEmpty(contentType))
{
request.ContentType = contentType;
}
string body = postData; string body = postData;
byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body); byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
request.ContentLength = postBytes.Length; request.ContentLength = postBytes.Length;
+481 -443
View File
@@ -1,484 +1,522 @@
using System; using AllBase;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using AllBase;
using NaiBa.Util.Extension;
namespace Work namespace Work
{ {
public class UserLogin public class UserLogin
{ {
public string Mobile; public string Mobile;
public string Password; public string Password;
public static bool Logining = false, NoRegedit = false, NoFindPass = false, NoBuy = false; public static bool Logining = false, NoRegedit = false, NoFindPass = false, NoBuy = false;
/// <summary> /// <summary>
/// 登录 /// 登录
/// </summary> /// </summary>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public bool Get(ref string message, out int lockUserName, out int weakPassword, out string messageInfo) public bool Get(ref string message, out int lockUserName, out int weakPassword, out string messageInfo)
{ {
bool IsLoginDef = false; bool IsLoginDef = false;
Logining = true; Logining = true;
string mobile = Mobile; string mobile = Mobile;
string password = Password; string password = Password;
string passwordMd5; string passwordMd5;
if (password == "******") if (password == "******")
passwordMd5 = BaseClass.PassWord; passwordMd5 = BaseClass.PassWord;
else else
passwordMd5 = Md5Base.GetMd5(password).ToLower(); passwordMd5 = Md5Base.GetMd5(password).ToLower();
BaseClass.PassWord = passwordMd5; BaseClass.PassWord = passwordMd5;
BaseClass.PassWordBak = BaseClass.PassWord; BaseClass.PassWordBak = BaseClass.PassWord;
BaseClass.UserName = Mobile; BaseClass.UserName = Mobile;
Random r = new Random(); Random r = new Random();
int r2 = r.Next(100000000, 899999999); //生成随机码 int r2 = r.Next(100000000, 899999999); //生成随机码
string url = BaseClass.Build29WxObjString("user/user_login"); string url = BaseClass.Build29WxObjString("user/user_login");
for (int j = 0; j < 100 && string.IsNullOrEmpty(BaseClass.MacInfo); j++) for (int j = 0; j < 100 && string.IsNullOrEmpty(BaseClass.MacInfo); j++)
{ {
Thread.Sleep(10); Thread.Sleep(10);
} }
Agian: Agian:
string data = "mobile=" + mobile + "&r2=" + r2 + "&password=" + passwordMd5 + "&" + GetSignature() + "&mac=" + BaseClass.MacInfo + "&version=" + BaseClass.VersionCount; string data = "mobile=" + mobile + "&r2=" + r2 + "&password=" + passwordMd5 + "&" + GetSignature() + "&mac=" + BaseClass.MacInfo + "&version=" + BaseClass.VersionCount;
data += "&from_tool=" + GetHtml.UrlEncodeUtf8(BaseClass.AgentName) + "&client_ip=" + GetHtml.UrlEncodeUtf8(BaseClass.IPAddress) + "&client_addr=" + GetHtml.UrlEncodeUtf8(BaseClass.IPAddressName); data += "&from_tool=" + GetHtml.UrlEncodeUtf8(BaseClass.AgentName) + "&client_ip=" + GetHtml.UrlEncodeUtf8(BaseClass.IPAddress) + "&client_addr=" + GetHtml.UrlEncodeUtf8(BaseClass.IPAddressName);
data += "&sub_soft_type=order"; data += "&sub_soft_type=order";
string html = GetHtml.PostUtf8(url, data); string html = GetHtml.PostUtf8(url, data);
lockUserName = -1; lockUserName = -1;
weakPassword = -1; weakPassword = -1;
messageInfo = ""; messageInfo = "";
if (string.IsNullOrEmpty(html) || html.Contains("Error No File")) if (string.IsNullOrEmpty(html) || html.Contains("Error No File"))
{ {
if (!IsLoginDef) if (!IsLoginDef)
{ {
IsLoginDef = true; IsLoginDef = true;
url = BaseClass.Build29WxObjString("login"); url = BaseClass.Build29WxObjString("login");
goto Agian; goto Agian;
} }
message = "链接服务器失败\r\n" + message = "链接服务器失败\r\n" +
"如有问题请联系官方QQ:" + BaseClass.ServiceQQ; "如有问题请联系官方QQ:" + BaseClass.ServiceQQ;
return false; return false;
} }
if (html == "need open") if (html == "need open")
{ {
message = "登录失败\r\n请先点击“购买开户”开通本软件使用权限"; message = "登录失败\r\n请先点击“购买开户”开通本软件使用权限";
return false; return false;
} }
if (!html.Contains("\"code\":200")) if (!html.Contains("\"code\":200"))
{ {
var errMsg = BaseRegex.GetStringJson(ref html, "msg"); var errMsg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(errMsg)) if (string.IsNullOrEmpty(errMsg))
errMsg = html; errMsg = html;
message = errMsg; message = errMsg;
return false; return false;
} }
string code = BaseRegex.GetStringJson(ref html, "c"); string code = BaseRegex.GetStringJson(ref html, "c");
string codex = Encryption(r2); string codex = Encryption(r2);
if (code != codex) if (code != codex)
{ {
message = "登录失败\r\n链接异常请重试"; message = "登录失败\r\n链接异常请重试";
return false; return false;
} }
if (IsLoginDef) if (IsLoginDef)
{ {
//BaseClass.LoginApiUrl = "http://new.qixiaoke.com/"; //BaseClass.LoginApiUrl = "http://new.qixiaoke.com/";
//BaseClass.ImageApiUrl = BaseClass.LoginApiUrl + "index.php?obj=api/image"; //BaseClass.ImageApiUrl = BaseClass.LoginApiUrl + "index.php?obj=api/image";
} }
//BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end"); //BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end");
//BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company"); //BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company");
//BaseClass.UserId =Convert.ToInt32(BaseRegex.GetStringJson(ref html, "uid")); //BaseClass.UserId =Convert.ToInt32(BaseRegex.GetStringJson(ref html, "uid"));
//BaseClass.UserKey = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "key")); //BaseClass.UserKey = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "key"));
//BaseClass.NickName = BaseRegex.GetStringJson(ref html, "nickname"); //BaseClass.NickName = BaseRegex.GetStringJson(ref html, "nickname");
//BaseClass.UserVersion = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "v")); //BaseClass.UserVersion = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "v"));
//BaseClass.UserVersionString = BaseRegex.GetStringJson(ref html, "vt"); //BaseClass.UserVersionString = BaseRegex.GetStringJson(ref html, "vt");
//BaseClass.CompanyId = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "cid")); //BaseClass.CompanyId = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "cid"));
//BaseClass.GroupId = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "groupid")); //BaseClass.GroupId = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "groupid"));
//BaseClass.Balance = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "balance")); //BaseClass.Balance = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "balance"));
//BaseClass.IsFactory = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "factory")) == 1; //BaseClass.IsFactory = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "factory")) == 1;
//BaseClass.IsCloudBuyOrder = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "cloud_buy_order_status")) == 1; //BaseClass.IsCloudBuyOrder = Convert.ToInt32(BaseRegex.GetStringJson(ref html, "cloud_buy_order_status")) == 1;
//if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11) //if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11)
//{ //{
// BaseClass.UserId = 0; // BaseClass.UserId = 0;
// BaseClass.UserKey = 0; // BaseClass.UserKey = 0;
// return false; // return false;
//} //}
//BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end"); //BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end");
//BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company"); //BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company");
//string islock = BaseRegex.GetStringJson(ref html, "is_lock");
//int.TryParse(islock, out lockUserName);
//string isweak = BaseRegex.GetStringJson(ref html, "is_weak_password");
//int.TryParse(isweak, out weakPassword);
//messageInfo = BaseRegex.GetStringJson(ref html, "message");
//// 代理权限列表 //string islock = BaseRegex.GetStringJson(ref html, "is_lock");
//string agent_auth = BaseRegex.GetStringJson(ref html, "agent_auth"); //int.TryParse(islock, out lockUserName);
//string isweak = BaseRegex.GetStringJson(ref html, "is_weak_password");
//int.TryParse(isweak, out weakPassword);
//messageInfo = BaseRegex.GetStringJson(ref html, "message");
BaseClass.UserId = BaseRegex.GetStringJson(ref html, "id").ParseToInt(); //// 代理权限列表
BaseClass.UserKey = BaseRegex.GetStringJson(ref html, "user_key").ParseToInt(); //string agent_auth = BaseRegex.GetStringJson(ref html, "agent_auth");
BaseClass.NickName = BaseRegex.GetStringJson(ref html, "nick_name");
BaseClass.UserName = BaseRegex.GetStringJson(ref html, "user_name"); BaseClass.UserId = BaseRegex.GetStringJson(ref html, "id").ParseToInt();
BaseClass.ParentUserName = BaseRegex.GetStringJson(ref html, "parent_user_name"); BaseClass.UserKey = BaseRegex.GetStringJson(ref html, "user_key").ParseToInt();
BaseClass.SaLevel = BaseRegex.GetIntJson(ref html, "sa_level").ParseToInt(); BaseClass.NickName = BaseRegex.GetStringJson(ref html, "nick_name");
BaseClass.UserAuthority = BaseRegex.GetStringJson(ref html, "authority").ParseToString(); BaseClass.UserName = BaseRegex.GetStringJson(ref html, "user_name");
BaseClass.ParentAuthority = BaseRegex.GetStringJson(ref html, "parent_authority").ParseToString(); BaseClass.ParentUserName = BaseRegex.GetStringJson(ref html, "parent_user_name");
BaseClass.ForbiddenPage = BaseRegex.GetStringJson(ref html, "forbidden_page").ParseToString(); BaseClass.SaLevel = BaseRegex.GetIntJson(ref html, "sa_level").ParseToInt();
BaseClass.Mobile = BaseRegex.GetStringJson(ref html, "mobile"); BaseClass.UserAuthority = BaseRegex.GetStringJson(ref html, "authority").ParseToString();
BaseClass.UserVersion = BaseRegex.GetStringJson(ref html, "version").ParseToInt(); BaseClass.ParentAuthority = BaseRegex.GetStringJson(ref html, "parent_authority").ParseToString();
BaseClass.UserVersionString = BaseRegex.GetStringJson(ref html, "version_s"); BaseClass.ForbiddenPage = BaseRegex.GetStringJson(ref html, "forbidden_page").ParseToString();
BaseClass.CompanyId = BaseRegex.GetStringJson(ref html, "company_Id").ParseToInt(); BaseClass.Mobile = BaseRegex.GetStringJson(ref html, "mobile");
BaseClass.GroupId = BaseRegex.GetStringJson(ref html, "group_id").ParseToInt(); BaseClass.UserVersion = BaseRegex.GetStringJson(ref html, "version").ParseToInt();
//BaseClass.AuthorizedAmount = BaseRegex.GetNullableDecimalJson(ref html, "authorized_amount"); BaseClass.UserVersionString = BaseRegex.GetStringJson(ref html, "version_s");
BaseClass.Points = BaseRegex.GetStringJson(ref html, "points").ParseToInt(); BaseClass.CompanyId = BaseRegex.GetStringJson(ref html, "company_Id").ParseToInt();
BaseClass.ShopPointsPerMonth = BaseRegex.GetStringJson(ref html, "shop_points_per_month").ParseToInt(); BaseClass.GroupId = BaseRegex.GetStringJson(ref html, "group_id").ParseToInt();
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance"); //BaseClass.AuthorizedAmount = BaseRegex.GetNullableDecimalJson(ref html, "authorized_amount");
BaseClass.Points = BaseRegex.GetStringJson(ref html, "points").ParseToInt();
BaseClass.ShopPointsPerMonth = BaseRegex.GetStringJson(ref html, "shop_points_per_month").ParseToInt();
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
BaseClass.PostagePerOrder = Math.Max(2.2m, BaseRegex.GetDecimalJson(ref html, "postage_per_order")); BaseClass.PostagePerOrder = Math.Max(2.2m, BaseRegex.GetDecimalJson(ref html, "postage_per_order"));
BaseClass.RefundPostagePerOrder = Math.Max(2.5m, BaseRegex.GetDecimalJson(ref html, "refund_postage_per_order")); BaseClass.RefundPostagePerOrder = Math.Max(2.5m, BaseRegex.GetDecimalJson(ref html, "refund_postage_per_order"));
BaseClass.RechargeAmountTotal = BaseRegex.GetDecimalJson(ref html, "recharge_amount_total"); BaseClass.RechargeAmountTotal = BaseRegex.GetDecimalJson(ref html, "recharge_amount_total");
BaseClass.OemGiftAmount = BaseRegex.GetDecimalJson(ref html, "gift_oem_amount_per_order"); BaseClass.OemGiftAmount = BaseRegex.GetDecimalJson(ref html, "gift_oem_amount_per_order");
BaseClass.OemId = BaseRegex.GetStringJson(ref html, "oem_id"); BaseClass.OemId = BaseRegex.GetStringJson(ref html, "oem_id");
BaseClass.OemName = BaseRegex.GetStringJson(ref html, "oem_name"); BaseClass.OemName = BaseRegex.GetStringJson(ref html, "oem_name");
BaseClass.IsOemOwner = BaseRegex.GetBoolJson(ref html, "is_oem_owner"); BaseClass.IsOemOwner = BaseRegex.GetBoolJson(ref html, "is_oem_owner");
if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11) if (BaseClass.GroupId != 3 && BaseClass.GroupId != 4 && BaseClass.GroupId != 9 && BaseClass.GroupId != 10 && BaseClass.GroupId != 11)
{ {
message = "该账户禁止登录订单管理"; message = "该账户禁止登录订单管理";
BaseClass.UserId = 0; BaseClass.UserId = 0;
BaseClass.UserKey = 0; BaseClass.UserKey = 0;
return false; return false;
} }
if (BaseClass.ForbiddenPage.Contains("拍单")) if (BaseClass.ForbiddenPage.Contains("拍单"))
{ {
message = "该账户禁止登录订单管理"; message = "该账户禁止登录订单管理";
BaseClass.UserId = 0; BaseClass.UserId = 0;
BaseClass.UserKey = 0; BaseClass.UserKey = 0;
return false; return false;
} }
BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end"); BaseClass.EndDate = BaseRegex.GetStringJson(ref html, "end");
BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company_name"); BaseClass.CompanyName = BaseRegex.GetStringJson(ref html, "company_name");
if (BaseClass.UserVersion == 3) if (BaseClass.UserVersion == 3)
{ {
BaseClass.QqGroupNum = BaseRegex.GetStringJson(ref html, "qq_group_num"); BaseClass.QqGroupNum = BaseRegex.GetStringJson(ref html, "qq_group_num");
BaseClass.QqGroupUrl = BaseRegex.GetStringJson(ref html, "qq_group_url"); BaseClass.QqGroupUrl = BaseRegex.GetStringJson(ref html, "qq_group_url");
BaseClass.WechatUrl = BaseRegex.GetStringJson(ref html, "wechat_url"); BaseClass.WechatUrl = BaseRegex.GetStringJson(ref html, "wechat_url");
} }
if (BaseClass.UserVersion == 3 || BaseClass.UserVersion == 4 || BaseClass.UserVersion == 5 || BaseClass.UserVersion == 10 || BaseClass.UserVersion == 9) if (BaseClass.UserVersion == 3 || BaseClass.UserVersion == 4 || BaseClass.UserVersion == 5 || BaseClass.UserVersion == 10 || BaseClass.UserVersion == 9)
{ {
BaseClass.IsPinduoduo = BaseRegex.GetStringJson(ref html, "pinduoduo") == "1"; BaseClass.IsPinduoduo = BaseRegex.GetStringJson(ref html, "pinduoduo") == "1";
BaseClass.AlimamaDomain = BaseRegex.GetStringJson(ref html, "alimama_domain"); BaseClass.AlimamaDomain = BaseRegex.GetStringJson(ref html, "alimama_domain");
BaseClass.AlimamaPid = BaseRegex.GetStringJson(ref html, "alimama_pid"); BaseClass.AlimamaPid = BaseRegex.GetStringJson(ref html, "alimama_pid");
} }
if (!BaseClass.UserApi && BaseClass.UserVersion != 110) if (!BaseClass.UserApi && BaseClass.UserVersion != 110)
BaseClass.UserVersion = 100; BaseClass.UserVersion = 100;
//if (BaseClass.UserVersion == 110) //if (BaseClass.UserVersion == 110)
// BaseClass.ClientId = BaseSpecialConfig.ToolClientId; // 特别版本,使用指定ClientId // BaseClass.ClientId = BaseSpecialConfig.ToolClientId; // 特别版本,使用指定ClientId
string islock = BaseRegex.GetStringJson(ref html, "is_lock"); string islock = BaseRegex.GetStringJson(ref html, "is_lock");
int.TryParse(islock, out lockUserName); int.TryParse(islock, out lockUserName);
string isweak = BaseRegex.GetStringJson(ref html, "is_weak_password"); string isweak = BaseRegex.GetStringJson(ref html, "is_weak_password");
int.TryParse(isweak, out weakPassword); int.TryParse(isweak, out weakPassword);
messageInfo = BaseRegex.GetStringJson(ref html, "message"); messageInfo = BaseRegex.GetStringJson(ref html, "message");
//// 代理权限列表 //// 代理权限列表
//string agent_auth = BaseRegex.GetStringJson(ref html, "agent_auth"); //string agent_auth = BaseRegex.GetStringJson(ref html, "agent_auth");
//if (!string.IsNullOrEmpty(agent_auth) && agent_auth != "0") //if (!string.IsNullOrEmpty(agent_auth) && agent_auth != "0")
//{ //{
// var strArr = agent_auth.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); // var strArr = agent_auth.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
// foreach (var item in strArr) // foreach (var item in strArr)
// { // {
// var itemArr = item.Split(','); // var itemArr = item.Split(',');
// if (itemArr.Length == 2) // if (itemArr.Length == 2)
// { // {
// BaseClass.AgentAuth[itemArr[0]] = itemArr[1]; // BaseClass.AgentAuth[itemArr[0]] = itemArr[1];
// } // }
// } // }
//} //}
BaseClass.IsLoginSuccess = true; BaseClass.IsLoginSuccess = true;
Initialization i = new Initialization(); Initialization i = new Initialization();
i.SaveConfig(); i.SaveConfig();
return true; return true;
} }
/// <summary> /// <summary>
/// 注册账户 /// 注册账户
/// </summary> /// </summary>
/// <param name="mobile">手机</param> /// <param name="mobile">手机</param>
/// <param name="password">密码</param> /// <param name="password">密码</param>
/// <param name="code">验证码</param> /// <param name="code">验证码</param>
/// <param name="nickname">昵称</param> /// <param name="nickname">昵称</param>
/// <param name="email">邮箱</param> /// <param name="email">邮箱</param>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public bool Regedit(string mobile, string password, string code, string nickname, string email, out string message) public bool Regedit(string mobile, string password, string code, string nickname, string email, out string message)
{ {
string passwordMd5 = Md5Base.GetMd5(password).ToLower(); string passwordMd5 = Md5Base.GetMd5(password).ToLower();
string url = BaseClass.Build29WxObjString("regedit"); string url = BaseClass.Build29WxObjString("regedit");
string data = "mobile=" + mobile + "&password=" + passwordMd5 + "&sms_code=" + code + "&nickname=" + GetHtml.UrlEncodeUtf8(nickname) + string data = "mobile=" + mobile + "&password=" + passwordMd5 + "&sms_code=" + code + "&nickname=" + GetHtml.UrlEncodeUtf8(nickname) +
"&email=" + email + "&" + GetSignature(); "&email=" + email + "&" + GetSignature();
string html = GetHtml.PostUtf8(url, data); string html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || html.Contains("Error No File")) if (string.IsNullOrEmpty(html) || html.Contains("Error No File"))
{ {
message = "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" + message = "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" +
"1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" + "1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" +
"2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" + "2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" +
"3、请不要使用代理上网,更换为路由或者直接链接\r\n" + "3、请不要使用代理上网,更换为路由或者直接链接\r\n" +
"4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" + "4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" +
"5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助"; "5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助";
return false; return false;
} }
if (!html.Contains("\"code\":200")) if (!html.Contains("\"code\":200"))
{ {
var errMsg = BaseRegex.GetStringJson(ref html, "msg"); var errMsg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(errMsg)) if (string.IsNullOrEmpty(errMsg))
errMsg = html; errMsg = html;
message = errMsg; message = errMsg;
if (message.Contains("手机号码已被注册")) if (message.Contains("手机号码已被注册"))
{ {
message = message.Replace("手机号码已被注册", "手机号码已被注册,请直接登录或找回密码"); message = message.Replace("手机号码已被注册", "手机号码已被注册,请直接登录或找回密码");
} }
if (message.Contains("短信验证码错误")) if (message.Contains("短信验证码错误"))
{ {
message = "短信验证码错误,请重新输入\r\n如果接收不到,请联系客服QQ:" + BaseClass.ServiceQQ + ""; message = "短信验证码错误,请重新输入\r\n如果接收不到,请联系客服QQ:" + BaseClass.ServiceQQ + "";
} }
return false; return false;
} }
message = ""; message = "";
return true; return true;
} }
/// <summary> /// <summary>
/// 重置密码 /// 重置密码
/// </summary> /// </summary>
/// <param name="mobile"></param> /// <param name="mobile"></param>
/// <param name="code"></param> /// <param name="code"></param>
/// <param name="password"></param> /// <param name="password"></param>
/// <param name="message"></param> /// <param name="message"></param>
/// <returns></returns> /// <returns></returns>
public bool ResetPassword(string mobile, string code, string password, out string message) public bool ResetPassword(string mobile, string code, string password, out string message)
{ {
string passwordMd5 = Md5Base.GetMd5(password).ToLower(); string passwordMd5 = Md5Base.GetMd5(password).ToLower();
string url = BaseClass.Build29WxObjString("reset_password"); string url = BaseClass.Build29WxObjString("reset_password");
string data = "mobile=" + mobile + "&password=" + passwordMd5 + "&sms_code=" + code + "&" + GetSignature(); string data = "mobile=" + mobile + "&password=" + passwordMd5 + "&sms_code=" + code + "&" + GetSignature();
string html = GetHtml.PostUtf8(url, data); string html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || html.Contains("Error No File")) if (string.IsNullOrEmpty(html) || html.Contains("Error No File"))
{ {
message = "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" + message = "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" +
"1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" + "1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" +
"2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" + "2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" +
"3、请不要使用代理上网,更换为路由或者直接链接\r\n" + "3、请不要使用代理上网,更换为路由或者直接链接\r\n" +
"4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" + "4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" +
"5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助"; "5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助";
return false; return false;
} }
if (!html.Contains("\"code\":200")) if (!html.Contains("\"code\":200"))
{ {
var errMsg = BaseRegex.GetStringJson(ref html, "msg"); var errMsg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(errMsg)) if (string.IsNullOrEmpty(errMsg))
errMsg = html; errMsg = html;
message = errMsg; message = errMsg;
return false; return false;
} }
message = ""; message = "";
return true; return true;
} }
/// <summary> /// <summary>
/// 获取签名字符串 /// 获取签名字符串
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public static string GetSignature(bool isPhoneOrder = false) public static string GetSignature()
{ {
int time = BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + BaseClass.TimeDifferent; int time = BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + BaseClass.TimeDifferent;
string code = Encryption(time); string code = Encryption(time);
if (isPhoneOrder)
{
code = BaseClass.GetMd5(time.ToString() + "8eLg*MDD46YjA_e*onDgnvkdIaGhi=7B").ToUpper();
}
return "time=" + time + "&code=" + code + "&NbCodeVersion=1";
}
public static bool IsPinduoduo = false; return "time=" + time + "&code=" + code + "&NbCodeVersion=1";
}
/// <summary> public static bool IsPinduoduo = false;
/// 获取签名字符串,新版
/// </summary>
/// <returns></returns>
public static string GetSignaturex(bool isPhoneOrder = false, int posttype = 0)
{
return GetSignaturex(BaseClass.ShopId, BaseClass.ShopName, isPhoneOrder, posttype);
}
public static string GetSignaturex(string shopId, string shopName, bool isPhoneOrder = false, int posttype=0) /// <summary>
{ /// 获取签名字符串,新版
if (string.IsNullOrEmpty(shopId)) /// </summary>
shopId = BaseClass.ShopId; /// <returns></returns>
if (string.IsNullOrEmpty(shopName)) public static string GetSignaturex()
shopName = BaseClass.ShopName; {
int time = BaseClass.ConvertDateTimeInt(DateTime.Now) + BaseClass.TimeDifferent; return GetSignaturex(BaseClass.ShopId, BaseClass.ShopName);
string time1 = Encryption(time); }
if (posttype==1)
{
return time1;
}
return GetSignature(isPhoneOrder) + "&version=" + BaseClass.VersionCount + "&uid=" + BaseClass.UserId + "&key=" + BaseClass.UserKey +
"&cid=" + BaseClass.CompanyId + "&company=" + GetHtml.UrlEncodeUtf8(BaseClass.CompanyName) + "&user_name=" + BaseClass.UserName +
"&sid=" + shopId + "&shop=" + GetHtml.UrlEncodeUtf8(shopName);
}
/// <summary> public static string GetSignaturex(string shopId, string shopName)
/// 签名算法 {
/// </summary> var dict = GetSignaturexDict(shopId, shopName);
/// <param name="s">随机数</param> return string.Join("&", dict.Select(kv => $"{kv.Key}={kv.Value}"));
/// <returns>加密签名结果</returns> }
public static string Encryptionxx(int s) public static object GetSignPostData(object data)
{ {
string ss = s.ToString(); var dict = GetSignaturexDict(BaseClass.ShopId, BaseClass.ShopName);
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());
if (BaseClass.NewSignatureAuth)
{
double y = s * 1.6081825125;
y += 4582095.48659959;
y += kb[3] * 934579.486548;
y += kb[7] + 4889894.30184;
byte[] k = Encoding.ASCII.GetBytes(y.ToString());
y -= 478735.48548;
y -= k[6] * 426720.454545;
y -= k[2] * 5667826.96889;
byte[] k1 = Encoding.ASCII.GetBytes(y.ToString());
y += 56979810.2455;
y -= k1[1] * 58742.0564845;
y -= k1[5] * 1528.487866;
string c = ((int)y).ToString();
return GetMd5(c); //返回签名的MD5结果
}
else
{
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结果
}
//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结果
}
/// <summary> var result = new ExpandoObject() as IDictionary<string, object>;
/// 签名算法
/// </summary>
/// <param name="s">随机数</param>
/// <returns>加密签名结果</returns>
public static string Encryption(int s)
{
//return GetMd5(s + "sdhewu*/fhAAue48485ew5+5%@3485esGFFHFD");
string sign = $"{s}sdhewu*/fhAAue48485ew5+5%@3485esGFFHFD"; if (data != null)
return GetMd5(sign); {
foreach (var prop in data.GetType().GetProperties())
{
result[prop.Name] = prop.GetValue(data) ?? string.Empty;
}
}
} // 添加sign的属性
foreach (var kv in dict)
{
result[kv.Key] = kv.Value;
}
public string Get(string key) return result;
{ }
if (string.IsNullOrEmpty(key)) private static Dictionary<string, string> GetSignaturexDict(string shopId, string shopName)
return ""; {
byte[] inArray = Convert.FromBase64String(key.Replace("/", "=")); if (string.IsNullOrEmpty(shopId))
string html = Encoding.UTF8.GetString(inArray); shopId = BaseClass.ShopId;
if (string.IsNullOrEmpty(shopName))
shopName = BaseClass.ShopName;
html = html.Replace("C", "1"); int time = BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + BaseClass.TimeDifferent;
html = html.Replace("Q", "6"); string time1 = Encryption(time);
html = html.Replace("I", "2");
html = html.Replace("L", "0"); var dict = new Dictionary<string, string>
html = html.Replace("Z", "9"); {
html = html.Replace("O", "5"); { "time", time.ToString() },
html = html.Replace("P", "8"); { "code", time1 },
html = html.Replace("D", "7"); { "code_version", "1" },
html = html.Replace("R", "b"); { "version", BaseClass.VersionCount.ToString() },
html = html.Replace("S", "c"); { "user_name", BaseClass.UserName },
html = html.Replace("J", "a"); { "path", BaseClass.MainPath }
return html; };
}
/// <summary> if (!string.IsNullOrEmpty(BaseClass.AgentCode))
/// MD5加密 {
/// </summary> dict.Add("agent_code", BaseClass.AgentCode);
/// <param name="instring"></param> dict.Add("agent_name", BaseClass.AgentName);
/// <returns></returns> }
public static string GetMd5(string instring)
{ return dict;
byte[] result = Encoding.Default.GetBytes(instring.Trim()); }
MD5 md5 = new MD5CryptoServiceProvider(); /// <summary>
byte[] output = md5.ComputeHash(result); /// 签名算法
return BitConverter.ToString(output).Replace("-", ""); /// </summary>
} /// <param name="s">随机数</param>
/// <summary> /// <returns>加密签名结果</returns>
/// 获取验证码 public static string Encryptionxx(int s)
/// </summary> {
/// <param name="mobile"></param> string ss = s.ToString();
/// <param name="success"></param> if (ss.Length > 8)
/// <returns></returns> {
public static string SendCode(string mobile, out bool success) ss = ss.Substring(ss.Length - 8);
{ s = int.Parse(ss);
string url = BaseClass.Build29WxObjString("sms_gate"); if (s < 100000000)
string data = "mobile=" + mobile + "&" + GetSignature(); s += 100000000;
string html = GetHtml.PostUtf8(url, data); }
success = false; byte[] kb = Encoding.ASCII.GetBytes(s.ToString());
if (string.IsNullOrEmpty(html) || html.Contains("Error No File")) if (BaseClass.NewSignatureAuth)
{ {
return "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" + double y = s * 1.6081825125;
"1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" + y += 4582095.48659959;
"2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" + y += kb[3] * 934579.486548;
"3、请不要使用代理上网,更换为路由或者直接链接\r\n" + y += kb[7] + 4889894.30184;
"4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" + byte[] k = Encoding.ASCII.GetBytes(y.ToString());
"5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助"; y -= 478735.48548;
} y -= k[6] * 426720.454545;
if (!html.Contains("\"code\":200")) y -= k[2] * 5667826.96889;
{ byte[] k1 = Encoding.ASCII.GetBytes(y.ToString());
var errMsg = BaseRegex.GetStringJson(ref html, "msg"); y += 56979810.2455;
if (string.IsNullOrEmpty(errMsg)) y -= k1[1] * 58742.0564845;
errMsg = html; y -= k1[5] * 1528.487866;
return errMsg; string c = ((int)y).ToString();
} return GetMd5(c); //返回签名的MD5结果
success = true; }
return ""; else
} {
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结果
}
//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结果
}
/// <summary>
/// 签名算法
/// </summary>
/// <param name="s">随机数</param>
/// <returns>加密签名结果</returns>
public static string Encryption(int s)
{
//return GetMd5(s + "sdhewu*/fhAAue48485ew5+5%@3485esGFFHFD");
string sign = $"{s}sdhewu*/fhAAue48485ew5+5%@3485esGFFHFD";
return GetMd5(sign);
}
public string Get(string key)
{
if (string.IsNullOrEmpty(key))
return "";
byte[] inArray = Convert.FromBase64String(key.Replace("/", "="));
string html = Encoding.UTF8.GetString(inArray);
html = html.Replace("C", "1");
html = html.Replace("Q", "6");
html = html.Replace("I", "2");
html = html.Replace("L", "0");
html = html.Replace("Z", "9");
html = html.Replace("O", "5");
html = html.Replace("P", "8");
html = html.Replace("D", "7");
html = html.Replace("R", "b");
html = html.Replace("S", "c");
html = html.Replace("J", "a");
return html;
}
/// <summary>
/// MD5加密
/// </summary>
/// <param name="instring"></param>
/// <returns></returns>
public static string GetMd5(string instring)
{
byte[] result = Encoding.Default.GetBytes(instring.Trim());
MD5 md5 = new MD5CryptoServiceProvider();
byte[] output = md5.ComputeHash(result);
return BitConverter.ToString(output).Replace("-", "");
}
/// <summary>
/// 获取验证码
/// </summary>
/// <param name="mobile"></param>
/// <param name="success"></param>
/// <returns></returns>
public static string SendCode(string mobile, out bool success)
{
string url = BaseClass.Build29WxObjString("sms_gate");
string data = "mobile=" + mobile + "&" + GetSignature();
string html = GetHtml.PostUtf8(url, data);
success = false;
if (string.IsNullOrEmpty(html) || html.Contains("Error No File"))
{
return "提交请求失败,请重试,如仍失败请尝试以下方法:\r\n" +
"1、Win7、8、10系统请(右击)使用管理员权限运行\r\n" +
"2、检查网络链接是否正确、杀毒防火墙等是否禁止链接(可卸载后再次登录)\r\n" +
"3、请不要使用代理上网,更换为路由或者直接链接\r\n" +
"4、可先卸载杀毒软件或者安全卫士,软件正常联网后,重新安装杀毒\r\n" +
"5、如以上方法依然无法解决,可联系客服QQ:" + BaseClass.ServiceQQ + " 协助";
}
if (!html.Contains("\"code\":200"))
{
var errMsg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(errMsg))
errMsg = html;
return errMsg;
}
success = true;
return "";
}
public static string JsCode = @"var auth = { public static string JsCode = @"var auth = {
getPublicKey: function() { getPublicKey: function() {
var _this = this; var _this = this;
Helper.get(""earth/api/queryPasswordEncrypt"", {}).then(function(d) { Helper.get(""earth/api/queryPasswordEncrypt"", {}).then(function(d) {
@@ -767,5 +805,5 @@ namespace Work
} }
};auth.init();"; };auth.init();";
} }
} }
@@ -30,9 +30,9 @@ namespace Work._29Tools.Forms.UserForms
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.pbQrcode = new System.Windows.Forms.PictureBox(); this.pbQrcode = new System.Windows.Forms.PictureBox();
this.btnRefresh = new DevComponents.DotNetBar.PanelEx(); this.btnRefresh = new DevComponents.DotNetBar.PanelEx();
@@ -45,6 +45,9 @@ namespace Work._29Tools.Forms.UserForms
this.btnBalanceTopUp = new DevComponents.DotNetBar.PanelEx(); this.btnBalanceTopUp = new DevComponents.DotNetBar.PanelEx();
this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new Work.UserComponents.UcGroupBoxEx(this.components); this.ucGroupBoxEx1 = new Work.UserComponents.UcGroupBoxEx(this.components);
this.label13 = new System.Windows.Forms.Label();
this.consumptionArmt = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.rangeUsedAramt = new System.Windows.Forms.Label(); this.rangeUsedAramt = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.exportRecord = new System.Windows.Forms.LinkLabel(); this.exportRecord = new System.Windows.Forms.LinkLabel();
@@ -75,9 +78,6 @@ namespace Work._29Tools.Forms.UserForms
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.statusBarUserControl1 = new Work.UserControls.StatusBarUserControl(); this.statusBarUserControl1 = new Work.UserControls.StatusBarUserControl();
this.ucSplitPage1 = new Work.UserControls.UcSplitPage(); this.ucSplitPage1 = new Work.UserControls.UcSplitPage();
this.label11 = new System.Windows.Forms.Label();
this.consumptionArmt = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbQrcode)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbQrcode)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
@@ -319,6 +319,32 @@ namespace Work._29Tools.Forms.UserForms
this.ucGroupBoxEx1.Text = "查询条件"; this.ucGroupBoxEx1.Text = "查询条件";
this.ucGroupBoxEx1.Enter += new System.EventHandler(this.ucGroupBoxEx1_Enter); this.ucGroupBoxEx1.Enter += new System.EventHandler(this.ucGroupBoxEx1_Enter);
// //
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(614, 50);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(56, 17);
this.label13.TabIndex = 1182;
this.label13.Text = "截至时间";
//
// consumptionArmt
//
this.consumptionArmt.Location = new System.Drawing.Point(1078, 18);
this.consumptionArmt.Name = "consumptionArmt";
this.consumptionArmt.Size = new System.Drawing.Size(67, 17);
this.consumptionArmt.TabIndex = 1181;
this.consumptionArmt.Text = "xxxx.xx";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(1016, 18);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(68, 17);
this.label11.TabIndex = 1180;
this.label11.Text = "消费总额:";
//
// rangeUsedAramt // rangeUsedAramt
// //
this.rangeUsedAramt.Location = new System.Drawing.Point(943, 64); this.rangeUsedAramt.Location = new System.Drawing.Point(943, 64);
@@ -353,7 +379,7 @@ namespace Work._29Tools.Forms.UserForms
this.balanceArmt.Name = "balanceArmt"; this.balanceArmt.Name = "balanceArmt";
this.balanceArmt.Size = new System.Drawing.Size(67, 17); this.balanceArmt.Size = new System.Drawing.Size(67, 17);
this.balanceArmt.TabIndex = 1167; this.balanceArmt.TabIndex = 1167;
this.balanceArmt.Text = "1000.00"; this.balanceArmt.Text = "xxxx.xx";
// //
// label10 // label10
// //
@@ -370,7 +396,7 @@ namespace Work._29Tools.Forms.UserForms
this.rechargeArmtTotal.Name = "rechargeArmtTotal"; this.rechargeArmtTotal.Name = "rechargeArmtTotal";
this.rechargeArmtTotal.Size = new System.Drawing.Size(67, 17); this.rechargeArmtTotal.Size = new System.Drawing.Size(67, 17);
this.rechargeArmtTotal.TabIndex = 1165; this.rechargeArmtTotal.TabIndex = 1165;
this.rechargeArmtTotal.Text = "10000.00"; this.rechargeArmtTotal.Text = "xxxx.xx";
// //
// label8 // label8
// //
@@ -474,14 +500,14 @@ namespace Work._29Tools.Forms.UserForms
this.cmbType.FormattingEnabled = true; this.cmbType.FormattingEnabled = true;
this.cmbType.Items.AddRange(new object[] { this.cmbType.Items.AddRange(new object[] {
"", "",
"充值", "充值",
"管理员充值", "管理员充值",
"支付宝充值", "支付宝充值",
"礼物单支出/礼物单退费", "礼物单支出/礼物单退费",
"拍单扣除/作废返还", "拍单扣除/作废返还",
"超重扣费支出", "超重扣费支出",
"退货包裹扣费支出", "退货包裹扣费支出",
"云仓退货扣费支出"}); "云仓退货扣费支出"});
this.cmbType.Location = new System.Drawing.Point(42, 33); this.cmbType.Location = new System.Drawing.Point(42, 33);
this.cmbType.Name = "cmbType"; this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(121, 25); this.cmbType.Size = new System.Drawing.Size(121, 25);
@@ -525,20 +551,20 @@ namespace Work._29Tools.Forms.UserForms
// //
this.dgvPayment.AllowUserToAddRows = false; this.dgvPayment.AllowUserToAddRows = false;
this.dgvPayment.AllowUserToDeleteRows = false; this.dgvPayment.AllowUserToDeleteRows = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvPayment.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; this.dgvPayment.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvPayment.AutoRowNumber = true; this.dgvPayment.AutoRowNumber = true;
this.dgvPayment.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgvPayment.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvPayment.BackgroundColor = System.Drawing.Color.White; this.dgvPayment.BackgroundColor = System.Drawing.Color.White;
this.dgvPayment.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.dgvPayment.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvPayment.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.dgvPayment.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvPayment.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvPayment.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPayment.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dgvPayment.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck, this.colCheck,
@@ -582,8 +608,8 @@ namespace Work._29Tools.Forms.UserForms
// //
// colAmount // colAmount
// //
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colAmount.DefaultCellStyle = dataGridViewCellStyle6; this.colAmount.DefaultCellStyle = dataGridViewCellStyle3;
this.colAmount.FillWeight = 60F; this.colAmount.FillWeight = 60F;
this.colAmount.HeaderText = "金额"; this.colAmount.HeaderText = "金额";
this.colAmount.Name = "colAmount"; this.colAmount.Name = "colAmount";
@@ -643,32 +669,6 @@ namespace Work._29Tools.Forms.UserForms
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange); this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
this.ucSplitPage1.Load += new System.EventHandler(this.ucSplitPage1_Load); this.ucSplitPage1.Load += new System.EventHandler(this.ucSplitPage1_Load);
// //
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(1016, 18);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(68, 17);
this.label11.TabIndex = 1180;
this.label11.Text = "消费总额:";
//
// consumptionArmt
//
this.consumptionArmt.Location = new System.Drawing.Point(1078, 18);
this.consumptionArmt.Name = "consumptionArmt";
this.consumptionArmt.Size = new System.Drawing.Size(67, 17);
this.consumptionArmt.TabIndex = 1181;
this.consumptionArmt.Text = "1000.00";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(614, 50);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(56, 17);
this.label13.TabIndex = 1182;
this.label13.Text = "截至时间";
//
// WXGetBalanceQrCodeForm // WXGetBalanceQrCodeForm
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -5,6 +5,7 @@ using CefSharp.WinForms;
using DevComponents.WinForms.Drawing; using DevComponents.WinForms.Drawing;
using NaiBa.CefHelper; using NaiBa.CefHelper;
using NaiBa.Util.Extension; using NaiBa.Util.Extension;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -16,6 +17,7 @@ using System.Drawing.Printing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Security.Policy;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -25,6 +27,7 @@ using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms; using Work._29Tools.Forms.ShopForms;
using Work.BaseForms; using Work.BaseForms;
using Work.Extension; using Work.Extension;
using WxOrder.Framework.Commons;
namespace Work._29Tools.Forms.UserForms namespace Work._29Tools.Forms.UserForms
{ {
@@ -37,6 +40,9 @@ namespace Work._29Tools.Forms.UserForms
{ {
InitializeComponent(); InitializeComponent();
updateBalanceAction = updateBalance; updateBalanceAction = updateBalance;
_ = GetUserAmountSummary();
rangeUsedAramt.Visible = false;
label9.Visible = false;
} }
public void refreshQrcode() public void refreshQrcode()
@@ -209,14 +215,14 @@ namespace Work._29Tools.Forms.UserForms
#endif #endif
Invoke(new Action(() => Invoke(new Action(() =>
{ {
rechargeArmtTotal.Text = BaseClass.RechargeAmountTotal.ToString("N2"); //rechargeArmtTotal.Text = BaseClass.RechargeAmountTotal.ToString("N2");
balanceArmt.Text = BaseClass.Balance.ToString("N2"); //balanceArmt.Text = BaseClass.Balance.ToString("N2");
rangeUsedAramt.Text = paymentList.Sum(a => a.amount).ToString("N2"); //rangeUsedAramt.Text = paymentList.Sum(a => a.amount).ToString("N2");
List<int> types = new List<int> { 16, 20, 23, 24, 26, 31 }; //List<int> types = new List<int> { 16, 20, 23, 24, 26, 31 };
consumptionArmt.Text = //consumptionArmt.Text =
(paymentList.Where(a => types.Contains(a.type.Value)).Sum(a => a.amount) //(paymentList.Where(a => types.Contains(a.type.Value)).Sum(a => a.amount)
- paymentList.Where(a => a.type == 23).Sum(a => a.amount)) //- paymentList.Where(a => a.type == 23).Sum(a => a.amount))
.ToString("N2"); // paymentList.Sum(a => a.amount).ToString("N2"); //.ToString("N2"); // paymentList.Sum(a => a.amount).ToString("N2");
})); }));
} }
@@ -298,5 +304,43 @@ namespace Work._29Tools.Forms.UserForms
} }
} }
private async Task GetUserAmountSummary()
{
var url = BaseClass.Build29WxObjString("user/GetUserAmountSummary");
var data3 = UserLogin.GetSignPostData(new { });
var html3 = await GetHtml.PostJsonAsync(url, data3);
var ret = JsonConvert.DeserializeObject<Result<UserAmountSummary>>(html3);
if (ret.Code != 200)
{
}
else
{
rechargeArmtTotal.Text = (ret.Data.RechargeTotal / 100m).ToString("N2");
balanceArmt.Text = (ret.Data.Balance / 100m).ToString("N2");
//rangeUsedAramt.Text = paymentList.Sum(a => a.amount).ToString("N2");
consumptionArmt.Text = (ret.Data.ConsumeTotal / 100m).ToString("N2");
}
}
private class UserAmountSummary
{
/// <summary>
/// 充值总额
/// </summary>
public long RechargeTotal { get; set; }
/// <summary>
/// 消费总额
/// </summary>
public long ConsumeTotal { get; set; }
/// <summary>
/// 剩余余额
/// </summary>
public long Balance { get; set; }
}
} }
} }
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->