290 lines
9.7 KiB
XML
290 lines
9.7 KiB
XML
<UserControl
|
|
x:Class="OrderSupportTicket.Views.TicketSidebarView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:behaviors="clr-namespace:OrderSupportTicket.Behaviors"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:models="clr-namespace:OrderSupportTicket.Models"
|
|
xmlns:vm="clr-namespace:OrderSupportTicket.ViewModels"
|
|
d:Background="White"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<ResourceDictionary Source="OrderSupportTicketStyles.xaml" />
|
|
</UserControl.Resources>
|
|
<Border BorderBrush="#DDE2E8" BorderThickness="0,0,1,0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="40" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel
|
|
Margin="14,0"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<TextBlock
|
|
FontSize="15"
|
|
FontWeight="SemiBold"
|
|
Text="历史工单" />
|
|
<Border
|
|
Margin="8,0,0,0"
|
|
Padding="7,2"
|
|
Background="#B3261E"
|
|
CornerRadius="9"
|
|
Visibility="{Binding HasNewData, Converter={StaticResource BoolToVisibility}}">
|
|
<TextBlock
|
|
FontSize="11"
|
|
Foreground="White"
|
|
Text="{Binding NewDataText}" />
|
|
</Border>
|
|
</StackPanel>
|
|
<Grid Grid.Row="1">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Grid Margin="11,8,14,4">
|
|
<TextBox
|
|
Padding="8,5"
|
|
Background="#FAFBFC"
|
|
BorderBrush="#DDE2E8"
|
|
GotFocus="TicketSearchBox_GotFocus"
|
|
Text="{Binding TicketSearchText, UpdateSourceTrigger=PropertyChanged}" />
|
|
<TextBlock
|
|
Margin="9,0"
|
|
VerticalAlignment="Center"
|
|
Foreground="#6B7785"
|
|
IsHitTestVisible="False"
|
|
Text="搜索订单号、商品、店铺或状态">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding TicketSearchText}" Value="">
|
|
<Setter Property="Visibility" Value="Visible" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Grid>
|
|
<TabControl
|
|
Grid.Row="1"
|
|
Margin="11,0,14,4"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
ItemContainerStyle="{StaticResource StatusTabItemStyle}"
|
|
SelectedIndex="{Binding SelectedTicketStatusIndex}">
|
|
<TabItem Header="全部" />
|
|
<TabItem Header="待客服回复" />
|
|
<TabItem Header="客服已回复" />
|
|
<TabItem Header="已完结" />
|
|
</TabControl>
|
|
<Border
|
|
Grid.Row="2"
|
|
Padding="11,10"
|
|
Background="#F3EAF2"
|
|
BorderBrush="#98638F"
|
|
BorderThickness="3,1,0,1"
|
|
Visibility="{Binding IsDraftVisible, Converter={StaticResource BoolToVisibility}}">
|
|
<StackPanel>
|
|
<TextBlock FontWeight="SemiBold" Text="新工单(未提交)" />
|
|
<TextBlock
|
|
Margin="0,5,0,0"
|
|
FontSize="12"
|
|
MouseLeftButtonUp="CopyOrderId_MouseLeftButtonUp"
|
|
Style="{StaticResource CopyableOrderIdStyle}"
|
|
Tag="{Binding SelectedOrder.OrderId}"
|
|
Text="{Binding SelectedOrder.OrderId, StringFormat=订单 {0}}" />
|
|
<TextBlock
|
|
Margin="0,4,0,0"
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="请在右侧描述问题" />
|
|
</StackPanel>
|
|
</Border>
|
|
<ListBox
|
|
Grid.Row="3"
|
|
behaviors:ListBoxInteractionBehavior.SelectedItemCommand="{Binding SelectTicketCommand}"
|
|
d:ItemsSource="{d:SampleData ItemCount=10}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
ItemContainerStyle="{StaticResource TicketListItemStyle}"
|
|
ItemsSource="{Binding TicketView}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
SelectedItem="{Binding SelectedTicket, Mode=OneWay}">
|
|
<ListBox.Resources>
|
|
<Style BasedOn="{StaticResource ChatScrollBarStyle}" TargetType="ScrollBar" />
|
|
</ListBox.Resources>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type vm:WorkOrderSummaryViewModel}">
|
|
<Grid Margin="11,10,14,10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
FontWeight="SemiBold"
|
|
Foreground="{StaticResource TextBrush}"
|
|
Tag="{Binding WechatOrderId}"
|
|
Text="{Binding WechatOrderId}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
<Border
|
|
x:Name="UnreadBadge"
|
|
Grid.Column="1"
|
|
Height="18"
|
|
MinWidth="18"
|
|
Margin="6,-1,0,0"
|
|
Padding="5,0"
|
|
Background="{StaticResource BrandBrush}"
|
|
CornerRadius="9">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="11"
|
|
Foreground="White"
|
|
Text="{Binding UnreadCount}" />
|
|
</Border>
|
|
</Grid>
|
|
<Border
|
|
Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
Style="{StaticResource StatusTagStyle}">
|
|
<TextBlock Style="{StaticResource StatusTextStyle}" Text="{Binding StatusText}" />
|
|
</Border>
|
|
</Grid>
|
|
<Grid Grid.Row="1" Margin="0,7,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="48" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Width="48" Height="48">
|
|
<Border
|
|
Background="#F1F3F6"
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="18"
|
|
Foreground="#9AA5B1"
|
|
Style="{StaticResource TextBlockIcon}"
|
|
Text="{StaticResource txt-image}" />
|
|
</Border>
|
|
<Border
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="1"
|
|
CornerRadius="4">
|
|
<Border.Background>
|
|
<ImageBrush ImageSource="{Binding ProductImage}" Stretch="UniformToFill" />
|
|
</Border.Background>
|
|
</Border>
|
|
</Grid>
|
|
<StackPanel Grid.Column="1" Margin="9,0,0,0">
|
|
<TextBlock
|
|
FontSize="13"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding ProductNameText}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
<Grid Margin="0,3,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
FontSize="12"
|
|
FontWeight="SemiBold"
|
|
Foreground="{StaticResource PriceBrush}"
|
|
Text="{Binding ProductAmountText}" />
|
|
<TextBlock
|
|
Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
FontSize="12"
|
|
Foreground="{StaticResource SubTextBrush}"
|
|
Text="{Binding ShopName, StringFormat=店铺 {0}}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
</Grid>
|
|
<Grid Margin="0,3,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
FontSize="11"
|
|
Foreground="{StaticResource SubTextBrush}"
|
|
Text="{Binding PreviewText}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
<TextBlock
|
|
Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
FontSize="11"
|
|
Foreground="{StaticResource SubTextBrush}"
|
|
Text="{Binding UpdatedAtText}" />
|
|
</Grid>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding UnreadCount}" Value="0">
|
|
<Setter TargetName="UnreadBadge" Property="Visibility" Value="Collapsed" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Grid>
|
|
<Button
|
|
Grid.Row="2"
|
|
Padding="14,9"
|
|
HorizontalContentAlignment="Left"
|
|
Background="Transparent"
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="0,1,0,0"
|
|
Command="{Binding RetryRealtimeCommand}"
|
|
Cursor="Hand">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Ellipse
|
|
Width="8"
|
|
Height="8"
|
|
Margin="0,0,8,0">
|
|
<Ellipse.Style>
|
|
<Style TargetType="Ellipse">
|
|
<Setter Property="Fill" Value="#D14343" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding SseState}" Value="{x:Static models:TicketRealtimeState.Connected}">
|
|
<Setter Property="Fill" Value="#2F7D4F" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding SseState}" Value="{x:Static models:TicketRealtimeState.Connecting}">
|
|
<Setter Property="Fill" Value="#D99A1B" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding SseState}" Value="{x:Static models:TicketRealtimeState.Reconnecting}">
|
|
<Setter Property="Fill" Value="#D99A1B" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
<TextBlock
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="{Binding SseStatusText}" />
|
|
</StackPanel>
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
</UserControl>
|