|
@ -28,6 +28,7 @@ namespace BBWY.Client.ViewModels |
|
|
public Product Product { get; set; } |
|
|
public Product Product { get; set; } |
|
|
public string PurchaserId { get; set; } |
|
|
public string PurchaserId { get; set; } |
|
|
public string PurchaserName { get => purchaserName; set { Set(ref purchaserName, value); } } |
|
|
public string PurchaserName { get => purchaserName; set { Set(ref purchaserName, value); } } |
|
|
|
|
|
public string PurchaserLocation { get; set; } |
|
|
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|
|
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
@ -113,9 +114,9 @@ namespace BBWY.Client.ViewModels |
|
|
ewh.Set(); |
|
|
ewh.Set(); |
|
|
ewh.Dispose(); |
|
|
ewh.Dispose(); |
|
|
}); |
|
|
}); |
|
|
WaitHandle.WaitAll(waitList.ToArray()); |
|
|
|
|
|
IsLoading = false; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
WaitHandle.WaitAll(waitList.ToArray()); |
|
|
|
|
|
IsLoading = false; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -129,7 +130,7 @@ namespace BBWY.Client.ViewModels |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (skuList == null) |
|
|
if (skuList == null) |
|
|
skuList = LoadPurchaseProductCore(purchaseSchemeProduct.PurchaseProductId, out _, out _, out _, null); |
|
|
skuList = LoadPurchaseProductCore(purchaseSchemeProduct.PurchaseProductId, out _, out _, out _, out _, null); |
|
|
if (skuList == null) |
|
|
if (skuList == null) |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
@ -151,11 +152,13 @@ namespace BBWY.Client.ViewModels |
|
|
out string errorMsg, |
|
|
out string errorMsg, |
|
|
out string purchaserId, |
|
|
out string purchaserId, |
|
|
out string purchaserName, |
|
|
out string purchaserName, |
|
|
|
|
|
out string purchaserLocation, |
|
|
Func<string, string> checkPurchaserFunc) |
|
|
Func<string, string> checkPurchaserFunc) |
|
|
{ |
|
|
{ |
|
|
errorMsg = string.Empty; |
|
|
errorMsg = string.Empty; |
|
|
purchaserId = string.Empty; |
|
|
purchaserId = string.Empty; |
|
|
purchaserName = string.Empty; |
|
|
purchaserName = string.Empty; |
|
|
|
|
|
purchaserLocation = string.Empty; |
|
|
//1688商品详情接口
|
|
|
//1688商品详情接口
|
|
|
var response = oneBoundAPIService.GetProductInfo("1688", purchseProductId); |
|
|
var response = oneBoundAPIService.GetProductInfo("1688", purchseProductId); |
|
|
if (!response.Success) |
|
|
if (!response.Success) |
|
@ -168,7 +171,7 @@ namespace BBWY.Client.ViewModels |
|
|
var jobject = response.Data; |
|
|
var jobject = response.Data; |
|
|
purchaserId = jobject["item"]["seller_info"].Value<string>("user_num_id"); |
|
|
purchaserId = jobject["item"]["seller_info"].Value<string>("user_num_id"); |
|
|
purchaserName = jobject["item"]["seller_info"].Value<string>("title"); |
|
|
purchaserName = jobject["item"]["seller_info"].Value<string>("title"); |
|
|
|
|
|
purchaserLocation = jobject["item"].Value<string>("location"); |
|
|
if (checkPurchaserFunc != null) |
|
|
if (checkPurchaserFunc != null) |
|
|
{ |
|
|
{ |
|
|
errorMsg = checkPurchaserFunc(purchaserId); |
|
|
errorMsg = checkPurchaserFunc(purchaserId); |
|
@ -193,7 +196,7 @@ namespace BBWY.Client.ViewModels |
|
|
//ProductId = Product.Id,
|
|
|
//ProductId = Product.Id,
|
|
|
//SkuId = purchaseSchemeProduct.SkuId,
|
|
|
//SkuId = purchaseSchemeProduct.SkuId,
|
|
|
PurchaseProductId = purchseProductId, |
|
|
PurchaseProductId = purchseProductId, |
|
|
Price = j.Value<double>("price"), |
|
|
Price = j.Value<decimal>("price"), |
|
|
PurchaseSkuId = j.Value<string>("sku_id"), |
|
|
PurchaseSkuId = j.Value<string>("sku_id"), |
|
|
PurchaseSkuSpecId = j.Value<string>("spec_id"), |
|
|
PurchaseSkuSpecId = j.Value<string>("spec_id"), |
|
|
Title = j.Value<string>("properties_name"), |
|
|
Title = j.Value<string>("properties_name"), |
|
@ -289,6 +292,7 @@ namespace BBWY.Client.ViewModels |
|
|
out string errorMsg, |
|
|
out string errorMsg, |
|
|
out string purchaserId, |
|
|
out string purchaserId, |
|
|
out string purchaserName, |
|
|
out string purchaserName, |
|
|
|
|
|
out string purchaserLocation, |
|
|
(p) => |
|
|
(p) => |
|
|
{ |
|
|
{ |
|
|
if (sku.PurchaseSchemeList.Any(s => s.PurchaserId == p)) |
|
|
if (sku.PurchaseSchemeList.Any(s => s.PurchaserId == p)) |
|
@ -311,7 +315,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
|
PurchaserId = purchaserId; |
|
|
PurchaserId = purchaserId; |
|
|
PurchaserName = purchaserName; |
|
|
PurchaserName = purchaserName; |
|
|
|
|
|
PurchaserLocation = purchaserLocation; |
|
|
purchaseSchemeProduct.PurchaseUrl = purchaseUrl; |
|
|
purchaseSchemeProduct.PurchaseUrl = purchaseUrl; |
|
|
purchaseSchemeProduct.PurchaseProductId = purchaseProductId; |
|
|
purchaseSchemeProduct.PurchaseProductId = purchaseProductId; |
|
|
|
|
|
|
|
@ -341,6 +345,9 @@ namespace BBWY.Client.ViewModels |
|
|
var productSku = Product.SkuList.FirstOrDefault(sku => sku.Id == purchaseSchemeProduct.SkuId); |
|
|
var productSku = Product.SkuList.FirstOrDefault(sku => sku.Id == purchaseSchemeProduct.SkuId); |
|
|
productSku.SelectedPurchaseScheme.PurchaserId = PurchaserId; |
|
|
productSku.SelectedPurchaseScheme.PurchaserId = PurchaserId; |
|
|
productSku.SelectedPurchaseScheme.PurchaserName = PurchaserName; |
|
|
productSku.SelectedPurchaseScheme.PurchaserName = PurchaserName; |
|
|
|
|
|
productSku.SelectedPurchaseScheme.PurchaserLocation = PurchaserLocation; |
|
|
|
|
|
productSku.SelectedPurchaseScheme.DefaultCost = productSku.SelectedPurchaseScheme.PurchaseSchemeProductList.Sum(p => p.PurchaseSchemeProductSkuList.Count() == 0 ? 0 : p.PurchaseSchemeProductSkuList.Sum(s => s.Price)); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void EditPurchaseProduct(PurchaseSchemeProduct purchaseSchemeProduct) |
|
|
private void EditPurchaseProduct(PurchaseSchemeProduct purchaseSchemeProduct) |
|
|