Browse Source

bbwy平台扣点

qianyi
shanji 3 years ago
parent
commit
310322422d
  1. 14
      BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs

14
BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs

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

Loading…
Cancel
Save