用户拍单可以通过商品选择sku
This commit is contained in:
1 parent
ec4d8073b3
commit
8e33d095f3
17 files changed
+1620
-616
No files matched your search
@@ -0,0 +1,128 @@
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.BuyerCtrls.SkuSelectListRowCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="150"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Border
|
||||
Margin="4"
|
||||
BorderBrush="LightSkyBlue"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
x:Name="imgSku"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="8"
|
||||
VerticalAlignment="Top"
|
||||
Cursor="Hand"
|
||||
MouseDown="imgSku_MouseDown"
|
||||
MouseEnter="imgSku_MouseEnter"
|
||||
MouseLeave="imgSku_MouseLeave" />
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
Margin="0,8"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<WrapPanel Visibility="{Binding SpecNameStr, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="商品标题:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="商品标题"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding GoodsNameStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
<WrapPanel Grid.Row="1" Visibility="{Binding SpecNameStr, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="商品规格:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="SKU规格"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Bold"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding SpecNameStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel Grid.Row="2" Visibility="{Binding groupPrice, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="规格单价:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="0.00"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding groupPrice}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
<Button
|
||||
x:Name="btnAdd"
|
||||
Grid.Column="100"
|
||||
MinWidth="48"
|
||||
MinHeight="28"
|
||||
Margin="8"
|
||||
Padding="4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Click="btnAdd_Click"
|
||||
Content="确定关联"
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,75 @@
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
|
||||
/// <summary>
|
||||
/// SkuSelectListRowCtrl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SkuSelectListRowCtrl : UserControl
|
||||
{
|
||||
public SkuSelectListRowCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContextChanged += SkuSelectListRowCtrl_DataContextChanged;
|
||||
}
|
||||
|
||||
private void SkuSelectListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is frontSkuInfo3 frontSku)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
// 异步加载图片防止卡顿
|
||||
// 缩略图在有的电脑上无法显示
|
||||
//BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
|
||||
BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(frontSku.thumbUrl);
|
||||
Thread.Sleep(Randomx.GetId(200));
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
imgSku.Source = bImg;
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void imgSku_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgSku_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgSku_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private async void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is frontSkuInfo3 frontSku)
|
||||
{
|
||||
await BuyMapSkuViewModel.BuyMapSkuInstance.SetOrderMapSku(frontSku);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -580,24 +580,33 @@
|
||||
BorderThickness="0,0,0,1">
|
||||
<WrapPanel>
|
||||
<CheckBox
|
||||
x:Name="chkMapProdOnly"
|
||||
x:Name="chkNoMapProd"
|
||||
Margin="8,0,4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkMapProdOnly_Click"
|
||||
Content="已关联拍单"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chkNoMapProdOnly"
|
||||
Margin="8,0,4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkNoMapProdOnly_Click"
|
||||
Click="chkMapProd_Click"
|
||||
Content="未关联拍单"
|
||||
FontSize="12" />
|
||||
|
||||
<CheckBox
|
||||
x:Name="chkMapProd"
|
||||
Margin="8,0,4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkMapProd_Click"
|
||||
Content="已关联商品"
|
||||
FontSize="12" />
|
||||
<CheckBox
|
||||
x:Name="chkMapSku"
|
||||
Margin="8,0,4,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkMapProd_Click"
|
||||
Content="已关联拍单"
|
||||
FontSize="12" />
|
||||
|
||||
<Button
|
||||
Width="Auto"
|
||||
|
||||
@@ -1512,9 +1512,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
if (!order.IsWaitBuy)
|
||||
return true;
|
||||
if (chkMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null))
|
||||
if (chkMapSku.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null && (oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0)))
|
||||
return true;
|
||||
if (chkNoMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null))
|
||||
if (chkMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMapSkus == null || oi.BuyMapSkus.Count == 0))
|
||||
return true;
|
||||
if (chkNoMapProd.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null))
|
||||
return true;
|
||||
}
|
||||
if (filterHeadStr.StartsWith("待发货"))
|
||||
@@ -1820,17 +1822,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
GlobalConfig.OrderTabHeaderStr = ((tabOrderType.SelectedItem as TabItem)?.Header).ParseToString();
|
||||
FilterOrders();
|
||||
}
|
||||
|
||||
private void chkMapProdOnly_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
private void chkMapProd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (chkMapProdOnly.IsChecked == true)
|
||||
chkNoMapProdOnly.IsChecked = false;
|
||||
FilterOrders();
|
||||
}
|
||||
private void chkNoMapProdOnly_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (chkNoMapProdOnly.IsChecked == true)
|
||||
chkMapProdOnly.IsChecked = false;
|
||||
if (sender is CheckBox chk)
|
||||
{
|
||||
var isCheck = !chk.IsChecked.ParseToBool();
|
||||
chkNoMapProd.IsChecked = chkMapProd.IsChecked = chkMapSku.IsChecked = false;
|
||||
chk.IsChecked = !isCheck;
|
||||
}
|
||||
FilterOrders();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,42 +1,52 @@
|
||||
<UserControl x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListRowCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="230" d:DesignWidth="1200">
|
||||
<Border Margin="0,12,8,0" HorizontalAlignment="Stretch" VerticalAlignment="Center" BorderThickness="1"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}" CornerRadius="10">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<UserControl
|
||||
x:Class="_29WxOrderWpf.Ctrls.OrderCtrls.OrderListRowCtrl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
d:DesignHeight="230"
|
||||
d:DesignWidth="1200"
|
||||
mc:Ignorable="d">
|
||||
<Border
|
||||
Margin="0,12,8,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource ListRowBorderColorBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10">
|
||||
<Border.Style>
|
||||
<!-- 鼠标进入或悬停Border时切换颜色(悬停时Border的填充控件必须有填充Border,所在层级不限,仅填充透明Grid则触发器无效) -->
|
||||
<Style TargetType="Border">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource ListRowHoverBackColorBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--子控件是普通控件而非模板页控件,无需指定DataContext="{Binding}"-->
|
||||
<local:OrderListRowHeaderCtrl></local:OrderListRowHeaderCtrl>
|
||||
<!--<local:OrderListRowHeaderCtrl DataContext="{Binding}"></local:OrderListRowHeaderCtrl>-->
|
||||
<Border Grid.Row="1" Background="Transparent" CornerRadius="0,0,12,12" >
|
||||
<Grid x:Name="gridChildOrder">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="6"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="6"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!-- 子控件是普通控件而非模板页控件,无需指定DataContext="{Binding}" -->
|
||||
<local:OrderListRowHeaderCtrl />
|
||||
<!--<local:OrderListRowHeaderCtrl DataContext="{Binding}"></local:OrderListRowHeaderCtrl>-->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Background="Transparent"
|
||||
CornerRadius="0,0,12,12">
|
||||
<Grid x:Name="gridChildOrder">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="6" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="6" />
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -1757,6 +1757,19 @@
|
||||
Visibility="{Binding ItemOrder.IsWaitBuy, Converter={StaticResource visibleToVisibilityConverter}}"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" Margin="4,0,0,0" Content="关联拍单" Width="56" Height="24"/>-->
|
||||
<WrapPanel Grid.Row="1" HorizontalAlignment="Center">
|
||||
<Button
|
||||
x:Name="btnMapSkus"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Height="24"
|
||||
MinWidth="38"
|
||||
Margin="4,4,0,4"
|
||||
HorizontalAlignment="Center"
|
||||
Click="btnMapSkus_Click"
|
||||
Content="选择SKU"
|
||||
Style="{StaticResource BasePageButtonLightStyle}"
|
||||
Visibility="{Binding MapSkusBtnVisibility}" />
|
||||
|
||||
|
||||
<Button
|
||||
x:Name="btnBuyOrder"
|
||||
|
||||
@@ -1585,6 +1585,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void btnMapSkus_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
BuyMapSkuSelectWindow window = new BuyMapSkuSelectWindow(orderItem);
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Commands;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.Record;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
using Work.SearchSame;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
|
||||
namespace _29WxOrderWpf.ViewModels;
|
||||
|
||||
public class BuyMapSkuViewModel : PropertyNotifyObject
|
||||
{
|
||||
public static BuyMapSkuViewModel BuyMapSkuInstance { get; set; }
|
||||
/// <summary>
|
||||
/// 请求关闭窗口
|
||||
/// </summary>
|
||||
public event Action RequestClose;
|
||||
private volatile bool _isWindowLoaded = false;
|
||||
public oms_wei_order_item_info OrderItem
|
||||
{
|
||||
get { return this.GetValue(x => x.OrderItem); }
|
||||
set { this.SetValue(x => x.OrderItem, value); }
|
||||
}
|
||||
public ObservableCollection<WXBuyMapSkusInfo> BuyMapSkus
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyMapSkus); }
|
||||
set { this.SetValue(x => x.BuyMapSkus, value); }
|
||||
}
|
||||
public ObservableCollection<frontSkuInfo3> FrontSkuInfos
|
||||
{
|
||||
get { return this.GetValue(x => x.FrontSkuInfos); }
|
||||
set { this.SetValue(x => x.FrontSkuInfos, value); }
|
||||
}
|
||||
public string ShopGoodsName
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopGoodsName); }
|
||||
set { this.SetValue(x => x.ShopGoodsName, value); }
|
||||
}
|
||||
public string ShopSkuName
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopSkuName); }
|
||||
set { this.SetValue(x => x.ShopSkuName, value); }
|
||||
}
|
||||
public string ShopSkuPrice
|
||||
{
|
||||
get { return this.GetValue(x => x.ShopSkuPrice); }
|
||||
set { this.SetValue(x => x.ShopSkuPrice, value); }
|
||||
}
|
||||
//pddFrontGoods3Lite
|
||||
|
||||
public BuyMapSkuViewModel(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
if (BuyMapSkuInstance != null)
|
||||
BuyMapSkuInstance.RequestClose.Invoke();
|
||||
|
||||
BuyMapSkuInstance = this;
|
||||
|
||||
OrderItem = orderItem;
|
||||
if (orderItem != null)
|
||||
{
|
||||
this.ShopGoodsName = orderItem.title;
|
||||
this.ShopSkuName = orderItem.sku_attr_str;
|
||||
this.ShopSkuPrice = (orderItem.real_price * 0.01m).ParseToString();
|
||||
}
|
||||
if (orderItem?.BuyMapSkus != null && orderItem?.BuyMapSkus.Count > 0)
|
||||
{
|
||||
BuyMapSkus = new ObservableCollection<WXBuyMapSkusInfo>(orderItem.BuyMapSkus);
|
||||
SetCurrentFrontSkuInfo3(BuyMapSkus?.FirstOrDefault());
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCurrentFrontSkuInfo3(WXBuyMapSkusInfo skuInfo)
|
||||
{
|
||||
foreach (var info in BuyMapSkus)
|
||||
{
|
||||
info.IsChecked = false;
|
||||
}
|
||||
skuInfo.IsChecked = true;
|
||||
FrontSkuInfos = new ObservableCollection<frontSkuInfo3>(skuInfo?.pdd_front_goods3_Lite.skus);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口加载完成时调用
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
_isWindowLoaded = true;
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
// todo get skus
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 窗口关闭时调用,停止后台任务
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
_isWindowLoaded = false;
|
||||
}
|
||||
|
||||
public async Task SetOrderMapSku(frontSkuInfo3 upSku)
|
||||
{
|
||||
var mapSkuProd = OrderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_id == upSku.goodsId.ParseToString());
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
var mapSku = mapSkuProd.pdd_front_goods3_Lite.skus.FirstOrDefault(s => string.Join(",", s.specs.Select(sp => sp.spec_value)) == upSku.SpecNameStr);
|
||||
if (mapSku == null)
|
||||
return;
|
||||
|
||||
var mapGoodsName = mapSkuProd.map_goods_name;
|
||||
var mapSkuName = string.Join(",", mapSku.specs.Select(sp => sp.spec_value));
|
||||
var mapGoodsId = mapSkuProd.map_goods_id;
|
||||
var mapSkuId = mapSku.skuId.ParseToString();
|
||||
var sendProvince = mapSkuProd.map_send_address;
|
||||
|
||||
string cmbTransitWarehouse = "";
|
||||
string txtBuyTransitWarehouse = "";
|
||||
var transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == mapSkuProd.transit_warehouse_id);
|
||||
if (transitWarehouse != null)
|
||||
{
|
||||
cmbTransitWarehouse = transitWarehouse?.TransName + " " + transitWarehouse?.TransDetailAddress;
|
||||
txtBuyTransitWarehouse = transitWarehouse?.TransDetailAddress;
|
||||
}
|
||||
|
||||
var spuCode = OrderItem.out_product_id.IsNullOrEmpty() ? OrderItem.product_id : OrderItem.out_product_id;
|
||||
var skuCode = OrderItem.out_sku_id.IsNullOrEmpty() ? OrderItem.sku_attr_str : OrderItem.out_sku_id;
|
||||
if (spuCode.IsNullOrEmpty())
|
||||
spuCode = OrderItem.product_id;
|
||||
if (await SaveSkuMap(spuCode, skuCode, mapGoodsName, mapSkuName, mapGoodsId, mapSkuId, transitWarehouse, sendProvince))
|
||||
RequestClose?.Invoke();
|
||||
}
|
||||
|
||||
public async Task<bool> SaveSkuMap(string spuCode, string skuCode, string mapGoodsName,
|
||||
string mapSkuName, string mapGoodsId, string mapSkuId, TransitWarehouseParam transitWarehouse, string sendProvince)
|
||||
{
|
||||
if (transitWarehouse == null)
|
||||
{
|
||||
BaseMsgForm.ShowError("仓库不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
string url;
|
||||
string upSpuCode = spuCode;
|
||||
string upSkuCode = skuCode;
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&spu_code=" + GetHtml.UrlEncodeUtf8(upSpuCode)
|
||||
+ "&sku_code=" + GetHtml.UrlEncodeUtf8(upSkuCode)
|
||||
+ "&main_user_name=" + BaseClass.MainUserName
|
||||
+ "&map_goods_name=" + mapGoodsName
|
||||
+ "&map_spec_name=" + mapSkuName
|
||||
+ "&map_goods_id=" + mapGoodsId
|
||||
+ "&map_sku_id=" + mapSkuId
|
||||
+ "&map_send_address=" + sendProvince
|
||||
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
|
||||
|
||||
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map");
|
||||
var result = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
result = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgForm.ShowError("保存失败" + BaseRegex.GetStringJson(ref result, "msg") + ",请稍后重试");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
|
||||
var dataMap = UserLogin.GetSignaturex()
|
||||
+ "&spu_codes=" + upSpuCode;
|
||||
//dataMap += "&sku_codes=" + upSkuCode;
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultMap = await GetHtml.PostUtf8Async(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
resultMap = await GetHtml.PostUtf8Async(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List<WXBuyMapInfo> buyMapList = new List<WXBuyMapInfo>();
|
||||
try
|
||||
{
|
||||
buyMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString());
|
||||
|
||||
GlobalConfig.BuyMapList.RemoveAll(b => buyMapList.Any(map => b.spu_code == map.spu_code && b.sku_code == map.sku_code));
|
||||
GlobalConfig.BuyMapList.AddRange(buyMapList);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
var map = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode);
|
||||
if (map != null)
|
||||
{
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
if (order.IsWaitBuy)
|
||||
{
|
||||
foreach (var item in order.orderItems)
|
||||
{
|
||||
if ((item.out_product_id == map.spu_code && item.out_sku_id == map.sku_code) ||
|
||||
(item.out_product_id == map.spu_code && item.sku_attr_str == map.sku_code) ||
|
||||
(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.SetOrderItemTextProperty();
|
||||
// todo 此处刷新一条可能不够
|
||||
MainWindow.Instance.orderListCtrl.FilterOneOrder(order, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BaseMsgWindow.ShowInfo("保存成功!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="_29WxOrderWpf.Windows.OrderWindows.BuyMapSkuSelectWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.OrderWindows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:skudata="clr-namespace:AllBase.Model.Result;assembly=29WxOrderAllBase"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
Title="SkuSelectWindow"
|
||||
Width="1360"
|
||||
Height="768"
|
||||
d:Height="700"
|
||||
d:Width="1200"
|
||||
FontSize="15"
|
||||
Loaded="SkuSelectWindow_Loaded"
|
||||
ResizeMode="NoResize"
|
||||
Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
<!--<x:Array x:Key="frontSkuInfo" Type="skudata:frontSkuInfo3">
|
||||
<skudata:frontSkuInfo3 />
|
||||
</x:Array>-->
|
||||
</Window.Resources>
|
||||
<Grid
|
||||
x:Name="mainGrid"
|
||||
Margin="2"
|
||||
Background="Transparent"
|
||||
MouseLeftButtonDown="gridTitle_MouseLeftButtonDown">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gridTitle">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Width="50"
|
||||
Height="50"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Source="{StaticResource main29WeixinIcon}" />
|
||||
<Label
|
||||
x:Name="lblAppName"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="中转单售后"
|
||||
FontSize="20"
|
||||
Foreground="{StaticResource mainColorLightBrush}" />
|
||||
</Grid>
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Padding="40,20"
|
||||
Background="White">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" MinHeight="50" />
|
||||
<RowDefinition Height="Auto" MinHeight="50" />
|
||||
<RowDefinition Height="*" MinHeight="50" />
|
||||
<RowDefinition Height="Auto" MinHeight="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" MinWidth="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
FontSize="15"
|
||||
Text="订单商品:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
x:Name="imgSku"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Height="100"
|
||||
Margin="8"
|
||||
VerticalAlignment="Top"
|
||||
Cursor="Hand"
|
||||
MouseDown="imgSku_MouseDown"
|
||||
MouseEnter="imgSku_MouseEnter"
|
||||
MouseLeave="imgSku_MouseLeave" />
|
||||
<Grid
|
||||
Grid.Column="1"
|
||||
Margin="0,8"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<WrapPanel Visibility="{Binding ShopGoodsName, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="店铺商品标题:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="店铺商品标题"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShopGoodsName}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
<WrapPanel Grid.Row="1" Visibility="{Binding ShopSkuName, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="店铺商品规格:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="店铺SKU规格"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
FontWeight="Bold"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShopSkuName}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel Grid.Row="2" Visibility="{Binding ShopSkuPrice, Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="店铺规格单价:"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBox
|
||||
Grid.Row="0"
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="0.00"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ShopSkuPrice}"
|
||||
TextWrapping="Wrap" />
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
FontSize="15"
|
||||
Text="关联商品:" />
|
||||
<Grid Grid.Row="1" Grid.Column="1">
|
||||
<ListBox
|
||||
x:Name="lbxOrderItem"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="7,0,7,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BorderThickness="0"
|
||||
ItemsSource="{Binding BuyMapSkus}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
VirtualizingPanel.ScrollUnit="Pixel">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 此处绑定将数据源传递给子自定义控件OrderListRowCtrl -->
|
||||
<!--<buyerctrls:SkuSelectListRowCtrl
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
DataContext="{Binding}" />-->
|
||||
<RadioButton
|
||||
MaxWidth="250"
|
||||
Margin="0,0,0,10"
|
||||
Click="RadioButton_Click"
|
||||
IsChecked="{Binding IsChecked}">
|
||||
<TextBox
|
||||
VerticalAlignment="Top"
|
||||
d:Opacity="0.5"
|
||||
d:Text="商品标题"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding map_goods_name}"
|
||||
TextWrapping="Wrap" />
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<!-- 单行横向,超出部分隐藏或滚动 -->
|
||||
<StackPanel IsItemsHost="True" Orientation="Horizontal" />
|
||||
|
||||
<!-- 若需自动换行,替换为以下 WrapPanel -->
|
||||
<!-- <WrapPanel Orientation="Horizontal" IsItemsHost="True"/> -->
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
FontSize="15"
|
||||
Text="选择SKU:" />
|
||||
<ListBox
|
||||
x:Name="lbxSku"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="7,0,7,0"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BorderThickness="0"
|
||||
ItemsSource="{Binding FrontSkuInfos}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
VirtualizingPanel.ScrollUnit="Pixel">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<ContentPresenter
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!-- 此处绑定将数据源传递给子自定义控件OrderListRowCtrl -->
|
||||
<buyerctrls:SkuSelectListRowCtrl
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
DataContext="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Button
|
||||
x:Name="btnAdd"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
MinWidth="48"
|
||||
MinHeight="28"
|
||||
Padding="4"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
d:Visibility="Visible"
|
||||
Click="btnAdd_Click"
|
||||
Content="添 加"
|
||||
Style="{StaticResource BasePageButtonStyle}"
|
||||
Visibility="Collapsed" />
|
||||
<Image
|
||||
x:Name="imgLoading"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="52,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
d:Visibility="Visible"
|
||||
IsEnabled="False"
|
||||
Source="{StaticResource imgLoadingPic}"
|
||||
Visibility="Collapsed">
|
||||
<Image.RenderTransform>
|
||||
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
|
||||
</Image.RenderTransform>
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="Image.Loaded">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
RepeatBehavior="Forever"
|
||||
Storyboard.TargetName="imgLoading"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
|
||||
From="0"
|
||||
To="360"
|
||||
Duration="0:0:3" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Image.Triggers>
|
||||
</Image>
|
||||
<Label
|
||||
x:Name="lblMsg"
|
||||
Grid.Row="9"
|
||||
Grid.Column="1"
|
||||
Margin="70,0,0,0"
|
||||
Foreground="{StaticResource PageWarningBrushCC}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<userctrls:UcWindowBoxes
|
||||
x:Name="ucWindowBox"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
MaxBoxVisibility="Visible" />
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,114 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.ViewModels;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.Config;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.POIFS.NIO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Work._29Tools.BLL;
|
||||
|
||||
namespace _29WxOrderWpf.Windows.OrderWindows
|
||||
{
|
||||
/// <summary>
|
||||
/// SkuSelectWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class BuyMapSkuSelectWindow : BaseWindow
|
||||
{
|
||||
public oms_wei_order_item_info OrderItem { get; set; }
|
||||
public BuyMapSkuViewModel ViewModel { get; set; } = null;
|
||||
|
||||
|
||||
public BuyMapSkuSelectWindow(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (orderItem != null)
|
||||
OrderItem = orderItem;
|
||||
|
||||
ViewModel = new BuyMapSkuViewModel(orderItem);
|
||||
DataContext = ViewModel;
|
||||
ViewModel.RequestClose += ViewModel_RequestClose;
|
||||
}
|
||||
|
||||
private void ViewModel_RequestClose()
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private async void SkuSelectWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
btnAdd.IsEnabled = true;
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
// 异步加载图片防止卡顿
|
||||
// 缩略图在有的电脑上无法显示
|
||||
//BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
|
||||
BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(OrderItem.thumb_img);
|
||||
Thread.Sleep(Randomx.GetId(200));
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
imgSku.Source = bImg;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void gridTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
this.DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
private void RadioButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.IsLoaded && sender is RadioButton rb)
|
||||
{
|
||||
if (rb.DataContext is WXBuyMapSkusInfo skuInfo)
|
||||
{
|
||||
this.ViewModel.SetCurrentFrontSkuInfo3(skuInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void imgSku_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgSku_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void imgSku_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -45,8 +45,8 @@ XDYGZC ;广州仓 ;何外华 ;13826339849 ;广州市从化区太平镇
|
||||
XDYWHC ;武汉2仓 ;杨先生 ;13044121071 ;湖北省武汉市汉阳区洲头街道汉新大道2号3栋17楼 ;13 ;180 ;1548 ;湖北省 ;武汉市
|
||||
XDYSHANDC ;山东2仓 ;鸿鹄小申 ;13044121239 ;山东省临沂市费县南外环东转盘往东200米顺通快递有限公司(仓库二楼) ;22 ;292 ;2415 ;山东省 ;临沂市
|
||||
XDYSHC ;上海新仓 ;纪先生 ;13044121150 ;上海市上海市普陀区真如镇街道真北路2653弄T区 ;25 ;321 ;2709 ;上海市 ;上海市
|
||||
XDYSZC ;深圳仓 ;峰峰 ;15343351331 ;广东省东莞市凤岗镇浸校塘东良巷逸乐轩E栋5号楼 ;6 ;79 ;732 ;广东省 ;东莞市";
|
||||
//XDYYWC ;义乌仓 ;小田 ;19058117371 ;浙江省金华市义乌市北苑街道西站大道妈妈商贸18号库39号楼誉达 ;31 ;386 ;3409 ;浙江省 ;金华市
|
||||
XDYSZC ;深圳仓 ;峰峰 ;15343351331 ;广东省东莞市凤岗镇浸校塘东良巷逸乐轩E栋5号楼 ;6 ;79 ;732 ;广东省 ;东莞市
|
||||
XDYYWC ;义乌仓 ;小田 ;19058117371 ;浙江省金华市义乌市北苑街道西站大道妈妈商贸18号库39号楼誉达 ;31 ;386 ;3409 ;浙江省 ;金华市";
|
||||
//XDYJJC ;晋江仓 ;安群 ;19905951984 ;福建省泉州市南安市霞美镇温山村431号鸿鹄大厦 ;4 ;58 ;569 ;福建省 ;泉州市
|
||||
//XDYCDC ;成都仓 ;谢春虹 ;15828201479 ;四川省资阳市乐至县仙鹤大道桑都街15-19号仓库(不要放驿站,送到仓库) ;26 ;340 ;2898 ;四川省 ;资阳市
|
||||
//XDYCHONGQC ;重庆2仓 ;翁桂柱 ;18923911055 ;重庆市九龙坡区中梁山街道云飞九龙香山(二纵线东50米)重庆九龙坡区渝州公司 ;32 ;394 ;3339
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AllBase.Model.Result;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
@@ -32,14 +33,32 @@ namespace AllBase.Model.DBModel
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
public class WXBuyMapSkusInfo
|
||||
public class WXBuyMapSkusInfo : PropertyNotifyObject
|
||||
{
|
||||
public bool? IsChecked
|
||||
{
|
||||
get { return this.GetValue(x => x.IsChecked); }
|
||||
set { this.SetValue(x => x.IsChecked, value); }
|
||||
}
|
||||
|
||||
public long id { get; set; }
|
||||
public string user_name { get; set; }
|
||||
public string spu_code { get; set; }
|
||||
public string map_url { get; set; }
|
||||
public string map_goods_name { get; set; }
|
||||
public string map_goods_id { get; set; }
|
||||
public string map_url
|
||||
{
|
||||
get { return this.GetValue(x => x.map_url); }
|
||||
set { this.SetValue(x => x.map_url, value); }
|
||||
}
|
||||
public string map_goods_name
|
||||
{
|
||||
get { return this.GetValue(x => x.map_goods_name); }
|
||||
set { this.SetValue(x => x.map_goods_name, value); }
|
||||
}
|
||||
public string map_goods_id
|
||||
{
|
||||
get { return this.GetValue(x => x.map_goods_id); }
|
||||
set { this.SetValue(x => x.map_goods_id, value); }
|
||||
}
|
||||
string _map_skus;
|
||||
public string map_skus
|
||||
{
|
||||
@@ -55,7 +74,11 @@ namespace AllBase.Model.DBModel
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public pddFrontGoods3Lite pdd_front_goods3_Lite { get; private set; }
|
||||
public pddFrontGoods3Lite pdd_front_goods3_Lite
|
||||
{
|
||||
get { return this.GetValue(x => x.pdd_front_goods3_Lite); }
|
||||
set { this.SetValue(x => x.pdd_front_goods3_Lite, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发货地(省,市)
|
||||
/// </summary>
|
||||
|
||||
@@ -38,10 +38,20 @@ namespace AllBase.Model.DBModel
|
||||
get { return this.GetValue(x => x.BuyMap); }
|
||||
set { this.SetValue(x => x.BuyMap, value); }
|
||||
}
|
||||
public Visibility MapSkusBtnVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.MapSkusBtnVisibility); }
|
||||
set { this.SetValue(x => x.MapSkusBtnVisibility, value); }
|
||||
}
|
||||
public List<WXBuyMapSkusInfo> BuyMapSkus
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyMapSkus); }
|
||||
set { this.SetValue(x => x.BuyMapSkus, value); }
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.BuyMapSkus, value);
|
||||
if (value != null && value.Count > 0) MapSkusBtnVisibility = Visibility.Visible;
|
||||
else MapSkusBtnVisibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 采购按钮文字
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -138,13 +139,17 @@ namespace AllBase.Model.Result
|
||||
|
||||
}
|
||||
|
||||
public class pddFrontGoods3Lite
|
||||
public class pddFrontGoods3Lite : PropertyNotifyObject
|
||||
{
|
||||
public long? goodsId { get; set; } // 1661424397,
|
||||
public string goodsName { get; set; } // "红薏仁5斤装 红薏仁米小薏米仁农家自产新红薏米1斤2斤苡仁糙薏米",
|
||||
public long? mallId { get; set; } // 525159017
|
||||
public string mallName { get; set; }
|
||||
public List<frontSkuInfo3> skus { get; set; }
|
||||
public List<frontSkuInfo3> skus
|
||||
{
|
||||
get { return this.GetValue(x => x.skus); }
|
||||
set { this.SetValue(x => x.skus, value); }
|
||||
}
|
||||
}
|
||||
|
||||
public class newShareTitleInfo
|
||||
@@ -164,11 +169,20 @@ namespace AllBase.Model.Result
|
||||
|
||||
}
|
||||
|
||||
public class frontSkuInfo3
|
||||
public class frontSkuInfo3 : PropertyNotifyObject
|
||||
{
|
||||
public long? skuId { get; set; } // 28790184768,
|
||||
public long? goodsId { get; set; } // 1661424397,
|
||||
public string thumbUrl { get; set; } // "https://t00img.yangkeduo.com/t10img/images/2018-06-09/5c7746a3608e75a2b65926f4ed0f34cb.jpeg",
|
||||
public string GoodsNameStr
|
||||
{
|
||||
get { return this.GetValue(x => x.GoodsNameStr); }
|
||||
set { this.SetValue(x => x.GoodsNameStr, value); }
|
||||
}
|
||||
public string thumbUrl
|
||||
{
|
||||
get { return this.GetValue(x => x.thumbUrl); }
|
||||
set { this.SetValue(x => x.thumbUrl, value); }
|
||||
} // "https://t00img.yangkeduo.com/t10img/images/2018-06-09/5c7746a3608e75a2b65926f4ed0f34cb.jpeg",
|
||||
public int? initQuantity { get; set; } // 0,
|
||||
public int? quantity { get; set; } // 1000,
|
||||
public int? limitQuantity { get; set; } // 999999,
|
||||
@@ -177,7 +191,21 @@ namespace AllBase.Model.Result
|
||||
public int? defaultQuantity { get; set; } // 100,
|
||||
public int? isOnsale { get; set; } // 1,
|
||||
public string spec { get; set; } // "677094835",
|
||||
public List<frontSpecInfo3> specs { get; set; }
|
||||
public string SpecNameStr
|
||||
{
|
||||
get { return this.GetValue(x => x.SpecNameStr) == null ? string.Join(",", specs?.Select(s => s.spec_value)) : this.GetValue(x => x.SpecNameStr); }
|
||||
set { this.SetValue(x => x.SpecNameStr, value); }
|
||||
}
|
||||
List<frontSpecInfo3> _specs = new List<frontSpecInfo3>();
|
||||
public List<frontSpecInfo3> specs
|
||||
{
|
||||
get => _specs;
|
||||
set
|
||||
{
|
||||
specs = value;
|
||||
SpecNameStr = string.Join(",", value.Select(s => s.spec_value));
|
||||
}
|
||||
}
|
||||
public int? price { get; set; } // 0,
|
||||
public string normalPrice { get; set; } // "14.5",
|
||||
public string groupPrice { get; set; } // "13.5",
|
||||
|
||||
@@ -186,8 +186,8 @@ namespace TemuKJD.ToolForms
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(orderItem.thumb_img);
|
||||
this.txtShopSkuId.Text = orderItem.sku_id;
|
||||
this.txtShopGoodsId.Text = orderItem.product_id;
|
||||
this.txtUpSpuCode.Text = orderItem.out_product_id.IsNullOrEmpty() ? orderItem.product_id : orderItem.out_product_id;
|
||||
this.txtUpSkuCode.Text = orderItem.out_sku_id.IsNullOrEmpty() ? orderItem.sku_attr_str : orderItem.out_sku_id;
|
||||
this.txtSpuCode.Text = orderItem.out_product_id.IsNullOrEmpty() ? orderItem.product_id : orderItem.out_product_id;
|
||||
this.txtSkuCode.Text = orderItem.out_sku_id.IsNullOrEmpty() ? orderItem.sku_attr_str : orderItem.out_sku_id;
|
||||
this.txtShopGoodsName.Text = orderItem.title;
|
||||
this.txtShopSpecName.Text = orderItem.sku_attr_str;
|
||||
this.txtShopOrderItemCnt.Text = orderItem.sku_cnt.ParseToString();
|
||||
@@ -944,8 +944,8 @@ namespace TemuKJD.ToolForms
|
||||
}
|
||||
|
||||
string url;
|
||||
string upSpuCode = txtUpSpuCode.Text.Trim();
|
||||
string upSkuCode = txtUpSkuCode.Text.Trim();
|
||||
string upSpuCode = txtSpuCode.Text.Trim();
|
||||
string upSkuCode = txtSkuCode.Text.Trim();
|
||||
// 保存sku及商品关联信息
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&spu_code=" + GetHtml.UrlEncodeUtf8(upSpuCode)
|
||||
|
||||
+17
-17
@@ -57,9 +57,9 @@
|
||||
this.txtShopSpecName = new System.Windows.Forms.TextBox();
|
||||
this.label14 = new System.Windows.Forms.Label();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.txtUpSpuCode = new System.Windows.Forms.TextBox();
|
||||
this.txtSpuCode = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.txtUpSkuCode = new System.Windows.Forms.TextBox();
|
||||
this.txtSkuCode = new System.Windows.Forms.TextBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.txtShopSkuId = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
@@ -470,11 +470,11 @@
|
||||
//
|
||||
// txtUpSpuCode
|
||||
//
|
||||
this.txtUpSpuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtUpSpuCode.Location = new System.Drawing.Point(85, 228);
|
||||
this.txtUpSpuCode.Name = "txtUpSpuCode";
|
||||
this.txtUpSpuCode.Size = new System.Drawing.Size(152, 23);
|
||||
this.txtUpSpuCode.TabIndex = 814;
|
||||
this.txtSpuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtSpuCode.Location = new System.Drawing.Point(85, 228);
|
||||
this.txtSpuCode.Name = "txtUpSpuCode";
|
||||
this.txtSpuCode.Size = new System.Drawing.Size(152, 23);
|
||||
this.txtSpuCode.TabIndex = 814;
|
||||
//
|
||||
// label12
|
||||
//
|
||||
@@ -487,13 +487,13 @@
|
||||
//
|
||||
// txtUpSkuCode
|
||||
//
|
||||
this.txtUpSkuCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
this.txtSkuCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtUpSkuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtUpSkuCode.Location = new System.Drawing.Point(321, 228);
|
||||
this.txtUpSkuCode.Name = "txtUpSkuCode";
|
||||
this.txtUpSkuCode.Size = new System.Drawing.Size(152, 23);
|
||||
this.txtUpSkuCode.TabIndex = 812;
|
||||
this.txtSkuCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtSkuCode.Location = new System.Drawing.Point(321, 228);
|
||||
this.txtSkuCode.Name = "txtUpSkuCode";
|
||||
this.txtSkuCode.Size = new System.Drawing.Size(152, 23);
|
||||
this.txtSkuCode.TabIndex = 812;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
@@ -779,8 +779,8 @@
|
||||
this.panel1.Controls.Add(this.label10);
|
||||
this.panel1.Controls.Add(this.txtShopSkuId);
|
||||
this.panel1.Controls.Add(this.label11);
|
||||
this.panel1.Controls.Add(this.txtUpSpuCode);
|
||||
this.panel1.Controls.Add(this.txtUpSkuCode);
|
||||
this.panel1.Controls.Add(this.txtSpuCode);
|
||||
this.panel1.Controls.Add(this.txtSkuCode);
|
||||
this.panel1.Controls.Add(this.label12);
|
||||
this.panel1.Controls.Add(this.pnlMap);
|
||||
this.panel1.Location = new System.Drawing.Point(867, 3);
|
||||
@@ -1201,9 +1201,9 @@
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox txtShopGoodsName;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.TextBox txtUpSpuCode;
|
||||
private System.Windows.Forms.TextBox txtSpuCode;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.TextBox txtUpSkuCode;
|
||||
private System.Windows.Forms.TextBox txtSkuCode;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.TextBox txtShopSpecName;
|
||||
|
||||
Reference in new issue
Block a user