|
@@ -38,7 +38,7 @@
|
|
</span>
|
|
</span>
|
|
<template v-else>
|
|
<template v-else>
|
|
<span class="sp2" v-if="discount_code_status == 1"
|
|
<span class="sp2" v-if="discount_code_status == 1"
|
|
- >-<span v-html="changePrice(discount_money, 16)"></span
|
|
|
|
|
|
+ >-¥<span v-html="changePrice(discount_money, 16)"></span
|
|
></span>
|
|
></span>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -92,19 +92,16 @@ export default {
|
|
watch: {},
|
|
watch: {},
|
|
//方法集合
|
|
//方法集合
|
|
methods: {
|
|
methods: {
|
|
- changePrice(price, fontSize) {
|
|
|
|
- let str = "";
|
|
|
|
- price = price ? price.toString() : "0.00";
|
|
|
|
- if (price.indexOf(".") > -1) {
|
|
|
|
- let arr = price.split(".");
|
|
|
|
- str = `<span style="font-size: ${fontSize ? fontSize : 16}px;">${
|
|
|
|
- arr[0]
|
|
|
|
- }</span>.<span style="font-size: 16px;">${arr[1]}</span>`;
|
|
|
|
- } else {
|
|
|
|
- str = `<span style="font-size: ${
|
|
|
|
- fontSize ? fontSize : 16
|
|
|
|
- }px;">${price}</span>.<span style="font-size: 16px;">00</span>`;
|
|
|
|
- }
|
|
|
|
|
|
+ changePrice(price, fontSize1, fontSize2) {
|
|
|
|
+ price = price ? price * 1 : 0;
|
|
|
|
+ price = price.toFixed(2);
|
|
|
|
+ price = price.toString();
|
|
|
|
+ let arr = price.split(".");
|
|
|
|
+ let str = `<span style="font-size: ${fontSize1 ? fontSize1 : 16}px;">${
|
|
|
|
+ arr[0]
|
|
|
|
+ }</span>.<span style="font-size: ${fontSize2 ? fontSize2 : 16}px;">${
|
|
|
|
+ arr[1]
|
|
|
|
+ }</span>`;
|
|
|
|
|
|
return str;
|
|
return str;
|
|
},
|
|
},
|