用户列表页面完成 订单列表页面开始 10%
This commit is contained in:
1 parent
25cdf642bf
commit
edc7913637
52 files changed
+2032
-365
No files matched your search
@@ -1,10 +1,14 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.OrderCtrls;
|
||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Extension;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -27,7 +31,9 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.Linq;
|
||||
using Work;
|
||||
using Work.BLL;
|
||||
|
||||
namespace _29WxOrderWpf
|
||||
{
|
||||
@@ -36,13 +42,15 @@ namespace _29WxOrderWpf
|
||||
/// </summary>
|
||||
public partial class MainWindow : BaseWindow
|
||||
{
|
||||
public static MainWindow Instance { get; private set; }
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = this;
|
||||
Instance = this;
|
||||
|
||||
this.Height = 800;
|
||||
this.Width = 1600;
|
||||
gridUser.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
@@ -54,6 +62,16 @@ namespace _29WxOrderWpf
|
||||
loginWindow.Owner = this;
|
||||
loginWindow.ShowDialog();
|
||||
#endregion
|
||||
|
||||
if (loginWindow.IsLogin)
|
||||
{
|
||||
//shopListCtrl.Visibility = Visibility.Visible;
|
||||
orderListCtrl.Visibility = Visibility.Visible;
|
||||
Task.Run(() =>
|
||||
{
|
||||
GetServerShop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#region 反抓包功能
|
||||
@@ -175,5 +193,73 @@ namespace _29WxOrderWpf
|
||||
else
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
public bool readShop { get; set; } = false;
|
||||
public bool hasReadShop { get; set; } = false;
|
||||
public void GetServerShop()
|
||||
{
|
||||
if (readShop == false)
|
||||
{
|
||||
List<ShopLoginInfo> list = new List<ShopLoginInfo>();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
}));
|
||||
readShop = true;
|
||||
int page = 0;
|
||||
while (true)
|
||||
{
|
||||
page++;
|
||||
var url = BaseClass.Build29WxObjString("shop/get_shop_list");
|
||||
var data = UserLogin.GetSignaturex() + "&page=" + page;
|
||||
data += "&is_get_erp_shop_id=true";
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html)
|
||||
|| !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass"))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
var jArr = JObject.Parse(html)["data"];
|
||||
if (jArr.Count() == 0)
|
||||
break;
|
||||
|
||||
foreach (JObject jObj in jArr)
|
||||
{
|
||||
var shop = ShopBLL.DeserializationShop(jObj);
|
||||
|
||||
var shopExist = list.Where(l => l.ShopId == shop.ShopId).ToList();
|
||||
if (shopExist != null)
|
||||
shopExist.Remove(shop);
|
||||
|
||||
list.Add(shop);
|
||||
if (!GlobalConfig.ShopLoginList.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Add(shop);
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => !list.Any(ss => ss.ShopId == s.ShopId)).ToList())
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Remove(shop);
|
||||
}
|
||||
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => s.is_point_shop_expire).ToList())
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Remove(shop);
|
||||
}
|
||||
}));
|
||||
readShop = false;
|
||||
hasReadShop = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user