10 changed files with 452 additions and 5 deletions
@ -0,0 +1,204 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace BBWY.Client.Models |
||||
|
{ |
||||
|
public class OrderCouponDetailGroupItemResponse |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 发起方
|
||||
|
/// </summary>
|
||||
|
public string Initiator { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 优惠券或活动类型
|
||||
|
/// </summary>
|
||||
|
public string CouponOrPromotionType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 优惠金额
|
||||
|
/// </summary>
|
||||
|
public decimal? PreferentialAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 商家承担金额
|
||||
|
/// </summary>
|
||||
|
public decimal? UndertakenByMerchantAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 平台承担金额
|
||||
|
/// </summary>
|
||||
|
public decimal? UndertakenByPlatformAmount { get; set; } |
||||
|
} |
||||
|
|
||||
|
public class OrderCouponDetailGroupResponse |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 发起方
|
||||
|
/// </summary>
|
||||
|
public string Initiator { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 优惠明细集合
|
||||
|
/// </summary>
|
||||
|
public IList<OrderCouponDetailGroupItemResponse> ItemList { get; set; } |
||||
|
} |
||||
|
|
||||
|
public class OrderCouponDetailResponse |
||||
|
{ /// <summary>
|
||||
|
/// 合计优惠金额
|
||||
|
/// </summary>
|
||||
|
public decimal TotalPreferentialAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计商家承担金额
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalUndertakenByMerchantAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计平台承担金额
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalUndertakenByPlatformAmount { get; set; } |
||||
|
|
||||
|
public IList<OrderCouponDetailGroupResponse> GroupList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计单品金额
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalItemPrice { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计基础优惠
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalBaseDiscount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计满减
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalManJian { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计商家运费
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalVenderFee { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计基础运费
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalBaseFee { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计偏远运费
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalRemoteFee { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计优惠券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalCoupon { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计京豆
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalJingDou { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计余额
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalBalance { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计超级红包
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalSuperRedEnvelope { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计plus会员95折优惠
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalPlus95 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计退换货无忧
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalTuiHuanHuoWuYou { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计全球购税费
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalTaxFee { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计落地配服务
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalLuoDiPeiService { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计应付金额
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalShouldPay { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计京券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalJingQuan { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计东券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalDongQuan { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计限品类京券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalXianPinLeiJingQuan { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计限品类东券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalXianPinLeiDongQuan { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计按比例平台承担优惠券
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalPingTaiChengDanYouHuiQuan { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计礼金优惠
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalLiJinYouHui { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计支付营销优惠
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalZhiFuYingXiaoYouHui { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计京东支付优惠
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalJdZhiFuYouHui { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计全球购一般税
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalGlobalGeneralTax { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计全球购一般包税
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalGlobalGeneralIncludeTax { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计京享礼金
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalJingXiangLiJin { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计跨店满减促销
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalPromotionDiscount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 合计满期赠促销
|
||||
|
/// </summary>
|
||||
|
public decimal? TotalExpiryGiftDiscount { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
using BBWY.Client.APIServices; |
||||
|
using BBWY.Client.Models; |
||||
|
using System.Threading.Tasks; |
||||
|
using System.Windows; |
||||
|
|
||||
|
namespace BBWY.Client.ViewModels |
||||
|
{ |
||||
|
public class OrderCouponDetailViewModel : BaseVM |
||||
|
{ |
||||
|
private string orderId; |
||||
|
private OrderService orderService; |
||||
|
private Shop shop; |
||||
|
|
||||
|
public OrderCouponDetailViewModel(OrderService orderService) |
||||
|
{ |
||||
|
this.orderService = orderService; |
||||
|
} |
||||
|
|
||||
|
public string OrderId { get => orderId; set { Set(ref orderId, value); } } |
||||
|
|
||||
|
public OrderCouponDetailResponse Coupon { get => coupon; set { Set(ref coupon, value); } } |
||||
|
|
||||
|
private OrderCouponDetailResponse coupon; |
||||
|
|
||||
|
public void SetData(string orderId, Shop shop) |
||||
|
{ |
||||
|
this.OrderId = orderId; |
||||
|
this.shop = shop; |
||||
|
Task.Factory.StartNew(() => orderService.GetOrderCouponDetail(orderId, shop)) |
||||
|
.ContinueWith(t => |
||||
|
{ |
||||
|
var r = t.Result; |
||||
|
if (!r.Success) |
||||
|
{ |
||||
|
MessageBox.Show(r.Msg, "优惠券明细"); |
||||
|
return; |
||||
|
} |
||||
|
this.Coupon = r.Data; |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,144 @@ |
|||||
|
<c:BWindow x:Class="BBWY.Client.Views.Order.OrderCouponDetailWindow" |
||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
|
xmlns:local="clr-namespace:BBWY.Client.Views.Order" |
||||
|
mc:Ignorable="d" |
||||
|
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
||||
|
Title="订单优惠明细" Height="600" Width="600" |
||||
|
Style="{StaticResource bwstyle}" |
||||
|
DataContext="{Binding OrderCouponDetailVM,Source={StaticResource Locator}}" |
||||
|
MinButtonVisibility="Collapsed" |
||||
|
MaxButtonVisibility="Collapsed"> |
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="30"/> |
||||
|
<RowDefinition/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Border BorderBrush="{StaticResource MainMenu.BorderBrush}" |
||||
|
Background="{StaticResource Border.Background}"> |
||||
|
<TextBlock Text="{Binding OrderId,StringFormat=\{0\}优惠明细}" Style="{StaticResource middleTextBlock}"/> |
||||
|
</Border> |
||||
|
|
||||
|
<Grid Grid.Row="1" Margin="5"> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="Auto"/> |
||||
|
<RowDefinition Height="40"/> |
||||
|
<RowDefinition Height="Auto"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
|
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="30"/> |
||||
|
<RowDefinition/> |
||||
|
<RowDefinition Height="30"/> |
||||
|
</Grid.RowDefinitions> |
||||
|
<Grid Background="{StaticResource Border.Background}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
|
||||
|
|
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" |
||||
|
HorizontalAlignment="Left"/> |
||||
|
<Border Height="1" Grid.ColumnSpan="5" Background="{StaticResource Border.Brush}" VerticalAlignment="Top"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="5" HorizontalAlignment="Right"/> |
||||
|
|
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="1" HorizontalAlignment="Left"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="2" HorizontalAlignment="Left"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="3" HorizontalAlignment="Left"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="4" HorizontalAlignment="Left"/> |
||||
|
<TextBlock Text="发起方(推测)" Style="{StaticResource middleTextBlock}"/> |
||||
|
<TextBlock Text="促销/优惠券" Style="{StaticResource middleTextBlock}" Grid.Column="1"/> |
||||
|
<TextBlock Text="优惠金额" Style="{StaticResource middleTextBlock}" Grid.Column="2"/> |
||||
|
<TextBlock Text="商家承担" Style="{StaticResource middleTextBlock}" Grid.Column="3"/> |
||||
|
<TextBlock Text="平台承担" Style="{StaticResource middleTextBlock}" Grid.Column="4"/> |
||||
|
</Grid> |
||||
|
|
||||
|
<ListBox x:Name="listbox_groups" |
||||
|
ItemsSource="{Binding Coupon.GroupList}" |
||||
|
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
||||
|
Style="{StaticResource NoScrollViewListBoxStyle}" |
||||
|
Grid.Row="1" |
||||
|
BorderBrush="{StaticResource Border.Brush}" |
||||
|
BorderThickness="1,1,1,0"> |
||||
|
<ListBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<Grid Width="{Binding ActualWidth,ElementName=listbox_groups,Converter={StaticResource widthConverter},ConverterParameter=2}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.8*"/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="{Binding Initiator}" Style="{StaticResource middleTextBlock}"/> |
||||
|
<Border Height="1" Background="{StaticResource Border.Brush}" VerticalAlignment="Bottom"/> |
||||
|
<ListBox x:Name="listbox_couponItem" Grid.Column="1" |
||||
|
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
||||
|
Style="{StaticResource NoScrollViewListBoxStyle}" |
||||
|
ItemsSource="{Binding ItemList}"> |
||||
|
<ListBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<Grid Width="{Binding ActualWidth,ElementName=listbox_couponItem}" |
||||
|
Height="30"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition/> |
||||
|
<ColumnDefinition/> |
||||
|
<ColumnDefinition/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Margin="-1,0,0,0"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Margin="-1,0,0,0" Grid.Column="1"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Margin="-1,0,0,0" Grid.Column="2"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" Grid.Column="3"/> |
||||
|
<Border Height="1" Background="{StaticResource Border.Brush}" VerticalAlignment="Bottom" Grid.ColumnSpan="4"/> |
||||
|
<TextBlock Text="{Binding CouponOrPromotionType}" Style="{StaticResource middleTextBlock}"/> |
||||
|
<TextBlock Text="{Binding PreferentialAmount}" Style="{StaticResource middleTextBlock}" Grid.Column="1"/> |
||||
|
<TextBlock Text="{Binding UndertakenByMerchantAmount}" Style="{StaticResource middleTextBlock}" Grid.Column="2"/> |
||||
|
<TextBlock Text="{Binding UndertakenByPlatformAmount}" Style="{StaticResource middleTextBlock}" Grid.Column="3"/> |
||||
|
</Grid> |
||||
|
</DataTemplate> |
||||
|
</ListBox.ItemTemplate> |
||||
|
</ListBox> |
||||
|
</Grid> |
||||
|
</DataTemplate> |
||||
|
</ListBox.ItemTemplate> |
||||
|
</ListBox> |
||||
|
|
||||
|
<Grid Grid.Row="2" Background="{StaticResource Border.Background}" Margin="0,-0.8,0,0"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
<ColumnDefinition Width="0.2*"/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="合计" Grid.ColumnSpan="2" Style="{StaticResource middleTextBlock}"/> |
||||
|
<TextBlock Text="{Binding Coupon.TotalPreferentialAmount}" Grid.Column="2" Style="{StaticResource middleTextBlock}"/> |
||||
|
<TextBlock Text="{Binding Coupon.TotalUndertakenByMerchantAmount}" Grid.Column="3" Style="{StaticResource middleTextBlock}"/> |
||||
|
<TextBlock Text="{Binding Coupon.TotalUndertakenByPlatformAmount}" Grid.Column="4" Style="{StaticResource middleTextBlock}"/> |
||||
|
<Border Width="1" |
||||
|
Background="{StaticResource Border.Brush}" |
||||
|
Grid.Column="2" |
||||
|
HorizontalAlignment="Left"/> |
||||
|
<Border Width="1" |
||||
|
Background="{StaticResource Border.Brush}" |
||||
|
Grid.Column="3" |
||||
|
HorizontalAlignment="Left"/> |
||||
|
<Border Width="1" |
||||
|
Background="{StaticResource Border.Brush}" |
||||
|
Grid.Column="4" |
||||
|
HorizontalAlignment="Left"/> |
||||
|
|
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" |
||||
|
HorizontalAlignment="Left"/> |
||||
|
<Border Height="1" Grid.ColumnSpan="5" Background="{StaticResource Border.Brush}" VerticalAlignment="Bottom"/> |
||||
|
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="5" HorizontalAlignment="Right"/> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
</Grid> |
||||
|
</c:BWindow> |
@ -0,0 +1,18 @@ |
|||||
|
using BBWY.Client.Models; |
||||
|
using BBWY.Client.ViewModels; |
||||
|
using BBWY.Controls; |
||||
|
|
||||
|
namespace BBWY.Client.Views.Order |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// OrderCouponDetailWindow.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class OrderCouponDetailWindow : BWindow |
||||
|
{ |
||||
|
public OrderCouponDetailWindow(string orderId, Shop shop) |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
(this.DataContext as OrderCouponDetailViewModel).SetData(orderId, shop); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue