diff --git a/29WxOrderWpf/29WxOrderWpf.csproj b/29WxOrderWpf/29WxOrderWpf.csproj index 6f84b3f..9ab11fe 100644 --- a/29WxOrderWpf/29WxOrderWpf.csproj +++ b/29WxOrderWpf/29WxOrderWpf.csproj @@ -61,6 +61,7 @@ + @@ -84,6 +85,7 @@ BaseMsgWindow.xaml + @@ -281,6 +283,11 @@ - + + + + + + \ No newline at end of file diff --git a/29WxOrderWpf/App.xaml b/29WxOrderWpf/App.xaml index 34882f3..747d1b5 100644 --- a/29WxOrderWpf/App.xaml +++ b/29WxOrderWpf/App.xaml @@ -8,6 +8,7 @@ + @@ -15,6 +16,7 @@ + diff --git a/29WxOrderWpf/Converters/ImageUrlToBitmapImageConverter.cs b/29WxOrderWpf/Converters/ImageUrlToBitmapImageConverter.cs new file mode 100644 index 0000000..7e9282b --- /dev/null +++ b/29WxOrderWpf/Converters/ImageUrlToBitmapImageConverter.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media.Imaging; + +namespace _29WxOrderWpf.Converters +{ + public class ImageUrlToBitmapImageConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is string url && Uri.IsWellFormedUriString(url, UriKind.Absolute)) + { + return new BitmapImage(new Uri(url)); + //return Task.Run(() => new BitmapImage(new Uri(url))); // 使用 Task.Run 来异步加载图片。 + } + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); // 不需要反向转换,所以不实现。 + } + } +} diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml index 66da706..73b48e3 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml @@ -5,7 +5,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls" xmlns:utils="clr-namespace:_29WxOrderWpf.Utils" - xmlns:converters="clr-namespace:_29WxOrderWpf.Converters" + xmlns:converters="clr-namespace:_29WxOrderWpf.Converters" + xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" Loaded="Window_Loaded"> @@ -14,9 +15,11 @@ + + - + @@ -30,43 +33,116 @@ + - - - - + + - + - - + + - - - - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -29,10 +30,125 @@ + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowCtrl.xaml.cs index e5b873f..a093165 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowCtrl.xaml.cs @@ -25,6 +25,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls public OrderListRowCtrl() { InitializeComponent(); + + //BitmapImage bitImage = new BitmapImage(); + //bitImage.BeginInit(); + //bitImage.UriSource = new Uri(imageUrl, UriKind.Absolute); + //bitImage.EndInit(); + //img.Source = bitImage; + } + + private void CheckBox_Click(object sender, RoutedEventArgs e) + { + try + { + MainWindow.Instance.orderListCtrl.UpdateChkAllBox(); + } + catch + { + } } } } diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml index b6e78d9..8eff56b 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls" xmlns:usercontrols="clr-namespace:_29WxOrderWpf.UserControls" + xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.OrderCtrls" xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls" mc:Ignorable="d" d:DesignHeight="50" d:DesignWidth="800"> @@ -21,28 +21,29 @@ - - - + - + + - - + + - + - - - + + + diff --git a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml deleted file mode 100644 index c8c97ad..0000000 --- a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml.cs b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml.cs deleted file mode 100644 index e7a1866..0000000 --- a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListRowCtrl.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace _29WxOrderWpf.Ctrls.ShopCtrls -{ - /// - /// ShopListRowCtrl.xaml 的交互逻辑 - /// - public partial class ShopListRowCtrl : UserControl - { - public ShopListRowCtrl() - { - InitializeComponent(); - } - } -} diff --git a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListViewModel.cs b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListViewModel.cs deleted file mode 100644 index 41b5b7e..0000000 --- a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace _29WxOrderWpf.Ctrls.ShopCtrls -{ - internal class ShopListViewModel - { - } -} diff --git a/29WxOrderWpf/Resources/err_pic.png b/29WxOrderWpf/Resources/err_pic.png new file mode 100644 index 0000000..2e41d42 Binary files /dev/null and b/29WxOrderWpf/Resources/err_pic.png differ diff --git a/29WxOrderWpf/Resources/loading_blue.gif b/29WxOrderWpf/Resources/loading_blue.gif new file mode 100644 index 0000000..4679238 Binary files /dev/null and b/29WxOrderWpf/Resources/loading_blue.gif differ diff --git a/29WxOrderWpf/Styles/StaticImageDictionary.xaml b/29WxOrderWpf/Styles/StaticImageDictionary.xaml index 8b6ad7d..20937fa 100644 --- a/29WxOrderWpf/Styles/StaticImageDictionary.xaml +++ b/29WxOrderWpf/Styles/StaticImageDictionary.xaml @@ -14,4 +14,6 @@ + + \ No newline at end of file diff --git a/29WxOrderWpf/Styles/UcWaterMarkTextBoxStyle.xaml b/29WxOrderWpf/Styles/UcWaterMarkTextBoxStyle.xaml index ed31d67..744a88f 100644 --- a/29WxOrderWpf/Styles/UcWaterMarkTextBoxStyle.xaml +++ b/29WxOrderWpf/Styles/UcWaterMarkTextBoxStyle.xaml @@ -7,32 +7,41 @@ - + - + + - - - + + + + + - + \ No newline at end of file diff --git a/29WxOrderWpf/UserControls/UcImageButton.cs b/29WxOrderWpf/UserControls/UcImageButton.cs index d4149d8..ab6110c 100644 --- a/29WxOrderWpf/UserControls/UcImageButton.cs +++ b/29WxOrderWpf/UserControls/UcImageButton.cs @@ -13,7 +13,6 @@ namespace _29WxOrderWpf.UserControls { public UcImageButton() { - this.DataContext = this; } public static readonly DependencyProperty ButtonImageProperty = DependencyProperty.Register( diff --git a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.cs b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.cs index 6621b62..129cd11 100644 --- a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.cs +++ b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.cs @@ -12,7 +12,6 @@ namespace _29WxOrderWpf.UserControls { public UcWaterMarkTextBox() { - this.DataContext = this; } public static readonly DependencyProperty WaterMarkProperty = DependencyProperty.Register( diff --git a/29WxOrderWpf/UserControls/UcWindowBoxes.xaml.cs b/29WxOrderWpf/UserControls/UcWindowBoxes.xaml.cs index fa0d743..b518228 100644 --- a/29WxOrderWpf/UserControls/UcWindowBoxes.xaml.cs +++ b/29WxOrderWpf/UserControls/UcWindowBoxes.xaml.cs @@ -45,7 +45,6 @@ namespace _29WxOrderWpf.UserControls public UcWindowBoxes() { InitializeComponent(); - this.DataContext = this; } private void WindowBoxes_Loaded(object sender, RoutedEventArgs e) diff --git a/AllBase/29WxOrderAllBase.csproj b/AllBase/29WxOrderAllBase.csproj index 098f261..df78344 100644 --- a/AllBase/29WxOrderAllBase.csproj +++ b/AllBase/29WxOrderAllBase.csproj @@ -140,6 +140,7 @@ + diff --git a/AllBase/Model/oms_wei_order_info.cs b/AllBase/Model/oms_wei_order_info.cs index f13a25c..59ebf46 100644 --- a/AllBase/Model/oms_wei_order_info.cs +++ b/AllBase/Model/oms_wei_order_info.cs @@ -1,5 +1,9 @@ -using System; +using AllBase.Helper; +using AllBase.Model.MvvmBaseClasses; +using NaiBa.Util.Extension; +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; @@ -7,9 +11,62 @@ using System.Threading.Tasks; namespace AllBase.Model { - public class oms_wei_order_info + public class oms_wei_order_info : PropertyNotifyObject { - public bool is_select { get; set; } + public ObservableCollection order_items { get; set; } = new ObservableCollection(); + public oms_wei_order_item order_item + { + get + { + if (order_items.FirstOrDefault() != null) + return order_items.FirstOrDefault(); + return new oms_wei_order_item(); + } + } + + public string create_time_str + { + get { return BaseClass.StampToDateTime(create_time).ToString("yyyy-MM-dd HH:mm:ss"); } + set { create_time_str = value; } + } + public string delivery_deadline_status_str + { + get + { + if (this.status == 20 || this.status == 21) + { + return "剩余"; + } + return "剩余"; + } + set { delivery_deadline_status_str = value; } + } + + /// + /// 订单中所有商品加起来的总售价 + /// + public string sale_price_total_str + { + get { return "¥" + (order_items.Sum(oi => oi.sale_price * oi.sku_cnt) * 0.01m).ParseToDecimal().ToString("0.00"); } + set { sale_price_total_str = value; } + } + /// + /// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内)字符串 + /// + public string cash_coupon_discounted_price_str + { + get { return "¥" + (order_items.Sum(oi => oi.cash_coupon_discounted_price.ParseToInt() * oi.sku_cnt) * 0.01m).ParseToDecimal().ToString("0.00"); } + set { cash_coupon_discounted_price_str = value; } + } + + /// + /// 是否被选中 + /// + public bool IsSelect + { + get { return this.GetValue(x => x.IsSelect); } + set { this.SetValue(x => x.IsSelect, value); } + } public bool is_visible { get; set; } = true; @@ -26,6 +83,26 @@ namespace AllBase.Model /// public string openid { get; set; } public int create_time { get; set; } + public string delivery_deadline_str + { + get + { + if (this.status == 20 || this.status == 21) + { + var deadlineTime = BaseClass.StampToDateTime(delivery_deadline.ParseToInt()); + var nowTime = DateTime.Now; + if (deadlineTime < nowTime) + return "已超时"; + + var timeSpan = BaseClass.StampToDateTime(delivery_deadline.ParseToInt()) - nowTime; + var durationStr = Math.Floor(timeSpan.TotalHours).ParseToInt() + "时" + timeSpan.Minutes + "分" + timeSpan.Seconds + "秒"; + return durationStr; + } + return "待获取状态"; + } + set { delivery_deadline_str = value; } + } + public int update_time { get; set; } public string unionid { get; set; } /// diff --git a/AllBase/Model/oms_wei_order_item.cs b/AllBase/Model/oms_wei_order_item.cs new file mode 100644 index 0000000..38d73ea --- /dev/null +++ b/AllBase/Model/oms_wei_order_item.cs @@ -0,0 +1,154 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AllBase.Model +{ + public class oms_wei_order_item + { + /// + /// 订单商品表数据库id + /// + public long id { get; set; } + public long shop_id { get; set; } + /// + /// 商户ID + /// + public long merchant_id { get; set; } + /// + /// 订单id(平台订单id) + /// + public string order_id { get; set; } + /// + /// 商品spuid + /// + public string product_id { get; set; } + public string sku_id { get; set; } + /// + /// sku小图 + /// + public string thumb_img { get; set; } + /// + /// sku数量 + /// + public int? sku_cnt { get; set; } + /// + /// 售卖单价(单位:分) + /// + public int? sale_price { get; set; } + /// + /// 商品名称 + /// + public string title { get; set; } + /// + /// 正在售后/退款流程中的 sku 数量 + /// + public int? on_aftersale_sku_cnt { get; set; } + /// + /// 完成售后/退款的 sku 数量 + /// + public int? finish_aftersale_sku_cnt { get; set; } + /// + /// 商品编码 + /// + public string sku_code { get; set; } + /// + /// 市场单价(单位:分) + /// + public int? market_price { get; set; } + /// + /// sku属性JSON + /// + public string sku_attrs { get; set; } + /// + /// sku实付总价,取estimate_price和change_price中较小值 + /// + public int? real_price { get; set; } + /// + /// 商品外部spuid + /// + public string out_product_id { get; set; } + /// + /// 采购价 + /// + public int? purchase_price { get; set; } + /// + /// 运费 + /// + public int? freight { get; set; } + /// + /// 商品外部skuid + /// + public string out_sku_id { get; set; } + /// + /// 是否有优惠金额,非必填,默认为false + /// + public string is_discounted { get; set; } + /// + /// 优惠后sku总价,非必填,is_discounted为true时有值 + /// + public int? estimate_price { get; set; } + /// + /// 是否修改过价格,非必填,默认为false + /// + public string is_change_price { get; set; } + /// + /// 改价后sku总价,非必填,is_change_price为true时有值 + /// + public int? change_price { get; set; } + /// + /// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内) + /// + public int? cash_coupon_discounted_price { get; set; } + /// + /// 区域库存id + /// + public string out_warehouse_id { get; set; } + /// + /// 退货地址 + /// + public string return_address { get; set; } + /// + /// 商品发货信息JSON + /// + public string sku_deliver_info { get; set; } + /// + /// 商品额外服务信息JSON + /// + public string extra_service { get; set; } + /// + /// 是否使用了会员积分抵扣 + /// + public string use_deduction { get; set; } + /// + /// 会员积分抵扣金额,单位为分 + /// + public int? deduction_price { get; set; } + /// + /// 达人佣金(微信小店:分账金额),单位为分 + /// + public int? predict_commission_fee { get; set; } + /// + /// 达人佣金(微信小店:分账金额),单位为分 + /// + public int? commission_amount { get; set; } + /// + /// 商品优惠券信息,逐步替换 order.order_detail.coupon_info + /// + public string order_product_coupon_info_list { get; set; } + /// + /// 商品id(o_goods外键) + /// + public long? erp_goods_id { get; set; } + /// + /// 商品skuid(o_goods_sku外键) + /// + public long? erp_goods_sku_id { get; set; } + /// + /// 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 11 已取消 + /// + public int? refund_status { get; set; } + } +}