pxx上货功能 temu备货管理可以查询商品售后率并根据售后率处理备货

This commit is contained in:
wule committed 2025-09-19 09:31:34 +08:00
1 parent f4fedf1e2f
commit 0e6a034d5f
34 files changed
+3568 -893

No files matched your search

@@ -82,8 +82,8 @@
this.splitContainer1.Panel2.Controls.Add(this.btnStop);
this.splitContainer1.Panel2.Controls.Add(this.btnReload);
this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin);
this.splitContainer1.Size = new System.Drawing.Size(1438, 736);
this.splitContainer1.SplitterDistance = 676;
this.splitContainer1.Size = new System.Drawing.Size(1438, 755);
this.splitContainer1.SplitterDistance = 694;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -322,7 +322,7 @@
this.splitContainer2.BackColor = System.Drawing.Color.White;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(1, 33);
this.splitContainer2.Location = new System.Drawing.Point(1, 14);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@@ -333,7 +333,7 @@
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer2.Size = new System.Drawing.Size(1438, 766);
this.splitContainer2.Size = new System.Drawing.Size(1438, 785);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 5;
//
@@ -32,6 +32,7 @@ namespace TemuKJD.PDDForms.AdminForms
{
public partial class PDDAdminShopLoginForm : LRBaseForm
{
public static PDDAdminShopLoginForm adminShopLoginInstance { get; set; } = null;
public int CloseAfterSecond { get; set; }
public EnumOpenType openType = EnumOpenType.manage;
public bool isMultiLogin = false;
@@ -49,6 +50,12 @@ namespace TemuKJD.PDDForms.AdminForms
public PDDAdminShopLoginForm(ShopLoginInfo shopInfo)
{
if (adminShopLoginInstance != null && !adminShopLoginInstance.IsDisposed)
{
adminShopLoginInstance.Dispose();
}
adminShopLoginInstance = this;
InitializeComponent();
this.shop = shopInfo;
@@ -59,6 +66,8 @@ namespace TemuKJD.PDDForms.AdminForms
private void ShopLoginForm_Load(object sender, EventArgs e)
{
//this.splitContainer1.SplitterDistance = 674;
this.splitContainer1.SplitterDistance = this.splitContainer1.Height - 62;
if (BaseClass.SaLevel == 1)
this.btnReturnPackage.Visible = true;
else
@@ -767,6 +776,13 @@ namespace TemuKJD.PDDForms.AdminForms
private void ShopLoginForm_FormClosed(object sender, FormClosedEventArgs e)
{
//OnSaveComplete(shop);
Task.Run(() => {
Thread.Sleep(500);
if (!this.IsDisposed)
{
MainForm.instance.Invoke(new Action(() => { this.Dispose(); }));
}
});
}
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -195,6 +195,9 @@
<metadata name="ColDelete.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colAddTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOpResult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+223
View File
@@ -0,0 +1,223 @@
namespace TemuKJD.PDDForms.ProductSelectForms
{
partial class UcAddPrice
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.txtPriceStart = new System.Windows.Forms.TextBox();
this.lblPrice = new System.Windows.Forms.Label();
this.txtPriceEnd = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.txtAddTimes = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.txtAddMorePrice = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtSinglePriceAdd = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.lblClose = new System.Windows.Forms.Label();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.Controls.Add(this.txtPriceStart);
this.flowLayoutPanel1.Controls.Add(this.lblPrice);
this.flowLayoutPanel1.Controls.Add(this.txtPriceEnd);
this.flowLayoutPanel1.Controls.Add(this.label9);
this.flowLayoutPanel1.Controls.Add(this.txtAddTimes);
this.flowLayoutPanel1.Controls.Add(this.label10);
this.flowLayoutPanel1.Controls.Add(this.txtAddMorePrice);
this.flowLayoutPanel1.Controls.Add(this.label11);
this.flowLayoutPanel1.Controls.Add(this.txtSinglePriceAdd);
this.flowLayoutPanel1.Controls.Add(this.label1);
this.flowLayoutPanel1.Controls.Add(this.lblClose);
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(336, 18);
this.flowLayoutPanel1.TabIndex = 0;
//
// txtPriceStart
//
this.txtPriceStart.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.txtPriceStart.Location = new System.Drawing.Point(0, 0);
this.txtPriceStart.Margin = new System.Windows.Forms.Padding(0);
this.txtPriceStart.Name = "txtPriceStart";
this.txtPriceStart.Size = new System.Drawing.Size(38, 23);
this.txtPriceStart.TabIndex = 551;
this.txtPriceStart.Text = "0.0";
this.txtPriceStart.TextChanged += new System.EventHandler(this.Price_TextChanged);
//
// lblPrice
//
this.lblPrice.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPrice.AutoSize = true;
this.lblPrice.Location = new System.Drawing.Point(38, 3);
this.lblPrice.Margin = new System.Windows.Forms.Padding(0);
this.lblPrice.Name = "lblPrice";
this.lblPrice.Size = new System.Drawing.Size(58, 17);
this.lblPrice.TabIndex = 550;
this.lblPrice.Text = "< 价格 ≤";
//
// txtPriceEnd
//
this.txtPriceEnd.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.txtPriceEnd.Location = new System.Drawing.Point(96, 0);
this.txtPriceEnd.Margin = new System.Windows.Forms.Padding(0);
this.txtPriceEnd.Name = "txtPriceEnd";
this.txtPriceEnd.Size = new System.Drawing.Size(38, 23);
this.txtPriceEnd.TabIndex = 549;
this.txtPriceEnd.Text = "999.0";
this.txtPriceEnd.TextChanged += new System.EventHandler(this.Price_TextChanged);
//
// label9
//
this.label9.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(134, 3);
this.label9.Margin = new System.Windows.Forms.Padding(0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(44, 17);
this.label9.TabIndex = 545;
this.label9.Text = ",加价";
//
// txtAddTimes
//
this.txtAddTimes.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.txtAddTimes.Location = new System.Drawing.Point(178, 0);
this.txtAddTimes.Margin = new System.Windows.Forms.Padding(0);
this.txtAddTimes.Name = "txtAddTimes";
this.txtAddTimes.Size = new System.Drawing.Size(31, 23);
this.txtAddTimes.TabIndex = 544;
this.txtAddTimes.Text = "2.0";
this.txtAddTimes.TextChanged += new System.EventHandler(this.Price_TextChanged);
//
// label10
//
this.label10.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(209, 3);
this.label10.Margin = new System.Windows.Forms.Padding(0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(44, 17);
this.label10.TabIndex = 546;
this.label10.Text = "倍再加";
//
// txtAddMorePrice
//
this.txtAddMorePrice.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.txtAddMorePrice.Location = new System.Drawing.Point(253, 0);
this.txtAddMorePrice.Margin = new System.Windows.Forms.Padding(0);
this.txtAddMorePrice.Name = "txtAddMorePrice";
this.txtAddMorePrice.Size = new System.Drawing.Size(31, 23);
this.txtAddMorePrice.TabIndex = 547;
this.txtAddMorePrice.Text = "5.0";
this.txtAddMorePrice.TextChanged += new System.EventHandler(this.Price_TextChanged);
//
// label11
//
this.label11.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(0, 26);
this.label11.Margin = new System.Windows.Forms.Padding(0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(68, 17);
this.label11.TabIndex = 548;
this.label11.Text = "元,单买加";
//
// txtSinglePriceAdd
//
this.txtSinglePriceAdd.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.txtSinglePriceAdd.Location = new System.Drawing.Point(68, 23);
this.txtSinglePriceAdd.Margin = new System.Windows.Forms.Padding(0);
this.txtSinglePriceAdd.Name = "txtSinglePriceAdd";
this.txtSinglePriceAdd.Size = new System.Drawing.Size(31, 23);
this.txtSinglePriceAdd.TabIndex = 553;
this.txtSinglePriceAdd.Text = "1.0";
this.txtSinglePriceAdd.TextChanged += new System.EventHandler(this.Price_TextChanged);
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(99, 26);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(20, 17);
this.label1.TabIndex = 554;
this.label1.Text = "元";
//
// lblClose
//
this.lblClose.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblClose.AutoSize = true;
this.lblClose.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblClose.ForeColor = System.Drawing.SystemColors.HotTrack;
this.lblClose.Location = new System.Drawing.Point(119, 26);
this.lblClose.Margin = new System.Windows.Forms.Padding(0);
this.lblClose.Name = "lblClose";
this.lblClose.Size = new System.Drawing.Size(17, 17);
this.lblClose.TabIndex = 552;
this.lblClose.Text = "×";
this.lblClose.Click += new System.EventHandler(this.lblClose_Click);
//
// UcAddPrice
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoSize = true;
this.Controls.Add(this.flowLayoutPanel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.MinimumSize = new System.Drawing.Size(0, 20);
this.Name = "UcAddPrice";
this.Size = new System.Drawing.Size(336, 18);
this.Load += new System.EventHandler(this.UcAddPrice_Load);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.TextBox txtPriceEnd;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox txtAddMorePrice;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox txtAddTimes;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label lblPrice;
private System.Windows.Forms.TextBox txtPriceStart;
public System.Windows.Forms.Label lblClose;
private System.Windows.Forms.TextBox txtSinglePriceAdd;
private System.Windows.Forms.Label label1;
}
}
@@ -0,0 +1,202 @@
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TemuKJD.PDDForms.ProductSelectForms
{
public partial class UcAddPrice : UserControl
{
/// <summary>
/// 额外加价
/// </summary>
[Description("显示最小值"), Category("UserProperty")]
public bool isShowMin
{
get
{
return this.txtPriceStart.Visible;
}
set
{
if (this.txtPriceStart.Visible != value)
{
this.txtPriceStart.Visible = value;
if (value == false)
{
this.lblPrice.Text = "价格 ≤";
isShowMax = true;
}
else
this.lblPrice.Text = "< 价格 ≤";
this.Invalidate();
}
}
}
/// <summary>
/// 额外加价
/// </summary>
[Description("显示最大值"), Category("UserProperty")]
public bool isShowMax
{
get
{
return this.txtPriceEnd.Visible;
}
set
{
if (this.txtPriceEnd.Visible != value)
{
this.txtPriceEnd.Visible = value;
if (value == false)
{
isShowMin = true;
this.lblPrice.Text = "< 价格";
}
else
this.lblPrice.Text = "< 价格 ≤";
this.Invalidate();
}
}
}
/// <summary>
/// 开始价格
/// </summary>
[Description("开始价格"), Category("UserProperty")]
public decimal PriceStart
{
get
{
return this.txtPriceStart.Text.Trim().ParseToDecimal();
}
set
{
if (this.txtPriceStart.Text.Trim().ParseToDecimal() != value)
{
this.txtPriceStart.Text = value.ToString();
this.Invalidate();
}
}
}
/// <summary>
/// 结束价格
/// </summary>
[Description("结束价格"), Category("UserProperty")]
public decimal PriceEnd
{
get
{
return this.txtPriceEnd.Text.Trim().ParseToDecimal();
}
set
{
if (this.txtPriceEnd.Text.Trim().ParseToDecimal() != value)
{
this.txtPriceEnd.Text = value.ToString();
this.Invalidate();
}
}
}
/// <summary>
/// 加价倍数
/// </summary>
[Description("加价倍数"), Category("UserProperty")]
public decimal PriceAddTimes
{
get
{
return this.txtAddTimes.Text.Trim().ParseToDecimal();
}
set
{
if (this.txtAddTimes.Text.Trim().ParseToDecimal() != value)
{
this.txtAddTimes.Text = value.ToString();
this.Invalidate();
}
}
}
/// <summary>
/// 额外加价
/// </summary>
[Description("额外加价"), Category("UserProperty")]
public decimal PriceAddMore
{
get
{
return this.txtAddMorePrice.Text.Trim().ParseToDecimal();
}
set
{
if (this.txtAddMorePrice.Text.Trim().ParseToDecimal() != value)
{
this.txtAddMorePrice.Text = value.ToString();
this.Invalidate();
}
}
}
/// <summary>
/// 额外加价
/// </summary>
[Description("单买加价"), Category("UserProperty")]
public decimal SinglePriceAdd
{
get
{
return Math.Max(1, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal());
}
set
{
if (this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() != value)
{
if (value < 1)
value = 1;
this.txtSinglePriceAdd.Text = value.ToString();
this.Invalidate();
}
}
}
public UcAddPrice()
{
InitializeComponent();
}
private void UcAddPrice_Load(object sender, EventArgs e)
{
OnPriceChange(this);
}
private void lblClose_Click(object sender, EventArgs e)
{
this.Dispose();
OnPriceChange(this);
}
private void Price_TextChanged(object sender, EventArgs e)
{
OnPriceChange(this);
}
#region 价格发生改变事件
public event Action<object> PriceChange;
protected virtual void OnPriceChange(object param)
{
this.PriceChange?.Invoke(param);
}
#endregion
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -32,7 +32,8 @@ namespace TemuKJD.PDDForms.ShopForms
BaseMsgForm.ShowError("商品Id不存在!");
return "failed";
}
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
//var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
var shop = PDDAdminShopListForm.lstAdminShopInfo.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
if (string.IsNullOrEmpty(supplierId) || shop == null)
{
BaseMsgForm.ShowError("店铺不存在!");
@@ -77,7 +78,48 @@ namespace TemuKJD.PDDForms.ShopForms
return;
}
}
catch (Exception ex) { }
catch (Exception ex)
{
OnInfoReceived("商品获取失败!商品数据格式获取失败!" + ex.Message);
return;
}
var size_json = "{}";
if (product.size_spec_id.ParseToLong() != 0)
{
try
{
var prod_size_rst = GetPddProdSizeSpec(sourceShop, sourceProdId.ToString(), commitId, product.size_spec_id.ParseToString());
prod_size_rst = GetHtml.Unicode2String(prod_size_rst);
JObject prod_size_obj = JObject.Parse(prod_size_rst);
size_json = JsonHelper.SerializeObject(prod_size_obj["result"]);
var size = JsonHelper.DeserializeJsonToObject<PDDSizeSpecInfo>(size_json);
if (size == null)
{
OnInfoReceived("尺码表获取失败!尺码数据格式获取失败!");
return;
}
}
catch (Exception ex)
{
OnInfoReceived("尺码表获取失败!尺码数据格式获取失败!" + ex.Message);
return;
}
}
//temu尺码表暂时注释
//if (product.sizeTemplateId > 0)
//{
// html = SizeSpecQuery(shop1, prodId1.ToString(), product.sizeTemplateId.ToString());
// if(!html.Contains("\"success\":true"))
// {
// success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg");
// }
// else
// {
// obj = JObject.Parse(html);
// sizeRst = JsonHelper.SerializeObject(obj["result"]);
// }
//}
var property_json = "{}";
PDDProductPropertyInfo property = null;
@@ -142,22 +184,6 @@ namespace TemuKJD.PDDForms.ShopForms
// return;
//}
var sizeRst = "";
//尺码表暂时注释
//if (product.sizeTemplateId > 0)
//{
// html = SizeSpecQuery(shop1, prodId1.ToString(), product.sizeTemplateId.ToString());
// if(!html.Contains("\"success\":true"))
// {
// success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg");
// }
// else
// {
// obj = JObject.Parse(html);
// sizeRst = JsonHelper.SerializeObject(obj["result"]);
// }
//}
bool isExist = false;
var existUrl = BaseClass.BuildObjString("product/get_product_list");
string existData = UserLogin.GetSignaturex() + "&search_spu=" + product.goods_id;
@@ -172,7 +198,8 @@ namespace TemuKJD.PDDForms.ShopForms
isExist = true;
}
string product_json = "{\"detail\":" + detail_json + ",\"decoration\":" + decoration_json + ",\"property\":" + property_json + "}";
string product_json = "{\"detail\":" + detail_json + ",\"size\":" + size_json + ",\"decoration\":" + decoration_json + ",\"property\":" + property_json + "}";
string main_img = product.image_url;
if (string.IsNullOrEmpty(main_img))
main_img = product.hd_thumb_url;
@@ -200,12 +227,15 @@ namespace TemuKJD.PDDForms.ShopForms
"&from_shop_id=" + shop.ShopId +
"&spu_id=" + product.goods_id.ParseToString() +
"&skc_id=" + product.goods_id.ParseToString() +
"&price_text=" + product.sku.Min(s => s.multi_price).ParseToInt() * 0.01m + "-" + product.sku.Max(s => s.multi_price).ParseToInt() * 0.01m +
"&main_cat_id=" + (product.cat_ids?.FirstOrDefault(c => c != null)).ParseToString() +
"&main_cat_name=" + HttpUtility.UrlEncode((product.cats?.FirstOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&cat_id=" + (product.cat_id).ParseToString() +
"&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
"&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(size_json, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
html = GetHtml.PostUtf8(url, data);
@@ -496,6 +526,29 @@ namespace TemuKJD.PDDForms.ShopForms
}
return result;
}
private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/cabernet/mms/sizespec/query/draft";
//string body = @"{""goods_id"":" + prodId + "}";
string body = @"{""id"":" + sizeSpecId + @"}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string GetPddProdProperty(ShopLoginInfo shop, string prodId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
+23 -22
View File
@@ -30,6 +30,7 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PDDShopLoginForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnReturnPackage = new TemuKJD.UserControls.ButtonEx();
this.btnLoginAgain = new TemuKJD.UserControls.ButtonEx();
this.pnlMultiLogin = new System.Windows.Forms.Panel();
this.cmbMultiCookieName = new DevComponents.DotNetBar.Controls.ComboBoxEx();
@@ -46,7 +47,6 @@
this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.btnReturnPackage = new TemuKJD.UserControls.ButtonEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@@ -82,11 +82,29 @@
this.splitContainer1.Panel2.Controls.Add(this.btnStop);
this.splitContainer1.Panel2.Controls.Add(this.btnReload);
this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin);
this.splitContainer1.Size = new System.Drawing.Size(1438, 736);
this.splitContainer1.SplitterDistance = 675;
this.splitContainer1.Size = new System.Drawing.Size(1438, 755);
this.splitContainer1.SplitterDistance = 690;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
// btnReturnPackage
//
this.btnReturnPackage.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnReturnPackage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnReturnPackage.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnReturnPackage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReturnPackage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReturnPackage.ForeColor = System.Drawing.Color.White;
this.btnReturnPackage.Location = new System.Drawing.Point(674, 30);
this.btnReturnPackage.Margin = new System.Windows.Forms.Padding(2);
this.btnReturnPackage.Name = "btnReturnPackage";
this.btnReturnPackage.Size = new System.Drawing.Size(136, 25);
this.btnReturnPackage.TabIndex = 464;
this.btnReturnPackage.Text = "提交退货到库存管理";
this.btnReturnPackage.UseVisualStyleBackColor = false;
this.btnReturnPackage.Visible = false;
this.btnReturnPackage.Click += new System.EventHandler(this.btnReturnPackage_Click);
//
// btnLoginAgain
//
this.btnLoginAgain.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -304,7 +322,7 @@
this.splitContainer2.BackColor = System.Drawing.Color.White;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(1, 33);
this.splitContainer2.Location = new System.Drawing.Point(1, 14);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@@ -315,7 +333,7 @@
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
this.splitContainer2.Size = new System.Drawing.Size(1438, 766);
this.splitContainer2.Size = new System.Drawing.Size(1438, 785);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 5;
//
@@ -330,23 +348,6 @@
this.txtAddress.TabIndex = 7;
this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown);
//
// btnReturnPackage
//
this.btnReturnPackage.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnReturnPackage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnReturnPackage.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnReturnPackage.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnReturnPackage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnReturnPackage.ForeColor = System.Drawing.Color.White;
this.btnReturnPackage.Location = new System.Drawing.Point(674, 30);
this.btnReturnPackage.Margin = new System.Windows.Forms.Padding(2);
this.btnReturnPackage.Name = "btnReturnPackage";
this.btnReturnPackage.Size = new System.Drawing.Size(136, 25);
this.btnReturnPackage.TabIndex = 464;
this.btnReturnPackage.Text = "提交退货到库存管理";
this.btnReturnPackage.UseVisualStyleBackColor = false;
this.btnReturnPackage.Visible = false;
//
// PDDShopLoginForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+14 -1
View File
@@ -68,7 +68,7 @@ namespace TemuKJD.PDDForms.ShopForms
private void ShopLoginForm_Load(object sender, EventArgs e)
{
//this.splitContainer1.SplitterDistance = 674;
this.splitContainer1.SplitterDistance = this.splitContainer1.Height - 62;
if (isMultiLogin && shop != null)
{
@@ -906,6 +906,13 @@ function fireKeyEvent(el, evtType, keyCode) {
private void ShopLoginForm_FormClosed(object sender, FormClosedEventArgs e)
{
//OnSaveComplete(shop);
Task.Run(() => {
Thread.Sleep(500);
if (!this.IsDisposed)
{
MainForm.instance.Invoke(new Action(() => { this.Dispose(); }));
}
});
}
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
@@ -1007,5 +1014,11 @@ function getElementWithText(sText)
InputUserNameAndPassword(cefWebBrowser, shop.LoginName, DataOpenSSL.DecryptString(shop.Password));
});
}
private void btnReturnPackage_Click(object sender, EventArgs e)
{
//ReturnPackageDetailForm form = new ReturnPackageDetailForm(this.shop);
//form.ShowDialog();
}
}
}