代理版本调试
This commit is contained in:
1 parent
dcdfa30419
commit
1669305479
34 files changed
+4872
-184
No files matched your search
@@ -55,7 +55,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>29wx.ico</ApplicationIcon>
|
||||
<ApplicationIcon>29_common_icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -375,6 +375,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\loading.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="29_common_icon.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
+85
-13
@@ -1,15 +1,18 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
@@ -56,19 +59,49 @@ namespace _29WxOrderWpf
|
||||
string IgPakFile = "locales/ig.pak";//贴牌客服端码
|
||||
string OenVersionFile = "locales/igv.pak";//贴牌资源配置版本
|
||||
string IaPakFile = "locales/ia.pak";//logo
|
||||
string IbPakFile = "locales/ib.pak";//ico
|
||||
//string IbPakFile = "locales/ib.pak";//ico
|
||||
string IcPakFile = "locales/ic.pak";//功能配置
|
||||
//OenMechanism(IgPakFile, OenVersionFile, IaPakFile, IbPakFile, IcPakFile);
|
||||
|
||||
#region 后台修改logo 贴牌用
|
||||
//// 替换字典程序logo等
|
||||
//Uri imageUri = new Uri("pack://application:,,,/Resources/WindowBoxes/close.hover.png"); // 新的图片路径
|
||||
//BitmapImage newBitmapImage = new BitmapImage(imageUri);
|
||||
//// 获取资源字典
|
||||
//ResourceDictionary dict = Application.Current.Resources;
|
||||
//// 添加或更新资源
|
||||
//dict["main29WeixinIcon"] = newBitmapImage;
|
||||
#endregion
|
||||
if (!File.Exists("locales/io.pak"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ioTxt = FileBase.ReadAllText("locales/io.pak");
|
||||
if (ioTxt.StartsWith("MThd") || !ioTxt.Contains("MThd"))
|
||||
return;
|
||||
|
||||
string agentNameFile = "locales/na.pak";
|
||||
if (File.Exists(agentNameFile))
|
||||
{
|
||||
var config = FileBase.ReadAllText(agentNameFile, Encoding.UTF8);
|
||||
var configArr = config.Split(new string[] { "\r\n", "MThd" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (configArr.Length >= 2)
|
||||
{
|
||||
BaseClass.ProgramName = configArr[1];
|
||||
BaseClass.ToolName = configArr[1];
|
||||
BaseClass.AgentName = configArr[0];
|
||||
}
|
||||
}
|
||||
|
||||
string LogoPakFile = "locales/lo.pak"; // ico
|
||||
if (File.Exists(LogoPakFile))
|
||||
{
|
||||
BitmapImage bitmap = new BitmapImage(new Uri(LogoPakFile, UriKind.Relative));
|
||||
Application.Current.Resources["main29WeixinIcon"] = bitmap;
|
||||
// winform部分,直接指定路径,从bitmap转换的会丢失颜色
|
||||
BaseClass.Ico = new Icon(LogoPakFile); //BitmapImageToIcon(Application.Current.Resources["main29WeixinIcon"] as BitmapImage);
|
||||
}
|
||||
//BaseClass.ProgromLogo = Environment.CurrentDirectory + "\\locales\\ia.pak";//logo
|
||||
//BaseClass.ProgromLogoIco = Environment.CurrentDirectory + "\\locales\\ib.pak";//ico
|
||||
string ImgPakFile = "locales/im.pak";
|
||||
if (File.Exists(ImgPakFile))
|
||||
{
|
||||
BaseClass.LogoImage = Image.FromFile(ImgPakFile);
|
||||
}
|
||||
|
||||
// 待后续完善
|
||||
OenMechanism(IgPakFile, OenVersionFile, IaPakFile, LogoPakFile, IcPakFile);
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -168,9 +201,48 @@ namespace _29WxOrderWpf
|
||||
/// <param name="sIaPakFile">ico本地缓存文件</param>
|
||||
/// <param name="sIbPakFile">logo本地缓存文件</param>
|
||||
/// <param name="sIcPakFile">贴牌配置本地缓存文件</param>
|
||||
private static void OenMechanism(string IgPakFile, string OenVersionFile, string IaPakFile, string IbPakFile, string IcPakFile)
|
||||
private void OenMechanism(string IgPakFile, string OenVersionFile, string IaPakFile, string logoBitmapFile, string IcPakFile)
|
||||
{
|
||||
//todo: 贴牌相关处理逻辑
|
||||
return;
|
||||
|
||||
#region 贴牌修改logo
|
||||
//// 替换字典程序logo等
|
||||
//Uri imageUri = new Uri("pack://application:,,,/Resources/WindowBoxes/close.hover.png"); // 新的图片路径
|
||||
//BitmapImage newBitmapImage = new BitmapImage(imageUri);
|
||||
//// 获取资源字典
|
||||
//ResourceDictionary dict = Application.Current.Resources;
|
||||
//// 添加或更新资源
|
||||
//dict["main29WeixinIcon"] = newBitmapImage;
|
||||
|
||||
if (File.Exists(logoBitmapFile))
|
||||
{
|
||||
BitmapImage bitmap = new BitmapImage(new Uri(logoBitmapFile, UriKind.Relative));
|
||||
Application.Current.Resources["main29WeixinIcon"] = bitmap;
|
||||
}
|
||||
BaseClass.Ico = BitmapImageToIcon(Application.Current.Resources["main29WeixinIcon"] as BitmapImage);
|
||||
#endregion
|
||||
}
|
||||
|
||||
public Icon BitmapImageToIcon(BitmapImage bitmapImage)
|
||||
{
|
||||
// 将BitmapImage转换为BitmapSource
|
||||
BitmapSource bitmapSource = BitmapFrame.Create(bitmapImage);
|
||||
|
||||
// 创建一个MemoryStream来存储BitmapSource的像素数据
|
||||
using (MemoryStream memoryStream = new MemoryStream())
|
||||
{
|
||||
PngBitmapEncoder encoder = new PngBitmapEncoder();
|
||||
encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
|
||||
encoder.Save(memoryStream);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// 从MemoryStream中创建一个System.Drawing.Bitmap对象
|
||||
using (var bitmap = new Bitmap(memoryStream))
|
||||
{
|
||||
// 现在你可以将System.Drawing.Bitmap转换为System.Drawing.Icon了
|
||||
return Icon.FromHandle(bitmap.GetHicon());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" DataContextChanged="UserControl_DataContextChanged"
|
||||
d:DesignHeight="250" d:DesignWidth="1200">
|
||||
d:DesignHeight="180" d:DesignWidth="1200">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
@@ -36,7 +36,8 @@
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Image Grid.Row="1" x:Name="imgOrderItem" Grid.Column="0" VerticalAlignment="Top" Height="100" Width="100" Margin="0,2,8,2" Source="{Binding thumb_img, Converter={StaticResource ImageUrlToBitmapImage}}"></Image>-->
|
||||
<Image Grid.Row="1" x:Name="imgOrderItem" Grid.Column="0" VerticalAlignment="Top" Height="100" Width="100" Margin="0,2,8,2"></Image>
|
||||
<Image Grid.Row="1" x:Name="imgOrderItem" Grid.Column="0" VerticalAlignment="Top" Height="100" Width="100" Margin="0,2,8,2"
|
||||
Cursor="Hand" MouseEnter="imgOrderItem_MouseEnter" MouseLeave="imgOrderItem_MouseLeave" MouseDown="imgOrderItem_MouseDown"></Image>
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -176,7 +177,7 @@
|
||||
x:Name="txtRefundResult" BorderThickness="0" Foreground="#f56c6c" HorizontalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtRefundResult,Path=Text,Converter={StaticResource HasTextVisibility}}"/>
|
||||
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5">
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5" Width="auto" HorizontalAlignment="Center">
|
||||
<TextBox Text="收货地址:" Grid.Column="1" Grid.Row="5" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="收货地址" Text="{Binding ItemOrder.address_str}" Grid.Column="1" Grid.Row="5" Margin="0,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap"/>
|
||||
|
||||
@@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -22,8 +23,10 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.Forms.ShopForms;
|
||||
using Work._29Tools.Forms.ToolForms;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
@@ -97,120 +100,211 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
BaseMsgWindow.ShowError("请选择买手号");
|
||||
return;
|
||||
}
|
||||
// 拍单的时候检测一下买手号
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
return;
|
||||
}
|
||||
|
||||
if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
|
||||
btnBuyOrder.Cursor = Cursors.Wait;
|
||||
btnBuyOrder.IsEnabled = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (orderItem.Shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.Shop);
|
||||
shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
|
||||
shopLoginForm.IsGetSupplierPage = true;
|
||||
shopLoginForm.ShowDialog();
|
||||
|
||||
// 不是立即生效的,不用立即刷新
|
||||
//var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
|
||||
//if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
// is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
|
||||
//if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
|
||||
//{
|
||||
// orderItem.Shop.Is29Supplier = true;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
// orderItem.Shop.Is29Supplier = false;
|
||||
//}
|
||||
//foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
//{
|
||||
// // 更新代发管理情况
|
||||
// foreach (var o in order.orderItems)
|
||||
// Dispatcher.Invoke(new Action(() => { o.UpdateOrderItemBuyButton(); }));
|
||||
//}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
Thread.Sleep(2000);
|
||||
Dispatcher.Invoke(new Action(() => { btnBuyOrder.IsEnabled = true; }));
|
||||
});
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
// 拍单的时候检测一下买手号
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
PddMobileLoginForm.CheckBuyerLogin(GlobalConfig.CurrentPddBuyer);
|
||||
}
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
return;
|
||||
}
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
if (GlobalConfig.CurrentPddBuyer.status != "在线")
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
return;
|
||||
}
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
BaseMsgWindow.ShowError("买手号掉线");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
|
||||
var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
|
||||
data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
|
||||
data += "&shop_id=" + orderItem.Shop.ErpShopId;
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var erpMs = JsonHelper.DeserializeJsonToList<ErpMerchantInfo>(JsonHelper.JObjectParse(html)["data"].ParseToString());
|
||||
var erpM = erpMs.FirstOrDefault();
|
||||
if (erpM == null)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
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;
|
||||
var balance = erpM.balance.ParseToDecimal();
|
||||
if (balance < 10)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("拍单校验出错,请稍后重试");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 已有拍单关联的跳的到订单确认界面
|
||||
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";
|
||||
if (orderItem.BuyGoodsBtnTxt == "去店铺后台绑定代发")
|
||||
{
|
||||
if (orderItem.Shop != null)
|
||||
{
|
||||
WXShopLoginForm shopLoginForm = new WXShopLoginForm(orderItem.Shop);
|
||||
shopLoginForm.openType = Work._29Tools.Forms.ShopForms.EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/supply/consignmentOrderList";
|
||||
shopLoginForm.IsGetSupplierPage = true;
|
||||
shopLoginForm.ShowDialog();
|
||||
|
||||
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";
|
||||
// 不是立即生效的,不用立即刷新
|
||||
//var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
|
||||
//if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
// is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(orderItem.Shop);
|
||||
//if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
|
||||
//{
|
||||
// orderItem.Shop.Is29Supplier = true;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
// orderItem.Shop.Is29Supplier = false;
|
||||
//}
|
||||
//foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
//{
|
||||
// // 更新代发管理情况
|
||||
// foreach (var o in order.orderItems)
|
||||
// Dispatcher.Invoke(new Action(() => { o.UpdateOrderItemBuyButton(); }));
|
||||
//}
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
//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";
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
buyOrderForm.pnlBuy.Visible = true;
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
|
||||
PddMobileBuyOrderForm buyOrderForm = new PddMobileBuyOrderForm(MainWindow.Instance.orderListCtrl.FilterOneOrder, orderItem, GlobalConfig.CurrentPddBuyer, orderItem.BuyMap);
|
||||
|
||||
// 未关联拍单的跳到所有订单页面
|
||||
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.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;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
@@ -329,6 +423,25 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void imgOrderItem_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgOrderItem_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgOrderItem_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
ShowImgForm imgFrom = new ShowImgForm(orderItem.thumb_img);
|
||||
imgFrom.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,5 +55,6 @@
|
||||
</Border.Effect>
|
||||
<TextBlock Text="这里是默认提示信息" Margin="10" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="tbMessage"></TextBlock>
|
||||
</Border>
|
||||
<!--<Image x:Name="imageBig" HorizontalAlignment="Left" Height="800" Width="800" VerticalAlignment="Center" Grid.Row="1" Margin="200,0,0,0"/>-->
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -60,6 +60,7 @@ namespace _29WxOrderWpf
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ucWindowBox.SetWindowMax();
|
||||
this.Title = BaseClass.ToolName;
|
||||
|
||||
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
|
||||
|
||||
|
||||
Reference in new issue
Block a user