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

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