You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.8 KiB

2 years ago
using CommunityToolkit.Mvvm.ComponentModel;
using System;
2 years ago
namespace BBWYB.Client.Models
{
/// <summary>
/// 采购商品的Sku
/// </summary>
2 years ago
public class PurchaseSchemeProductSku : ObservableObject
2 years ago
{
2 years ago
public PurchaseSchemeProductSku()
{
QuantityRatio = 1;
}
2 years ago
/// <summary>
/// 采购商品的SKU和采购方案的关系Id
/// </summary>
public long Id { get; set; }
private bool isSelected;
2 years ago
public bool IsSelected { get => isSelected; set { SetProperty(ref isSelected, value); } }
2 years ago
public decimal Price { get; set; }
/// <summary>
/// Sku标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// Sku图片
/// </summary>
public string Logo { get; set; }
public string SkuId { get; set; }
public string ProductId { get; set; }
public string PurchaseProductId { get; set; }
public string PurchaseSkuId { get; set; }
public string PurchaseSkuSpecId { get; set; }
public long SkuPurchaseSchemeId { get; set; }
public long UserId { get; set; }
public int ItemTotal
{
get => itemTotal; set
{
2 years ago
if (SetProperty(ref itemTotal, value))
2 years ago
{
SkuAmount = value * Price;
OnItemTotalChanged?.Invoke(value);
}
}
}
2 years ago
public decimal SkuAmount { get => skuAmount; set { SetProperty(ref skuAmount, value); } }
2 years ago
private int itemTotal;
private decimal skuAmount;
2 years ago
private int quantityRatio;
2 years ago
public Action<int> OnItemTotalChanged { get; set; }
2 years ago
public int QuantityRatio { get => quantityRatio; set { SetProperty(ref quantityRatio, value); } }
2 years ago
}
}