|
@ -29,8 +29,11 @@ namespace BBWY.Client.ViewModels |
|
|
private string siNanDingDingKey; |
|
|
private string siNanDingDingKey; |
|
|
private SiNanPolicyLevel selectedSiNanPolicyLevel; |
|
|
private SiNanPolicyLevel selectedSiNanPolicyLevel; |
|
|
|
|
|
|
|
|
|
|
|
private Platform purchasePlatform; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ICommand SaveCommand { get; set; } |
|
|
public ICommand SaveCommand { get; set; } |
|
|
|
|
|
|
|
|
public ICommand SetPanelIndexCommand { get; set; } |
|
|
public ICommand SetPanelIndexCommand { get; set; } |
|
|
|
|
|
|
|
|
public PurchaseAccount PurchaseAccount { get => purchaseAccount; set { Set(ref purchaseAccount, value); } } |
|
|
public PurchaseAccount PurchaseAccount { get => purchaseAccount; set { Set(ref purchaseAccount, value); } } |
|
@ -52,6 +55,19 @@ namespace BBWY.Client.ViewModels |
|
|
public string SiNanDingDingKey { get => siNanDingDingKey; set { Set(ref siNanDingDingKey, value); } } |
|
|
public string SiNanDingDingKey { get => siNanDingDingKey; set { Set(ref siNanDingDingKey, value); } } |
|
|
public SiNanPolicyLevel SelectedSiNanPolicyLevel { get => selectedSiNanPolicyLevel; set { Set(ref selectedSiNanPolicyLevel, value); } } |
|
|
public SiNanPolicyLevel SelectedSiNanPolicyLevel { get => selectedSiNanPolicyLevel; set { Set(ref selectedSiNanPolicyLevel, value); } } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 采购平台
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Platform PurchasePlatform |
|
|
|
|
|
{ |
|
|
|
|
|
get => purchasePlatform; |
|
|
|
|
|
set |
|
|
|
|
|
{ |
|
|
|
|
|
if (Set(ref purchasePlatform, value)) |
|
|
|
|
|
OnPurchasePlatformChanged(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService) |
|
|
public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService) |
|
|
{ |
|
|
{ |
|
|
PanelIndex = 0; |
|
|
PanelIndex = 0; |
|
@ -89,6 +105,9 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
|
protected override void Load() |
|
|
protected override void Load() |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (globalContext.User.Shop.PurchaseAccountList == null) |
|
|
|
|
|
globalContext.User.Shop.PurchaseAccountList = new List<PurchaseAccount>(); |
|
|
|
|
|
|
|
|
IsLoading = false; |
|
|
IsLoading = false; |
|
|
if (!string.IsNullOrEmpty(globalContext.User.Shop.ManagePwd)) |
|
|
if (!string.IsNullOrEmpty(globalContext.User.Shop.ManagePwd)) |
|
|
{ |
|
|
{ |
|
@ -99,9 +118,7 @@ namespace BBWY.Client.ViewModels |
|
|
isValidated = true; |
|
|
isValidated = true; |
|
|
this.ManagePwd = globalContext.User.Shop.ManagePwd; |
|
|
this.ManagePwd = globalContext.User.Shop.ManagePwd; |
|
|
this.PlatformCommissionRatio = (globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M) * 100; |
|
|
this.PlatformCommissionRatio = (globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M) * 100; |
|
|
this.PurchaseAccount = globalContext.User.Shop.PurchaseAccountList == null || globalContext.User.Shop.PurchaseAccountList.Count() == 0 ? |
|
|
|
|
|
new PurchaseAccount() : |
|
|
|
|
|
globalContext.User.Shop.PurchaseAccountList[0].Clone() as PurchaseAccount; |
|
|
|
|
|
DingDingKey = globalContext.User.Shop.DingDingKey; |
|
|
DingDingKey = globalContext.User.Shop.DingDingKey; |
|
|
DingDingWebHook = globalContext.User.Shop.DingDingWebHook; |
|
|
DingDingWebHook = globalContext.User.Shop.DingDingWebHook; |
|
|
SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString()); |
|
|
SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString()); |
|
@ -109,11 +126,13 @@ namespace BBWY.Client.ViewModels |
|
|
SelectedSiNanPolicyLevel = (SiNanPolicyLevel)globalContext.User.Shop.SiNanPolicyLevel; |
|
|
SelectedSiNanPolicyLevel = (SiNanPolicyLevel)globalContext.User.Shop.SiNanPolicyLevel; |
|
|
SiNanDingDingKey = globalContext.User.Shop.SiNanDingDingKey; |
|
|
SiNanDingDingKey = globalContext.User.Shop.SiNanDingDingKey; |
|
|
SiNanDingDingWebHook = globalContext.User.Shop.SiNanDingDingWebHook; |
|
|
SiNanDingDingWebHook = globalContext.User.Shop.SiNanDingDingWebHook; |
|
|
|
|
|
|
|
|
|
|
|
PurchasePlatform = Platform.阿里巴巴; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected override void Unload() |
|
|
protected override void Unload() |
|
|
{ |
|
|
{ |
|
|
this.PurchaseAccount = null; |
|
|
//this.PurchaseAccount = null;
|
|
|
this.PlatformCommissionRatio = 0M; |
|
|
this.PlatformCommissionRatio = 0M; |
|
|
this.ManagePwd = string.Empty; |
|
|
this.ManagePwd = string.Empty; |
|
|
this.isValidated = false; |
|
|
this.isValidated = false; |
|
@ -163,11 +182,7 @@ namespace BBWY.Client.ViewModels |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (globalContext.User.Shop.PurchaseAccountList == null) |
|
|
|
|
|
globalContext.User.Shop.PurchaseAccountList = new List<PurchaseAccount>(); |
|
|
|
|
|
globalContext.User.Shop.PurchaseAccountList.Clear(); |
|
|
|
|
|
PurchaseAccount.Id = response.Data; |
|
|
PurchaseAccount.Id = response.Data; |
|
|
globalContext.User.Shop.PurchaseAccountList.Add(PurchaseAccount); |
|
|
|
|
|
globalContext.User.Shop.PlatformCommissionRatio = p; |
|
|
globalContext.User.Shop.PlatformCommissionRatio = p; |
|
|
globalContext.User.Shop.ManagePwd = this.ManagePwd; |
|
|
globalContext.User.Shop.ManagePwd = this.ManagePwd; |
|
|
globalContext.User.Shop.DingDingKey = this.DingDingKey; |
|
|
globalContext.User.Shop.DingDingKey = this.DingDingKey; |
|
@ -179,5 +194,20 @@ namespace BBWY.Client.ViewModels |
|
|
globalContext.User.Shop.SiNanPolicyLevel = (int)this.SelectedSiNanPolicyLevel; |
|
|
globalContext.User.Shop.SiNanPolicyLevel = (int)this.SelectedSiNanPolicyLevel; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void OnPurchasePlatformChanged() |
|
|
|
|
|
{ |
|
|
|
|
|
var pa = globalContext.User.Shop.PurchaseAccountList.FirstOrDefault(pa => pa.PurchasePlatformId == PurchasePlatform); |
|
|
|
|
|
if (pa == null) |
|
|
|
|
|
{ |
|
|
|
|
|
pa = new PurchaseAccount() |
|
|
|
|
|
{ |
|
|
|
|
|
PurchasePlatformId = PurchasePlatform, |
|
|
|
|
|
}; |
|
|
|
|
|
globalContext.User.Shop.PurchaseAccountList.Add(pa); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.PurchaseAccount = pa; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|