订单列表显示功能及逻辑优化

This commit is contained in:
wule_5900x committed 2026-06-22 01:22:28 +08:00
1 parent 44503f91cf
commit 031fa8cfe6
21 files changed
+815 -134

No files matched your search

+80 -3
View File
@@ -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<oms_wei_order_item> order_items { get; set; } = new ObservableCollection<oms_wei_order_item>();
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; }
}
/// <summary>
/// 订单中所有商品加起来的总售价
/// </summary>
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; }
}
/// <summary>
/// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内)字符串
/// </summary>
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; }
}
/// <summary>
/// 是否被选中
/// </summary>
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
/// </summary>
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; }
/// <summary>