淘宝拍单
This commit is contained in:
1 parent
37cb8e86ae
commit
c993e00f15
4 files changed
+283
-89
No files matched your search
@@ -26,6 +26,7 @@ using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.CefTools;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
using static WPFCommon.Interop.InteropValues;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
@@ -53,6 +54,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
public ChromiumWebBrowser CefWebBrowser { get; private set; }
|
||||
private BuyerLoginInfo buyer = null;
|
||||
private oms_wei_order_item_info orderItem = null;
|
||||
WXBuyMapSkusInfo buymapSkuInfo = null;
|
||||
WXBuyMapInfo buyMapInfo = null;
|
||||
private string currentUrl = "";
|
||||
private volatile bool _isWindowLoaded = false;
|
||||
|
||||
@@ -79,6 +82,78 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
set { this.SetValue(x => x.Address, value); }
|
||||
}
|
||||
|
||||
/// <summary>拍单商品Id</summary>
|
||||
public string txtBuyGoodsIdVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuyGoodsIdVal); }
|
||||
set { this.SetValue(x => x.txtBuyGoodsIdVal, value); }
|
||||
}
|
||||
/// <summary>拍单商品Sku</summary>
|
||||
public string txtBuySkuIdVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuySkuIdVal); }
|
||||
set { this.SetValue(x => x.txtBuySkuIdVal, value); }
|
||||
}
|
||||
/// <summary>拍单商品名称</summary>
|
||||
public string txtBuyGoodsNameVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuyGoodsNameVal); }
|
||||
set { this.SetValue(x => x.txtBuyGoodsNameVal, value); }
|
||||
}
|
||||
/// <summary>拍单Sku名称</summary>
|
||||
public string txtBuySkuNameVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuySkuNameVal); }
|
||||
set { this.SetValue(x => x.txtBuySkuNameVal, value); }
|
||||
}
|
||||
/// <summary>拍单数量</summary>
|
||||
public string txtBuyCntVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuyCntVal); }
|
||||
set { this.SetValue(x => x.txtBuyCntVal, value); }
|
||||
}
|
||||
/// <summary>拍单总价格</summary>
|
||||
public string txtBuyPriceVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtBuyPriceVal); }
|
||||
set { this.SetValue(x => x.txtBuyPriceVal, value); }
|
||||
}
|
||||
|
||||
/// <summary>关联商品名称</summary>
|
||||
public string txtMapGoodsNameVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtMapGoodsNameVal); }
|
||||
set { this.SetValue(x => x.txtMapGoodsNameVal, value); }
|
||||
}
|
||||
/// <summary>关联规格名称</summary>
|
||||
public string txtMapSkuNameVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtMapSkuNameVal); }
|
||||
set { this.SetValue(x => x.txtMapSkuNameVal, value); }
|
||||
}
|
||||
public string txtMapGoodsIdVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtMapGoodsIdVal); }
|
||||
set { this.SetValue(x => x.txtMapGoodsIdVal, value); }
|
||||
}
|
||||
public string txtMapSkuIdVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtMapSkuIdVal); }
|
||||
set { this.SetValue(x => x.txtMapSkuIdVal, value); }
|
||||
}
|
||||
/// <summary> 发货地 </summary>
|
||||
public string txtSendProvinceVal
|
||||
{
|
||||
get { return this.GetValue(x => x.txtSendProvinceVal); }
|
||||
set { this.SetValue(x => x.txtSendProvinceVal, value); }
|
||||
}
|
||||
/// <summary> 中转仓 </summary>
|
||||
public string cmbTransitWarehouseVal
|
||||
{
|
||||
get { return this.GetValue(x => x.cmbTransitWarehouseVal); }
|
||||
set { this.SetValue(x => x.cmbTransitWarehouseVal, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 命令
|
||||
@@ -396,12 +471,13 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
var pddFrontSkuInfo = new frontSkuInfo3()
|
||||
{
|
||||
skuId = key.ParseToLong(),
|
||||
skuID = key.ParseToLong(),
|
||||
goodsId = pddFrontGoods3.goodsId,
|
||||
thumbUrl = thumbUrl,
|
||||
quantity = tbSku2.quantity,
|
||||
isOnsale = 1,
|
||||
spec = taobaoSku?.propPath, // 淘宝在
|
||||
spec = taobaoSku?.propPath, // 淘宝格式与拼多多存在差异,包含冒号与父类型id
|
||||
specs = pddSpecs,
|
||||
price = tbSku2.price.priceMoney.ParseToInt() + 100,
|
||||
normalPrice = ((tbSku2.price.priceMoney.ParseToInt() + 100) / 100m).ToString("F2"),
|
||||
@@ -411,7 +487,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
pddFrontGoods3.skus.Add(pddFrontSkuInfo);
|
||||
}
|
||||
|
||||
WXBuyMapSkusInfo buymapSkuInfo = new WXBuyMapSkusInfo()
|
||||
this.buymapSkuInfo = new WXBuyMapSkusInfo()
|
||||
{
|
||||
source_platform = "tb",
|
||||
map_goods_id = BaseRegex.GetStringJson(ref loaderData, "itemId"),
|
||||
@@ -419,6 +495,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
map_url = "929536442189",
|
||||
map_skus = JsonHelper.SerializeObject(pddFrontGoods3),
|
||||
};
|
||||
|
||||
if (buyMapInfo == null)
|
||||
buyMapInfo = new WXBuyMapInfo
|
||||
{
|
||||
map_spec_name = pddFrontGoods3.skus.FirstOrDefault()?.SpecNameStr,
|
||||
map_sku_id = pddFrontGoods3.skus.FirstOrDefault()?.skuID.ParseToString(),
|
||||
};
|
||||
SetBuyMapValues(buymapSkuInfo, buyMapInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,6 +513,56 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
//}
|
||||
}
|
||||
|
||||
private void SetBuyMapValues(WXBuyMapSkusInfo skuInfo, WXBuyMapInfo info)
|
||||
{
|
||||
//var data = taobaoResponseData;
|
||||
//var goodsId = BaseRegex.GetLongJson(ref data, "goodsId");
|
||||
//var skuId = BaseRegex.GetLongJson(ref data, "skuId");
|
||||
//var goodsName = BaseRegex.GetStringJson(ref data, "goodsName");
|
||||
//var spec = BaseRegex.GetStringJson(ref data, "spec");
|
||||
//var oneGoodsPrice = BaseRegex.GetIntJson(ref data, "goodsPrice");
|
||||
//var buyCnt = BaseRegex.GetIntJson(ref data, "goodsNumber");
|
||||
//var buyPrice = BaseRegex.GetIntJson(ref data, "payAmount");
|
||||
//if (buyPrice.IsNullOrZero())
|
||||
// buyPrice = BaseRegex.GetIntJson(ref data, "orderAmount");
|
||||
//var orderSn = BaseRegex.GetIntJson(ref data, "orderSn");
|
||||
|
||||
if (skuInfo == null || info == null)
|
||||
return;
|
||||
var goods = JsonHelper.DeserializeJsonToObject<pddFrontGoods3Lite>(skuInfo.map_skus);
|
||||
if (goods == null)
|
||||
return;
|
||||
var sku = goods.skus.FirstOrDefault(s => s.skuID.ParseToString() == info.map_sku_id);
|
||||
if (sku == null)
|
||||
return;
|
||||
|
||||
var goodsId = skuInfo.map_goods_id;
|
||||
var skuId = info.map_sku_id;
|
||||
var goodsName = skuInfo.map_goods_name;
|
||||
var spec = info.map_spec_name;
|
||||
var oneGoodsPrice = sku.groupPrice.ParseToInt();
|
||||
var buyCnt = orderItem.sku_cnt;
|
||||
var buyPrice = oneGoodsPrice * buyCnt;
|
||||
var orderSn = "";
|
||||
|
||||
|
||||
// 自动填写关联信息界面
|
||||
this.txtMapGoodsIdVal = goodsId.ParseToString();
|
||||
this.txtMapSkuIdVal = skuId.ParseToString();
|
||||
this.txtMapGoodsNameVal = goodsName;
|
||||
this.txtMapSkuNameVal = spec;
|
||||
this.txtSendProvinceVal = "";
|
||||
this.cmbTransitWarehouseVal = "";
|
||||
|
||||
// 自动填写拍单信息界面
|
||||
if (!goodsId.IsNullOrZero()) this.txtBuyGoodsIdVal = goodsId.ParseToString();
|
||||
if (!skuId.IsNullOrZero()) this.txtBuySkuIdVal = skuId.ParseToString();
|
||||
if (!goodsName.IsNullOrEmpty()) this.txtBuyGoodsNameVal = goodsName;
|
||||
if (!spec.IsNullOrEmpty()) this.txtBuySkuNameVal = spec;
|
||||
if (!buyCnt.IsNullOrZero()) this.txtBuyCntVal = buyCnt.ParseToString();
|
||||
if (!buyPrice.IsNullOrZero()) this.txtBuyPriceVal = (buyPrice * 0.01m).ParseToString();
|
||||
}
|
||||
|
||||
private void StopButton()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user