Showing
1 changed file
with
6 additions
and
2 deletions
@@ -282,8 +282,12 @@ const setProductData = base => { | @@ -282,8 +282,12 @@ const setProductData = base => { | ||
282 | total: 0 | 282 | total: 0 |
283 | }; | 283 | }; |
284 | 284 | ||
285 | - // 目前没有RGB值先以背景图方式实现 | ||
286 | - group.rgb = `url('${helpers.image(value.colorImage, 30, 30)}')`; | 285 | + // 有RGB值限时rgb值没有则显示背景图 |
286 | + if (value.colorCode) { | ||
287 | + group.rgb = `#${value.colorCode}`; | ||
288 | + } else { | ||
289 | + group.rgb = `url('${helpers.image(value.colorImage, 30, 30)}')`; | ||
290 | + } | ||
287 | 291 | ||
288 | // 商品颜色列表 | 292 | // 商品颜色列表 |
289 | _.forEach(value.goodsImagesList, function(subValue) { | 293 | _.forEach(value.goodsImagesList, function(subValue) { |
-
Please register or login to post a comment