优化读单

This commit is contained in:
wule committed 2026-11-19 11:43:09 +08:00
1 parent 171064f03f
commit 5e453e2927
10 files changed
+566 -402

No files matched your search

+68
View File
@@ -1,5 +1,6 @@
using AllBase;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -7,6 +8,7 @@ using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Work
{
@@ -232,6 +234,72 @@ namespace Work
return true;
}
public static async Task GetUserOemAmount(int type)
{
var url3 = BaseClass.Build29WxObjString("user/GetUserMarkups");
var data3 = UserLogin.GetSignPostData(new { PaymentType = type });
var html = await GetHtml.PostJsonAsync(url3, data3);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = await GetHtml.PostJsonAsync(url3, data3);
if (html.Contains("\"code\":200"))
{
try
{
var jArr = AllBase.JsonHelper.JObjectParse(html)["data"] as JArray;
foreach (var r in jArr)
{
if (type == 16)
{
if (r["level"].ParseToInt() == 1)
{
BaseClass.ParentOemId = r["oemId"].ParseToString();
BaseClass.ParentOemGiftAmount = r["markup"].ParseToInt() * 0.01m;
}
else if (r["level"].ParseToInt() == 2)
{
BaseClass.OemId = r["oemId"].ParseToString();
BaseClass.OemGiftAmount = r["markup"].ParseToInt() * 0.01m;
}
}
else if (type == 20)
{
if (r["level"].ParseToInt() == 1)
{
BaseClass.ParentOemId = r["oemId"].ParseToString();
BaseClass.ParentPostageOemAmount = r["markup"].ParseToInt() * 0.01m;
}
else if (r["level"].ParseToInt() == 2)
{
BaseClass.OemId = r["oemId"].ParseToString();
BaseClass.PostageOemAmount = r["markup"].ParseToInt() * 0.01m;
}
}
else if (type == 26)
{
if (r["level"].ParseToInt() == 1)
{
BaseClass.ParentOemId = r["oemId"].ParseToString();
BaseClass.ParentRefundPostageOemAmount = r["markup"].ParseToInt() * 0.01m;
}
else if (r["level"].ParseToInt() == 2)
{
BaseClass.OemId = r["oemId"].ParseToString();
BaseClass.RefundPostageOemAmount = r["markup"].ParseToInt() * 0.01m;
}
}
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
else
{
throw new Exception(BaseRegex.GetStringJsonByRegs(ref html, html, "msg"));
}
}
/// <summary>
/// 注册账户
+2 -2
View File
@@ -93,7 +93,7 @@ namespace TemuKJD.ToolForms
// (拍单后)回调函数,过滤订单
private Func<oms_wei_order_info, bool, Task> filterOrderAction = null;
// (拍单后)回调函数,更新拍单余额
private Action updateBalanceAction = null;
private Func<Task> updateBalanceAction = null;
string _txtBuyTransitWarehouseStr = "";
/// <summary>
@@ -145,7 +145,7 @@ namespace TemuKJD.ToolForms
bool HasChangeAddress = false;
public PddMobileBuyOrderForm(Func<oms_wei_order_info, bool, Task> filterOrder, Action updateBalance, oms_wei_order_item_info orderItemInfo, BuyerLoginInfo buyerInfo, WXBuyMapInfo buy_map = null)
public PddMobileBuyOrderForm(Func<oms_wei_order_info, bool, Task> filterOrder, Func<Task> updateBalance, oms_wei_order_item_info orderItemInfo, BuyerLoginInfo buyerInfo, WXBuyMapInfo buy_map = null)
{
InitializeComponent();
@@ -34,9 +34,9 @@ namespace Work._29Tools.Forms.UserForms
public partial class WXGetBalanceQrCodeForm : BaseForms.BaseGeneralForm
{
// (拍单后)回调函数,更新拍单余额
private Action updateBalanceAction = null;
private Func<Task> updateBalanceAction = null;
public WXGetBalanceQrCodeForm(Action updateBalance = null)
public WXGetBalanceQrCodeForm(Func<Task> updateBalance = null)
{
InitializeComponent();
updateBalanceAction = updateBalance;
@@ -106,7 +106,7 @@ namespace Work._29Tools.Forms.UserForms
pictureBox2.Visible = false;
}
private void btnBalanceTopUp_Click(object sender, EventArgs e)
private async void btnBalanceTopUp_Click(object sender, EventArgs e)
{
string url2 = "https://po.e57.cn/prod-api/api/oms-api/alipay/pay";
var data = new JObject();
@@ -135,7 +135,7 @@ namespace Work._29Tools.Forms.UserForms
loginForm.ShowDialog();
if (updateBalanceAction != null)
{
updateBalanceAction();
await updateBalanceAction();
}
}
}