|
|
@ -24,7 +24,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
private int skuSafeTurnoverDays; |
|
|
|
private string dingDingWebHook; |
|
|
|
private string dingDingKey; |
|
|
|
private int selectedSkuSafeTurnoverDay; |
|
|
|
private KVModel selectedSkuSafeTurnoverDay; |
|
|
|
|
|
|
|
|
|
|
|
public ICommand SaveCommand { get; set; } |
|
|
@ -39,12 +39,12 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
public int PanelIndex { get => panelIndex; set { Set(ref panelIndex, value); } } |
|
|
|
|
|
|
|
public IList<int> SafeDayList { get; set; } |
|
|
|
public IList<KVModel> SafeDayList { get; set; } |
|
|
|
public int SkuSafeTurnoverDays { get => skuSafeTurnoverDays; set { Set(ref skuSafeTurnoverDays, value); } } |
|
|
|
public string DingDingWebHook { get => dingDingWebHook; set { Set(ref dingDingWebHook, value); } } |
|
|
|
public string DingDingKey { get => dingDingKey; set { Set(ref dingDingKey, value); } } |
|
|
|
|
|
|
|
public int SelectedSkuSafeTurnoverDay { get => selectedSkuSafeTurnoverDay; set { Set(ref selectedSkuSafeTurnoverDay, value); } } |
|
|
|
public KVModel SelectedSkuSafeTurnoverDay { get => selectedSkuSafeTurnoverDay; set { Set(ref selectedSkuSafeTurnoverDay, value); } } |
|
|
|
|
|
|
|
public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService) |
|
|
|
{ |
|
|
@ -56,7 +56,29 @@ namespace BBWY.Client.ViewModels |
|
|
|
{ |
|
|
|
PanelIndex = i; |
|
|
|
}); |
|
|
|
SafeDayList = new List<int>() { 0, 14, 21, 28 }; |
|
|
|
SafeDayList = new List<KVModel>() |
|
|
|
{ |
|
|
|
new KVModel() |
|
|
|
{ |
|
|
|
Key="不提醒", |
|
|
|
Value="0" |
|
|
|
}, |
|
|
|
new KVModel() |
|
|
|
{ |
|
|
|
Key="14", |
|
|
|
Value="14" |
|
|
|
}, |
|
|
|
new KVModel() |
|
|
|
{ |
|
|
|
Key="21", |
|
|
|
Value="21" |
|
|
|
}, |
|
|
|
new KVModel() |
|
|
|
{ |
|
|
|
Key="28", |
|
|
|
Value="28" |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
protected override void Load() |
|
|
@ -76,7 +98,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
globalContext.User.Shop.PurchaseAccountList[0].Clone() as PurchaseAccount; |
|
|
|
DingDingKey = globalContext.User.Shop.DingDingKey; |
|
|
|
DingDingWebHook = globalContext.User.Shop.DingDingWebHook; |
|
|
|
SelectedSkuSafeTurnoverDay = globalContext.User.Shop.SkuSafeTurnoverDays; |
|
|
|
SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString()); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void Unload() |
|
|
@ -86,7 +108,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
this.ManagePwd = string.Empty; |
|
|
|
this.isValidated = false; |
|
|
|
this.DingDingKey = this.DingDingWebHook = string.Empty; |
|
|
|
SelectedSkuSafeTurnoverDay = 0; |
|
|
|
SelectedSkuSafeTurnoverDay = SafeDayList[0]; |
|
|
|
} |
|
|
|
|
|
|
|
private void Save() |
|
|
@ -118,7 +140,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
PurchaseAccount, |
|
|
|
DingDingWebHook, |
|
|
|
DingDingKey, |
|
|
|
SelectedSkuSafeTurnoverDay)).ContinueWith(r => |
|
|
|
int.Parse(SelectedSkuSafeTurnoverDay.Value))).ContinueWith(r => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
var response = r.Result; |
|
|
@ -135,6 +157,9 @@ namespace BBWY.Client.ViewModels |
|
|
|
globalContext.User.Shop.PurchaseAccountList.Add(PurchaseAccount); |
|
|
|
globalContext.User.Shop.PlatformCommissionRatio = p; |
|
|
|
globalContext.User.Shop.ManagePwd = this.ManagePwd; |
|
|
|
globalContext.User.Shop.DingDingKey = this.DingDingKey; |
|
|
|
globalContext.User.Shop.DingDingWebHook = this.DingDingWebHook; |
|
|
|
globalContext.User.Shop.SkuSafeTurnoverDays = int.Parse(SelectedSkuSafeTurnoverDay.Value); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|