230 lines
7.8 KiB
XML
230 lines
7.8 KiB
XML
<UserControl
|
||
x:Class="_29WxOrderWpf.Ctrls.Statistics.PeriodRevenueStatisticsView"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:common="WxOrder.Framework"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
||
d:Background="#F5F7FB"
|
||
d:DataContext="{d:DesignInstance Type=vm:PeriodRevenueStatisticsViewModel}"
|
||
d:DesignHeight="900"
|
||
d:DesignWidth="1600"
|
||
mc:Ignorable="d">
|
||
<UserControl.Resources>
|
||
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
|
||
|
||
<!-- 卡片样式(白底、圆角、阴影) -->
|
||
<Style x:Key="CardBorderStyle" TargetType="Border">
|
||
<Setter Property="Background" Value="White" />
|
||
<Setter Property="CornerRadius" Value="8" />
|
||
<Setter Property="Padding" Value="18" />
|
||
<Setter Property="Margin" Value="4" />
|
||
<Setter Property="Effect">
|
||
<Setter.Value>
|
||
<DropShadowEffect
|
||
BlurRadius="10"
|
||
Opacity="0.08"
|
||
ShadowDepth="2"
|
||
Color="#000000" />
|
||
</Setter.Value>
|
||
</Setter>
|
||
</Style>
|
||
|
||
<!-- 表格单元格文字居中 -->
|
||
<Style x:Key="CenterCellTextStyle" TargetType="TextBlock">
|
||
<Setter Property="TextAlignment" Value="Center" />
|
||
<Setter Property="VerticalAlignment" Value="Center" />
|
||
</Style>
|
||
|
||
<!-- 面板标题 -->
|
||
<Style x:Key="PanelTitleStyle" TargetType="TextBlock">
|
||
<Setter Property="FontSize" Value="16" />
|
||
<Setter Property="FontWeight" Value="Bold" />
|
||
<Setter Property="Foreground" Value="#333333" />
|
||
</Style>
|
||
</UserControl.Resources>
|
||
|
||
<Grid Background="#F5F7FB">
|
||
<ScrollViewer
|
||
common:ScrollViewerBehavior.FixMouseWheel="True"
|
||
HorizontalScrollBarVisibility="Disabled"
|
||
VerticalScrollBarVisibility="Auto">
|
||
<StackPanel Margin="12">
|
||
|
||
<!-- ============ 查询条件工具栏(共享 UserControl) ============ -->
|
||
<stat:RevenueStatisticsSearchBar />
|
||
|
||
<!-- ============ 汇总卡片(共享 UserControl) ============ -->
|
||
<stat:RevenueSummaryCards />
|
||
|
||
<!-- ============ 周期统计表格 ============ -->
|
||
<Border Margin="6,8,6,12" Style="{StaticResource CardBorderStyle}">
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="*" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<TextBlock
|
||
Grid.Row="0"
|
||
Margin="0,0,0,10"
|
||
Style="{StaticResource PanelTitleStyle}"
|
||
Text="{Binding PageTitle}" />
|
||
|
||
<DataGrid
|
||
Grid.Row="1"
|
||
AlternatingRowBackground="#FAFAFA"
|
||
AutoGenerateColumns="False"
|
||
Background="Transparent"
|
||
BorderThickness="0"
|
||
CanUserAddRows="False"
|
||
CanUserDeleteRows="False"
|
||
CanUserReorderColumns="False"
|
||
CanUserResizeRows="False"
|
||
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
|
||
FontSize="13"
|
||
Foreground="#333333"
|
||
GridLinesVisibility="Horizontal"
|
||
HeadersVisibility="Column"
|
||
HorizontalGridLinesBrush="#EEEEEE"
|
||
IsReadOnly="True"
|
||
ItemsSource="{Binding Statistics}"
|
||
RowHeight="46"
|
||
ScrollViewer.CanContentScroll="True"
|
||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||
SelectionMode="Single"
|
||
SelectionUnit="FullRow">
|
||
<DataGrid.Columns>
|
||
<DataGridTextColumn
|
||
Width="1.4*"
|
||
Binding="{Binding Period}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}">
|
||
<DataGridTextColumn.Header>
|
||
<TextBlock
|
||
FontSize="14"
|
||
FontWeight="Bold"
|
||
Foreground="{DynamicResource mainForegroundColorBrush}"
|
||
Text="{Binding DataContext.PeriodColumnHeader, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
||
</DataGridTextColumn.Header>
|
||
</DataGridTextColumn>
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding OrderCount, StringFormat={}{0:N0}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="订单数" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding SalesAmount, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="销售额" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding BuyerPaymentAmount, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="采购金额" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding Profit, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="利润" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding RefundAmount, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="退款金额" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding PlatformFeeTotal, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="平台服务费总额" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding Commission, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="达人佣金" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding AverageProfitRate, StringFormat={}{0:0.00}%}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="平均利润率" />
|
||
<DataGridTextColumn
|
||
Width="*"
|
||
Binding="{Binding AvgOrderAmount, StringFormat={}¥{0:N2}}"
|
||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||
Header="客单价" />
|
||
</DataGrid.Columns>
|
||
</DataGrid>
|
||
|
||
<!-- ============ 底部翻页 ============ -->
|
||
<Border
|
||
Grid.Row="2"
|
||
Margin="0,10,0,0"
|
||
Padding="0,4"
|
||
Background="#F8F9FB"
|
||
CornerRadius="6">
|
||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="0,0,12,0"
|
||
VerticalAlignment="Center"
|
||
FontSize="13"
|
||
Foreground="#666666"
|
||
Text="{Binding PagerText}" />
|
||
<Button
|
||
Height="28"
|
||
Margin="4,0,0,0"
|
||
Padding="12,0"
|
||
Command="{Binding FirstPageCommand}"
|
||
Content="首页"
|
||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||
<Button
|
||
Height="28"
|
||
Margin="4,0,0,0"
|
||
Padding="12,0"
|
||
Command="{Binding PrevPageCommand}"
|
||
Content="上一页"
|
||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||
<Button
|
||
Height="28"
|
||
Margin="4,0,0,0"
|
||
Padding="12,0"
|
||
Command="{Binding NextPageCommand}"
|
||
Content="下一页"
|
||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||
<Button
|
||
Height="28"
|
||
Margin="4,0,0,0"
|
||
Padding="12,0"
|
||
Command="{Binding LastPageCommand}"
|
||
Content="末页"
|
||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||
</StackPanel>
|
||
</Border>
|
||
</Grid>
|
||
</Border>
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
|
||
<!-- ============ 加载遮罩 ============ -->
|
||
<Border
|
||
d:Visibility="Collapsed"
|
||
Background="#66FFFFFF"
|
||
Visibility="{Binding IsLoading, Converter={StaticResource boolToVisibilityConverter}}">
|
||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||
<ProgressBar
|
||
Width="240"
|
||
Height="8"
|
||
IsIndeterminate="True" />
|
||
<TextBlock
|
||
Margin="0,12,0,0"
|
||
HorizontalAlignment="Center"
|
||
FontSize="13"
|
||
Foreground="#888888"
|
||
Text="数据加载中..." />
|
||
</StackPanel>
|
||
</Border>
|
||
</Grid>
|
||
</UserControl> |