子账户显示昵称 客服加入批量登录 客服登录后页面不刷新问题修复

This commit is contained in:
wule committed 2026-03-21 13:49:01 +08:00
1 parent b502c6a2ed
commit 8e919b0bd7
22 files changed
+869 -217

No files matched your search

@@ -16,10 +16,13 @@ namespace TemuKJD.WXForms.ShopForms
{
public partial class WXSubAccountShopEditForm : BaseGeneralForm
{
ShopLoginInfo shop = null;
public List<ShopSubAccountInfo> AllSubAccountList { get; set; } = new List<ShopSubAccountInfo>();
public static List<ShopSubAccountInfo> lstAllSubAccount { get; set; } = new List<ShopSubAccountInfo>();
public List<ShopSubAccountInfo> ShopSubAccountList { get; set; } = new List<ShopSubAccountInfo>();
public List<ShopSubAccountInfo> NotShopSubAccountList { get; set; } = new List<ShopSubAccountInfo>();
ShopLoginInfo shop = null;
public WXSubAccountShopEditForm(ShopLoginInfo _shop)
{
InitializeComponent();
@@ -35,18 +38,51 @@ namespace TemuKJD.WXForms.ShopForms
GetUser();
}
private void GetUser()
public void GetUser(bool isReGetSubUser = false)
{
flpNotSubAccount.Controls.Clear();
flpShopSubAccount.Controls.Clear();
AllSubAccountList.Clear();
if (lstAllSubAccount.Count == 0 || isReGetSubUser)
{
GetServerSubUser();
}
if (shop != null)
{
ShopSubAccountList.Clear();
ShopSubAccountList.AddRange(lstAllSubAccount.Where(u => shop.SubUserName.Contains(u.sub_user_name)));
shop.ShopSubAccountList.Clear();
shop.ShopSubAccountList.AddRange(ShopSubAccountList);
NotShopSubAccountList.Clear();
NotShopSubAccountList.AddRange(lstAllSubAccount.Where(u => !ShopSubAccountList.Any(bu => bu.id == u.id)));
foreach (var item in ShopSubAccountList)
{
UcSubAccount s = new UcSubAccount(item, false);
s.AddSubAcountEvent += S_AddSubAcountEvent;
s.RemoveSubAcountEvent += S_RemoveSubAcountEvent;
flpShopSubAccount.Controls.Add(s);
}
foreach (var item in NotShopSubAccountList)
{
UcSubAccount s = new UcSubAccount(item);
s.AddSubAcountEvent += S_AddSubAcountEvent;
s.RemoveSubAcountEvent += S_RemoveSubAcountEvent;
flpNotSubAccount.Controls.Add(s);
}
}
}
public static void GetServerSubUser()
{
string url = BaseClass.BuildObjString("user/get_sub_user");
string data = UserLogin.GetSignaturex();
string html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html))
return;
if (html.Contains("\"data\""))
if (!html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (html.Contains("\"code\":200"))
{
lstAllSubAccount.Clear();
var userObj = Newtonsoft.Json.Linq.JObject.Parse(html);
foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"])
{
@@ -59,30 +95,7 @@ namespace TemuKJD.WXForms.ShopForms
user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id");
user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count");
AllSubAccountList.Add(user);
}
if (shop != null)
{
ShopSubAccountList.Clear();
ShopSubAccountList.AddRange(AllSubAccountList.Where(u=>shop.SubUserName.Contains(u.sub_user_name)));
shop.ShopSubAccountList.Clear();
shop.ShopSubAccountList.AddRange(ShopSubAccountList);
NotShopSubAccountList.AddRange(AllSubAccountList.Where(u => !ShopSubAccountList.Any(bu => bu.id == u.id)));
foreach (var item in ShopSubAccountList)
{
UcSubAccount s = new UcSubAccount(item, false);
s.AddSubAcountEvent += S_AddSubAcountEvent;
s.RemoveSubAcountEvent += S_RemoveSubAcountEvent;
flpShopSubAccount.Controls.Add(s);
}
foreach (var item in NotShopSubAccountList)
{
UcSubAccount s = new UcSubAccount(item);
s.AddSubAcountEvent += S_AddSubAcountEvent;
s.RemoveSubAcountEvent += S_RemoveSubAcountEvent;
flpNotSubAccount.Controls.Add(s);
}
lstAllSubAccount.Add(user);
}
}
}
@@ -190,5 +203,10 @@ namespace TemuKJD.WXForms.ShopForms
OnSaveComplete(shop);
this.Close();
}
private void btnRefresh_Click(object sender, EventArgs e)
{
GetUser(true);
}
}
}