@@ -202,4 +202,147 @@ | |||
</Setter> | |||
</Style> | |||
<!--#endregion--> | |||
<Style x:Key="ComboBoxStyle_1" TargetType="{x:Type ComboBox}"> | |||
<Setter Property="BorderThickness" Value="0" /> | |||
<Setter Property="ItemContainerStyle"> | |||
<Setter.Value> | |||
<Style TargetType="ComboBoxItem"> | |||
<Setter Property="Height" Value="25" /> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ComboBoxItem}"> | |||
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> | |||
<Border x:Name="_borderbg" Background="Transparent" /> | |||
<TextBlock | |||
x:Name="_txt" | |||
Margin="5,0,3,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
Foreground="#DDD" | |||
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" /> | |||
<Border | |||
x:Name="_border" | |||
Background="#103153" | |||
Opacity="0" /> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsSelected" Value="true"> | |||
<Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxSelectedForeground}" /> | |||
<Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxSelectdBackground}" /> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsSelected" Value="false" /> | |||
<Condition Property="IsMouseOver" Value="true" /> | |||
</MultiTrigger.Conditions> | |||
<Setter TargetName="_borderbg" Property="Background" Value="{StaticResource ComboBoxMouseOverBackground}" /> | |||
<Setter TargetName="_txt" Property="Foreground" Value="{StaticResource ComboBoxMouseOverForegrond}" /> | |||
</MultiTrigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</Setter.Value> | |||
</Setter> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ComboBox}"> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.7*" /> | |||
<ColumnDefinition Width="0.3*" MaxWidth="30" /> | |||
</Grid.ColumnDefinitions> | |||
<Border | |||
x:Name="_prybr" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
BorderBrush="{TemplateBinding BorderBrush}" | |||
BorderThickness="{TemplateBinding BorderThickness}" | |||
CornerRadius="0" /> | |||
<ContentPresenter | |||
x:Name="ContentSite" | |||
Margin="3,3,0,3" | |||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" | |||
VerticalAlignment="Center" | |||
Content="{TemplateBinding SelectionBoxItem}" | |||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" | |||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" | |||
IsHitTestVisible="False" /> | |||
<!-- ToggleButton 已数据绑定到 ComboBox 本身以切换 IsDropDownOpen --> | |||
<ToggleButton | |||
x:Name="ToggleButton" | |||
Grid.Column="0" | |||
Grid.ColumnSpan="2" | |||
ClickMode="Press" | |||
Focusable="false" | |||
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" | |||
Template="{StaticResource ComboBoxToggleButton}" /> | |||
<!-- 必须将 TextBox 命名为 PART_EditableTextBox,否则 ComboBox 将无法识别它 --> | |||
<TextBox | |||
x:Name="PART_EditableTextBox" | |||
Margin="2,0,0,0" | |||
VerticalAlignment="Center" | |||
Background="Transparent" | |||
BorderThickness="0" | |||
CaretBrush="{TemplateBinding Foreground}" | |||
Focusable="True" | |||
Foreground="{TemplateBinding Foreground}" | |||
IsReadOnly="{TemplateBinding IsReadOnly}" | |||
Visibility="Hidden" /> | |||
<!-- Popup 可显示 ComboBox 中的项列表。IsOpen 已数据绑定到通过 ComboBoxToggleButton 来切换的 IsDropDownOpen --> | |||
<Popup | |||
x:Name="Popup" | |||
AllowsTransparency="True" | |||
Focusable="False" | |||
IsOpen="{TemplateBinding IsDropDownOpen}" | |||
Placement="Bottom" | |||
PopupAnimation="Slide"> | |||
<Grid | |||
x:Name="DropDown" | |||
MinWidth="{TemplateBinding ActualWidth}" | |||
MaxHeight="150" | |||
SnapsToDevicePixels="True"> | |||
<Border | |||
x:Name="DropDownBorder" | |||
BorderBrush="#3ba7f2" | |||
BorderThickness="0" /> | |||
<ScrollViewer | |||
Margin="1" | |||
CanContentScroll="True" | |||
HorizontalScrollBarVisibility="Auto" | |||
SnapsToDevicePixels="True" | |||
VerticalScrollBarVisibility="Auto"> | |||
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True --> | |||
<!-- 一下可以设置列表背景色 --> | |||
<StackPanel | |||
Background="#103153" | |||
IsItemsHost="True" | |||
KeyboardNavigation.DirectionalNavigation="Contained" /> | |||
</ScrollViewer> | |||
</Grid> | |||
</Popup> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsEditable" Value="true"> | |||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" /> | |||
</Trigger> | |||
<Trigger Property="IsMouseOver" Value="True"> | |||
<Setter TargetName="_prybr" Property="BorderBrush" Value="#aa3ba7f2" /> | |||
<!--<Setter Property="Background" Value="#553ba7f2" TargetName="_prybr"/>--> | |||
</Trigger> | |||
<Trigger Property="IsEnabled" Value="False"> | |||
<Setter TargetName="ContentSite" Property="Opacity" Value="0.6" /> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
</ResourceDictionary> |
@@ -20,8 +20,9 @@ namespace BPASmartClient.Model | |||
private int _bowLoc; | |||
public int NoodleLoc { get { return _noodleLoc; } set { _noodleLoc = value; OnPropertyChanged(); } } | |||
private int _noodleLoc; | |||
public double Frytime { get { return _frytime; } set { _frytime = value; OnPropertyChanged(); } } | |||
private double _frytime; | |||
public int FrytimeMin { get { return _frytimeMin; } set { _frytimeMin = value; OnPropertyChanged(); } } | |||
private int _frytimeMin; | |||
public int FrytimeS { get { return _frytimeS; } set { _frytimeS = value; OnPropertyChanged(); } } | |||
private int _frytimeS; | |||
} | |||
} |
@@ -10,6 +10,7 @@ namespace BPASmartClient.Model | |||
{ | |||
public int NoodleLoc { get; set ; } | |||
public int Bowloc { get; set; } | |||
public double FryTime { get; set; } | |||
public int FryTimeS { get; set; } | |||
public int FryTimeMin { get; set; } | |||
} | |||
} |
@@ -43,24 +43,42 @@ namespace BPASmartClient.MorkSUpgradedVer | |||
{ | |||
if (FoodMenuViewModel.orderStatusLists.Count > 0) | |||
{ | |||
foreach (var item in FoodMenuViewModel.orderStatusLists) | |||
for (int i = 0; i < FoodMenuViewModel.orderStatusLists.Count; i++) | |||
{ | |||
if (string.IsNullOrEmpty(item.OrderPush.SuborderId)) | |||
var res = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SortNum == 1+i); | |||
if (res != null) | |||
{ | |||
item.OrderPush.SuborderId = Guid.NewGuid().ToString(); | |||
var res = mORKS.RBTakeNoodleTask.FirstOrDefault(o => o.SuborderId == item.OrderPush.SuborderId); | |||
if (res == null) | |||
if (string.IsNullOrEmpty(res.OrderPush.SuborderId)) | |||
{ | |||
mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].NoodleLoc, SuborderId = item.OrderPush.SuborderId }); | |||
MessageLog.GetInstance.Show($"添加订单:面条位置【{Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].NoodleLoc}】"); | |||
mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].Bowloc, SuborderId = item.OrderPush.SuborderId }); | |||
MessageLog.GetInstance.Show($"添加订单:碗位置【{Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].Bowloc}】"); | |||
NoodOrderCtrl.GetInstance.WorkList(res); | |||
mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].NoodleLoc, SuborderId = res.OrderPush.SuborderId }); | |||
MessageLog.GetInstance.Show($"添加订单:面条位置【{Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].NoodleLoc}】"); | |||
mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].Bowloc, SuborderId = res.OrderPush.SuborderId }); | |||
MessageLog.GetInstance.Show($"添加订单:碗位置【{Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].Bowloc}】"); | |||
Global.EnableLocalSimOrder = true; | |||
} | |||
} | |||
} | |||
//foreach (var item in FoodMenuViewModel.orderStatusLists) | |||
//{ | |||
// if (string.IsNullOrEmpty(item.OrderPush.SuborderId)) | |||
// { | |||
// item.OrderPush.SortNum = FoodMenuViewModel.SortNum++; | |||
// item.OrderPush.SuborderId = Guid.NewGuid().ToString(); | |||
// var res = mORKS.RBTakeNoodleTask.FirstOrDefault(o => o.SuborderId == item.OrderPush.SuborderId); | |||
// if (res == null) | |||
// { | |||
// mORKS.RBTakeNoodleTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].NoodleLoc, SuborderId = item.OrderPush.SuborderId }); | |||
// MessageLog.GetInstance.Show($"添加订单:面条位置【{Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].NoodleLoc}】"); | |||
// mORKS.TakeBowlTask.Enqueue(new OrderLocInfo() { Loc = (ushort)Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].Bowloc, SuborderId = item.OrderPush.SuborderId }); | |||
// MessageLog.GetInstance.Show($"添加订单:碗位置【{Json<NoodOrder>.Data.localOrder[item.OrderPush.GoodsName].Bowloc}】"); | |||
// Global.EnableLocalSimOrder = true; | |||
// } | |||
// } | |||
//} | |||
} | |||
}), "EnableForOrder"); | |||
@@ -785,8 +803,8 @@ namespace BPASmartClient.MorkSUpgradedVer | |||
List<ushort> values = new List<ushort>(); | |||
if (Json<NoodOrder>.Data.localOrder.ContainsKey(re.OrderPush.GoodsName)) | |||
{ | |||
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTime); | |||
values.Add(0); | |||
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeMin); | |||
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeS); | |||
} | |||
else | |||
{ | |||
@@ -25,8 +25,8 @@ namespace BPASmartClient.ViewModel | |||
EditOrder = new BPARelayCommand<object>(NoodOrderCtrl.GetInstance.EditOrder); | |||
DeleteOrder = new BPARelayCommand<object>(NoodOrderCtrl.GetInstance.DeleteRecipe); | |||
} | |||
public LocalOrder LocalOrder { get { return _localOrder; } set { _localOrder = value; OnPropertyChanged(); } } | |||
private LocalOrder _localOrder = new LocalOrder(); | |||
public FoodMenuModel LocalOrder { get { return _localOrder; } set { _localOrder = value; OnPropertyChanged(); } } | |||
private FoodMenuModel _localOrder = new FoodMenuModel(); | |||
public ObservableCollection<FoodMenuModel> FoodMenus { get; set; } = FoodMenuViewModel.FoodMenus; | |||
} | |||
} |
@@ -21,20 +21,20 @@ namespace BPASmartClient | |||
{ | |||
private static NoodOrderCtrl _instance; | |||
public static NoodOrderCtrl GetInstance { get; set; }=_instance??=new NoodOrderCtrl(); | |||
public Action<LocalOrder>? orderStatusAction; | |||
public Action<LocalOrder>? editRecipeAction; | |||
public Action<FoodMenuModel>? orderStatusAction; | |||
public Action<FoodMenuModel>? editRecipeAction; | |||
public ConcurrentDictionary<string,FrameworkElement> allViews = new ConcurrentDictionary<string, FrameworkElement> (); | |||
public Action<string>? showInfo; | |||
public LocalOrder LocalOrder { get; set; } = new LocalOrder(); | |||
public void CheckOrder(object o) | |||
{ | |||
if (o is string x) | |||
{ | |||
var res = FoodMenuViewModel.FoodMenus.FirstOrDefault(o => o.GoodName == x); | |||
if (res != null) | |||
OrderStatusViewModel.orderMenus.Add(res); | |||
} | |||
} | |||
public FoodMenuModel LocalOrder { get; set; } = new FoodMenuModel(); | |||
//public void CheckOrder(object o) | |||
//{ | |||
// if (o is string x) | |||
// { | |||
// var res = FoodMenuViewModel.FoodMenus.FirstOrDefault(o => o.GoodName == x); | |||
// if (res != null) | |||
// OrderStatusViewModel.orderMenus.Add(res); | |||
// } | |||
//} | |||
public void Show(string info) | |||
{ | |||
showInfo?.Invoke(info); | |||
@@ -43,10 +43,10 @@ namespace BPASmartClient | |||
{ | |||
FoodMenuViewModel.FoodMenus.Clear(); | |||
Json<NoodOrder>.Data.localOrder?.Keys?.ToList().ForEach(key => FoodMenuViewModel.FoodMenus.Add(new FoodMenuModel { GoodName = key, BowLoc = Json<NoodOrder>.Data.localOrder[key].Bowloc, NoodleLoc = Json<NoodOrder>.Data.localOrder[key].NoodleLoc, Frytime = Json<NoodOrder>.Data.localOrder[key].FryTime })); | |||
Json<NoodOrder>.Data.localOrder?.Keys?.ToList().ForEach(key => FoodMenuViewModel.FoodMenus.Add(new FoodMenuModel { GoodName = key, BowLoc = Json<NoodOrder>.Data.localOrder[key].Bowloc, NoodleLoc = Json<NoodOrder>.Data.localOrder[key].NoodleLoc, FrytimeMin = Json<NoodOrder>.Data.localOrder[key].FryTimeMin,FrytimeS = Json<NoodOrder>.Data.localOrder[key].FryTimeS })); | |||
Json<NoodOrder>.Data.localOrder.addItem = ((key, value) => | |||
{ | |||
FoodMenuViewModel.FoodMenus.Add(new FoodMenuModel { GoodName = key ,BowLoc = value.Bowloc,NoodleLoc = value.NoodleLoc,Frytime = value.FryTime}); | |||
FoodMenuViewModel.FoodMenus.Add(new FoodMenuModel { GoodName = key ,BowLoc = value.Bowloc,NoodleLoc = value.NoodleLoc,FrytimeS = value.FryTimeS,FrytimeMin = value.FryTimeMin}); | |||
}); | |||
Json<NoodOrder>.Data.localOrder.removeItem = ((key, value) => | |||
{ | |||
@@ -57,41 +57,45 @@ namespace BPASmartClient | |||
} | |||
}); | |||
} | |||
public void RemoveOrder(object o) | |||
//public void RemoveOrder(object o) | |||
//{ | |||
// if (o is string re) | |||
// { | |||
// var res = OrderStatusViewModel.orderMenus.FirstOrDefault(o => o.GoodName == re); | |||
// if (res != null) | |||
// OrderStatusViewModel.orderMenus.Remove(res); | |||
// } | |||
//} | |||
public void StartOrder(FoodMenuModel localOrder,int amount) | |||
{ | |||
if (o is string re) | |||
if (amount > 0 && !string.IsNullOrEmpty(localOrder.GoodName)) | |||
{ | |||
var res = OrderStatusViewModel.orderMenus.FirstOrDefault(o => o.GoodName == re); | |||
if (res != null) | |||
OrderStatusViewModel.orderMenus.Remove(res); | |||
} | |||
} | |||
public void StartOrder(LocalOrder localOrder,int amount) | |||
{ | |||
if (amount > 0 && !string.IsNullOrEmpty(localOrder.Name)) | |||
{ | |||
MorksSimorderModel res = Json<NoodOrder>.Data.localOrder[localOrder.Name]; | |||
MorksSimorderModel res = Json<NoodOrder>.Data.localOrder[localOrder.GoodName]; | |||
if (res != null) | |||
{ | |||
for (int i = 0; i < amount; i++) | |||
{ | |||
Application.Current.Dispatcher.Invoke(() => | |||
{ | |||
FoodMenuViewModel.orderStatusLists.Add(new MorkOrder() | |||
FoodMenuViewModel.orderStatusLists.Insert(0,new MorkOrder() | |||
{ | |||
OrderPush = new MorkOrderPush() { DeviceId = res.DeviceId, GoodsName = localOrder.Name, SortNum = FoodMenuViewModel.SortNum++ }, | |||
OrderPush = new MorkOrderPush() { DeviceId = res.DeviceId, GoodsName = localOrder.GoodName,SortNum = FoodMenuViewModel.SortNum++}, | |||
OrderStatus = ORDER_STATUS.WAIT, | |||
StartDate = DateTime.Now.ToString("HH:mm:ss"), | |||
}); | |||
}); | |||
Json<NoodOrder>.Data.localOrder[localOrder.Name].Publish(); | |||
Json<NoodOrder>.Data.localOrder[localOrder.GoodName].Publish(); | |||
} | |||
Show($"成功下单{localOrder.Name}/{amount}次!"); | |||
Show($"成功下发{localOrder.GoodName}!共{amount}单!"); | |||
ActionManage.GetInstance.Send("EnableForOrder"); | |||
} | |||
} | |||
else | |||
{ | |||
Show($"请选择后下单"); | |||
} | |||
} | |||
public void EditOrder(object o) | |||
{ | |||
@@ -102,7 +106,7 @@ namespace BPASmartClient | |||
var res = Json<NoodOrder>.Data.localOrder[re]; | |||
if (res != null) | |||
{ | |||
LocalOrder = new LocalOrder() { Name = re, NoodleLoc = res.NoodleLoc, Bowloc = res.Bowloc, FryTime = res.FryTime }; | |||
LocalOrder = new FoodMenuModel() { GoodName = re, NoodleLoc = res.NoodleLoc, BowLoc = res.Bowloc, FrytimeMin = res.FryTimeMin,FrytimeS = res.FryTimeS }; | |||
orderStatusAction?.Invoke(LocalOrder); | |||
editRecipeAction?.Invoke(LocalOrder); | |||
} | |||
@@ -110,31 +114,31 @@ namespace BPASmartClient | |||
} | |||
} | |||
public void SaveRecipe(LocalOrder order) | |||
public void SaveRecipe(FoodMenuModel order) | |||
{ | |||
if (Json<NoodOrder>.Data.localOrder.ContainsKey(order.Name)) | |||
if (Json<NoodOrder>.Data.localOrder.ContainsKey(order.GoodName)) | |||
{ | |||
Json<NoodOrder>.Data.localOrder.ReMove(order.Name); | |||
Json<NoodOrder>.Data.localOrder.Add(order.Name, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.Bowloc, FryTime = order.FryTime,DeviceId=42}); | |||
Json<NoodOrder>.Data.localOrder.ReMove(order.GoodName); | |||
Json<NoodOrder>.Data.localOrder.Add(order.GoodName, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.BowLoc, FryTimeMin = order.FrytimeMin, FryTimeS = order.FrytimeS, DeviceId=42}); | |||
Show("已更改!"); | |||
} | |||
else | |||
{ | |||
Json<NoodOrder>.Data.localOrder.Add(order.Name, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.Bowloc, FryTime = order.FryTime, DeviceId = 42 }); | |||
Json<NoodOrder>.Data.localOrder.Add(order.GoodName, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.BowLoc, FryTimeMin = order.FrytimeMin, FryTimeS = order.FrytimeS, DeviceId = 42 }); | |||
Show("已添加!"); | |||
} | |||
} | |||
public void NewRecipe(LocalOrder order) | |||
{ | |||
if (!Json<NoodOrder>.Data.localOrder.ContainsKey(order.Name)) | |||
{ | |||
Json<NoodOrder>.Data.localOrder.Add(order.Name, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.Bowloc, FryTime = order.FryTime }); | |||
} | |||
else | |||
{ | |||
MessageBox.Show("已存在该菜品,请注意菜品名称", "提示", MessageBoxButton.OK); | |||
} | |||
} | |||
//public void NewRecipe(LocalOrder order) | |||
//{ | |||
// if (!Json<NoodOrder>.Data.localOrder.ContainsKey(order.Name)) | |||
// { | |||
// Json<NoodOrder>.Data.localOrder.Add(order.Name, new Model.MorksSimorderModel() { NoodleLoc = order.NoodleLoc, Bowloc = order.Bowloc, FryTime = order.FryTime }); | |||
// } | |||
// else | |||
// { | |||
// MessageBox.Show("已存在该菜品,请注意菜品名称", "提示", MessageBoxButton.OK); | |||
// } | |||
//} | |||
public void DeleteRecipe(object o) | |||
{ | |||
if (o is string re) | |||
@@ -163,7 +167,12 @@ namespace BPASmartClient | |||
FoodMenuViewModel.WaitTakeMeal.Insert(0, res); | |||
}); | |||
} | |||
public void WorkList(MorkOrder res) | |||
{ | |||
Application.Current.Dispatcher.Invoke(() => { | |||
res.OrderPush.SuborderId = Guid.NewGuid().ToString(); | |||
}); | |||
} | |||
public Task FinishOrder(MorkOrder res) | |||
{ | |||
return Task.Factory.StartNew(() => | |||
@@ -171,7 +180,7 @@ namespace BPASmartClient | |||
Thread.Sleep(1000); | |||
Application.Current.Dispatcher.Invoke(() => | |||
{ | |||
FoodMenuViewModel.WaitTakeMeal.Remove(res); | |||
FoodMenuViewModel.WaitTakeMeal.Remove(res); | |||
}); | |||
}); | |||
} | |||
@@ -37,26 +37,13 @@ namespace BPASmartClient.ViewModel | |||
EditOrder = new BPARelayCommand<object>(NoodOrderCtrl.GetInstance.EditOrder); | |||
} | |||
#endregion | |||
public ObservableCollection<MorkOrder> orderStatusLists { get; set; } = FoodMenuViewModel.orderStatusLists; | |||
public ObservableCollection<FoodMenuModel> FoodMenus { get; set; } = FoodMenuViewModel.FoodMenus; | |||
public static ObservableCollection<FoodMenuModel> orderMenus { get; set; } = new ObservableCollection<FoodMenuModel>(); | |||
public LocalOrder LocalOrder { get { return _localOrder; } set { _localOrder = value; OnPropertyChanged(); } } | |||
private LocalOrder _localOrder= new LocalOrder(); | |||
public FoodMenuModel LocalOrder { get { return _localOrder; } set { _localOrder = value; OnPropertyChanged(); } } | |||
private FoodMenuModel _localOrder = new FoodMenuModel(); | |||
public int OrderAmount { get { return _orderAmount; } set { _orderAmount = value; OnPropertyChanged(); } } | |||
private int _orderAmount = 1; | |||
} | |||
public class LocalOrder : NotifyBase | |||
{ | |||
public string Name { get { return _name; } set { _name = value; OnPropertyChanged(); } } | |||
private string _name = string.Empty; | |||
public int NoodleLoc { get { return _noodleLoc; } set { _noodleLoc = value; OnPropertyChanged(); } } | |||
private int _noodleLoc; | |||
public int Bowloc { get { return _bowloc; } set { _bowloc = value; OnPropertyChanged(); } } | |||
private int _bowloc; | |||
public double FryTime { get { return _fryTime; } set { _fryTime = value; OnPropertyChanged(); } } | |||
private double _fryTime; | |||
} | |||
} |
@@ -3,7 +3,8 @@ | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" | |||
xmlns:local="clr-namespace:BPASmartClient"> | |||
xmlns:myConvert ="clr-namespace:MyConvert" | |||
xmlns:local="clr-namespace:BPASmartClient" xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"> | |||
<Application.Resources> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
@@ -34,7 +35,7 @@ | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> | |||
<Grid HorizontalAlignment="Stretch" Background="Transparent" VerticalAlignment="Stretch"> | |||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal"> | |||
<Border x:Name="btnBorder" Height="60" Width="60" Background="{TemplateBinding Background}"/> | |||
<ContentControl x:Name="ctrl" Margin="40,0,0,0" Content="{TemplateBinding Content}" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"/> | |||
@@ -58,7 +59,7 @@ | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type Button}"> | |||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> | |||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Transparent"> | |||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical"> | |||
<Border Height="60" x:Name="btnBorder" Width="60" Background="{TemplateBinding Background}"/> | |||
<ContentControl x:Name="ctrl" Margin="0,40,0,0" Content="{TemplateBinding Content}" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"/> | |||
@@ -219,6 +220,90 @@ | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> | |||
<Setter Property="OverridesDefaultStyle" Value="true"/> | |||
<Setter Property="BorderBrush" Value="Red"/> | |||
<Setter Property="Focusable" Value="false"/> | |||
<Setter Property="ClickMode" Value="Press"/> | |||
<Setter Property="Template"> | |||
<Setter.Value> | |||
<ControlTemplate TargetType="{x:Type ToggleButton}"> | |||
<Border x:Name="templateRoot" Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,0,1" SnapsToDevicePixels="true"> | |||
<Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="1" HorizontalAlignment="Right" Margin="0" SnapsToDevicePixels="true" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"> | |||
<TextBlock x:Name="arrow" FontSize="10" Text="" FontFamily="../../Image/#iconfont" Background="Transparent" Foreground="{TemplateBinding BorderBrush}" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center"/> | |||
</Border> | |||
</Border> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Foreground" TargetName="arrow" Value="white"/> | |||
<Setter Property="Background" TargetName="templateRoot" Value="{Binding BorderBrush,RelativeSource={RelativeSource Mode=TemplatedParent}}"/> | |||
<Setter Property="Opacity" TargetName="templateRoot" Value="0.8"/> | |||
</Trigger> | |||
<Trigger Property="IsPressed" Value="true"> | |||
<Setter Property="Opacity" TargetName="templateRoot" Value="0.6"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}"> | |||
<Grid x:Name="templateRoot" SnapsToDevicePixels="true"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="*"/> | |||
<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/> | |||
</Grid.ColumnDefinitions> | |||
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="1" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"> | |||
<theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}"> | |||
<Border x:Name="dropDownBorder" Background="Transparent" BorderBrush="{TemplateBinding Foreground}" Height="200" BorderThickness="1"> | |||
<ScrollViewer x:Name="DropDownScrollViewer" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden"> | |||
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled"> | |||
<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0"> | |||
<Rectangle x:Name="opaqueRect" Fill="White" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/> | |||
</Canvas> | |||
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> | |||
</Grid> | |||
</ScrollViewer> | |||
</Border> | |||
</theme:SystemDropShadowChrome> | |||
</Popup> | |||
<ToggleButton x:Name="toggleButton" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Style="{StaticResource ComboBoxToggleButton}"/> | |||
<ContentControl x:Name="contentPresenter" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | |||
</Grid> | |||
<ControlTemplate.Triggers> | |||
<Trigger Property="IsMouseOver" Value="true"> | |||
<Setter Property="Foreground" TargetName="contentPresenter" Value="white"/> | |||
</Trigger> | |||
<Trigger Property="HasItems" Value="false"> | |||
<Setter Property="Height" TargetName="dropDownBorder" Value="95"/> | |||
</Trigger> | |||
<MultiTrigger> | |||
<MultiTrigger.Conditions> | |||
<Condition Property="IsGrouping" Value="true"/> | |||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> | |||
</MultiTrigger.Conditions> | |||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/> | |||
</MultiTrigger> | |||
<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false"> | |||
<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/> | |||
<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/> | |||
</Trigger> | |||
</ControlTemplate.Triggers> | |||
</ControlTemplate> | |||
<Style x:Key="ComboBoxStyle1" TargetType="{x:Type ComboBox}"> | |||
<Setter Property="HorizontalContentAlignment" Value="Left"/> | |||
<Setter Property="VerticalContentAlignment" Value="Center"/> | |||
<Setter Property="FontSize" Value="25"/> | |||
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/> | |||
</Style> | |||
<myConvert:NoodleConvert x:Key="noodleConvert"/> | |||
<myConvert:BowConvert x:Key="BowConvert"/> | |||
</ResourceDictionary> | |||
</Application.Resources> | |||
</Application> |
@@ -21,8 +21,9 @@ | |||
<None Remove="Image\bk.png" /> | |||
<None Remove="Image\bk_1.png" /> | |||
<None Remove="Image\ebg.jpg" /> | |||
<None Remove="Image\iconfont.ttf" /> | |||
<None Remove="Image\noodle.jpg" /> | |||
<None Remove="Image\noodle_1.jpeg" /> | |||
<None Remove="Image\noodle_1.jpg" /> | |||
<None Remove="Image\主页.png" /> | |||
<None Remove="Image\表头.jpg" /> | |||
</ItemGroup> | |||
@@ -62,8 +63,9 @@ | |||
<ItemGroup> | |||
<Resource Include="Image\ebg.jpg" /> | |||
<Resource Include="Image\iconfont.ttf" /> | |||
<Resource Include="Image\noodle.jpg" /> | |||
<Resource Include="Image\noodle_1.jpeg" /> | |||
<Resource Include="Image\noodle_1.jpg" /> | |||
<Resource Include="Image\主页.png" /> | |||
<Resource Include="Image\表头.jpg" /> | |||
</ItemGroup> | |||
@@ -39,31 +39,32 @@ | |||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/菜品_1.png" Height="40" Width="40"/> | |||
<TextBlock Margin="20,0,0,0" Text="菜品名称 :" Foreground="Black" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="面条名称 :" Foreground="Black" FontSize="30" FontWeight="Black"/> | |||
<Border BorderBrush="Black" BorderThickness="0,0,0,2" Width="200"> | |||
<TextBox x:Name="nameText" Margin="0,0,0,2" Foreground="Black" Text="{Binding LocalOrder.Name}" Style="{StaticResource ComboBoxEditableTextBox}" FontSize="28" Background="Transparent" Height="40" /> | |||
<TextBox x:Name="nameText" Margin="0,0,0,2" Foreground="Black" Text="{Binding LocalOrder.GoodName}" Style="{StaticResource ComboBoxEditableTextBox}" FontSize="28" Background="Transparent" Height="40" /> | |||
</Border> | |||
</StackPanel> | |||
<StackPanel Margin="0,40,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/面条_1.png" Height="40" Width="40"/> | |||
<TextBlock Margin="20,0,0,0" Text="面条位置 :" Foreground="#F08454" FontSize="30" FontWeight="Black"/> | |||
<Border BorderBrush="#F08454" BorderThickness="0,0,0,2" Width="200"> | |||
<TextBox Margin="0,0,0,2" Text="{Binding LocalOrder.NoodleLoc}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#F08454" FontSize="28" Background="Transparent" Height="40" /> | |||
</Border> | |||
<ComboBox x:Name="NoodLoc" Width="200" Margin="0,0,0,2" Style="{StaticResource ComboBoxStyle1}" SelectedItem="{Binding LocalOrder.NoodleLoc,Converter={StaticResource noodleConvert}}" Foreground="#F08454" BorderBrush="#F08454" /> | |||
</StackPanel> | |||
<StackPanel Margin="0,40,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/碗.png" Height="40" Width="40"/> | |||
<TextBlock Margin="20,0,0,0" Text="面碗位置 :" Foreground="#F3CE98" FontSize="30" FontWeight="Black"/> | |||
<Border BorderBrush="#F3CE98" BorderThickness="0,0,0,2" Width="200"> | |||
<TextBox Margin="0,0,0,2" Text="{Binding LocalOrder.Bowloc}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#F3CE98" FontSize="28" Background="Transparent" Height="40" /> | |||
</Border> | |||
<TextBlock Margin="20,0,0,0" Text="面碗位置 :" Foreground="#EA7BD1" FontSize="30" FontWeight="Black"/> | |||
<ComboBox Width="200" x:Name="BowLoc" Margin="0,0,0,2" Style="{StaticResource ComboBoxStyle1}" SelectedItem="{Binding LocalOrder.BowLoc,Converter={StaticResource BowConvert}}" Foreground="#EA7BD1" BorderBrush="#EA7BD1" /> | |||
</StackPanel> | |||
<StackPanel Margin="0,40,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/时间.png" Height="40" Width="40"/> | |||
<TextBlock Margin="20,0,0,0" Text="炒制时间 :" Foreground="#ECBB52" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="煮面时间 :" Foreground="#ECBB52" FontSize="30" FontWeight="Black"/> | |||
<Border BorderBrush="#ECBB52" BorderThickness="0,0,0,2" Width="200"> | |||
<TextBox Margin="0,0,0,2" Text="{Binding LocalOrder.FryTime}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" /> | |||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> | |||
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeMin}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" /> | |||
<TextBlock Margin="0,0,10,2" Text="分" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" /> | |||
<TextBox Margin="0,0,0,2" Width="60" Text="{Binding LocalOrder.FrytimeS}" Style="{StaticResource ComboBoxEditableTextBox}" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" /> | |||
<TextBlock Margin="0,0,0,2" Text="秒" Foreground="#ECBB52" FontSize="28" Background="Transparent" Height="40" /> | |||
</StackPanel> | |||
</Border> | |||
</StackPanel> | |||
@@ -93,11 +94,11 @@ | |||
<StackPanel Margin="10,0,0,0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" > | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面条位置:" Foreground="#F08454" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding NoodleLoc}" FontSize="14" Foreground="#F08454" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding NoodleLoc,Converter={StaticResource noodleConvert}}" FontSize="14" Foreground="#F08454" FontWeight="Black"/> | |||
</StackPanel> | |||
<StackPanel Margin="0,5,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面碗位置:" Foreground="#F08454" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding BowLoc}" Foreground="#F08454" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding BowLoc,Converter={StaticResource BowConvert}}" Foreground="#F08454" FontSize="14" FontWeight="Black"/> | |||
</StackPanel> | |||
</StackPanel> | |||
</StackPanel> | |||
@@ -105,9 +106,11 @@ | |||
<Grid HorizontalAlignment="Right" Height="60" Margin="0,0,20,0" VerticalAlignment="Top"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<Image Height="20" Width="20" Source="/BPASmartClient.CustomResource;component/Image/时间.png"/> | |||
<TextBlock Text="炒制时间:" Foreground="#ECBB52" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="10,0,0,0" Text="{Binding Frytime}" Foreground="#ECBB52" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="min" Foreground="#ECBB52" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Text="炒制时间:" Foreground="#FBAF1A" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="5,0,0,0" Text="{Binding FrytimeMin}" VerticalAlignment="Center" Foreground="#FBAF1A" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="min" Foreground="#FBAF1A" FontSize="16" VerticalAlignment="Center" FontWeight="Black"/> | |||
<TextBlock Margin="2,0,0,0" Text="{Binding FrytimeS}" Foreground="#FBAF1A" VerticalAlignment="Center" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="s" Foreground="#FBAF1A" FontSize="16" VerticalAlignment="Center" FontWeight="Black"/> | |||
</StackPanel> | |||
</Grid> | |||
<Button Style="{StaticResource viewBtn_3}" Content="删除" Foreground="White" Command="{Binding ElementName=editView,Path=DeleteOrder}" CommandParameter="{Binding ElementName=checkOrder,Path=Content}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="20" Width="60" Margin="20"> | |||
@@ -21,6 +21,10 @@ namespace BPASmartClient.Control | |||
public EditRecipeView() | |||
{ | |||
InitializeComponent(); | |||
List<string> bowLocList = new List<string>() { "大碗", "小碗" }; | |||
BowLoc.ItemsSource = bowLocList; | |||
List<string> noodLocList = new List<string>() { "自动", "1号位", "2号位", "3号位", "4号位", "5号位" }; | |||
NoodLoc.ItemsSource = noodLocList; | |||
} | |||
} | |||
} |
@@ -26,38 +26,31 @@ | |||
<SolidColorBrush x:Key="CursorColor" Color="Aqua" /> | |||
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" /> | |||
<SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" /> | |||
</ResourceDictionary> | |||
</UserControl.Resources> | |||
<Grid Background="#D7D7D7"> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition Width="0.1*"/> | |||
<ColumnDefinition Width="1600"/> | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<Grid Background="#23282E"> | |||
<StackPanel Orientation="Vertical" VerticalAlignment="Top"> | |||
<RadioButton IsChecked="True" Click="RadioButton_Click" Style="{StaticResource toggle}" GroupName="or" Width="180" Height="60" FontSize="30" Content="本地菜谱" Foreground="White"/> | |||
<RadioButton IsChecked="False" Click="RadioButton_Click" Style="{StaticResource toggle}" GroupName="or" Width="180" Height="60" FontSize="30" Content="云端菜谱" Foreground="White"/> | |||
</StackPanel> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition/> | |||
<RowDefinition Height="120"/> | |||
</Grid.RowDefinitions> | |||
<Grid x:Name="localRecipe" Margin="20"> | |||
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<Grid x:Name="localRecipe" > | |||
<ScrollViewer Margin="0,20,0,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding FoodMenus}"> | |||
<ItemsControl.ItemsPanel> | |||
<ItemsPanelTemplate> | |||
<WrapPanel Orientation="Horizontal" Width="1600"/> | |||
<WrapPanel Orientation="Horizontal" Width="1500"/> | |||
</ItemsPanelTemplate> | |||
</ItemsControl.ItemsPanel> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid Height="220" Width="320" > | |||
<Grid Height="220" Width="300" > | |||
<RadioButton Content="{Binding GoodName}" Foreground="Black" Background="White" x:Name="checkOrder" Command="{Binding ElementName=orderstatusView,Path=EditOrder}" GroupName="hh" FontSize="40" FontWeight="Black" CommandParameter="{Binding ElementName=checkOrder,Path=Content}" Margin="5" Style="{DynamicResource togrecipebtn}"/> | |||
<Grid Height="80" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="20,0"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
@@ -65,11 +58,11 @@ | |||
<StackPanel Margin="10,0,0,0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" > | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面条位置:" Foreground="#F08454" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding NoodleLoc}" FontSize="14" Foreground="#F08454" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding NoodleLoc,Converter={StaticResource noodleConvert}}" FontSize="14" Foreground="#F08454" FontWeight="Black"/> | |||
</StackPanel> | |||
<StackPanel Margin="0,5,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面碗位置:" Foreground="#F08454" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding BowLoc}" Foreground="#F08454" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding BowLoc,Converter={StaticResource BowConvert}}" Foreground="#F08454" FontSize="14" FontWeight="Black"/> | |||
</StackPanel> | |||
</StackPanel> | |||
</StackPanel> | |||
@@ -77,9 +70,11 @@ | |||
<Grid HorizontalAlignment="Right" Height="60" Margin="0,0,20,0" VerticalAlignment="Top"> | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<Image Height="20" Width="20" Source="/BPASmartClient.CustomResource;component/Image/时间.png"/> | |||
<TextBlock Text="炒制时间:" Foreground="#ECBB52" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="10,0,0,0" Text="{Binding Frytime}" Foreground="#ECBB52" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="min" Foreground="#ECBB52" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Text="炒制时间:" Foreground="#FBAF1A" FontSize="16" FontWeight="Black"/> | |||
<TextBlock Margin="5,0,0,0" Text="{Binding FrytimeMin}" VerticalAlignment="Center" Foreground="#FBAF1A" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="min" Foreground="#FBAF1A" FontSize="16" VerticalAlignment="Center" FontWeight="Black"/> | |||
<TextBlock Margin="2,0,0,0" Text="{Binding FrytimeS}" Foreground="#FBAF1A" VerticalAlignment="Center" FontSize="14" FontWeight="Black"/> | |||
<TextBlock Text="s" Foreground="#FBAF1A" FontSize="16" VerticalAlignment="Center" FontWeight="Black"/> | |||
</StackPanel> | |||
</Grid> | |||
</Grid> | |||
@@ -98,16 +93,16 @@ | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<Image Source="/BPASmartClient.CustomResource;component/Image/菜品_1.png" Margin="40,30,10,30"/> | |||
<TextBlock Margin="0,0,20,0" Text="菜品名称:" Foreground="Black" FontSize="35" FontWeight="Black"/> | |||
<TextBlock Text="{Binding LocalOrder.Name}" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Text="{Binding LocalOrder.GoodName}" FontSize="30" FontWeight="Black"/> | |||
<Image Margin="40,30,10,30" Source="/BPASmartClient.CustomResource;component/Image/面条.png"/> | |||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" > | |||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面条位置:" Foreground="Black" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding LocalOrder.NoodleLoc}" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding LocalOrder.NoodleLoc,Converter={StaticResource noodleConvert}}" FontSize="30" FontWeight="Black"/> | |||
</StackPanel> | |||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> | |||
<TextBlock Text="面碗位置:" Foreground="Black" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding LocalOrder.Bowloc}" FontSize="30" FontWeight="Black"/> | |||
<TextBlock Margin="20,0,0,0" Text="{Binding LocalOrder.BowLoc,Converter={StaticResource BowConvert}}" FontSize="30" FontWeight="Black"/> | |||
</StackPanel> | |||
</StackPanel> | |||
</StackPanel> | |||
@@ -147,7 +142,58 @@ | |||
</Border> | |||
</Grid> | |||
<Border Grid.Column="1" BorderBrush="White" BorderThickness="3,0,0,0"/> | |||
<Grid Grid.Column="1"> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50"/> | |||
<RowDefinition/> | |||
</Grid.RowDefinitions> | |||
<Grid> | |||
<Grid.ColumnDefinitions> | |||
<ColumnDefinition/> | |||
<ColumnDefinition/> | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<TextBlock Text="订单号" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
<TextBlock Grid.Column="1" Foreground="White" Text="名称" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
<TextBlock Grid.Column="2" Foreground="White" Text="状态" HorizontalAlignment="Center" VerticalAlignment="Center"/> | |||
</Grid> | |||
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> | |||
<ItemsControl ItemsSource="{Binding orderStatusLists}"> | |||
<ItemsControl.ItemTemplate> | |||
<DataTemplate> | |||
<Grid x:Name="MyGrid" Margin="10" Height="40"> | |||
<Border Background="White" CornerRadius="20"> | |||
<StackPanel Orientation="Horizontal"> | |||
<TextBlock Margin="20,0" Grid.Column="0" FontSize="25" FontFamily="黑体" Foreground="#609FE7" HorizontalAlignment="Center" Style="{StaticResource TextBlockStyle}" Text="{Binding OrderPush.SortNum}" /> | |||
<TextBlock Margin="5,0,0,0" FontSize="20" FontWeight="Black" VerticalAlignment="Center" FontFamily="黑体" Foreground="Blue" HorizontalAlignment="Center" Style="{StaticResource TextBlockStyle}" Text="{Binding OrderPush.GoodsName}"/> | |||
<TextBlock Margin="20,0" HorizontalAlignment="Center" FontSize="20" FontFamily="黑体" Foreground="{Binding OrderStatus, Converter={StaticResource ColorConverter}}" Style="{StaticResource TextBlockStyle}" Text="{Binding OrderStatus, Converter={StaticResource TextConverter}}" /> | |||
</StackPanel> | |||
</Border> | |||
</Grid> | |||
<DataTemplate.Triggers> | |||
<EventTrigger RoutedEvent="FrameworkElement.Loaded"> | |||
<BeginStoryboard> | |||
<Storyboard AutoReverse="False"> | |||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MyGrid" Storyboard.TargetProperty="Height"> | |||
<EasingDoubleKeyFrame KeyTime="0" Value="0"/> | |||
<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="40"/> | |||
</DoubleAnimationUsingKeyFrames> | |||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="MyGrid" Storyboard.TargetProperty="Opacity"> | |||
<EasingDoubleKeyFrame KeyTime="0" Value="0"/> | |||
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/> | |||
</DoubleAnimationUsingKeyFrames> | |||
</Storyboard> | |||
</BeginStoryboard> | |||
</EventTrigger> | |||
</DataTemplate.Triggers> | |||
</DataTemplate> | |||
</ItemsControl.ItemTemplate> | |||
</ItemsControl> | |||
</ScrollViewer> | |||
</Grid> | |||
</Grid> | |||
@@ -49,7 +49,7 @@ | |||
<ColumnDefinition/> | |||
</Grid.ColumnDefinitions> | |||
<Grid> | |||
<Image Source="../../Image/noodle_1.jpeg" Stretch="UniformToFill" /> | |||
<Image Source="../../Image/noodle_1.jpg" Stretch="UniformToFill" /> | |||
<Border BorderBrush="White" BorderThickness="0.8" Margin="10"/> | |||
</Grid> | |||
<Grid Grid.Column="1"> | |||
@@ -66,7 +66,7 @@ | |||
</LinearGradientBrush> | |||
</Border.Background> | |||
</Border> | |||
<Button Content="开始点餐" Tag="OrderStatusView" Style="{DynamicResource viewBtn_1}" Click="btnClick" FontSize="50" Foreground="White"> | |||
<Button Content="开始点餐" Tag="OrderStatusView" Style="{DynamicResource viewBtn_1}" Click="btnClick" FontSize="50" Foreground="White"> | |||
<Button.Background> | |||
<ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/点餐.png"/> | |||
</Button.Background> | |||
@@ -0,0 +1,116 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Globalization; | |||
using System.Text; | |||
using System.Windows.Data; | |||
using System.Windows.Media; | |||
namespace MyConvert | |||
{ | |||
public class NoodleConvert : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
if (value is int num) | |||
{ | |||
switch (num) | |||
{ | |||
case 0: | |||
return "自动"; | |||
case 1: | |||
return "1号位"; | |||
case 2: | |||
return "2号位"; | |||
case 3: | |||
return "3号位"; | |||
case 4: | |||
return "4号位"; | |||
case 5: | |||
return "5号位"; | |||
default: | |||
return "自动"; | |||
} | |||
} | |||
else | |||
{ | |||
return "自动"; | |||
} | |||
} | |||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
if (value is string adress) | |||
{ | |||
switch (adress) | |||
{ | |||
case "自动": | |||
return 0; | |||
case "1号位": | |||
return 1; | |||
case "2号位": | |||
return 2; | |||
case "3号位": | |||
return 3; | |||
case "4号位": | |||
return 4; | |||
case "5号位": | |||
return 5; | |||
default: | |||
return 0; | |||
} | |||
} | |||
else | |||
{ | |||
return 0; | |||
} | |||
} | |||
} | |||
public class BowConvert : IValueConverter | |||
{ | |||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
if (value is int num) | |||
{ | |||
switch (num) | |||
{ | |||
case 10: | |||
return "大碗"; | |||
case 11: | |||
return "小碗"; | |||
default: | |||
return "小碗"; | |||
} | |||
} | |||
else | |||
{ | |||
return "小碗"; | |||
} | |||
} | |||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |||
{ | |||
if (value is string sizeName) | |||
{ | |||
switch (sizeName) | |||
{ | |||
case "大碗": | |||
return 10; | |||
case "小碗": | |||
return 11; | |||
default: | |||
return 11; | |||
} | |||
} | |||
else | |||
{ | |||
return 11; | |||
} | |||
} | |||
} | |||
} |