1店铺登录逻辑优化 2备货单查询显示

This commit is contained in:
wule committed 2025-07-01 18:58:51 +08:00
1 parent 89eb9ce9d4
commit 862ad088f5
216 files changed
+3481 -1543

No files matched your search

@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class FreightTemplateAddForm
{
@@ -42,7 +42,7 @@
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.txtFixCost = new System.Windows.Forms.TextBox();
this.groupTemplate = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.groupTemplate = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.label4 = new System.Windows.Forms.Label();
this.rbtype1 = new System.Windows.Forms.RadioButton();
this.rbtype2 = new System.Windows.Forms.RadioButton();
@@ -58,17 +58,17 @@
this.cobCity = new System.Windows.Forms.ComboBox();
this.cobProvince = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.btnSave = new LittleRabbit.UserControls.ButtonEx();
this.btnSave = new TemuKJD.UserControls.ButtonEx();
this.label2 = new System.Windows.Forms.Label();
this.txtTemplate = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvShop = new LittleRabbit.UserComponent.DataGridViewEx();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.statusBar = new LittleRabbit.UserControls.StatusBarUserControl();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -210,7 +210,7 @@
// groupTemplate
//
this.groupTemplate.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.groupTemplate.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.groupTemplate.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.groupTemplate.Controls.Add(this.label4);
this.groupTemplate.Controls.Add(this.rbtype1);
this.groupTemplate.Controls.Add(this.rbtype2);
@@ -1,7 +1,7 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using LittleRabbit.Extension;
using TemuKJD.Extension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -15,7 +15,7 @@ using System.Web.UI.WebControls;
using System.Windows.Forms;
using Work;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
/// <summary>
/// 运费模板管理窗口
@@ -53,10 +53,10 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
.Select(r2 => r2.Cells["colShopId"].Value?.ToString()).ToList();
Task.Run(()=> {
for (int i = 0; i < GlobalConfig.DouShopLoginList.Count; i++)
for (int i = 0; i < GlobalConfig.ShopLoginList.Count; i++)
{
var shop = GlobalConfig.DouShopLoginList[i];
if (!ids.Any(id => id == shop.ShopAccountId) || shop.LoginStatus != "登录成功")
var shop = GlobalConfig.ShopLoginList[i];
if (!ids.Any(id => id == shop.ShopId) || shop.LoginStatus != "登录成功")
continue;
string data = "template_name=" + template_name + "&product_province=" + pid + "&product_city=" + cid;
//固定运费
@@ -123,7 +123,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
count++;
for (int i = 0; i < dgvShop.Rows.Count; i++)
{
if (shop.ShopAccountId== dgvShop.Rows[i].Cells["colShopId"].Value.ToString())
if (shop.ShopId== dgvShop.Rows[i].Cells["colShopId"].Value.ToString())
{
dgvShop.Rows[i].Cells["colStatus"].Value = message;
break;
@@ -202,7 +202,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
var area = cobProvince.SelectedItem as ListItem;
int id = int.Parse(area.Value);
var shop = GlobalConfig.DouShopLoginList.Where(s=>s.LoginStatus=="登录成功").FirstOrDefault();
var shop = GlobalConfig.ShopLoginList.Where(s=>s.LoginStatus=="登录成功").FirstOrDefault();
if (shop == null)
return;
List<ListItem> list = new List<ListItem>();
@@ -265,10 +265,10 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
public void ReadLoad()
{
for (int i = 0; i < GlobalConfig.DouShopLoginList.Count; i++)
for (int i = 0; i < GlobalConfig.ShopLoginList.Count; i++)
{
var shop = GlobalConfig.DouShopLoginList[i];
dgvShop.Rows.Add(false, shop.ShopAccountId, shop.ShopAccount, 0, shop.LoginStatus);
var shop = GlobalConfig.ShopLoginList[i];
dgvShop.Rows.Add(false, shop.ShopId, shop.ShopAccount, 0, shop.LoginStatus);
}
}
+86 -86
View File
@@ -1,5 +1,5 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class FreightTemplateForm
{
@@ -34,7 +34,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx3 = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.cmbCity = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.cmbProvince = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.label3 = new System.Windows.Forms.Label();
@@ -71,16 +71,17 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.label7 = new System.Windows.Forms.Label();
this.btnAdd = new DevComponents.DotNetBar.PanelEx();
this.btnStopAdd = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx2 = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.chkLimited = new System.Windows.Forms.CheckBox();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.txtSearchText = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.btnSearch = new DevComponents.DotNetBar.PanelEx();
this.btnStop = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx1 = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvShop = new LittleRabbit.UserComponent.DataGridViewEx();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -88,15 +89,14 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.ucTabControl1 = new LittleRabbit.UserComponent.UcTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new LittleRabbit.UserControls.StatusBarUserControl();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.chkLimited = new System.Windows.Forms.CheckBox();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.ucTabControl1 = new TemuKJD.UserComponent.UcTabControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -119,12 +119,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit();
this.panelEx1.SuspendLayout();
this.ucTabControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
this.splitContainer4.Panel1.SuspendLayout();
this.splitContainer4.Panel2.SuspendLayout();
this.splitContainer4.SuspendLayout();
this.panelEx1.SuspendLayout();
this.ucTabControl1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -154,7 +154,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx3.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx3.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx3.Controls.Add(this.cmbCity);
this.ucGroupBoxEx3.Controls.Add(this.cmbProvince);
this.ucGroupBoxEx3.Controls.Add(this.label3);
@@ -641,12 +641,22 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.btnStopAdd.Text = "停止创建";
this.btnStopAdd.Click += new System.EventHandler(this.btnStopAdd_Click);
//
// chkLimited
//
this.chkLimited.AutoSize = true;
this.chkLimited.Location = new System.Drawing.Point(22, 61);
this.chkLimited.Name = "chkLimited";
this.chkLimited.Size = new System.Drawing.Size(131, 21);
this.chkLimited.TabIndex = 657;
this.chkLimited.Text = "限制下单区域(可选)";
this.chkLimited.UseVisualStyleBackColor = true;
//
// ucGroupBoxEx2
//
this.ucGroupBoxEx2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx2.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.Controls.Add(this.txtSearchText);
this.ucGroupBoxEx2.Controls.Add(this.label4);
this.ucGroupBoxEx2.Controls.Add(this.btnSearch);
@@ -727,7 +737,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx1.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2);
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
@@ -894,62 +904,6 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.colMessage.Visible = false;
this.colMessage.Width = 120;
//
// panelEx1
//
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx1.Controls.Add(this.ucTabControl1);
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelEx1.Location = new System.Drawing.Point(0, 0);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Padding = new System.Windows.Forms.Padding(1);
this.panelEx1.Size = new System.Drawing.Size(849, 408);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.White;
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.White;
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.panelEx1.Style.GradientAngle = 90;
this.panelEx1.TabIndex = 183;
//
// ucTabControl1
//
this.ucTabControl1.BackgroundColor = System.Drawing.Color.White;
this.ucTabControl1.Controls.Add(this.tabPage1);
this.ucTabControl1.Controls.Add(this.tabPage2);
this.ucTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucTabControl1.Location = new System.Drawing.Point(1, 1);
this.ucTabControl1.Name = "ucTabControl1";
this.ucTabControl1.Padding = new System.Drawing.Point(10, 3);
this.ucTabControl1.SelectedIndex = 0;
this.ucTabControl1.ShowCloseButton = true;
this.ucTabControl1.Size = new System.Drawing.Size(847, 406);
this.ucTabControl1.TabIndex = 0;
this.ucTabControl1.TabSelectColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucTabControl1.TabTextColor = System.Drawing.Color.Gray;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(2, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(841, 376);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "店铺1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(2, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(841, 376);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "店铺2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// splitContainer4
//
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -1004,15 +958,61 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.btnClear.TabIndex = 440;
this.btnClear.Text = "清空结果";
//
// chkLimited
// panelEx1
//
this.chkLimited.AutoSize = true;
this.chkLimited.Location = new System.Drawing.Point(22, 61);
this.chkLimited.Name = "chkLimited";
this.chkLimited.Size = new System.Drawing.Size(131, 21);
this.chkLimited.TabIndex = 657;
this.chkLimited.Text = "限制下单区域(可选)";
this.chkLimited.UseVisualStyleBackColor = true;
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx1.Controls.Add(this.ucTabControl1);
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelEx1.Location = new System.Drawing.Point(0, 0);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Padding = new System.Windows.Forms.Padding(1);
this.panelEx1.Size = new System.Drawing.Size(849, 408);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.White;
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.White;
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.panelEx1.Style.GradientAngle = 90;
this.panelEx1.TabIndex = 183;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(2, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(841, 376);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "店铺2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(2, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(841, 376);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "店铺1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// ucTabControl1
//
this.ucTabControl1.BackgroundColor = System.Drawing.Color.White;
this.ucTabControl1.Controls.Add(this.tabPage1);
this.ucTabControl1.Controls.Add(this.tabPage2);
this.ucTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucTabControl1.Location = new System.Drawing.Point(1, 1);
this.ucTabControl1.Name = "ucTabControl1";
this.ucTabControl1.Padding = new System.Drawing.Point(10, 3);
this.ucTabControl1.SelectedIndex = 0;
this.ucTabControl1.ShowCloseButton = true;
this.ucTabControl1.Size = new System.Drawing.Size(847, 406);
this.ucTabControl1.TabIndex = 0;
this.ucTabControl1.TabSelectColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucTabControl1.TabTextColor = System.Drawing.Color.Gray;
//
// FreightTemplateForm
//
@@ -1054,12 +1054,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
this.panelEx1.ResumeLayout(false);
this.ucTabControl1.ResumeLayout(false);
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
this.splitContainer4.ResumeLayout(false);
this.panelEx1.ResumeLayout(false);
this.ucTabControl1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -1077,10 +1077,6 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.SplitContainer splitContainer2;
private UserComponent.DataGridViewEx dgvShop;
private DevComponents.DotNetBar.PanelEx panelEx1;
private UserComponent.UcTabControl ucTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.SplitContainer splitContainer4;
private UserControls.StatusBarUserControl statusBar;
private DevComponents.DotNetBar.PanelEx btnClear;
@@ -1130,5 +1126,9 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private System.Windows.Forms.CheckBox chkLimited;
private DevComponents.DotNetBar.PanelEx panelEx1;
private UserComponent.UcTabControl ucTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
}
}
@@ -2,8 +2,8 @@
using AllBase.Helper;
using AllBase.Model.Param.OrderManage;
using AllBase.Model.Result;
using LittleRabbit.Extension;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.Util.Extension;
using NaiBa.Util.Helper;
using Newtonsoft.Json.Linq;
@@ -20,7 +20,7 @@ using System.Windows.Forms;
using Work;
using Work.DouyinApiClass;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class FreightTemplateForm : Form
{
@@ -84,14 +84,14 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
// 获取被删除的店铺
List<DataGridViewRow> dgvRowList = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> !GlobalConfig.DouShopLoginList.Any(s => s.ShopAccountId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
=> !GlobalConfig.ShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
// 更新被删除的店铺列表
foreach (var row in dgvRowList)
{
dgvShop.Rows.Remove(row);
}
// 绑定其他店铺(含新导入的店铺)
foreach (DouShopLoginInfo shopEntity in GlobalConfig.DouShopLoginList)
foreach (DouShopLoginInfo shopEntity in GlobalConfig.ShopLoginList)
{
BindShop(shopEntity, selectIds);
}
@@ -104,12 +104,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
selectShopId = new List<string>();
bool canUse = shopEntity.BuyApiAuth.ApiAuthStatus == "授权成功" && shopEntity.LoginStatus == "登录成功";
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopAccountId);
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
if (row == null)
{
this.dgvShop.Rows.Add(
selectShopId.Contains(shopEntity.ShopAccountId) && canUse,
shopEntity.ShopAccountId,
selectShopId.Contains(shopEntity.ShopId) && canUse,
shopEntity.ShopId,
shopEntity.ShopAccount,
shopEntity.BuyApiAuth.ApiAuthStatus,
shopEntity.LoginStatus,
@@ -119,7 +119,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
else
{
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopAccountId) && canUse;
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colBuyAuthStatus"].Value = shopEntity.BuyApiAuth.ApiAuthStatus;
row.Cells["colLoginStatus"].Value = shopEntity.LoginStatus;
@@ -139,7 +139,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
else
{
var list = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && s.LoginStatus == "登录成功").Select(ss => ss.ShopAccountId);
var list = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && s.LoginStatus == "登录成功").Select(ss => ss.ShopId);
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
@@ -156,7 +156,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
string columnName = dgvShop.Columns[e.ColumnIndex].Name;
long shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToLong();
string shopName = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ToString();
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId.ToString());
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString());
var row = dgvShop.Rows[e.RowIndex];
switch (columnName)
{
@@ -201,7 +201,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (cancellationTokenSource.IsCancellationRequested)
break;
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null)
continue;
@@ -212,7 +212,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
Invoke(new Action(() =>
{
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
if (row != null)
{
row.Cells["colLoginStatus"].Value = "未登录";
@@ -225,11 +225,11 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
FreightTemplateListForm templateListForm = null;
Invoke(new Action(() =>
{
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopAccountId);
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopId);
if (tab == null)
{
tab = new TabPage();
tab.Name = "tab" + shop.ShopAccountId;
tab.Name = "tab" + shop.ShopId;
tab.Text = shop.ShopAccount;
this.ucTabControl1.TabPages.Add(tab);
@@ -281,7 +281,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (addr != null && (addr.sub_districts != null || addr.level == "Town"))
return addr;
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.BuyApiAuth.ApiAuthStatus == "授权成功");
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.BuyApiAuth.ApiAuthStatus == "授权成功");
if (shop == null)
{
BaseMsgForm.ShowError("请确保有店铺拍单授权成功!");
@@ -593,7 +593,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (cancellationTokenSource.IsCancellationRequested)
break;
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ShopAccountId == shopId);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop == null)
continue;
@@ -604,7 +604,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
Invoke(new Action(() =>
{
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
var row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
if (row != null)
{
row.Cells["colLoginStatus"].Value = "未登录";
@@ -617,11 +617,11 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
FreightTemplateListForm templateListForm = null;
Invoke(new Action(() =>
{
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopAccountId);
var tab = this.ucTabControl1.TabPages.Cast<TabPage>().FirstOrDefault(t => t.Text == shop.ShopAccount && t.Name == "tab" + shop.ShopId);
if (tab == null)
{
tab = new TabPage();
tab.Name = "tab" + shop.ShopAccountId;
tab.Name = "tab" + shop.ShopId;
tab.Text = shop.ShopAccount;
this.ucTabControl1.TabPages.Add(tab);
@@ -1,5 +1,5 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class FreightTemplateListForm
{
@@ -33,9 +33,9 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvTemplate = new LittleRabbit.UserComponent.DataGridViewEx();
this.dgvTemplate = new TemuKJD.UserComponent.DataGridViewEx();
this.label1 = new System.Windows.Forms.Label();
this.statusBar = new LittleRabbit.UserControls.StatusBarUserControl();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colTemplateId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colTemplateName = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -14,7 +14,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Work.DouyinApiClass;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class FreightTemplateListForm : Form
{
@@ -1,5 +1,5 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class FreightTemplateNameForm
{
@@ -8,7 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class FreightTemplateNameForm : BaseForms.LRBaseForm
{
@@ -1,5 +1,5 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class FreightTemplateNotSendAreaForm
{
@@ -10,7 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class FreightTemplateNotSendAreaForm : BaseForms.LRBaseForm
{
+9 -9
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class MaterialManageForm
{
@@ -33,26 +33,26 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx3 = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.dtEndTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput();
this.dtBaginTime = new DevComponents.Editors.DateTimeAdv.DateTimeInput();
this.labelX47 = new DevComponents.DotNetBar.LabelX();
this.label4 = new System.Windows.Forms.Label();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.btnStop = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx1 = new LittleRabbit.UserComponent.UcGroupBoxEx(this.components);
this.btnGetProductCount = new LittleRabbit.UserControls.ButtonEx();
this.btnRefreshShop = new LittleRabbit.UserControls.ButtonEx();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnGetProductCount = new TemuKJD.UserControls.ButtonEx();
this.btnRefreshShop = new TemuKJD.UserControls.ButtonEx();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.dgvShop = new LittleRabbit.UserComponent.DataGridViewEx();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAuthStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new LittleRabbit.UserControls.StatusBarUserControl();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -102,7 +102,7 @@
this.ucGroupBoxEx3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx3.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx3.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx3.Controls.Add(this.dtEndTime);
this.ucGroupBoxEx3.Controls.Add(this.dtBaginTime);
this.ucGroupBoxEx3.Controls.Add(this.labelX47);
@@ -278,7 +278,7 @@
this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx1.BorderStyle = LittleRabbit.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.Controls.Add(this.btnGetProductCount);
this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2);
@@ -1,6 +1,6 @@
using AllBase.Helper;
using LittleRabbit.Extension;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
@@ -15,7 +15,7 @@ using System.Windows.Forms;
using Work.BLL.Upload;
using Work.DouyinApiClass;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class MaterialManageForm : Form
{
@@ -47,7 +47,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
else
{
var list = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopAccountId);
var list = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功").Select(ss => ss.ShopId);
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
@@ -60,19 +60,19 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
// 获取被删除的店铺
List<DataGridViewRow> dgvRowList = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> !GlobalConfig.DouShopLoginList.Any(s => s.ShopAccountId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
=> !GlobalConfig.ShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
// 更新被删除的店铺列表
foreach (var row in dgvRowList)
{
dgvShop.Rows.Remove(row);
}
for (int i = 0; i < GlobalConfig.DouShopLoginList.Count; i++)
for (int i = 0; i < GlobalConfig.ShopLoginList.Count; i++)
{
var shop = GlobalConfig.DouShopLoginList[i];
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopAccountId);
var shop = GlobalConfig.ShopLoginList[i];
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value?.ToString() == shop.ShopId);
if (row == null)
dgvShop.Rows.Add(false, shop.ShopAccountId, shop.ShopAccount, shop.LoginStatus);
dgvShop.Rows.Add(false, shop.ShopId, shop.ShopAccount, shop.LoginStatus);
else
{
row.Cells["colAuthStatus"].Value = shop.ApiAuthStatus;
@@ -161,7 +161,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
var shopList = GlobalConfig.DouShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && lstShopId.Contains(s.ShopAccountId));
var shopList = GlobalConfig.ShopLoginList.Where(s => s.ApiAuthStatus == "授权成功" && lstShopId.Contains(s.ShopId));
foreach (var shop in shopList)
{
DataGridViewRow row = null;
@@ -176,7 +176,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.statusBar.pgbTaskProgress.Text = n + "/" + total;
this.statusBar.pgbTaskProgress.Maximum = total;
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
if (row != null) { row.Cells["colMessage"].Value = "正在获取素材文件夹"; }
}));
@@ -335,7 +335,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
this.Invoke(new Action(() =>
{
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopAccountId);
row = this.dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["colShopId"].Value.ToString() == shop.ShopId);
if (row != null) { row.Cells["colMessage"].Value = "素材文件夹删除完成"; }
}));
Thread.Sleep(2000);
+2 -2
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class ShopAddEditForm
{
@@ -43,7 +43,7 @@
this.txtLoginName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.btnOk = new LittleRabbit.UserControls.ButtonEx();
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
@@ -1,6 +1,6 @@
using AllBase.Helper;
using AllBase.Model.Result;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.KJDForms.BaseForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -11,7 +11,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class ShopAddEditForm : LRBaseForm
{
@@ -59,7 +59,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
this.cmbGroup.Items.Clear();
this.cmbGroup.Items.Add(string.Empty);
foreach (var shop in GlobalConfig.DouShopLoginList)
foreach (var shop in GlobalConfig.ShopLoginList)
{
if (!string.IsNullOrEmpty(shop.Group) && !this.cmbGroup.Items.Contains(shop.Group))
this.cmbGroup.Items.Add(shop.Group);
+7 -7
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class ShopAuthForm
{
@@ -30,16 +30,16 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShopAuthForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.buttonEx1 = new LittleRabbit.UserControls.ButtonEx();
this.btnAuthInWeb = new LittleRabbit.UserControls.ButtonEx();
this.buttonEx1 = new TemuKJD.UserControls.ButtonEx();
this.btnAuthInWeb = new TemuKJD.UserControls.ButtonEx();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnCopyPassword = new LittleRabbit.UserControls.ButtonEx();
this.btnCopyUserName = new LittleRabbit.UserControls.ButtonEx();
this.btnCopyPassword = new TemuKJD.UserControls.ButtonEx();
this.btnCopyUserName = new TemuKJD.UserControls.ButtonEx();
this.txtPassWord = new System.Windows.Forms.TextBox();
this.txtUserName = new System.Windows.Forms.TextBox();
this.btnStop = new LittleRabbit.UserControls.ButtonEx();
this.btnReload = new LittleRabbit.UserControls.ButtonEx();
this.btnStop = new TemuKJD.UserControls.ButtonEx();
this.btnReload = new TemuKJD.UserControls.ButtonEx();
this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.txtAddress = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+6 -6
View File
@@ -3,7 +3,7 @@ using AllBase.Helper;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using System;
@@ -19,7 +19,7 @@ using System.Windows.Forms;
using Work;
using Work.BLL.Tools;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class ShopAuthForm : LRBaseForm
{
@@ -42,7 +42,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
var url = BaseClass.BuildObjString("shop&act=add_shop_agent_name");
var data = UserLogin.GetSignaturex()
+ "&shop_id=" + shop.ShopAccountId
+ "&shop_id=" + shop.ShopId
+ "&agent_name=" + BaseClass.AgentName;
var result = GetHtml.PostUtf8(url, data);
@@ -113,7 +113,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (res != null && res.StartsWith("授权成功") && res.EndsWith(shop.ShopAccount))
{
//shop.ApiAuthStatus = "授权成功";
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
ShopListForm.UpdateShopTokens(GlobalConfig.ShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
StartUp.SaveLocalShopLoginInfo();
OnSaveComplete(shop);
if (this.Created && this.chkCloseAfterLogin.Checked)
@@ -133,7 +133,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (this.Created && this.chkCloseAfterLogin.Checked)
{
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
ShopListForm.UpdateShopTokens(GlobalConfig.ShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
StartUp.SaveLocalShopLoginInfo();
OnSaveComplete(shop);
Thread.Sleep(2000);
@@ -233,7 +233,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
var data = responseData;
if (this.shop != null && data.Contains("\"code\":0"))
{
shop.ShopAccountId = BaseRegex.GetStringJson(ref data, "id");
shop.ShopId = BaseRegex.GetStringJson(ref data, "id");
shop.ShopToken = BaseRegex.GetStringJson(ref data, "token");
shop.ShopAccount = BaseRegex.GetStringJson(ref data, "shop_name");
shop.Mobile = BaseRegex.GetStringJson(ref data, "mobile");
+2 -2
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class ShopForm
{
@@ -44,7 +44,7 @@
this.panel2 = new System.Windows.Forms.Panel();
this.lblName = new System.Windows.Forms.Label();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tv = new LittleRabbit.UserComponent.UcTreeView();
this.tv = new TemuKJD.UserComponent.UcTreeView();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+1 -1
View File
@@ -9,7 +9,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class ShopForm : Form
{
+22 -9
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class ShopListForm
{
@@ -35,17 +35,17 @@
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel5 = new System.Windows.Forms.Panel();
this.btnRefreshAuth = new LittleRabbit.UserControls.ButtonEx();
this.btnLoginSelect = new LittleRabbit.UserControls.ButtonEx();
this.btnCheck = new LittleRabbit.UserControls.ButtonEx();
this.btnRefreshAuth = new TemuKJD.UserControls.ButtonEx();
this.btnLoginSelect = new TemuKJD.UserControls.ButtonEx();
this.btnCheck = new TemuKJD.UserControls.ButtonEx();
this.panel4 = new System.Windows.Forms.Panel();
this.btnImport = new LittleRabbit.UserControls.ButtonEx();
this.btnAddShop = new LittleRabbit.UserControls.ButtonEx();
this.btnImport = new TemuKJD.UserControls.ButtonEx();
this.btnAddShop = new TemuKJD.UserControls.ButtonEx();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvShop = new LittleRabbit.UserComponent.DataGridViewEx();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.statusBar = new LittleRabbit.UserControls.StatusBarUserControl();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -56,6 +56,7 @@
this.colBuyAccount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colChatAccount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colGotoShop = new System.Windows.Forms.DataGridViewLinkColumn();
this.colShopOperate = new System.Windows.Forms.DataGridViewLinkColumn();
this.colRelogin = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMultiLogin = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -251,7 +252,7 @@
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::LittleRabbit.Properties.Resources.loading_blue;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(506, 252);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
@@ -288,6 +289,7 @@
this.colBuyAccount,
this.colChatAccount,
this.colLoginStatus,
this.colGotoShop,
this.colShopOperate,
this.colRelogin,
this.colMultiLogin,
@@ -406,6 +408,15 @@
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Visible = false;
//
// colGotoShop
//
this.colGotoShop.FillWeight = 46F;
this.colGotoShop.HeaderText = "进入店铺";
this.colGotoShop.Name = "colGotoShop";
this.colGotoShop.ReadOnly = true;
this.colGotoShop.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colGotoShop.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colShopOperate
//
this.colShopOperate.FillWeight = 46F;
@@ -414,6 +425,7 @@
this.colShopOperate.ReadOnly = true;
this.colShopOperate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopOperate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colShopOperate.Visible = false;
//
// colRelogin
//
@@ -539,6 +551,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn colBuyAccount;
private System.Windows.Forms.DataGridViewTextBoxColumn colChatAccount;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewLinkColumn colGotoShop;
private System.Windows.Forms.DataGridViewLinkColumn colShopOperate;
private System.Windows.Forms.DataGridViewLinkColumn colRelogin;
private System.Windows.Forms.DataGridViewLinkColumn colMultiLogin;
+147 -137
View File
@@ -1,8 +1,8 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using LittleRabbit.Extension;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.BaseForms;
using NaiBa.Util.Extension;
using Newtonsoft.Json.Linq;
using System;
@@ -19,7 +19,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class ShopListForm : Form
{
@@ -35,7 +35,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
var data = UserLogin.GetSignaturex()
+ "&login_name=" + _shop.LoginName
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
+ "&shop_id=" + _shop.ShopAccountId
+ "&shop_id=" + _shop.ShopId
+ "&shop_account=" + _shop.ShopAccount
+ "&cookie=" + _shop.Cookies
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.Group);
@@ -54,6 +54,30 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}
return result;
}
public static string MdyServerDouShop(DouShopLoginInfo _shop)
{
var url = BaseClass.BuildObjString("shop/mdy_shop");
var data = UserLogin.GetSignaturex()
+ "&login_name=" + _shop.LoginName
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.Group);
var result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200") && !result.Contains("已达上限") && !result.Contains("已存在"))
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJson(ref result, "msg");
if (string.IsNullOrEmpty(msg))
msg = "店铺保存失败!";
BaseMsgForm.ShowError(msg);
}
return result;
}
public static List<DouShopLoginInfo> GetServerDouShop()
{
List<DouShopLoginInfo> list = new List<DouShopLoginInfo>();
@@ -89,7 +113,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
continue;
shop.LoginName = BaseRegex.GetStringJson(ref shopStr, "login_name");
shop.Password = BaseRegex.GetStringJson(ref shopStr, "login_pass");
shop.ShopAccountId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
shop.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
shop.ShopAccount = BaseRegex.GetStringJson(ref shopStr, "shop_account");
shop.Group = BaseRegex.GetStringJson(ref shopStr, "shop_group");
shop.Cookies = BaseRegex.GetStringJson(ref shopStr, "cookie");
@@ -144,7 +168,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
string shopIds = "";
foreach (var shop in shops)
{
shopIds += shop.ShopAccountId + ",";
shopIds += shop.ShopId + ",";
}
var shopTokens = GetServerShopTokens(shopIds); //{"code":200,"msg":"success","data":[{"shop_id":"9050819","app_key":"6876612657718691336","access_token":"fd818b94-b4e7-4707-8073-bebcd81d8e4c","refresh_token":"9a109ef3-2bef-4ca9-8f4e-18369a356255","add_time":"2021-07-09 10:54:56","expires_in":"2021-07-14 18:40:44"}]}
@@ -161,7 +185,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
string shopStr = JsonHelper.SerializeObject(jShop);
string shop_id = BaseRegex.GetStringJson(ref shopStr, "shop_id");
var shop = shops.FirstOrDefault(s => s.ShopAccountId == shop_id);
var shop = shops.FirstOrDefault(s => s.ShopId == shop_id);
if (shop != null)
{
var appkey = BaseRegex.GetStringJson(ref shopStr, "app_key");
@@ -279,36 +303,42 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
if ((isAdd as bool?) == true)
{
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == shopInfo.LoginName);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shopInfo.LoginName);
if (shop != null)
{
BaseMsgForm.ShowError("店铺" + shopInfo.LoginName + "已存在!");
}
else
{
GlobalConfig.DouShopLoginList.Add(shopInfo);
GlobalConfig.ShopLoginList.Add(shopInfo);
StartUp.SaveLocalShopLoginInfo();
ShopListForm.AddServerDouShop(shopInfo);
RefreshDataGridView(false);
}
}
else
{
StartUp.SaveLocalShopLoginInfo();
ShopListForm.AddServerDouShop(shopInfo);
shopLoginForm_SaveComplete(shopInfo);
RefreshDataGridView(false);
}
}
}
private void shopLoginForm_SaveComplete(object obj)
{
CheckShopLoginAsync(new string[] { (obj as DouShopLoginInfo).ShopAccount });
Task.Run(() =>
{
//CheckShopListLogin(new string[] { (obj as DouShopLoginInfo).LoginName });
RefreshDataGridView(false);
});
}
private void btnImport_Click(object sender, EventArgs e)
{
IsOperate = true;
ImportShop();
RefreshDataGridView();
}
void ImportShop()
@@ -355,14 +385,14 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
//shopLoginForm.ShowDialog();
//StartUp.SaveDouShopLoginInfo();
var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == shop.LoginName);
var shopInfo = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shop.LoginName);
if (shopInfo != null)
{
shopInfo.Password = shop.Password;
shopInfo.Group = shop.Group;
}
else
GlobalConfig.DouShopLoginList.Add(shop);
GlobalConfig.ShopLoginList.Add(shop);
StartUp.SaveLocalShopLoginInfo();
ShopListForm.AddServerDouShop(shop);
}
@@ -372,22 +402,19 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
}
}
RefreshDataGridView();
}
}
IsOperate = false;
this.btnImport.Enabled = true;
}
private void RefreshDataGridView()
private void RefreshDataGridView(bool updateStatus=true)
{
if (isLoading)
{
//BaseMsgForm.ShowError("当前正在加载,请稍等");
return;
}
this.statusBar.pgbTaskProgress.Maximum = GlobalConfig.DouShopLoginList.Count;
this.dgvShop.Rows.Clear();
Task.Run(() =>
{
isLoading = true;
@@ -396,27 +423,36 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
Thread.Sleep(1000);
}
for (int i = 0; i < GlobalConfig.DouShopLoginList.Count; i++)
var shopList = GlobalConfig.ShopLoginList.Where(s => !string.IsNullOrEmpty(s.ShopId)
|| GlobalConfig.ShopLoginList.Where(ss=>ss.LoginName == s.LoginName).Count() == 1)
.OrderBy(s=>s.LoginName).ToList();
this.Invoke(new Action(() =>
{
if (i % 5 == 0 || i == GlobalConfig.DouShopLoginList.Count - 1)
this.dgvShop.Rows.Clear();
if (updateStatus)
this.statusBar.pgbTaskProgress.Maximum = shopList.Count; // 显示总数
}));
for (int i = 0; i < shopList.Count; i++)
{
if (this.Created && updateStatus && (i % 5 == 0 || i == shopList.Count - 1))
{
if (this.Created)
this.Invoke(new Action(() =>
{
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在加载...";
this.statusBar.pgbTaskProgress.Value = (i + 1);
this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + GlobalConfig.DouShopLoginList.Count;
}));
}
this.statusBar.lblTaskStatus.Text = "正在加载...";
this.statusBar.pgbTaskProgress.Value = (i + 1);
this.statusBar.pgbTaskProgress.Text = (i + 1) + "/" + shopList.Count;
}));
}
AddDataGridViewRow(GlobalConfig.DouShopLoginList[i], true);
AddDataGridViewRow(shopList[i], true);
}
if (this.Created)
{
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "加载完毕";
if (updateStatus)
this.statusBar.lblTaskStatus.Text = "加载完毕";
this.pbLoading.Visible = false;
}));
}
@@ -432,7 +468,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
{
DataGridViewRow dgvr = dgvShop.Rows.Cast<DataGridViewRow>().Where(p =>
p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == param.LoginName &&
p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == param.ShopAccountId).FirstOrDefault();
p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == param.ShopId).FirstOrDefault();
if (dgvr != null)
{
UpdateDataGridViewRowToken(dgvr, param);
@@ -447,7 +483,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
int rowIndex = this.dgvShop.Rows.Add(
false,
param.LoginName,
param.ShopAccountId,
param.ShopId,
param.ShopAccount,
param.Cookies,
param.Group,
@@ -455,6 +491,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
param.BuyAccount,
param.ChatAccount,
"",
"进入",
"检测",
string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(),
"多重登录",
@@ -493,7 +530,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
/// </summary>
/// <param name="shopNames"></param>
/// <param name="isShowProgress"></param>
public void CheckShopLoginAsync(string[] shopNames, bool isShowProgress = true)
public void CheckShopListLogin(string[] shopNames, bool isShowProgress = true)
{
if (isShowProgress)
{
@@ -506,114 +543,53 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
}));
}
Task.Run(() =>
{
CheckShopLogin(shopNames, isShowProgress);
CheckShopLogin(shopNames, isShowProgress);
if (this.Created && isShowProgress)
if (this.Created && isShowProgress)
{
this.Invoke(new Action(() =>
{
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "检测完毕";
}));
}
});
this.statusBar.lblTaskStatus.Text = "检测完毕";
}));
}
}
public void CheckShopLogin(string[] shopNames, bool isShowProgress = true)
{
for (int i = 0; i < shopNames.Length; i++)
{
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == shopNames[i]);
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == shopNames[i]);
var campanys = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopNames[i]).ToList();
if (shop != null)
{
retryLogin:
var loginResult = "\"code\":0";//GetShopStatus(shop);
if (loginResult.Contains("\"code\":0"))
//var loginResult = "\"code\":0";//GetShopStatus(shop);
var loginResult = GetShopStatus(shop);
if (loginResult.Contains("\"success\":true"))
{
shop.LoginStatus = "登录成功";
//var shopId = BaseRegex.GetStringJson(ref loginResult, "id");
//var shopToken = BaseRegex.GetStringJson(ref loginResult, "token");
//var shopName = BaseRegex.GetStringJson(ref loginResult, "shop_name");
//var mobile = BaseRegex.GetStringJson(ref loginResult, "mobile");
//if (!string.IsNullOrEmpty(shopId)) shop.ShopAccountId = shopId;
//if (!string.IsNullOrEmpty(shopToken)) shop.ShopToken = shopToken;
//if (!string.IsNullOrEmpty(shopName)) shop.ShopAccount = shopName;
//if (!string.IsNullOrEmpty(mobile)) shop.Mobile = mobile;
}
else if (loginResult.Contains("未登录"))
{
var keyValue = shop.DictMultiCookies.FirstOrDefault(c => c.Value == shop.Cookies);
if (keyValue.Key != null)
shop.DictMultiCookies.Remove(keyValue.Key);
if (shop.DictMultiCookies.Keys.Count > 0)
foreach(var sc in campanys)
{
shop.Cookies = shop.DictMultiCookies.FirstOrDefault().Value;
goto retryLogin;
sc.LoginStatus = "登录成功";
//var shopId = BaseRegex.GetStringJson(ref loginResult, "id");
//var shopToken = BaseRegex.GetStringJson(ref loginResult, "token");
//var shopName = BaseRegex.GetStringJson(ref loginResult, "shop_name");
//var mobile = BaseRegex.GetStringJson(ref loginResult, "mobile");
//if (!string.IsNullOrEmpty(shopId)) shop.ShopId = shopId;
//if (!string.IsNullOrEmpty(shopToken)) shop.ShopToken = shopToken;
//if (!string.IsNullOrEmpty(shopName)) shop.ShopAccount = shopName;
//if (!string.IsNullOrEmpty(mobile)) shop.Mobile = mobile;
}
shop.LoginStatus = "未登录";
}
else
{
shop.LoginStatus = "登录失败";
}
// 获取店铺token列表
shop.ApiAuthStatus = "未授权";
if (!string.IsNullOrEmpty(shop.AccessToken) && shop.ExpiresTime > DateTime.Now)
{
Work.DouyinApiClass.DouyinApi api = new Work.DouyinApiClass.DouyinApi(shop);
string html = "";
//if (shop.LstBrand == null)
//{
// html = api.shopBrandList();
// if (html.Contains("\"code\":10000") && html.Contains("\"data\":["))
// {
// shop.LstBrand = JsonHelper.DeserializeJsonToList<BrandInfo>(JsonHelper.SerializeObject(JObject.Parse(html)["data"]));
// }
//}
if (string.IsNullOrEmpty(html) || html.Contains("该接口即将下线"))
foreach (var sc in campanys)
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
dictionary.Add("page", "1");
dictionary.Add("size", "1");
api.JsonData = dictionary;
html = api.GetProductList();
}
if (html.Contains("\"code\":10000"))
{
shop.ApiAuthStatus = "授权成功";
}
else
{
if (html.Contains("access_token已过期"))
{
}
else
{
var errMsg = BaseRegex.GetStringJson(ref html, "sub_msg");
if (string.IsNullOrEmpty(errMsg))
errMsg = html;
if (errMsg.Contains("店铺授权已被关闭"))
shop.ApiAuthStatus = "未授权,授权未开通或已关闭";
else
BaseMsgForm.ShowError("店铺 " + shop.ShopAccount + " 检测错误:\r\n" + errMsg);
}
//sc.LoginStatus = "登录失败";
sc.LoginStatus = "未登录";
}
}
shop.BuyApiAuth.ApiAuthStatus = "未授权";
if (!string.IsNullOrEmpty(shop.BuyApiAuth.AccessToken) && shop.BuyApiAuth.ExpiresTime > DateTime.Now)
{
shop.BuyApiAuth.ApiAuthStatus = "授权成功";
}
if (!string.IsNullOrEmpty(loginResult))
shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
//if (!string.IsNullOrEmpty(loginResult))
// shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
StartUp.SaveLocalShopLoginInfo();
AddDataGridViewRow(shop);
}
if (this.Created && isShowProgress)
{
@@ -641,25 +617,41 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
string result;
try
{
string url = "https://fxg.jinritemai.com/common/index/index?_lid=" + _lid;
url = "https://fxg.jinritemai.com/common/index/index?_=" + timeStamp + "&appid=1";
//string url = "https://fxg.jinritemai.com/common/index/index?_lid=" + _lid;
//url = "https://fxg.jinritemai.com/common/index/index?_=" + timeStamp + "&appid=1";
string url = "https://seller.kuajingmaihuo.com/bg/quiet/api/mms/userInfo";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.KeepAlive = true;
request.Headers.Add("sec-ch-ua", @""" Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""");
request.Headers.Set(HttpRequestHeader.CacheControl, "max-age=0");
request.Headers.Add("Anti-Content", @"0aqAfqFyXcGvBgd9Q0HiJJ7kvWcKK7muUHnJ6oMAdmem0tmm_enmX1DBr-nJNxmoki33dqHTkZU18BU2p8P72Cg2uEZ_acOOBCxGmIs-Gym4EtKpTdZ6kWRCSClS9L6maLm0imx0GIjodHtLnwpx4ayHnhzNnCXEFecZSC8lBRHb9WCAoyY79kMLIWxBMZZSZrR2_LYUJ5UXzf-82ob455f7OvJa6s895N4wiMGR4vbVH8gFN2VuCxS27RpXDa2WCQQQd6XsJPw7amSUaob6oZ2MXuYb9K3ZqoCX5-nJimNZDR0rNCLB13sYgWq9jy0Q3gjnsFY2dJQDh3ewXS2vvf2DN9IAEzInwWTY31Fn0B6-s8DqwIm61OlXsfYt1AYOOyNMLzkw5llaDaqK21f7vspAuXwnJdAdKXJXSyyEimvTyF_AYLp1gkNqBqN1_ik_jc6cKTDJtGUgFjRojR4g4zM7Ww3wfW63WQrJftYhiTIJiS1tZcsceZht3Zu3MsvyxpAbx4bxFrvL0A6OFx752XsVi04Tm6HDhgt7MmpsrTO5WD_KjgjxNX8VNoGndD0OmriAYVn6kwmZXE6Y_khGedxumIGy4sOQI36__CeiuiPIvB8itfOqd7eyqyeCIaEODrh9dSLBQz8AxQ2xt60OTn4HSiPmlwo1J0TFtjUw2DUZB68tdrINb7ugulMsaIwMKr8S0bilSKW6JuYw3oAsmK3daQfJWy3mzVowY1UwPQfTB4Ibz6uRQxHkvhsRTXkrAygGeZIc9S");
request.Headers.Add("sec-ch-ua-platform", @"""Windows""");
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36";
request.Headers.Add("sec-ch-ua", @"""Google Chrome"";v=""137"", ""Chromium"";v=""137"", ""Not/A)Brand"";v=""24""");
request.Headers.Add("Sec-Purpose", @"prefetch;prerender");
request.ContentType = "application/json";
request.Headers.Add("sec-ch-ua-mobile", @"?0");
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36";
request.Accept = "*/*";
request.Headers.Add("Origin", @"https://seller.kuajingmaihuo.com");
request.Headers.Add("Purpose", @"prefetch");
request.Headers.Add("Sec-Fetch-Site", @"same-origin");
request.Headers.Add("Sec-Fetch-Mode", @"cors");
request.Headers.Add("Sec-Fetch-Dest", @"empty");
request.Referer = "https://fxg.jinritemai.com/ffa/mshop/homepage/index";
//request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br");
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
request.Referer = "https://seller.kuajingmaihuo.com/";
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
//request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
request.Headers.Set(HttpRequestHeader.Cookie, shop.Cookies);
//gfsitesid=MTQyNTYzMzg3MXwxNjI0ODY5MDgyMjN8fDQyOTIxMTA1Mjk2MDgzNzUHBwcHBwcH; gfsitesid=MTQyNTYzMzg3MXwxNjI0ODY5MDgyMjN8fDQyOTIxMTA1Mjk2MDgzNzUHBwcHBwcH; gfsitesid=MTQyNTYzMzg3MXwxNjI0ODY5MDgyMjN8fDQyOTIxMTA1Mjk2MDgzNzUHBwcHBwcH; gfsitesid=MTQyNTYzMzg3MXwxNjI0ODY5MDgyMjN8fDQyOTIxMTA1Mjk2MDgzNzUHBwcHBwcH; gftoken=MTQyNTYzMzg3MXwxNjI0ODY5MDgyMjN8fDAGBgYGBgY; Hm_lvt_b6520b076191ab4b36812da4c90f7a5e=1624869083; passport_csrf_token_default=63caff152adc5e1d5da5767bf68c6e13; passport_csrf_token=63caff152adc5e1d5da5767bf68c6e13; ttwid=1%7C7YnupmizSCfMVfQ9y8cSyDYdaFFZFIG3i91Gg2_c5o4%7C1624869083%7C2527885991ce10cc1d54edcb381f47d01aaaf862a2c1fb587f55e26aa41eba5b; ttcid=40a3419fe96343f794046035c0f1c6bb88; n_mh=7LrrRmeUceh3vjPZWa4C3h7B_APxodsUr7zuYy75V90; sso_uid_tt=c1960cf8de21effe142f1b380670a8a3; sso_uid_tt_ss=c1960cf8de21effe142f1b380670a8a3; toutiao_sso_user=c00794bc53d4a42eb9ab1388ca003bcb; toutiao_sso_user_ss=c00794bc53d4a42eb9ab1388ca003bcb; odin_tt=c646a97f8da607104fc7f1b424cf575d3a9360b52a860aa41d467407a14512fa049a875904a556a8ecbca4985d302a8287ae02bafeaf8235cd31d44a86c2f27f; gfpart_1.0.0.2541_75650=0; uidpasaddaehruigqreajf=0; ucas_sso_c0_ss=CkEKBTEuMC4wEIeIg9zOm-LsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DjkeaGBkjjxaKJBlCOvKLE77ansWBYbhIU4IRRs4bwygU2zJUnwUihzw_S6ko; ucas_sso_c0=CkEKBTEuMC4wEIeIg9zOm-LsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DjkeaGBkjjxaKJBlCOvKLE77ansWBYbhIU4IRRs4bwygU2zJUnwUihzw_S6ko; ucas_c0_ss=CkEKBTEuMC4wEKKIg9SJmuLsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DkkeaGBkjkxaKJBlCOvKLE77ansWBYbhIU3xVR2vJ8IbAhCwtumICcjmmBLh0; sid_guard=16f989cfdea4ddac75677dfc0ce57afd%7C1624869092%7C5184000%7CFri%2C+27-Aug-2021+08%3A31%3A32+GMT; uid_tt=6fdbf1e79a0ed585dfa8e872be181249; uid_tt_ss=6fdbf1e79a0ed585dfa8e872be181249; sid_tt=16f989cfdea4ddac75677dfc0ce57afd; sessionid=16f989cfdea4ddac75677dfc0ce57afd; sessionid_ss=16f989cfdea4ddac75677dfc0ce57afd; ucas_c0=CkEKBTEuMC4wEKKIg9SJmuLsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DkkeaGBkjkxaKJBlCOvKLE77ansWBYbhIU3xVR2vJ8IbAhCwtumICcjmmBLh0; PHPSESSID=3fe844ca974ebeea09da3231eee9646e; PHPSESSID_SS=3fe844ca974ebeea09da3231eee9646e; need_choose_shop=0; Hm_lpvt_b6520b076191ab4b36812da4c90f7a5e=1624869093; login_info=%7B%22for_im_reply%22%3A%223fe844ca974ebeea09da3231eee9646e%22%7D; tt_scid=jkzjB5E7zloxWMb2G449QYbHcDZpzOLTpPUBSBff8qryqYe.RyJXHuV0J7Zgm6nNa041; MONITOR_WEB_ID=4292110529608375
//passport_csrf_token_default=e5523a2b927b7a05c96d78a002476760; passport_csrf_token=e5523a2b927b7a05c96d78a002476760; source=bd.pcpz.1; uidpasaddaehruigqreajf=0; need_choose_shop=0; gfpart_1.0.0.695_75006=0; SHOP_ID=9050819; PIGEON_CID=4292110529608375; gfpart_1.0.0.2509_75019=0; Hm_lvt_b6520b076191ab4b36812da4c90f7a5e=1624517875,1624518442; passport_auth_status_ss=be2c708f6b44b8a69f25bb0be517ed9e%2C3eecc7d21580d321236fc0fdc098042c; passport_auth_status=be2c708f6b44b8a69f25bb0be517ed9e%2C3eecc7d21580d321236fc0fdc098042c; n_mh=7LrrRmeUceh3vjPZWa4C3h7B_APxodsUr7zuYy75V90; gfpart_1.0.0.312_74679=1; ttwid=1%7Cn--vVhfZ3AB5VnU0qJCRI6DEqVeEtvQU9yArHD7nu7A%7C1624868199%7Ccd636d9e6f1719d9a763eee1acf81ab435e14c542490ef0a5150c7566f110764; sso_uid_tt=b577dc2d646f30ca85d073bf096eb952; sso_uid_tt_ss=b577dc2d646f30ca85d073bf096eb952; toutiao_sso_user=c1581bc437561fd5a52f850ccd927686; toutiao_sso_user_ss=c1581bc437561fd5a52f850ccd927686; odin_tt=e85b04b36cb5475fe06a487c55655d731be76d54ae26e57e080823d3a568d863c7b24a14aa1c89b488b91e2e2f5743b98bc4e9b7f726b342d8f0c5ea43744e5c; ucas_sso_c0_ss=CkEKBTEuMC4wEIiIkvirrOHsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DsiuaGBkjsvqKJBlCOvKLE77ansWBYbhIUtAA8VK2j6e3rNeErWjH8DgLTusg; ucas_sso_c0=CkEKBTEuMC4wEIiIkvirrOHsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DsiuaGBkjsvqKJBlCOvKLE77ansWBYbhIUtAA8VK2j6e3rNeErWjH8DgLTusg; ucas_c0_ss=CkEKBTEuMC4wEISIh4LFquHsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DtiuaGBkjtvqKJBlCOvKLE77ansWBYbhIUW5zoGPqAfCOgljJMo1C38jEuxXU; sid_guard=e57a8c80525e8c0ed19010416cada4b5%7C1624868205%7C5184000%7CFri%2C+27-Aug-2021+08%3A16%3A45+GMT; uid_tt=77d00870f7e450b238e44daad9c2ce4b; uid_tt_ss=77d00870f7e450b238e44daad9c2ce4b; sid_tt=e57a8c80525e8c0ed19010416cada4b5; sessionid=e57a8c80525e8c0ed19010416cada4b5; sessionid_ss=e57a8c80525e8c0ed19010416cada4b5; ucas_c0=CkEKBTEuMC4wEISIh4LFquHsYBjmJiC9k9DP4oyUBCiwITC39dDb7fTPB0DtiuaGBkjtvqKJBlCOvKLE77ansWBYbhIUW5zoGPqAfCOgljJMo1C38jEuxXU; PHPSESSID=4509fb9e486ea387dd36c94c3300d730; PHPSESSID_SS=4509fb9e486ea387dd36c94c3300d730; login_info=%7B%22for_im_reply%22%3A%224509fb9e486ea387dd36c94c3300d730%22%7D; __G_CREATE_VERIFY_PASS__=9050819; gftoken=ZTU3YThjODA1MnwxNjI0ODY4MjE5MTN8fDAGBgYGBgY; Hm_lpvt_b6520b076191ab4b36812da4c90f7a5e=1624868264; tt_scid=UdcHHkJ0VryryaO30UGOPrdEqaM70FrV6n5xUCKx17Y27H1b.8HjmzE2PXTyrHxL62c8; MONITOR_WEB_ID=4292110529608375; gfpart_1.0.0.2541_75650=0
request.Method = "POST";
request.ServicePoint.Expect100Continue = false;
string body = @"{}";
byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(body);
request.ContentLength = postBytes.Length;
Stream stream = request.GetRequestStream();
stream.Write(postBytes, 0, postBytes.Length);
stream.Close();
response = (HttpWebResponse)request.GetResponse();
}
@@ -687,7 +679,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (this.Visible == true)
{
this.pbLoading.Visible = true;
RefreshDataGridView();
RefreshDataGridView(true);
}
}
@@ -726,21 +718,30 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
return;
string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
string loginName = dgvShop.Rows[e.RowIndex].Cells["colLoginName"].Value.ParseToString();
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == loginName);
string accountId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
switch (headerText)
{
case "检测":
//CheckShopLoginAsync(new string[] { loginName });
case "进入店铺":
IsOperate = true;
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
IsOperate = false;
}
break;
case "复制Cookies":
//SUB_PASS_ID=eyJ0IjoiRHBPWTBvVGxKWlZCZ1FmNVpPNGFwUjczdDZzUGk5bWVzbHZGejBUYlFkK3c4VjN4ZUIyV1RtZ24ybCtwWkhyNSIsInYiOjEsInMiOjEwMDAwLCJ1IjoyNDg3NDUxOTIxNzE0fQ==
string cook = shop.Cookies;
cook = BaseRegex.GetStringCookie(ref cook, "SUB_PASS_ID");
cook = "SUB_PASS_ID=" + cook;
Clipboard.SetDataObject(cook);
BaseMsgForm.ShowInfo("复制成功");
break;
case "删除":
if (BaseMsgForm.ShowConfirm("确定删除店铺吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
return;
@@ -802,7 +803,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
foreach(var row in dgvRows)
dgvShop.Rows.Remove(row);
GlobalConfig.DouShopLoginList.RemoveAll(v => v.LoginName == shopLoginName);
GlobalConfig.ShopLoginList.RemoveAll(v => v.LoginName == shopLoginName);
}
private void btnCheck_Click(object sender, EventArgs e)
@@ -816,7 +817,11 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
return;
}
CheckShopLoginAsync(shopNameList.ToArray());
Task.Run(() =>
{
CheckShopListLogin(shopNameList.Distinct().ToArray());
RefreshDataGridView(false);
});
}
}
@@ -847,12 +852,13 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
return;
}
shopLoginNameList = shopLoginNameList.Distinct().ToList();
foreach (var loginName in shopLoginNameList)
{
if (ShopListForm.IsOperate == false)
break;
var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == loginName);
var shopInfo = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName);
if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) && !string.IsNullOrEmpty(shopInfo.Password))
{
ShopLoginForm shopLoginForm = new ShopLoginForm(shopInfo);
@@ -899,8 +905,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
return;
}
UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => shopNameList.Contains(s.ShopAccount)).ToList());
CheckShopLoginAsync(shopNameList.ToArray());
UpdateShopTokens(GlobalConfig.ShopLoginList.Where(s => shopNameList.Contains(s.ShopAccount)).ToList());
Task.Run(() =>
{
CheckShopListLogin(shopNameList.ToArray());
RefreshDataGridView(false);
});
}
}
}
@@ -147,6 +147,9 @@
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colGotoShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopOperate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+5 -5
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class ShopLoginForm
{
@@ -36,12 +36,12 @@
this.btnDel = new DevComponents.DotNetBar.PanelEx();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnCopyPassword = new LittleRabbit.UserControls.ButtonEx();
this.btnCopyUserName = new LittleRabbit.UserControls.ButtonEx();
this.btnCopyPassword = new TemuKJD.UserControls.ButtonEx();
this.btnCopyUserName = new TemuKJD.UserControls.ButtonEx();
this.txtPassWord = new System.Windows.Forms.TextBox();
this.txtUserName = new System.Windows.Forms.TextBox();
this.btnStop = new LittleRabbit.UserControls.ButtonEx();
this.btnReload = new LittleRabbit.UserControls.ButtonEx();
this.btnStop = new TemuKJD.UserControls.ButtonEx();
this.btnReload = new TemuKJD.UserControls.ButtonEx();
this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
+61 -81
View File
@@ -3,9 +3,9 @@ using AllBase.Helper;
using AllBase.Model.Result;
using CefSharp;
using CefSharp.WinForms;
using LittleRabbit.DashBoardForms;
using LittleRabbit.Helper;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.DashBoardForms;
using TemuKJD.Helper;
using TemuKJD.KJDForms.BaseForms;
using Microsoft.Win32;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
@@ -25,7 +25,7 @@ using System.Windows.Forms;
using Work;
using Work.BLL.Tools;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public enum EnumOpenType
{
@@ -61,8 +61,8 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (openType == EnumOpenType.login)
{
this.shop.ShopAccountId = "";
this.shop.ShopAccount = "";
//this.shop.ShopId = "";
//this.shop.ShopAccount = "";
}
if (isMultiLogin && shop != null)
@@ -113,92 +113,72 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
if (!lstShopCompany.Any(c => c.LoginName == shop.LoginName))
continue;
string cookies = "";
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null));
if (cookieList != null && cookieList.Count > 0)
{
string cookies = "";
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null));
if (cookieList != null && cookieList.Count > 0)
foreach (var cookie in cookieList)
{
foreach (var cookie in cookieList)
{
//if (cookies.Contains(cookie.Name + "=" + cookie.Value))
// continue;
cookies += cookie.Name + "=" + cookie.Value + "; ";
}
cookies = cookies.Trim().TrimEnd(';');
//if (cookies.Contains(cookie.Name + "=" + cookie.Value))
// continue;
cookies += cookie.Name + "=" + cookie.Value + "; ";
}
cookies = cookies.Trim().TrimEnd(';');
}
if (!string.IsNullOrEmpty(cookies)
&& lstShopCompany.Any(c => c.LoginName == shop.LoginName))
if (!string.IsNullOrEmpty(cookies)
&& lstShopCompany.Any(c => c.LoginName == shop.LoginName))
{
shop.Cookies = cookies;
var lstShopCompanyCopy = lstShopCompany.ToList();
lstShopCompanyCopy = lstShopCompanyCopy.Where(l => l.LoginName == shop.LoginName).ToList();
foreach (ShopCompany sc in lstShopCompanyCopy)
{
var lstShopCompanyCopy = lstShopCompany.ToList();
//var shopCompany = lstShopCompany.FirstOrDefault(c=>c.LoginName==shop.LoginName);
//if (shopCompany == null)
// shopCompany = new ShopCompany();
//shop.LoginStatus = "登录成功";
//shop.ShopAccountId = shopCompany.AccountId;
//shop.ShopAccount = shopCompany.AccountName;
//shop.Cookies = cookies;
//shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
//var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.ShopAccountId == shop.ShopAccountId);
//if (shopInfo != null)
//{
// shopInfo.Cookies = shop.Cookies;
// shopInfo.Password = shop.Password;
// shopInfo.ShopAccountId = shop.ShopAccountId;
// shopInfo.ShopAccount = shop.ShopAccount;
//}
//else
// GlobalConfig.DouShopLoginList.Add(shop);
//StartUp.SaveLocalShopLoginInfo();
////ShopListForm.AddServerDouShop(shop); // 店铺写入到服务端
//ShopListForm.UpdateServerShopCookies(shop, shop.Cookies); // cookie写入到服务端
foreach (ShopCompany sc in lstShopCompanyCopy)
DouShopLoginInfo newShop = new DouShopLoginInfo()
{
DouShopLoginInfo newShop = new DouShopLoginInfo()
{
LoginName = shop.LoginName,
Password = shop.Password,
Group = shop.Group,
LoginStatus = "登录成功",
ShopAccount = sc.AccountName,
ShopAccountId = sc.AccountId,
Cookies = cookies,
};
LoginName = shop.LoginName,
Password = shop.Password,
Group = shop.Group,
ShopAccount = sc.AccountName,
ShopId = sc.AccountId,
};
var oldShop = GlobalConfig.DouShopLoginList.FirstOrDefault(l =>
l.LoginName == newShop.LoginName && l.ShopAccountId == newShop.ShopAccountId);
if (oldShop == null)
{
GlobalConfig.DouShopLoginList.Add(newShop);
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
}
else
{
oldShop.LoginName = shop.LoginName;
oldShop.Password = shop.Password;
oldShop.Group = shop.Group;
oldShop.LoginStatus = "登录成功";
oldShop.ShopAccount = sc.AccountName;
oldShop.ShopAccountId = sc.AccountId;
oldShop.Cookies = cookies;
}
StartUp.SaveLocalShopLoginInfo();
ShopListForm.UpdateServerShopCookies(newShop, newShop.Cookies);
}
OnSaveComplete(shop);
if (this.Created && this.chkCloseAfterLogin.Checked)
var oldShop = GlobalConfig.ShopLoginList.FirstOrDefault(l =>
l.LoginName == newShop.LoginName && l.ShopId == newShop.ShopId);
if (oldShop == null)
{
Invoke(new Action(() => { this.Close(); }));
newShop.LoginStatus = "登录成功";
newShop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
GlobalConfig.ShopLoginList.Add(newShop);
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
}
else
break;
{
oldShop.LoginStatus = "登录成功";
oldShop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
oldShop.LoginName = newShop.LoginName;
oldShop.Password = newShop.Password;
oldShop.Group = newShop.Group;
oldShop.ShopAccount = newShop.ShopAccount;
oldShop.ShopId = newShop.ShopId;
}
}
var lstShop = GlobalConfig.ShopLoginList.Where(l => l.LoginName == shop.LoginName).ToList();
foreach(var s in lstShop)
{
s.Cookies = shop.Cookies;
}
StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地
ShopListForm.UpdateServerShopCookies(shop, shop.Cookies); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
OnSaveComplete(shop);
if (this.Created && this.chkCloseAfterLogin.Checked)
{
Invoke(new Action(() => { this.Close(); }));
}
else
break;
}
}
}
+5 -5
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class SubAccountListForm
{
@@ -49,10 +49,10 @@
this.label39 = new System.Windows.Forms.Label();
this.nametextBox = new System.Windows.Forms.TextBox();
this.label40 = new System.Windows.Forms.Label();
this.btnRefresh = new LittleRabbit.UserControls.ButtonEx();
this.btnCancel = new LittleRabbit.UserControls.ButtonEx();
this.btnOpUser = new LittleRabbit.UserControls.ButtonEx();
this.dgvUser = new LittleRabbit.UserComponent.DataGridViewEx();
this.btnRefresh = new TemuKJD.UserControls.ButtonEx();
this.btnCancel = new TemuKJD.UserControls.ButtonEx();
this.btnOpUser = new TemuKJD.UserControls.ButtonEx();
this.dgvUser = new TemuKJD.UserComponent.DataGridViewEx();
this.UserIdColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.UserNameColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.mobileColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -1,6 +1,6 @@
using AllBase;
using AllBase.Model.Result;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.KJDForms.BaseForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class SubAccountListForm : Form
{
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class SubAccountShopEditForm
{
@@ -34,10 +34,10 @@
this.flpShopSubAccount = new System.Windows.Forms.FlowLayoutPanel();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnAdd = new LittleRabbit.UserControls.ButtonEx();
this.btnRemove = new LittleRabbit.UserControls.ButtonEx();
this.btnAdd = new TemuKJD.UserControls.ButtonEx();
this.btnRemove = new TemuKJD.UserControls.ButtonEx();
this.flpNotSubAccount = new System.Windows.Forms.FlowLayoutPanel();
this.btnOk = new LittleRabbit.UserControls.ButtonEx();
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.panel1 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
@@ -1,6 +1,6 @@
using AllBase;
using AllBase.Model.Result;
using LittleRabbit.LittleRabbitForms.BaseForms;
using TemuKJD.KJDForms.BaseForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class SubAccountShopEditForm : LRBaseForm
{
@@ -137,7 +137,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
shop.ShopSubAccountList.Remove(co.subAccount);
string url = BaseClass.BuildObjString("shop&act=delete_shop_user_sub_group");
string data = UserLogin.GetSignaturex()
+ "&shop_id=" + shop.ShopAccountId
+ "&shop_id=" + shop.ShopId
+ "&sub_user_id=" + co.subAccount.sub_user_id
+ "&status=" + co.subAccount.status
+ "&group_id=" + co.subAccount.group_id;
@@ -156,7 +156,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
shop.ShopSubAccountList.Add(co.subAccount);
string url = BaseClass.BuildObjString("shop&act=update_shop_user_sub_group");
string data = UserLogin.GetSignaturex()
+ "&shop_id=" + shop.ShopAccountId
+ "&shop_id=" + shop.ShopId
+ "&sub_user_id=" + co.subAccount.sub_user_id
+ "&status=" + co.subAccount.status
+ "&group_id=" + co.subAccount.group_id;
+1 -1
View File
@@ -1,4 +1,4 @@
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
partial class UcSubAccount
{
+1 -1
View File
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using AllBase.Model.Result;
namespace LittleRabbit.LittleRabbitForms.ShopForms
namespace TemuKJD.KJDForms.ShopForms
{
public partial class UcSubAccount : UserControl
{