Merge branch 'master' of github.com:KJD2025/KJD

This commit is contained in:
wule committed 2026-09-21 10:40:32 +08:00
commit 50d3e6c3ee
4 files changed
+109 -58

No files matched your search

@@ -109,7 +109,8 @@ namespace TemuKJD.WXForms.AdminForms
if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid))
{
data.Append("&id=" + Uid);
url = BaseClass.BuildObjString("user/update_user");
data.Append("&uu=true");
url = BaseClass.BuildObjString("user/update_user");
}
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
+15 -15
View File
@@ -28,8 +28,8 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = 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();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
@@ -358,7 +358,7 @@
this.cmbGroup.DropDownWidth = 1;
this.cmbGroup.FormattingEnabled = true;
this.cmbGroup.IntegralHeight = false;
this.cmbGroup.Location = new System.Drawing.Point(385, 5);
this.cmbGroup.Location = new System.Drawing.Point(385, 8);
this.cmbGroup.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbGroup.Name = "cmbGroup";
this.cmbGroup.Size = new System.Drawing.Size(74, 25);
@@ -384,7 +384,7 @@
this.cmbNotes.DropDownWidth = 1;
this.cmbNotes.FormattingEnabled = true;
this.cmbNotes.IntegralHeight = false;
this.cmbNotes.Location = new System.Drawing.Point(276, 5);
this.cmbNotes.Location = new System.Drawing.Point(276, 8);
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbNotes.Name = "cmbNotes";
this.cmbNotes.Size = new System.Drawing.Size(74, 25);
@@ -517,7 +517,7 @@
this.cmbSubAccount.DropDownWidth = 1;
this.cmbSubAccount.FormattingEnabled = true;
this.cmbSubAccount.IntegralHeight = false;
this.cmbSubAccount.Location = new System.Drawing.Point(506, 5);
this.cmbSubAccount.Location = new System.Drawing.Point(506, 8);
this.cmbSubAccount.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbSubAccount.Name = "cmbSubAccount";
this.cmbSubAccount.Size = new System.Drawing.Size(74, 25);
@@ -782,20 +782,20 @@
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvShop.AutoRowNumber = true;
this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
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.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -158,7 +158,7 @@ namespace TemuKJD.WXForms.ShopForms
this.btnRefreshBalance.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefreshBalance.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefreshBalance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefreshBalance.Location = new System.Drawing.Point(1130, 41);
this.btnRefreshBalance.Location = new System.Drawing.Point(702, 42);
this.btnRefreshBalance.Name = "btnRefreshBalance";
this.btnRefreshBalance.Size = new System.Drawing.Size(60, 23);
this.btnRefreshBalance.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -520,12 +520,15 @@ namespace TemuKJD.WXForms.ShopForms
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
this.ucSplitPage1.IsShowTotalCount = false;
this.ucSplitPage1.Location = new System.Drawing.Point(829, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.MaxPageSizeValue = 5000;
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(389, 25);
this.ucSplitPage1.TabIndex = 4;
this.ucSplitPage1.TotalCount = ((long)(0));
this.ucSplitPage1.TotalPage = 1;
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
//
@@ -611,5 +614,5 @@ namespace TemuKJD.WXForms.ShopForms
private System.Windows.Forms.DataGridViewTextBoxColumn colAuditRemark;
private System.Windows.Forms.DataGridViewTextBoxColumn colAuditTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colPayTradeNo;
}
}
}
@@ -13,6 +13,7 @@ using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -39,6 +40,7 @@ namespace TemuKJD.WXForms.ShopForms
/// <summary>收款二维码图片(base64)</summary>
private string qrCodeBase64 = "";
private bool isSettlement = false;
public WXShopOemWithdrawalForm()
{
@@ -93,7 +95,7 @@ namespace TemuKJD.WXForms.ShopForms
#endregion
#region 数据加载
private void WXShopOemWithdrawalForm_VisibleChanged(object sender, EventArgs e)
private async void WXShopOemWithdrawalForm_VisibleChanged(object sender, EventArgs e)
{
if (this.Visible && first)
{
@@ -103,49 +105,56 @@ namespace TemuKJD.WXForms.ShopForms
}
bool first = true;
/// <summary>
/// 刷新账户金额 + 提现记录
/// </summary>
private async Task RefreshAll()
{
await RefreshOMEAmount();
GetWithdrawals(ucSplitPage1.CurrentPage);
}
/// <summary>
/// 刷新账户统计 + 提现记录
/// 刷新OEM钱
/// </summary>
private void RefreshAll()
/// <returns></returns>
/// <exception cref="Exception"></exception>
private async Task RefreshOMEAmount()
{
LoadSummary();
GetWithdrawals(ucSplitPage1.CurrentPage);
var url = BaseClass.BuildObjString("user/getOemAmount");
var data = UserLogin.GetSignPostData(new { });
var html = await GetHtml.PostJsonAsync(url, data);
var ret = JsonConvert.DeserializeObject<Result<oemflowsStatistics>>(html);
if (ret.Code != 200)
{
throw new Exception(ret.Msg);
}
this.lblWithdrawable.Text = (ret.Data.AvailableBalance / 100m).ToString("F2");
this.lblTotalRebate.Text = (ret.Data.TotalRebateAmount / 100m).ToString("F2");
this.lblTotalWithdrawn.Text = (ret.Data.TotalWithdrawAmount / 100m).ToString("F2");
}
/// <summary>
/// 加载账户统计:可提现总额 / 历史累计返利 / 历史累计提现
/// </summary>
public void LoadSummary()
public async Task Settlement()
{
this.btnRefreshBalance.Enabled = false;
Task.Run(() =>
{
try
{
var url = BaseClass.BuildObjString("user/oem_settle_flows");
var obj = UserLogin.GetSignPostData(new { });
string data = JsonHelper.SerializeObject(obj);
var html = GetHtml.PostUtf8(url, data);
var ret = JsonConvert.DeserializeObject<Result<oemflowsStatistics>>(html);
Invoke(new Action(() =>
{
if (ret.Code != 200)
{
BaseMsgForm.ShowError("刷新失败:" + ret.Msg);
return;
}
this.lblWithdrawable.Text = (ret.Data.available_balance / 100m).ToString("F2");
this.lblTotalRebate.Text = (ret.Data.total_rebate_amount / 100m).ToString("F2");
this.lblTotalWithdrawn.Text = (ret.Data.total_withdraw_amount / 100m).ToString("F2");
}));
}
finally
{
Invoke(new Action(() => this.btnRefreshBalance.Enabled = true));
}
});
var url = BaseClass.BuildObjString("user/oem_settle_flows");
var data = UserLogin.GetSignPostData(new { });
var html = await GetHtml.PostJsonAsync(url, data);
var ret = JsonConvert.DeserializeObject<Result<oemflowsStatistics>>(html);
if (ret.Code != 200)
{
throw new Exception("结算失败:" + ret.Msg);
}
this.lblWithdrawable.Text = (ret.Data.AvailableBalance / 100m).ToString("F2");
this.lblTotalRebate.Text = (ret.Data.TotalRebateAmount / 100m).ToString("F2");
this.lblTotalWithdrawn.Text = (ret.Data.TotalWithdrawAmount / 100m).ToString("F2");
}
@@ -213,10 +222,41 @@ namespace TemuKJD.WXForms.ShopForms
#endregion
#region 事件
//private async void bt_RefreshAmount_Click(object sender, EventArgs e)
//{
// try
// {
// bt_RefreshAmount.Enabled = false;
// await RefreshOMEAmount();
// }
// catch (Exception ex)
// {
// BaseMsgForm.ShowError(ex.Message);
// }
// finally
// {
// bt_RefreshAmount.Enabled = true;
// }
//}
/// <summary>刷新可提现总额等账户统计</summary>
private void btnRefreshBalance_Click(object sender, EventArgs e)
private async void btnRefreshBalance_Click(object sender, EventArgs e)
{
LoadSummary();
try
{
btnRefreshBalance.Enabled = false;
await Settlement();
isSettlement = true;
}
catch (Exception ex)
{
BaseMsgForm.ShowError(ex.Message);
}
finally
{
btnRefreshBalance.Enabled = true;
}
}
/// <summary>选择收款二维码图片</summary>
@@ -253,8 +293,13 @@ namespace TemuKJD.WXForms.ShopForms
}
/// <summary>提交提现申请</summary>
private void btnSubmit_Click(object sender, EventArgs e)
private async void btnSubmit_Click(object sender, EventArgs e)
{
if (isSettlement == false)
{
BaseMsgForm.ShowError("请先结算后再选择提现!");
return;
}
decimal amountYuan = this.numAmount.Value;
if (amountYuan <= 0)
{
@@ -307,7 +352,7 @@ namespace TemuKJD.WXForms.ShopForms
this.numAmount.Value = 0;
this.qrCodeBase64 = "";
this.pictureBoxQr.Image = Properties.Resources.nopic;
RefreshAll();
Refresh();
}
catch (Exception ex)
{
@@ -338,6 +383,8 @@ namespace TemuKJD.WXForms.ShopForms
GetWithdrawals(ucSplitPage1.CurrentPage);
}
#endregion
}
class oemflowsStatistics
@@ -345,14 +392,14 @@ namespace TemuKJD.WXForms.ShopForms
/// <summary>
/// 当前可提现
/// </summary>
public long available_balance { get; set; }
public long AvailableBalance { get; set; }
/// <summary>
/// 历史累计返利
/// </summary>
public long total_rebate_amount { get; set; }
public long TotalRebateAmount { get; set; }
/// <summary>
/// 历史累计提现
/// </summary>
public long total_withdraw_amount { get; set; }
public long TotalWithdrawAmount { get; set; }
}
}