Showing
1 changed file
with
2 additions
and
1 deletions
@@ -18,7 +18,6 @@ const procProductImg = (product, gender) => { | @@ -18,7 +18,6 @@ const procProductImg = (product, gender) => { | ||
18 | return product.cover1 || product.cover2 || product.imagesUrl || ''; | 18 | return product.cover1 || product.cover2 || product.imagesUrl || ''; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | - | ||
22 | /** | 21 | /** |
23 | * 商品搜索商品数据处理 | 22 | * 商品搜索商品数据处理 |
24 | */ | 23 | */ |
@@ -46,6 +45,8 @@ exports.processProductList = (list, options) => { | @@ -46,6 +45,8 @@ exports.processProductList = (list, options) => { | ||
46 | // 市场价和售价一样,则不显示市场价 | 45 | // 市场价和售价一样,则不显示市场价 |
47 | if (product.marketPrice === product.salesPrice) { | 46 | if (product.marketPrice === product.salesPrice) { |
48 | product.marketPrice = false; | 47 | product.marketPrice = false; |
48 | + } else if (product.marketPrice && product.salesPrice) { | ||
49 | + product.discount = (product.salesPrice / product.marketPrice).toFixed(2) * 10; | ||
49 | } | 50 | } |
50 | 51 | ||
51 | // 判别默认的商品是否将默认的图片URL赋值到skn | 52 | // 判别默认的商品是否将默认的图片URL赋值到skn |
-
Please register or login to post a comment