290 lines
10 KiB
XML
290 lines
10 KiB
XML
<UserControl
|
|
x:Class="OrderSupportTicket.Views.TicketConversationView"
|
|
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:vm="clr-namespace:OrderSupportTicket.ViewModels"
|
|
xmlns:wpf="WPFCommon"
|
|
d:Background="White"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="OrderSupportTicketStyles.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<wpf:CommandProxy x:Key="ShowImageCommand" Command="{Binding ShowImageWindowCommand}" />
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid d:Visibility="Visible" Visibility="{Binding IsChatVisible, Converter={StaticResource BoolToVisibility}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Padding="18,11"
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="0,0,0,1">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
FontWeight="SemiBold"
|
|
MouseLeftButtonUp="CopyOrderId_MouseLeftButtonUp"
|
|
Style="{StaticResource CopyableOrderIdStyle}"
|
|
Tag="{Binding SelectedTicket.WechatOrderId}"
|
|
Text="{Binding SelectedTicket.WechatOrderId}" />
|
|
<Border
|
|
Margin="9,0,0,0"
|
|
DataContext="{Binding SelectedTicket}"
|
|
Style="{StaticResource StatusTagStyle}">
|
|
<TextBlock Style="{StaticResource StatusTextStyle}" Text="{Binding StatusText}" />
|
|
</Border>
|
|
</StackPanel>
|
|
<TextBlock
|
|
Margin="0,3,0,0"
|
|
FontSize="13"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding SelectedTicket.ProductNameText}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
<TextBlock
|
|
Margin="0,2,0,0"
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="{Binding SelectedTicket.ShopName, StringFormat=店铺 {0}}" />
|
|
</StackPanel>
|
|
<Button
|
|
Grid.Column="1"
|
|
Padding="12,5"
|
|
Background="Transparent"
|
|
BorderBrush="#98638F"
|
|
Command="{Binding LoadEarlierMessagesCommand}"
|
|
Content="加载更早留言">
|
|
<Button.Style>
|
|
<Style BasedOn="{StaticResource GhostButtonStyle}" TargetType="Button">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding HasMoreMessages}" Value="False">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Button.Style>
|
|
</Button>
|
|
<Button
|
|
Grid.Column="2"
|
|
Width="32"
|
|
Height="32"
|
|
Margin="8,0,0,0"
|
|
Padding="5"
|
|
VerticalAlignment="Top"
|
|
AutomationProperties.Name="刷新当前工单消息"
|
|
Command="{Binding RefreshMessagesCommand}"
|
|
Style="{StaticResource IconButtonStyle}"
|
|
ToolTip="刷新当前工单消息">
|
|
<TextBlock
|
|
FontSize="18"
|
|
Style="{StaticResource TextBlockIcon}"
|
|
Text="{StaticResource txt-arrow_clockwise}" />
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
<Grid Grid.Row="1">
|
|
<ListBox
|
|
Margin="18,10"
|
|
behaviors:ListBoxInteractionBehavior.ScrollVersion="{Binding MessageScrollVersion}"
|
|
d:ItemsSource="{d:SampleData ItemCount=10}"
|
|
Background="Transparent"
|
|
BorderThickness="0"
|
|
ItemContainerStyle="{StaticResource ChatListItemStyle}"
|
|
ItemsSource="{Binding Messages}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
|
VirtualizingPanel.ScrollUnit="Pixel">
|
|
<ListBox.Resources>
|
|
<Style BasedOn="{StaticResource ChatScrollBarStyle}" TargetType="ScrollBar" />
|
|
</ListBox.Resources>
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<VirtualizingStackPanel />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type vm:ChatMessageViewModel}">
|
|
<Grid Margin="0,5">
|
|
<StackPanel
|
|
x:Name="BubbleColumn"
|
|
MaxWidth="560"
|
|
HorizontalAlignment="Left">
|
|
<TextBlock
|
|
x:Name="Sender"
|
|
Margin="1,0,0,3"
|
|
FontSize="12"
|
|
Foreground="#6B7785"><Run Text="{Binding SenderDisplayName, Mode=OneWay}" /><Run Text=" " /><Run Text="{Binding CreatedAtText, Mode=OneWay}" /></TextBlock>
|
|
<Border
|
|
x:Name="Bubble"
|
|
Padding="13,9"
|
|
Background="#F1F3F6"
|
|
CornerRadius="8,8,8,2">
|
|
<StackPanel>
|
|
<TextBlock
|
|
x:Name="MessageText"
|
|
Foreground="#1F2933"
|
|
LineHeight="22"
|
|
Text="{Binding Content}"
|
|
TextWrapping="Wrap"
|
|
Visibility="{Binding HasText, Converter={StaticResource BoolToVisibility}}" />
|
|
<ItemsControl
|
|
Margin="0,6,0,0"
|
|
d:ItemsSource="{d:SampleData ItemCount=1}"
|
|
ItemsSource="{Binding Attachments}"
|
|
Visibility="{Binding HasAttachments, Converter={StaticResource BoolToVisibility}}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="{x:Type vm:ChatAttachmentViewModel}">
|
|
<Border
|
|
Margin="0,0,6,4"
|
|
Background="#26000000"
|
|
CornerRadius="5"
|
|
Cursor="Hand"
|
|
ToolTip="{Binding ToolTipText}">
|
|
<Border.InputBindings>
|
|
<MouseBinding
|
|
Command="{Binding Source={StaticResource ShowImageCommand}}"
|
|
CommandParameter="{Binding}"
|
|
MouseAction="LeftClick" />
|
|
</Border.InputBindings>
|
|
<Grid Width="150" Height="150">
|
|
<Image Source="{Binding Image}" Stretch="Uniform" />
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
FontSize="50"
|
|
Text="{StaticResource txt-image}">
|
|
<TextBlock.Style>
|
|
<Style BasedOn="{StaticResource TextBlockIcon}" TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="#5B6673" />
|
|
<Setter Property="Visibility" Value="Visible" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding DataContext.IsCustomer, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True">
|
|
<Setter Property="Foreground" Value="White" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding IsLoadFailed}" Value="True">
|
|
<Setter Property="Text" Value="{StaticResource txt-dismiss_square}" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding HasImage}" Value="True">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</Border>
|
|
</StackPanel>
|
|
</Grid>
|
|
<DataTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding IsCustomer}" Value="True">
|
|
<Setter TargetName="BubbleColumn" Property="HorizontalAlignment" Value="Right" />
|
|
<Setter TargetName="Bubble" Property="Background" Value="#98638F" />
|
|
<Setter TargetName="MessageText" Property="Foreground" Value="White" />
|
|
<Setter TargetName="Sender" Property="HorizontalAlignment" Value="Right" />
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding IsRecalled}" Value="True">
|
|
<Setter TargetName="Bubble" Property="Opacity" Value="0.62" />
|
|
</DataTrigger>
|
|
</DataTemplate.Triggers>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#6B7785"
|
|
Text="暂无公开留言">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding Messages.Count}" Value="0">
|
|
<Setter Property="Visibility" Value="Visible" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
</Grid>
|
|
</Grid>
|
|
<Grid d:Visibility="Hidden" Visibility="{Binding IsDraftVisible, Converter={StaticResource BoolToVisibility}}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Border
|
|
Padding="18,11"
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="0,0,0,1">
|
|
<StackPanel>
|
|
<TextBlock FontWeight="SemiBold" Text="新建工单" />
|
|
<TextBlock
|
|
Margin="0,2,0,0"
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="提交后进入等待客服回复;已完结订单再次提交会重开原工单。" />
|
|
</StackPanel>
|
|
</Border>
|
|
<Border
|
|
Grid.Row="1"
|
|
Margin="18"
|
|
Padding="14,12"
|
|
VerticalAlignment="Top"
|
|
Background="#FAFBFC"
|
|
BorderBrush="#DDE2E8"
|
|
BorderThickness="1"
|
|
CornerRadius="6">
|
|
<StackPanel>
|
|
<TextBlock Foreground="#6B7785" Text="关联订单" />
|
|
<TextBlock
|
|
Margin="0,4,0,0"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding SelectedOrderText}"
|
|
TextWrapping="Wrap" />
|
|
<TextBlock
|
|
Margin="0,4,0,0"
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="{Binding SelectedOrderDescription}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
d:Visibility="Hidden"
|
|
Visibility="{Binding IsEmptyVisible, Converter={StaticResource BoolToVisibility}}">
|
|
<TextBlock Foreground="#6B7785" Text="在左侧选择工单查看对话" />
|
|
<TextBlock
|
|
Margin="0,6,0,0"
|
|
FontSize="12"
|
|
Foreground="#6B7785"
|
|
Text="实时通知已订阅当前拍单账号下的全部店铺" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|