优化订单读取卡顿问题
This commit is contained in:
1 parent
c83521f36d
commit
1509e0a11d
15 files changed
+718
-542
No files matched your search
@@ -145,6 +145,7 @@
|
||||
VerticalContentAlignment="Center"
|
||||
BorderBrush="Transparent"
|
||||
SelectedIndex="0"
|
||||
SelectionChanged="cmbTimeType_SelectionChanged"
|
||||
Style="{StaticResource RoundedComboBox}"
|
||||
Text="更新时间">
|
||||
<ComboBoxItem>
|
||||
@@ -169,7 +170,8 @@
|
||||
Grid.Column="7"
|
||||
Margin="0,0,14,0"
|
||||
VerticalAlignment="Center"
|
||||
BorderThickness="0" />
|
||||
BorderThickness="0"
|
||||
SelectedDate="{Binding DateStart}" />
|
||||
|
||||
<!-- 结束时间 -->
|
||||
<Border
|
||||
@@ -185,7 +187,8 @@
|
||||
Grid.Column="8"
|
||||
Margin="10,0,4,0"
|
||||
VerticalAlignment="Center"
|
||||
BorderThickness="0" />
|
||||
BorderThickness="0"
|
||||
SelectedDate="{Binding DateEnd}" />
|
||||
<CheckBox
|
||||
x:Name="chkEndDate"
|
||||
Grid.Column="8"
|
||||
@@ -193,6 +196,7 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
BorderBrush="{StaticResource mainColorBrush}"
|
||||
Click="chkEndDate_Click"
|
||||
FontSize="12" />
|
||||
|
||||
<Button
|
||||
@@ -600,9 +604,10 @@
|
||||
</TabControl.Resources>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="待采购"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Header="待采购"
|
||||
Header="{Binding WaitBuyTabTxt}"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Padding="0,10"
|
||||
@@ -690,7 +695,8 @@
|
||||
SizeChanged="TabItem_SizeChanged" />
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
Header="待发货"
|
||||
d:Header="待发货"
|
||||
Header="{Binding WaitSendTabTxt}"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -729,9 +735,10 @@
|
||||
</TabItem>
|
||||
<TabItem
|
||||
MinWidth="60"
|
||||
d:Header="待收货"
|
||||
Background="Transparent"
|
||||
BorderBrush="Transparent"
|
||||
Header="待收货"
|
||||
Header="{Binding WaitReceiveTabTxt}"
|
||||
SizeChanged="TabItem_SizeChanged">
|
||||
<Border
|
||||
Margin="4,0,4,4"
|
||||
@@ -1487,7 +1494,9 @@
|
||||
HorizontalContentAlignment="Stretch"
|
||||
BorderThickness="0"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
VirtualizingPanel.ScrollUnit="Pixel">
|
||||
VirtualizingPanel.ScrollUnit="Pixel"
|
||||
VirtualizingStackPanel.IsVirtualizing="True"
|
||||
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
||||
<!-- 使用自定义属性模板去除ListBox高亮显示框 -->
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -45,6 +45,14 @@
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="6" />
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding orderItems}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<!--<TextBlock Text="{Binding ProductName}" Margin="20,0,0,0"/>-->
|
||||
<local:OrderListRowItemCtrl DataContext="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -41,20 +41,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
int index = 0;
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||
index++;
|
||||
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||
Grid.SetRow(rowItem, index);
|
||||
this.gridChildOrder.Children.Add(rowItem);
|
||||
if (index >= 5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
//await Task.Run(() => { });
|
||||
//
|
||||
//if (this.DataContext is oms_wei_order_info order)
|
||||
//{
|
||||
// int index = 0;
|
||||
// foreach (var orderItem in order.orderItems)
|
||||
// {
|
||||
// gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||
// index++;
|
||||
// var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||
// Grid.SetRow(rowItem, index);
|
||||
// this.gridChildOrder.Children.Add(rowItem);
|
||||
// if (index >= 5)
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding sku_attr_str}"
|
||||
Text="{Binding SkuAttrStr}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="规格" />
|
||||
</wpf:TitleContent>
|
||||
@@ -298,7 +298,7 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding predict_commission_fee_str}"
|
||||
Text="{Binding PredictCommissionFeeStr}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="平台服务费" />
|
||||
</wpf:TitleContent>
|
||||
@@ -308,7 +308,7 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding commission_amount_str}"
|
||||
Text="{Binding CommissionAmountStr}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="达人佣金" />
|
||||
</wpf:TitleContent>
|
||||
@@ -318,7 +318,7 @@
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding out_amount_str}"
|
||||
Text="{Binding OutAmountStr}"
|
||||
TextWrapping="Wrap"
|
||||
WaterMark="外采金额" />
|
||||
</wpf:TitleContent>
|
||||
|
||||
@@ -1960,7 +1960,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
form.lblSpuId.Text = orderItem.product_id;
|
||||
form.lblSkuId.Text = orderItem.sku_id; // skuId
|
||||
form.txtGoodsName.Text = orderItem.title; // 商品名称
|
||||
form.txtSkuName.Text = orderItem.sku_attr_str; // sku规格名称
|
||||
form.txtSkuName.Text = orderItem.SkuAttrStr; // sku规格名称
|
||||
form.txtOrderPrice.Text = "" + (orderItem.real_price.ParseToInt() / 100m / orderItem.sku_cnt); // 订单价格
|
||||
//form.txtCurrentPrice.Text = row.Cells["colCurrentPrice"].Value.ParseToString(); // 当前商品价格
|
||||
//form.txtCurrentStock.Text = row.Cells["colCurrentStock"].Value.ParseToString(); // 当前库存;
|
||||
|
||||
Reference in new issue
Block a user