|
@@ -205,7 +205,10 @@ onMounted(async () => {
|
|
|
render(data) {
|
|
|
if (data.type == "waterfall") {
|
|
|
let arr = data.products.map((item) => item.price);
|
|
|
- let range = `${data.products[0].symbol} ${Math.min.apply(null, arr)} - ${Math.max.apply(null, arr)}`;
|
|
|
+ let priceMin = Math.min.apply(null, arr)
|
|
|
+ let priceMax = Math.max.apply(null, arr)
|
|
|
+ let price = priceMin==priceMax ? priceMax : `${priceMin}-${priceMax}`
|
|
|
+ let range = `${data.products[0].symbol} ${price}`;
|
|
|
return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
|
|
|
<div class="tag-body">
|
|
|
<div data-id="${data.sid}" class="tag-commodity">
|
|
@@ -229,7 +232,10 @@ onMounted(async () => {
|
|
|
return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>`;
|
|
|
} else if (data.type == "commodity") {
|
|
|
let arr = data.products.map((item) => item.price);
|
|
|
- let range = `${data.products[0].symbol} ${Math.min.apply(null, arr)}-${Math.max.apply(null, arr)}`;
|
|
|
+ let priceMin = Math.min.apply(null, arr)
|
|
|
+ let priceMax = Math.max.apply(null, arr)
|
|
|
+ let price = priceMin==priceMax ? priceMax : `${priceMin}-${priceMax}`
|
|
|
+ let range = `${data.products[0].symbol} ${price}`;
|
|
|
return `<span class="tag-icon animate" style="background-image:url({{icon}})"></span>
|
|
|
<div class="tag-body">
|
|
|
<div data-id="${data.sid}" class="tag-commodity">
|