Browse Source

10028

yijia
shanji 2 years ago
parent
commit
33c7742475
  1. 27
      BBWYB.Client/APIServices/ProductService.cs
  2. 2
      BBWYB.Client/GlobalContext.cs
  3. 5
      BBWYB.Client/ViewModels/Ware/WareManagerViewModel.cs

27
BBWYB.Client/APIServices/ProductService.cs

@ -10,20 +10,21 @@ namespace BBWYB.Client.APIServices
{
public ProductService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { }
public ApiResponse<ProductListResponse> GetProductList(string spu, string productName, string productItem, int pageIndex)
public ApiResponse<ProductListResponse> GetProductList(string spu, string productName, string productItem, int pageIndex, int pageSize)
{
return SendRequest<ProductListResponse>(globalContext.BBWYApiHost,
"api/product/GetProductList",
new
{
Spu = spu,
ProductName = productName,
ProductItem = productItem,
PageIndex = pageIndex,
Platform = globalContext.User.Shop.Platform,
AppKey = globalContext.User.Shop.AppKey,
AppSecret = globalContext.User.Shop.AppSecret,
AppToken = globalContext.User.Shop.AppToken
spu,
productName,
productItem,
pageIndex,
pageSize,
globalContext.User.Shop.Platform,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken
},
null,
HttpMethod.Post);
@ -37,10 +38,10 @@ namespace BBWYB.Client.APIServices
{
Spu = spu,
Sku = sku,
Platform = globalContext.User.Shop.Platform,
AppKey = globalContext.User.Shop.AppKey,
AppSecret = globalContext.User.Shop.AppSecret,
AppToken = globalContext.User.Shop.AppToken
globalContext.User.Shop.Platform,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken
},
null,
HttpMethod.Post);

2
BBWYB.Client/GlobalContext.cs

@ -20,7 +20,7 @@ namespace BBWYB.Client
{
public GlobalContext()
{
BBWYBApiVersion = "10027";
BBWYBApiVersion = "10028";
}
private User user;

5
BBWYB.Client/ViewModels/Ware/WareManagerViewModel.cs

@ -57,6 +57,7 @@ namespace BBWYB.Client.ViewModels
#region Methods
public WareManagerViewModel(GlobalContext globalContext, BindingPurchaseProductViewModel bindingPurchaseProduct, PurchaseService purchaseService, ProductService productService)
{
PageSize = 5;
AddPurchaserCommand = new RelayCommand<Product>(AddPurchaser);
EditPurchaserCommand = new RelayCommand<Purchaser>(EditPurchaser);
DeletePurchaserCommand = new RelayCommand<Purchaser>(DeletePurchaser);
@ -111,7 +112,7 @@ namespace BBWYB.Client.ViewModels
IsLoading = false;
return;
}
productApiResponse = productService.GetProductList(skuResponse.Data.Items[0].ProductId, string.Empty, string.Empty, pageIndex);
productApiResponse = productService.GetProductList(skuResponse.Data.Items[0].ProductId, string.Empty, string.Empty, pageIndex, PageSize);
}
else
{
@ -122,7 +123,7 @@ namespace BBWYB.Client.ViewModels
}
else
{
productApiResponse = productService.GetProductList(SearchSpu, SearchProductName, SearchProductItem, pageIndex);
productApiResponse = productService.GetProductList(SearchSpu, SearchProductName, SearchProductItem, pageIndex, PageSize);
}
if (!productApiResponse.Success)

Loading…
Cancel
Save