From c993e00f1530fa46e0b3dbfc822cb4e932013ac3 Mon Sep 17 00:00:00 2001 From: wule Date: Mon, 5 Oct 2026 07:37:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=98=E5=AE=9D=E6=8B=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BuyerCtrls/TaobaoBuyOrderViewModel.cs | 138 +++++++++++++++++- .../Styles/StaticColorBrushDictionary.xaml | 68 ++++----- .../UserControls/UcWaterMarkTextBox.xaml | 56 ++++--- 29WxOrderWpf/UserControls/UcWindowBoxes.xaml | 110 +++++++++----- 4 files changed, 283 insertions(+), 89 deletions(-) diff --git a/29WxOrderWpf/Ctrls/BuyerCtrls/TaobaoBuyOrderViewModel.cs b/29WxOrderWpf/Ctrls/BuyerCtrls/TaobaoBuyOrderViewModel.cs index aed39a7..93a24f0 100644 --- a/29WxOrderWpf/Ctrls/BuyerCtrls/TaobaoBuyOrderViewModel.cs +++ b/29WxOrderWpf/Ctrls/BuyerCtrls/TaobaoBuyOrderViewModel.cs @@ -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); } } + /// 拍单商品Id + public string txtBuyGoodsIdVal + { + get { return this.GetValue(x => x.txtBuyGoodsIdVal); } + set { this.SetValue(x => x.txtBuyGoodsIdVal, value); } + } + /// 拍单商品Sku + public string txtBuySkuIdVal + { + get { return this.GetValue(x => x.txtBuySkuIdVal); } + set { this.SetValue(x => x.txtBuySkuIdVal, value); } + } + /// 拍单商品名称 + public string txtBuyGoodsNameVal + { + get { return this.GetValue(x => x.txtBuyGoodsNameVal); } + set { this.SetValue(x => x.txtBuyGoodsNameVal, value); } + } + /// 拍单Sku名称 + public string txtBuySkuNameVal + { + get { return this.GetValue(x => x.txtBuySkuNameVal); } + set { this.SetValue(x => x.txtBuySkuNameVal, value); } + } + /// 拍单数量 + public string txtBuyCntVal + { + get { return this.GetValue(x => x.txtBuyCntVal); } + set { this.SetValue(x => x.txtBuyCntVal, value); } + } + /// 拍单总价格 + public string txtBuyPriceVal + { + get { return this.GetValue(x => x.txtBuyPriceVal); } + set { this.SetValue(x => x.txtBuyPriceVal, value); } + } + + /// 关联商品名称 + public string txtMapGoodsNameVal + { + get { return this.GetValue(x => x.txtMapGoodsNameVal); } + set { this.SetValue(x => x.txtMapGoodsNameVal, value); } + } + /// 关联规格名称 + 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); } + } + /// 发货地 + public string txtSendProvinceVal + { + get { return this.GetValue(x => x.txtSendProvinceVal); } + set { this.SetValue(x => x.txtSendProvinceVal, value); } + } + /// 中转仓 + 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(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() { } diff --git a/29WxOrderWpf/Styles/StaticColorBrushDictionary.xaml b/29WxOrderWpf/Styles/StaticColorBrushDictionary.xaml index 20af15a..69205cb 100644 --- a/29WxOrderWpf/Styles/StaticColorBrushDictionary.xaml +++ b/29WxOrderWpf/Styles/StaticColorBrushDictionary.xaml @@ -1,41 +1,41 @@  - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + \ No newline at end of file diff --git a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml index a4d9aff..f00dcb7 100644 --- a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml +++ b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml @@ -1,21 +1,37 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/29WxOrderWpf/UserControls/UcWindowBoxes.xaml b/29WxOrderWpf/UserControls/UcWindowBoxes.xaml index 7076337..f096691 100644 --- a/29WxOrderWpf/UserControls/UcWindowBoxes.xaml +++ b/29WxOrderWpf/UserControls/UcWindowBoxes.xaml @@ -1,55 +1,99 @@ - - - - - - - - + + + + + + + + - - - - - - + + + + + - - - - +