淘宝买手拍单30%
This commit is contained in:
1 parent
080fc7e4c4
commit
f27ddca730
13 files changed
+378
-184
No files matched your search
@@ -33,8 +33,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
/// </summary>
|
||||
public partial class PDDBuyerSelectCtrl : UserControl
|
||||
{
|
||||
public static string buyPlatform { get; set; } = "pdd";
|
||||
|
||||
public PDDBuyerSelectCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -175,19 +173,31 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
wpPddBuyer.Visibility = Visibility.Collapsed;
|
||||
wpTaobaoBuyer.Visibility = Visibility.Visible;
|
||||
buyPlatform = "tb";
|
||||
foreach (var order in GlobalConfig.lstFilterOrder)
|
||||
OrderListCtrl.InitOrderObservableProp(order);
|
||||
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
GlobalConfig.CurrentBuyPlatform = "tb";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wpPddBuyer.Visibility = Visibility.Visible;
|
||||
wpTaobaoBuyer.Visibility = Visibility.Collapsed;
|
||||
buyPlatform = "pdd";
|
||||
foreach (var order in GlobalConfig.lstFilterOrder)
|
||||
OrderListCtrl.InitOrderObservableProp(order);
|
||||
GlobalConfig.CurrentBuyPlatform = "pdd";
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
//OrderListCtrl.InitOrderObservableProp(order);
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.UpdateOrderItemBuyButton();
|
||||
orderItem.SetAbnormalAndDirectBtnVisibility();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="taobaoBuyOrderCtrl"
|
||||
Width="1280"
|
||||
Height="800"
|
||||
Width="1360"
|
||||
Height="768"
|
||||
MinWidth="800"
|
||||
MinHeight="600"
|
||||
Loaded="taobaoBuyOrderCtrl_Loaded"
|
||||
@@ -41,7 +41,8 @@
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="600" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="300" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 浏览器容器 -->
|
||||
@@ -50,6 +51,15 @@
|
||||
Grid.Column="0"
|
||||
Background="White"
|
||||
ClipToBounds="True" />
|
||||
<GridSplitter
|
||||
Grid.Column="1"
|
||||
Width="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#d0d0d0"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True" />
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase.Model.DBModel;
|
||||
using CefSharp.Wpf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -21,18 +24,42 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
public partial class TaobaoBuyOrderCtrl : UserControl
|
||||
{
|
||||
|
||||
public TaobaoBuyOrderCtrl()
|
||||
/// <summary>视图模型</summary>
|
||||
public TaobaoBuyOrderViewModel ViewModel { get; }
|
||||
|
||||
public TaobaoBuyOrderCtrl(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = new TaobaoBuyOrderViewModel(buyerInfo, orderItemInfo);
|
||||
ViewModel.BrowserCreated += ViewModel_BrowserCreated;
|
||||
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
|
||||
private void taobaoBuyOrderCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
private async void taobaoBuyOrderCtrl_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await ViewModel.Start();
|
||||
}
|
||||
private void ViewModel_BrowserCreated(ChromiumWebBrowser browser)
|
||||
{
|
||||
Grid.SetRow(browser, 0);
|
||||
Grid.SetColumn(browser, 0);
|
||||
BrowserHost.Children.Add(browser);
|
||||
}
|
||||
|
||||
}
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
parentWindow.Close();
|
||||
}
|
||||
|
||||
private void txtAddress_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
ViewModel.ReloadCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
public ChromiumWebBrowser CefWebBrowser { get; private set; }
|
||||
private BuyerLoginInfo buyer = null;
|
||||
private oms_wei_order_item_info orderItem = null;
|
||||
private string currentUrl = "";
|
||||
private volatile bool _isWindowLoaded = false;
|
||||
|
||||
@@ -88,13 +89,14 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
|
||||
#endregion
|
||||
|
||||
public TaobaoBuyOrderViewModel(BuyerLoginInfo buyerInfo)
|
||||
public TaobaoBuyOrderViewModel(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo)
|
||||
{
|
||||
TaobaoBuyOrderInstance = this;
|
||||
|
||||
buyer = buyerInfo;
|
||||
UserName = buyerInfo?.buyer_name;
|
||||
PassWord = ""; //DataOpenSSL.DecryptString(buyerInfo.Password);
|
||||
orderItem = orderItemInfo;
|
||||
|
||||
ReloadCommand = new DelegateCommand(Reload);
|
||||
LoginAgainCommand = new DelegateCommand(LoginAgain);
|
||||
@@ -106,7 +108,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
/// <summary>
|
||||
/// 窗口加载完成时调用
|
||||
/// </summary>
|
||||
public void Start()
|
||||
public async Task Start()
|
||||
{
|
||||
_isWindowLoaded = true;
|
||||
|
||||
@@ -124,11 +126,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
Task.Run(() =>
|
||||
{
|
||||
AutoLogin();
|
||||
});
|
||||
}
|
||||
await AutoLogin();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,10 +141,11 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
/// <summary>
|
||||
/// 自动登录店铺后台
|
||||
/// </summary>
|
||||
private async void AutoLogin()
|
||||
private async Task AutoLogin()
|
||||
{
|
||||
if (buyer == null)
|
||||
return;
|
||||
|
||||
_ = Application.Current.Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
if (CefWebBrowser == null)
|
||||
@@ -184,9 +184,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// cef138必须init后方可设置或删除cookie
|
||||
|
||||
while (!CefWebBrowser.IsBrowserInitialized || !CefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
await Task.Delay(20);
|
||||
WPFCEFBrowser.DeleteCookie(CefWebBrowser.GetCookieManager(null));
|
||||
@@ -213,6 +211,66 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
CefWebBrowser.Load(InitUrl);
|
||||
else
|
||||
CefWebBrowser.Load(MainUrl);
|
||||
|
||||
await Task.Run(async() =>
|
||||
{
|
||||
while (Address.IsNullOrEmpty())
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
if (Address.StartsWith("https://s.taobao.com/search?"))
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
|
||||
string jsRst = "failed";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("(function() {\r\n");
|
||||
sb.Append(" var searchBtn = document.getElementsByClassName('image-search-icon-outerMode')[0];\r\n");
|
||||
sb.Append(" if (searchBtn)\r\n");
|
||||
sb.Append(" searchBtn.click();\r\n");
|
||||
sb.Append(" else\r\n");
|
||||
sb.Append(" return 'failed';\r\n");
|
||||
sb.Append("})();");
|
||||
var jsStr = sb.ToString();
|
||||
var client = CefWebBrowser.GetDevToolsClient();
|
||||
var host = CefWebBrowser.GetBrowserHost();
|
||||
if (client == null || host == null)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < 10 && jsRst == "failed"; i++)
|
||||
{
|
||||
var r = await client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
jsRst = r.Result.Value.ParseToString();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
var image = ImageBuild.LoadBitmipImageFromUrl(orderItem.thumb_img);
|
||||
if (image == null)
|
||||
return;
|
||||
|
||||
await Application.Current.Dispatcher.InvokeAsync(new Action(() => { Clipboard.SetImage(image); }));
|
||||
host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = 86, Type = KeyEventType.RawKeyDown, Modifiers = CefEventFlags.ControlDown });
|
||||
Thread.Sleep(Randomx.GetId(2500, 3000));
|
||||
|
||||
jsRst = "failed";
|
||||
sb = new StringBuilder();
|
||||
sb.Append("(function() {\r\n");
|
||||
sb.Append(" var searchBtn = document.getElementById('image-search-upload-button');\r\n");
|
||||
sb.Append(" if (searchBtn)\r\n");
|
||||
sb.Append(" searchBtn.click();\r\n");
|
||||
sb.Append(" else\r\n");
|
||||
sb.Append(" return 'failed';\r\n");
|
||||
sb.Append("})();");
|
||||
jsStr = sb.ToString();
|
||||
for (int i = 0; i < 10 && jsRst == "failed"; i++)
|
||||
{
|
||||
var r = await client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
jsRst = r.Result.Value.ParseToString();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -255,11 +313,25 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
{
|
||||
var _url = url;
|
||||
var _responseData = responseData;
|
||||
Task.Run(async() => {await DoResourceLoadComplete(url, responseData); });
|
||||
Task.Run(async () => { await DoResourceLoadComplete(url, responseData); });
|
||||
}
|
||||
|
||||
private async Task DoResourceLoadComplete(string url, string responseData)
|
||||
{
|
||||
//https://detail.tmall.com/item.htm?id=655638393036&sku_properties=1627207%3A42499150508
|
||||
//{"appData":null,"loaderData":{"home":{"data":{"res":{"seller":{"sellerNick":"匹克世冠专卖店","shopName":"匹克世冠专卖店","evaluates":[{"score":"4.8 ","level":"1","levelText":"高","title":"宝贝描述","type":"desc"},{"score":"4.8 ","level":"1","levelText":"高","title":"卖家服务","type":"serv"},{"score":"4.8 ","level":"1","levelText":"高","title":"物流服务","type":"post"}],"startsIcon":"https://img.alicdn.com/imgextra/i4/O1CN018GrFIW1Zx7vwjt3Jg_!!6000000003260-2-tps-91-14.png","pcShopUrl":"//shop67269976.taobao.com","creditLevelIcon":"//gw.alicdn.com/imgextra/i1/O1CN01VD9Iap25oweneR31D_!!6000000007574-2-tps-120-60.png","sellerType":"B","encryptUid":"RAzN8HWKpmWFSf9AkzVpz3nhAYRZrPS63pSiDPMWyvui5ixfJBs"},"item":{"images":["https://img.alicdn.com/imgextra/i4/717513321/O1CN01cvzkE61aP4Tjeupfh_!!4611686018427380329-0-item_pic.jpg","https://img.alicdn.com/imgextra/i3/717513321/O1CN01W9mF4N1aP4OAc3Mtt_!!4611686018427380329-0-item_pic.jpg","https://img.alicdn.com/imgextra/i1/717513321/O1CN01a72PTr1aP4S55SiRs_!!4611686018427380329-0-item_pic.jpg"],"title":"匹克态极拖鞋男情侣款夏季外穿潮鞋篮球运动防滑太极沙滩凉拖鞋女","itemId":"655638393036","useWirelessDesc":"true","qrCode":"https://h5.m.taobao.com/awp/core/detail.htm?id=655638393036","spuId":"2122802472","titleIcon":"//img.alicdn.com/tfs/TB1SMG7nnvI8KJjSspjXXcgjXXa-78-36.png?getAvatar=avatar"},"feature":{"pcResistDetail":"true","tmwOverseasScene":"false","pcIdentityRisk":"true"},"plusViewVO":{"askAnswerVO":{"ext":{"skeletonImg":"https://img.alicdn.com/imgextra/i2/O1CN01MLPxBr1flZy969k5W_!!6000000004047-2-tps-1376-1216.png"},"hit":"true"},"addCartActionVO":{"ext":{"type":"dialogWithRecommond_2","frequency":"day:1;repeat:1"},"hit":"true"},"guessLikeVO":{"hit":"true"},"wangwangFlowSplitVO":{"hit":"true"},"rankVO":{"hit":"true"},"tabPlaceholderVO":{"hit":"true"},"imageSearchVO":{"ext":{"textList":["商品已经下架啦~要不要瞧瞧别的~","该区域暂不支持购买","此商品不支持在当前地区销售","商品已经卖光啦~","当前商品仅限店铺会员购买","商品已经卖光啦,非常抱歉","店铺正在打烊中,当前商品不可下单","商品已经卖光啦~","当前库存已售完","该商品有卖家设置的购买门槛,须达门槛才可购买噢~","此商品暂时不能购买"]},"spm":"aliabtest1115297_1138353","hit":"true"},"reportEntranceVO":{"spm":"aliabtest1097211_1051854","hit":"true"},"headAtmosphereBeltVO":{"valid":"false","hit":"true"},"commentListVO":{"ext":{"countShow":"\"false\""},"hit":"true"},"pcFrontSkuQuantityLimitVO":{"hit":"true"},"buyParamVO":{"ext":{"autoApplCoupSource":"pcDetailOrder","needAutoApplCoup":"true"},"hit":"true"}},"skuCore":{"skuItem":{"renderSku":"true","itemStatus":0,"unitBuy":1},"sku2info":{"0":{"moreQuantity":"true","quantity":200,"logisticsTime":"平均9小时发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"157","priceDesc":"起","priceMoney":"15700"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmdD1Plv0m1WF"}},"5359436967823":{"moreQuantity":"false","quantity":12,"logisticsTime":"48小时内发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"157","priceMoney":"15700"},"cartParam":{"addCartCheck":"true"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmdD1Plv0m1WF"}},"5769423993152":{"moreQuantity":"false","quantity":19,"logisticsTime":"48小时内发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"157","priceMoney":"15700"},"cartParam":{"addCartCheck":"true"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmdD1Plv0m1WF"}},"5359436967808":{"moreQuantity":"false","quantity":46,"logisticsTime":"48小时内发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"157","priceMoney":"15700"},"cartParam":{"addCartCheck":"true"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmdD1Plv0m1WF"}},"5359436967810":{"moreQuantity":"false","quantity":95,"logisticsTime":"48小时内发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"157","priceMoney":"15700"},"cartParam":{"addCartCheck":"true"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmdD1Plv0m1WF"}},"5132110197053":{"moreQuantity":"false","quantity":18,"logisticsTime":"平均9小时发货","price":{"priceTitle":"优惠前","priceColorNew":"#FFFFFF","priceText":"169","priceMoney":"16900"},"cartParam":{"addCartCheck":"true"},"quantityDisplayValue":1,"quantityText":"有货","buyExParams":{"mi_id":"0000m5cdA3X8kO8PXBJ3r8ji8d6gjumNVDVBkp9kKySsEPW3KKjUvUifmLine truncated
|
||||
if (url.Contains("https://detail.tmall.com/item.htm?id=") || responseData.Contains("42499150508"))
|
||||
{
|
||||
responseData = responseData.Replace("\0", "");
|
||||
var loaderDatas = BaseRegex.GetJsonObjStrJson(ref responseData, "loaderData");
|
||||
var sku2info = BaseRegex.GetOneJsonObjStrJson(ref responseData, "sku2info");
|
||||
|
||||
if (loaderDatas.Count > 0)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//if (responseData.Contains("karl_malone_32") || responseData.Contains("jtt_fan"))
|
||||
//{
|
||||
// //https://h5api.m.taobao.com/h5/mtop.user.getusersimple/1.0/?jsv=2.7.2&appKey=12574478&t=1789984970076&sign=6bb7d3b5cd8bd3ab32bd97c1a0df1c0f&jsonpIncPrefix=tbnavnew&api=mtop.user.getUserSimple&v=1.0&dataType=json&type=originaljson&data=%7B%7D
|
||||
|
||||
@@ -348,15 +348,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品
|
||||
//if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d)))
|
||||
{
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
|
||||
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
if (item.PddBuyMap == null)
|
||||
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
if (item.PddBuyMap == null)
|
||||
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
|
||||
if (item.PddBuyMap == null)
|
||||
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
|
||||
}
|
||||
item.BuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time).ToList();
|
||||
item.PddBuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time).ToList();
|
||||
|
||||
// 中转仓订单
|
||||
if (item.ItemOrder.orderItems.Count > 1)
|
||||
@@ -1658,11 +1658,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
if (!order.IsWaitBuy)
|
||||
return true;
|
||||
if (chkMapSku.IsChecked == true && order.orderItems.Any(oi => oi.BuyMap == null))
|
||||
if (chkMapSku.IsChecked == true && order.orderItems.Any(oi => oi.PddBuyMap == null))
|
||||
return true;
|
||||
if (chkMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0 || oi.BuyMap != null))
|
||||
if (chkMapProd.IsChecked == true && order.orderItems.All(oi => oi.PddBuyMapSkus == null || oi.PddBuyMapSkus.Count == 0 || oi.PddBuyMap != null))
|
||||
return true;
|
||||
if (chkNoMapProd.IsChecked == true && (order.orderItems.All(oi => oi.BuyMap != null) || order.orderItems.All(oi => oi.BuyMapSkus != null && oi.BuyMapSkus.Count > 0)))
|
||||
if (chkNoMapProd.IsChecked == true && (order.orderItems.All(oi => oi.PddBuyMap != null) || order.orderItems.All(oi => oi.PddBuyMapSkus != null && oi.PddBuyMapSkus.Count > 0)))
|
||||
return true;
|
||||
}
|
||||
if (filterHeadStr.StartsWith("待发货"))
|
||||
@@ -2939,7 +2939,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private async void btnAutoBuy_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var buyOrders = GlobalConfig.lstFilterOrder.Where(o => o.IsWaitBuy && o.orderItems?.Count == 1 && o.orderItems.FirstOrDefault()?.BuyMap != null && o.IsSelect == true).ToList();
|
||||
var buyOrders = GlobalConfig.lstFilterOrder.Where(o => o.IsWaitBuy && o.orderItems?.Count == 1 && o.orderItems.FirstOrDefault()?.PddBuyMap != null && o.IsSelect == true).ToList();
|
||||
if (buyOrders.Count == 0)
|
||||
{
|
||||
BaseMsgWindow.ShowError("未勾选符合条件的订单!");
|
||||
|
||||
@@ -510,72 +510,84 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
//BaseMsgWindow.ShowAnimateMessage("触发成功!" + DateTime.Now.ParseToString(), "Msg", 5);
|
||||
//return;
|
||||
|
||||
// 打开拍单窗口
|
||||
MainWindow.Instance.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
||||
orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
|
||||
buyOrderForm.IsAutoBuy = isAutoBuy;
|
||||
|
||||
buyOrderForm.TitleText = "买手拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
|
||||
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html"; //"?type=0&comment_tab=1&combine_orders=1&main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.BuyMap != null)
|
||||
{
|
||||
//buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
// "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + +orderItem.sku_cnt +
|
||||
// "&page_from=101&detail_id=" + Randomx.GetNumber(11) + "&_oak_rcto=YW" +
|
||||
// Randomx.GetWordNumber("JvLXvJ8Fx9mUIW34yn103TOlATJGk5PaZshD6pY1bsVrsIjWdxWwjCoNX3IGT".Length) + "_VWkP5_q-1QNqGg" +
|
||||
// "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
|
||||
// "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
|
||||
//buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
// "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
// "&page_from=0&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail&refer_page_id=10014_" +
|
||||
// BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
if (isAbnormalOrder)
|
||||
buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
|
||||
buyOrderForm.ShowDialog();
|
||||
OrderListCtrl.IsAutoBuy = buyOrderForm.IsAutoBuy;
|
||||
|
||||
if (buyOrderForm.IsBuySuccess)
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
if (orderItem.BuyGoodsBtnTxt == "云仓拍单" && !isAbnormalOrder) // 异常拍单不改变订单供应商
|
||||
{
|
||||
try
|
||||
{
|
||||
await SetSendOrderSupplier(orderItem, "wxfc630d60a1af6c6f", "29供货商");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError(ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
PddBuyOrder(orderItem, isAbnormalOrder, isAutoBuy);
|
||||
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||
TbBuyOrder(orderItem, isAbnormalOrder, isAutoBuy);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
public static void TbBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
|
||||
{
|
||||
TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
|
||||
taobaoBuyView.ViewModel.InitUrl = "https://s.taobao.com/search?";
|
||||
new DialogWindow()
|
||||
{
|
||||
Title = "淘宝买手登录",
|
||||
Content = taobaoBuyView,
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
public static void PddBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
|
||||
{
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, GlobalConfig.CurrentPddBuyer, orderItem.PddBuyMap);
|
||||
buyOrderForm.IsAutoBuy = isAutoBuy;
|
||||
buyOrderForm.TitleText = "买手拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/orders.html"; //"?type=0&comment_tab=1&combine_orders=1&main_orders=1&refer_page_name=personal&refer_page_id=10001_1782219035613_a9ulipk4k3&refer_page_sn=10001";
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
//buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
// "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + +orderItem.sku_cnt +
|
||||
// "&page_from=101&detail_id=" + Randomx.GetNumber(11) + "&_oak_rcto=YW" +
|
||||
// Randomx.GetWordNumber("JvLXvJ8Fx9mUIW34yn103TOlATJGk5PaZshD6pY1bsVrsIjWdxWwjCoNX3IGT".Length) + "_VWkP5_q-1QNqGg" +
|
||||
// "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
|
||||
// "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.PddBuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.PddBuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
|
||||
//buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
// "&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
// "&page_from=0&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail&refer_page_id=10014_" +
|
||||
// BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_" + Randomx.GetWordNumber(10) + "&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
if (isAbnormalOrder)
|
||||
buyOrderForm.AbnormalTransitWarehouseOrderInfo = orderItem.ItemTransitOrder;
|
||||
buyOrderForm.ShowDialog();
|
||||
OrderListCtrl.IsAutoBuy = buyOrderForm.IsAutoBuy;
|
||||
|
||||
if (buyOrderForm.IsBuySuccess)
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
if (orderItem.BuyGoodsBtnTxt == "云仓拍单" && !isAbnormalOrder) // 异常拍单不改变订单供应商
|
||||
{
|
||||
try
|
||||
{
|
||||
await SetSendOrderSupplier(orderItem, "wxfc630d60a1af6c6f", "29供货商");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError(ex.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -785,7 +797,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
||||
orderItem, buyer, orderItem.BuyMap);
|
||||
orderItem, buyer, orderItem.PddBuyMap);
|
||||
buyOrderForm.TitleText = "订单查看 - 当前买手 " + buyer.buyer_nick;
|
||||
|
||||
//所有订单页面
|
||||
@@ -793,7 +805,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
//已有拍单关联的控制界面显示隐藏
|
||||
if (orderItem.BuyMap != null)
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
@@ -845,7 +857,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
|
||||
//PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance, orderItem, buyer, orderItem.BuyMap);
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.BuyMap);
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(null, null, orderItem, buyer, orderItem.PddBuyMap);
|
||||
buyOrderForm.BuyType = "direct";
|
||||
buyOrderForm.TitleText = "直发订单查看 - 当前买手 " + buyer.buyer_nick;
|
||||
|
||||
@@ -854,7 +866,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
buyOrderForm.pnlBuy.Visible = false;
|
||||
|
||||
//已有拍单关联的控制界面显示隐藏
|
||||
if (orderItem.BuyMap != null)
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
@@ -1404,7 +1416,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, StartUp.UpdateBalance,
|
||||
orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
|
||||
orderItem, GlobalConfig.CurrentPddBuyer, orderItem.PddBuyMap);
|
||||
|
||||
buyOrderForm.TitleText = "买手直发拍单 - 当前买手 " + GlobalConfig.CurrentPddBuyer.buyer_nick;
|
||||
buyOrderForm.BuyType = "direct";
|
||||
@@ -1419,11 +1431,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
if (orderItem.BuyMap != null)
|
||||
if (orderItem.PddBuyMap != null)
|
||||
{
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.PddBuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.PddBuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
|
||||
@@ -76,9 +76,9 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
||||
this.ShopSkuName = orderItem.sku_attr_str;
|
||||
this.ShopSkuPrice = (orderItem.real_price * 0.01m).ParseToString();
|
||||
}
|
||||
if (orderItem?.BuyMapSkus != null && orderItem?.BuyMapSkus.Count > 0)
|
||||
if (orderItem?.PddBuyMapSkus != null && orderItem?.PddBuyMapSkus.Count > 0)
|
||||
{
|
||||
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.BuyMapSkus);
|
||||
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.PddBuyMapSkus);
|
||||
SetCurrentFrontSkuInfo3(BuyMapSkus?.FirstOrDefault());
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
||||
|
||||
public async Task SetOrderMapSku(frontSkuInfo3 upSku)
|
||||
{
|
||||
var mapSkuProd = OrderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
||||
var mapSkuProd = OrderItem.PddBuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
@@ -219,7 +219,7 @@ public class BuyMapSkuViewModel : PropertyNotifyObject
|
||||
(item.product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
||||
(item.product_id == map.spu_code && item.sku_attr_str == map.sku_code))
|
||||
{
|
||||
item.BuyMap = map;
|
||||
item.PddBuyMap = map;
|
||||
|
||||
item.SetOrderItemTextProperty();
|
||||
// todo 此处刷新一条可能不够
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:wpf="WPFCommon"
|
||||
x:Name="baiduGetWaybillInfoView"
|
||||
Width="1280"
|
||||
Height="800"
|
||||
Width="1200"
|
||||
Height="600"
|
||||
MinWidth="800"
|
||||
MinHeight="600"
|
||||
comn:DialogWindowProperty.ResizeMode="CanResizeWithGrip"
|
||||
comn:DialogWindowProperty.ShowMinButton="False"
|
||||
comn:DialogWindowProperty.Width="1300"
|
||||
comn:DialogWindowProperty.Width="1200"
|
||||
Loaded="BaiduGetWaybillInfoView_Loaded"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
@@ -22,13 +22,13 @@
|
||||
</UserControl.Resources>
|
||||
<Grid Background="White">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Height="80" VerticalAlignment="Center">
|
||||
|
||||
<Grid Height="420" VerticalAlignment="Center">
|
||||
<Image
|
||||
x:Name="imgLoading"
|
||||
Width="20"
|
||||
@@ -60,13 +60,23 @@
|
||||
<TextBlock
|
||||
Margin="50,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="18"
|
||||
Text="{Binding LatestWaybillStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
|
||||
<GridSplitter
|
||||
Grid.Row="1"
|
||||
Height="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="#d0d0d0"
|
||||
ResizeBehavior="PreviousAndNext"
|
||||
ShowsPreview="True" />
|
||||
|
||||
<!-- 地址栏 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Row="2"
|
||||
Background="White"
|
||||
BorderBrush="#E0E0E0"
|
||||
BorderThickness="0,0,0,1">
|
||||
@@ -81,7 +91,7 @@
|
||||
</Border>
|
||||
|
||||
<!-- 主区域:浏览器 + 右侧面板 -->
|
||||
<Grid Grid.Row="2">
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
@@ -31,9 +31,15 @@ namespace _29WxOrderWpf.Views
|
||||
private void TaobaoLoginView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ViewModel.Start();
|
||||
|
||||
Window parentWindow = Window.GetWindow(this);
|
||||
if (this.IsLoaded && parentWindow != null)
|
||||
{
|
||||
parentWindow.Closed += TaobaoLoginView_ParentWindow_Closed;
|
||||
}
|
||||
}
|
||||
|
||||
private void TaobaoLoginView_Closed(object sender, System.EventArgs e)
|
||||
private void TaobaoLoginView_ParentWindow_Closed(object sender, System.EventArgs e)
|
||||
{
|
||||
ViewModel.Stop();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ namespace AllBase.Helper
|
||||
/// </summary>
|
||||
public static BuyerLoginInfo CurrentTaobaoBuyer { get; set; }
|
||||
/// <summary>
|
||||
/// 当前买手采购平台
|
||||
/// </summary>
|
||||
public static string CurrentBuyPlatform { get; set; } = "pdd";
|
||||
/// <summary>
|
||||
/// 支付宝密码
|
||||
/// </summary>
|
||||
//public static string AlipayPassword { get; set; }
|
||||
|
||||
@@ -87,5 +87,6 @@ namespace AllBase.Model.DBModel
|
||||
public string transit_warehouse_id { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
public string source_platform { get; set; } = "pdd";
|
||||
}
|
||||
}
|
||||
@@ -33,30 +33,46 @@ namespace AllBase.Model.DBModel
|
||||
/// <summary>
|
||||
/// 采购关联
|
||||
/// </summary>
|
||||
public WXBuyMapInfo BuyMap
|
||||
public WXBuyMapInfo PddBuyMap
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyMap); }
|
||||
set { this.SetValue(x => x.BuyMap, value); }
|
||||
}
|
||||
get { return this.GetValue(x => x.PddBuyMap); }
|
||||
set { this.SetValue(x => x.PddBuyMap, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 淘宝采购关联
|
||||
/// </summary>
|
||||
public WXBuyMapInfo TbBuyMap
|
||||
{
|
||||
get { return this.GetValue(x => x.TbBuyMap); }
|
||||
set { this.SetValue(x => x.TbBuyMap, value); }
|
||||
}
|
||||
public Visibility MapSkusBtnVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.MapSkusBtnVisibility); }
|
||||
set { this.SetValue(x => x.MapSkusBtnVisibility, value); }
|
||||
}
|
||||
public List<WXBuyMapSkusInfo> BuyMapSkus
|
||||
public List<WXBuyMapSkusInfo> PddBuyMapSkus
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyMapSkus); }
|
||||
get { return this.GetValue(x => x.PddBuyMapSkus); }
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.BuyMapSkus, value);
|
||||
if (value != null && value.Count > 0) MapSkusBtnVisibility = Visibility.Visible;
|
||||
else MapSkusBtnVisibility = Visibility.Collapsed;
|
||||
this.SetValue(x => x.PddBuyMapSkus, value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 采购按钮文字
|
||||
/// </summary>
|
||||
public string BuyGoodsBtnTxt
|
||||
|
||||
public List<WXBuyMapSkusInfo> TbBuyMapSkus
|
||||
{
|
||||
get { return this.GetValue(x => x.TbBuyMapSkus); }
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.TbBuyMapSkus, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采购按钮文字
|
||||
/// </summary>
|
||||
public string BuyGoodsBtnTxt
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyGoodsBtnTxt); }
|
||||
set { this.SetValue(x => x.BuyGoodsBtnTxt, value); }
|
||||
@@ -1508,49 +1524,74 @@ namespace AllBase.Model.DBModel
|
||||
var order_item = this;
|
||||
order_item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.shop_id.ParseToString());
|
||||
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
if (order_item.BuyMap == null)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnTxt = "关联拍单";
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush100;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||||
}
|
||||
else if (GlobalConfig.lstDangerItemWord.Any(d => order_item.title.Contains(d)))
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "危险品不支持中转拍单";
|
||||
}
|
||||
else if (Shop == null || (Shop?.LoginStatus != "登录成功" /*&& Shop?.Is29Supplier == null*/))
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "请登录店铺";
|
||||
}
|
||||
else if (Shop?.LoginStatus == "登录成功" && Shop?.Is29Supplier == null)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.OrangeBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.OrangeBrush;
|
||||
order_item.BuyGoodsBtnTxt = "代发状态读取中请稍候";
|
||||
}
|
||||
else if (Shop?.Is29Supplier == false)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "去店铺后台绑定代发";
|
||||
}
|
||||
else
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnTxt = "云仓拍单";
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush35;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||||
}
|
||||
// 关联商品sku
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||||
{
|
||||
if (PddBuyMapSkus != null && PddBuyMapSkus.Count > 0)
|
||||
MapSkusBtnVisibility = Visibility.Visible;
|
||||
else
|
||||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||||
}
|
||||
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||||
{
|
||||
if (TbBuyMapSkus != null && TbBuyMapSkus.Count > 0)
|
||||
MapSkusBtnVisibility = Visibility.Visible;
|
||||
else
|
||||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||||
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
if (GlobalConfig.CurrentBuyPlatform == "pdd" && order_item.PddBuyMap == null)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnTxt = "关联拍单";
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush100;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||||
}
|
||||
else if (GlobalConfig.CurrentBuyPlatform == "tb" && order_item.TbBuyMap == null)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnTxt = "关联拍单";
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush100;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||||
}
|
||||
else if (GlobalConfig.lstDangerItemWord.Any(d => order_item.title.Contains(d)))
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "危险品不支持中转拍单";
|
||||
}
|
||||
else if (Shop == null || (Shop?.LoginStatus != "登录成功" /*&& Shop?.Is29Supplier == null*/))
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "请登录店铺";
|
||||
}
|
||||
else if (Shop?.LoginStatus == "登录成功" && Shop?.Is29Supplier == null)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = false;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.OrangeBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.OrangeBrush;
|
||||
order_item.BuyGoodsBtnTxt = "代发状态读取中请稍候";
|
||||
}
|
||||
else if (Shop?.Is29Supplier == false)
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||||
order_item.BuyGoodsBtnTxt = "去店铺后台绑定代发";
|
||||
}
|
||||
else
|
||||
{
|
||||
order_item.IsBuyGoodsBtnEnabled = true;
|
||||
order_item.BuyGoodsBtnTxt = "云仓拍单";
|
||||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush35;
|
||||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,12 +199,12 @@ namespace TemuKJD.ToolForms
|
||||
txtBuyTransitWarehouse.Text = orderItem.ItemOrder.AddressStr;
|
||||
}
|
||||
}
|
||||
else if (orderItem.BuyMapSkus != null && orderItem.BuyMapSkus.Count > 0 && AbnormalTransitWarehouseOrderInfo == null) // 不能是异常重拍
|
||||
else if (orderItem.PddBuyMapSkus != null && orderItem.PddBuyMapSkus.Count > 0 && AbnormalTransitWarehouseOrderInfo == null) // 不能是异常重拍
|
||||
{
|
||||
//panel2.Visible = true;
|
||||
cmbMapSkusProd.Items.Clear();
|
||||
cmbMapSkusProd.Items.Add("");
|
||||
foreach (var mapSku in orderItem.BuyMapSkus)
|
||||
foreach (var mapSku in orderItem.PddBuyMapSkus)
|
||||
{
|
||||
cmbMapSkusProd.Items.Add(mapSku.map_goods_name + mapSku.map_goods_id);
|
||||
}
|
||||
@@ -1113,7 +1113,8 @@ namespace TemuKJD.ToolForms
|
||||
{
|
||||
if (item.out_product_id == upSpuCode || item.product_id == upSpuCode)
|
||||
{
|
||||
item.BuyMapSkus = buyMapSkuList;
|
||||
item.PddBuyMapSkus = buyMapSkuList.Where(s => s.source_platform == "pdd").ToList();
|
||||
item.PddBuyMapSkus = buyMapSkuList.Where(s => s.source_platform == "pdd").ToList();
|
||||
|
||||
//if (filterOrderAction != null)
|
||||
//{
|
||||
@@ -1179,7 +1180,7 @@ namespace TemuKJD.ToolForms
|
||||
(item.product_id == pddBuyMap.spu_code && item.out_sku_id == pddBuyMap.sku_code) ||
|
||||
(item.product_id == pddBuyMap.spu_code && item.sku_attr_str == pddBuyMap.sku_code))
|
||||
{
|
||||
item.BuyMap = pddBuyMap;
|
||||
item.PddBuyMap = pddBuyMap;
|
||||
|
||||
if (filterOrderAction != null)
|
||||
{
|
||||
@@ -1710,7 +1711,7 @@ namespace TemuKJD.ToolForms
|
||||
if (!string.IsNullOrEmpty(cmbMapSkusProd.Text))
|
||||
{
|
||||
cmbMapSkus.Items.Add("");
|
||||
var mapSku = orderItem.BuyMapSkus.FirstOrDefault(m => m.map_goods_name + m.map_goods_id == cmbMapSkusProd.Text);
|
||||
var mapSku = orderItem.PddBuyMapSkus.FirstOrDefault(m => m.map_goods_name + m.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSku != null)
|
||||
{
|
||||
foreach(var pddsku in mapSku.pdd_front_goods3_Lite.skus)
|
||||
@@ -1729,7 +1730,7 @@ namespace TemuKJD.ToolForms
|
||||
this.pictureBox2.Image = null;
|
||||
this.pictureBox2.Tag = null;
|
||||
|
||||
var mapSkuProd = orderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
var mapSkuProd = orderItem.PddBuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
@@ -1752,7 +1753,7 @@ namespace TemuKJD.ToolForms
|
||||
{
|
||||
if (this.IsFormLoad)
|
||||
{
|
||||
var mapSkuProd = orderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
var mapSkuProd = orderItem.PddBuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user