1代理改名字 2代理管理功能 3订单流水统计功能(方便报税) 4 商品预售界面-商品改价支持加减乘除四种模式

This commit is contained in:
wule committed 2026-07-18 18:29:06 +08:00
1 parent 457a8acee6
commit ba502650ab
69 files changed
+27720 -720

No files matched your search

@@ -1753,7 +1753,16 @@ namespace TemuKJD.WXForms.ProductForms
return;
}
var downProdRst = changePrice(shop, prodId, skuPricesStr, (newPrice * 100).ParseToInt());
var ChangePriceType = "固定价格";
Invoke(new Action(() =>
{
ChangePriceType = cmbChangePriceType.Text.Trim();
// 提前保存防止修改时出错/闪退导致保存失败。
dicProductBasePrice[prodId] = skuPricesStr;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_product_base_price", dicProductBasePrice);
}));
var downProdRst = changePrice(shop, prodId, skuPricesStr, (newPrice * 100).ParseToInt(), false, ChangePriceType);
Thread.Sleep(Randomx.GetId(200, 500));
if (!downProdRst.Contains("\"code\":0"))
{
@@ -1783,10 +1792,46 @@ namespace TemuKJD.WXForms.ProductForms
{
Invoke(new Action(() =>
{
dicProductBasePrice[prodId] = skuPricesStr;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_product_base_price", dicProductBasePrice);
row.Cells["colOpResult"].Value = "修改价格成功";
row.Cells["colPrice"].Value = newPrice;
if (ChangePriceType == "原价×")
{
var priceArr = JArray.Parse(skuPricesStr);
var oldLowPrice = priceArr.Min(p => p["price"].ParseToInt());
var oldHighPrice = priceArr.Max(p => p["price"].ParseToInt());
var lowPrice = (oldLowPrice * newPrice).ParseToInt() * 0.01m;
var highPrice = (oldHighPrice * newPrice).ParseToInt() * 0.01m;
row.Cells["colPrice"].Value = "" + lowPrice + " - " + highPrice;
}
else if (ChangePriceType == "原价÷")
{
var priceArr = JArray.Parse(skuPricesStr);
var oldLowPrice = priceArr.Min(p => p["price"].ParseToInt());
var oldHighPrice = priceArr.Max(p => p["price"].ParseToInt());
var lowPrice = (oldLowPrice / newPrice).ParseToInt() * 0.01m;
var highPrice = (oldHighPrice / newPrice).ParseToInt() * 0.01m;
row.Cells["colPrice"].Value = "" + lowPrice + " - " + highPrice;
}
else if (ChangePriceType == "原价+")
{
var priceArr = JArray.Parse(skuPricesStr);
var oldLowPrice = priceArr.Min(p => p["price"].ParseToInt());
var oldHighPrice = priceArr.Max(p => p["price"].ParseToInt());
var lowPrice = (oldLowPrice + (newPrice * 100).ParseToInt()) * 0.01m;
var highPrice = (oldHighPrice + (newPrice * 100).ParseToInt()) * 0.01m;
row.Cells["colPrice"].Value = "" + lowPrice + " - " + highPrice;
}
else if (ChangePriceType == "原价−")
{
var priceArr = JArray.Parse(skuPricesStr);
var oldLowPrice = priceArr.Min(p => p["price"].ParseToInt());
var oldHighPrice = priceArr.Max(p => p["price"].ParseToInt());
var lowPrice = (oldLowPrice - (newPrice * 100).ParseToInt()) * 0.01m;
var highPrice = (oldHighPrice - (newPrice * 100).ParseToInt()) * 0.01m;
row.Cells["colPrice"].Value = "" + lowPrice + " - " + highPrice;
}
else
row.Cells["colPrice"].Value = newPrice;
}));
}
});
@@ -1814,7 +1859,7 @@ namespace TemuKJD.WXForms.ProductForms
/// <param name="newPrice">新价格 单位分</param>
/// <param name="isRestore">是否是还原价格</param>
/// <returns></returns>
private string changePrice(ShopLoginInfo shop, string spuId, string skuPrices, int newPrice, bool isRestore = false)
private string changePrice(ShopLoginInfo shop, string spuId, string skuPrices, int newPrice, bool isRestore = false, string newPriceType = "固定价格")
{
try
{
@@ -1829,7 +1874,18 @@ namespace TemuKJD.WXForms.ProductForms
if (isRestore)
obj["salePrice"] = sku["price"].ParseToInt();
else
obj["salePrice"] = newPrice;
{
if (newPriceType == "原价×")
obj["salePrice"] = sku["price"].ParseToInt() * newPrice / 100;
else if (newPriceType == "原价÷")
obj["salePrice"] = sku["price"].ParseToInt() * 100 / newPrice;
else if (newPriceType == "原价+")
obj["salePrice"] = sku["price"].ParseToInt() + newPrice;
else if (newPriceType == "原价−")
obj["salePrice"] = sku["price"].ParseToInt() - newPrice;
else
obj["salePrice"] = newPrice;
}
skuArr.Add(obj);
}
changePriceObj["skuList"] = skuArr;