|
|
@ -45,7 +45,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
} |
|
|
|
isValidated = true; |
|
|
|
this.ManagePwd = globalContext.User.Shop.ManagePwd; |
|
|
|
this.PlatformCommissionRatio = globalContext.User.Shop.PlatformCommissionRatio ?? 5; |
|
|
|
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; |
|
|
@ -55,6 +55,9 @@ namespace BBWY.Client.ViewModels |
|
|
|
protected override void Unload() |
|
|
|
{ |
|
|
|
this.PurchaseAccount = null; |
|
|
|
this.PlatformCommissionRatio = 0M; |
|
|
|
this.ManagePwd = string.Empty; |
|
|
|
this.isValidated = false; |
|
|
|
} |
|
|
|
|
|
|
|
private void Save() |
|
|
@ -65,15 +68,16 @@ namespace BBWY.Client.ViewModels |
|
|
|
return; |
|
|
|
} |
|
|
|
if (string.IsNullOrEmpty(PurchaseAccount.AppKey) || |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AppKey) || |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AppKey) || |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AppKey)) |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AppSecret) || |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AppToken) || |
|
|
|
string.IsNullOrEmpty(PurchaseAccount.AccountName)) |
|
|
|
{ |
|
|
|
MessageBox.Show("采购信息不能为空", "保存店铺设置"); |
|
|
|
return; |
|
|
|
} |
|
|
|
var p = PlatformCommissionRatio / 100; |
|
|
|
IsLoading = true; |
|
|
|
Task.Factory.StartNew(() => shopService.SaveShopSetting(globalContext.User.Shop.ShopId, ManagePwd, PlatformCommissionRatio, PurchaseAccount)).ContinueWith(r => |
|
|
|
Task.Factory.StartNew(() => shopService.SaveShopSetting(globalContext.User.Shop.ShopId, ManagePwd, p, PurchaseAccount)).ContinueWith(r => |
|
|
|
{ |
|
|
|
IsLoading = false; |
|
|
|
var response = r.Result; |
|
|
|