|
@ -123,6 +123,16 @@ namespace BBWY.Server.Business |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private string GetSkuTitle(JToken s) |
|
|
|
|
|
{ |
|
|
|
|
|
var title = s["saleAttrs"] != null ? string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())) : string.Empty; |
|
|
|
|
|
if (!string.IsNullOrEmpty(title) && title.Contains("id") && title.Contains("value")) |
|
|
|
|
|
{ |
|
|
|
|
|
title = string.Join("", JArray.Parse(title).Select(j => $"{j.Value<string>("value")}{j.Value<string>("unit")}")); |
|
|
|
|
|
} |
|
|
|
|
|
return title; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public override IList<ProductSkuResponse> GetProductSkuList(SearchProductSkuRequest searchProductSkuRequest) |
|
|
public override IList<ProductSkuResponse> GetProductSkuList(SearchProductSkuRequest searchProductSkuRequest) |
|
|
{ |
|
|
{ |
|
|
var jdClient = GetJdClient(searchProductSkuRequest.AppKey, searchProductSkuRequest.AppSecret); |
|
|
var jdClient = GetJdClient(searchProductSkuRequest.AppKey, searchProductSkuRequest.AppSecret); |
|
@ -164,7 +174,7 @@ namespace BBWY.Server.Business |
|
|
Id = s.Value<string>("skuId"), |
|
|
Id = s.Value<string>("skuId"), |
|
|
ProductId = s.Value<string>("wareId"), |
|
|
ProductId = s.Value<string>("wareId"), |
|
|
Price = s.Value<decimal>("jdPrice"), |
|
|
Price = s.Value<decimal>("jdPrice"), |
|
|
Title = s["saleAttrs"] != null ? string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())) : string.Empty, |
|
|
Title = GetSkuTitle(s), |
|
|
Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value<string>("logo")}", |
|
|
Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value<string>("logo")}", |
|
|
State = s.Value<int>("status"), |
|
|
State = s.Value<int>("status"), |
|
|
CreateTime = s.Value<long>("created").StampToDateTime(), |
|
|
CreateTime = s.Value<long>("created").StampToDateTime(), |
|
|