Commit a9d5821bab03b81645f51238b1109c559872ca72
1 parent
863ce605
折扣专区支持文字性质角标,tag
Showing
2 changed files
with
4 additions
and
4 deletions
src/pages/discountList/discountList.vue
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | 52 | ||
| 53 | <!-- 折扣角标 --> | 53 | <!-- 折扣角标 --> |
| 54 | <div class="discount-flag" slot="flag" v-if="parseFloat(item.price) < parseFloat(item.prices)"> | 54 | <div class="discount-flag" slot="flag" v-if="parseFloat(item.price) < parseFloat(item.prices)"> |
| 55 | - {{getDiscount(item.price, item.prices)}}折 | 55 | + {{item.tag || getDiscount(item.price, item.prices)}} |
| 56 | </div> | 56 | </div> |
| 57 | </goods-item-8> | 57 | </goods-item-8> |
| 58 | </div> | 58 | </div> |
| @@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
| 110 | // 售价/原价 | 110 | // 售价/原价 |
| 111 | let x = (price * 100) / (prices * 100); | 111 | let x = (price * 100) / (prices * 100); |
| 112 | 112 | ||
| 113 | - return (Math.floor(x * 1000) / 1000) * 10; | 113 | + return ((Math.floor(x * 1000) / 1000) * 10).toString() + '折'; |
| 114 | } | 114 | } |
| 115 | } | 115 | } |
| 116 | }, | 116 | }, |
src/pages/optimization2/optimization2.vue
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | 44 | ||
| 45 | <!-- 折扣角标 --> | 45 | <!-- 折扣角标 --> |
| 46 | <div class="discount-flag" slot="flag" v-if="parseFloat(item.price) < parseFloat(item.prices)"> | 46 | <div class="discount-flag" slot="flag" v-if="parseFloat(item.price) < parseFloat(item.prices)"> |
| 47 | - {{getDiscount(item.price, item.prices)}}折 | 47 | + {{item.tag || getDiscount(item.price, item.prices)}} |
| 48 | </div> | 48 | </div> |
| 49 | </goods-item-2> | 49 | </goods-item-2> |
| 50 | </div> | 50 | </div> |
| @@ -192,7 +192,7 @@ | @@ -192,7 +192,7 @@ | ||
| 192 | // 售价/原价 | 192 | // 售价/原价 |
| 193 | let x = (price * 100) / (prices * 100); | 193 | let x = (price * 100) / (prices * 100); |
| 194 | 194 | ||
| 195 | - return (Math.floor(x * 1000) / 1000) * 10; | 195 | + return ((Math.floor(x * 1000) / 1000) * 10).toString() + '折'; |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| 198 | }, | 198 | }, |