用户拍单可以通过商品选择sku
This commit is contained in:
1 parent
ec4d8073b3
commit
8e33d095f3
17 files changed
+1620
-616
No files matched your search
@@ -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
Reference in new issue
Block a user