Browse Source

刷单弹窗,标签下拉框优化

qianyi
shanji 3 years ago
parent
commit
6d048a7cdb
  1. 9
      BBWY.Client/Models/KVModel.cs
  2. 17
      BBWY.Client/Views/Order/SD.xaml
  3. 18
      BBWY.Client/Views/Order/SD.xaml.cs

9
BBWY.Client/Models/KVModel.cs

@ -0,0 +1,9 @@
namespace BBWY.Client.Models
{
public class KVModel : NotifyObject
{
public string Key { get; set; }
public string Value { get; set; }
}
}

17
BBWY.Client/Views/Order/SD.xaml

@ -11,7 +11,8 @@
Title="SD订单" Height="300" Width="300" Title="SD订单" Height="300" Width="300"
Style="{StaticResource bwstyle}" Style="{StaticResource bwstyle}"
MinButtonVisibility="Collapsed" MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"> MaxButtonVisibility="Collapsed"
Loaded="BWindow_Loaded">
<c:BWindow.Resources> <c:BWindow.Resources>
<ObjectDataProvider x:Key="SDTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> <ObjectDataProvider x:Key="SDTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters> <ObjectDataProvider.MethodParameters>
@ -58,12 +59,14 @@
<ComboBox x:Name="cbx_flag" Grid.Column="1" Grid.Row="3" Height="25" Width="100" <ComboBox x:Name="cbx_flag" Grid.Column="1" Grid.Row="3" Height="25" Width="100"
HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="5,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="5,0,0,0"
SelectedIndex="0" FocusVisualStyle="{x:Null}"> SelectedIndex="0" FocusVisualStyle="{x:Null}">
<ComboBoxItem Content="Gray" Foreground="Gray"/> <ComboBox.ItemTemplate>
<ComboBoxItem Content="Red" Foreground="Red"/> <DataTemplate>
<ComboBoxItem Content="Yellow" Foreground="Yellow"/> <StackPanel Orientation="Horizontal">
<ComboBoxItem Content="Green" Foreground="Green"/> <TextBlock Text="{Binding Key}"/>
<ComboBoxItem Content="Blue" Foreground="Blue"/> <Border Height="10" Width="40" Background="{Binding Value}" Margin="5,0,0,0"/>
<ComboBoxItem Content="Purple" Foreground="Purple"/> </StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Text="商家备注" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Row="4"/> <TextBlock Text="商家备注" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Row="4"/>
<c:BTextBox x:Name="txtVenderRemark" Grid.Column="1" Grid.Row="4" Height="30" Width="150" HorizontalAlignment="Left" Margin="5,0,0,0"/> <c:BTextBox x:Name="txtVenderRemark" Grid.Column="1" Grid.Row="4" Height="30" Width="150" HorizontalAlignment="Left" Margin="5,0,0,0"/>

18
BBWY.Client/Views/Order/SD.xaml.cs

@ -1,5 +1,6 @@
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Controls; using BBWY.Controls;
using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -29,6 +30,19 @@ namespace BBWY.Client.Views.Order
InitializeComponent(); InitializeComponent();
this.OrderId = orderId; this.OrderId = orderId;
this.IsSetStorageType = isSetStorageType; this.IsSetStorageType = isSetStorageType;
}
private void BWindow_Loaded(object sender, RoutedEventArgs e)
{
cbx_flag.ItemsSource = new List<KVModel>()
{
new KVModel() {Key="灰色",Value="Gray"},
new KVModel() {Key="红色",Value="Red"},
new KVModel() {Key="黄色",Value="Yellow"},
new KVModel() {Key="绿色",Value="Green"},
new KVModel() {Key="蓝色",Value="Blue"},
new KVModel() {Key="紫色",Value="Purple"}
};
} }
private void btn_Save_Click(object sender, RoutedEventArgs e) private void btn_Save_Click(object sender, RoutedEventArgs e)
@ -37,12 +51,14 @@ namespace BBWY.Client.Views.Order
decimal.TryParse(txtDeliveryExpressFreight.Text, out decimal deliveryExpressFreight); decimal.TryParse(txtDeliveryExpressFreight.Text, out decimal deliveryExpressFreight);
SDCommissionAmount = sdCommissionAmountd; SDCommissionAmount = sdCommissionAmountd;
DeliveryExpressFreight = deliveryExpressFreight; DeliveryExpressFreight = deliveryExpressFreight;
Flag = (cbx_flag.SelectedItem as ComboBoxItem).Content.ToString(); Flag = (cbx_flag.SelectedItem as KVModel).Value;
SDType = (SDType)cbx_sdType.SelectedItem; SDType = (SDType)cbx_sdType.SelectedItem;
VenderRemark = txtVenderRemark.Text; VenderRemark = txtVenderRemark.Text;
this.DialogResult = true; this.DialogResult = true;
this.Close(); this.Close();
} }
} }
} }

Loading…
Cancel
Save