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"
Style="{StaticResource bwstyle}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed">
MaxButtonVisibility="Collapsed"
Loaded="BWindow_Loaded">
<c:BWindow.Resources>
<ObjectDataProvider x:Key="SDTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
@ -58,12 +59,14 @@
<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"
SelectedIndex="0" FocusVisualStyle="{x:Null}">
<ComboBoxItem Content="Gray" Foreground="Gray"/>
<ComboBoxItem Content="Red" Foreground="Red"/>
<ComboBoxItem Content="Yellow" Foreground="Yellow"/>
<ComboBoxItem Content="Green" Foreground="Green"/>
<ComboBoxItem Content="Blue" Foreground="Blue"/>
<ComboBoxItem Content="Purple" Foreground="Purple"/>
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Key}"/>
<Border Height="10" Width="40" Background="{Binding Value}" Margin="5,0,0,0"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<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"/>

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

@ -1,5 +1,6 @@
using BBWY.Client.Models;
using BBWY.Controls;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
@ -29,6 +30,19 @@ namespace BBWY.Client.Views.Order
InitializeComponent();
this.OrderId = orderId;
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)
@ -37,12 +51,14 @@ namespace BBWY.Client.Views.Order
decimal.TryParse(txtDeliveryExpressFreight.Text, out decimal deliveryExpressFreight);
SDCommissionAmount = sdCommissionAmountd;
DeliveryExpressFreight = deliveryExpressFreight;
Flag = (cbx_flag.SelectedItem as ComboBoxItem).Content.ToString();
Flag = (cbx_flag.SelectedItem as KVModel).Value;
SDType = (SDType)cbx_sdType.SelectedItem;
VenderRemark = txtVenderRemark.Text;
this.DialogResult = true;
this.Close();
}
}
}

Loading…
Cancel
Save