优化读单
This commit is contained in:
1 parent
171064f03f
commit
5e453e2927
10 files changed
+566
-402
No files matched your search
@@ -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>
|
||||
/// 注册账户
|
||||
|
||||
Reference in new issue
Block a user