| | |
| | | |
| | | <template> |
| | | <div class="Price" v-if="priceNew"> |
| | | <div class="Price"> |
| | | ¥<span class="newPrice">{{ priceN1 }}</span |
| | | >{{ priceN2 }}/年 |
| | | <span class="iconSave" v-if="showIcon">省</span> |
| | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | priceNew: {}, |
| | | priceNew: { |
| | | default: 0, |
| | | }, |
| | | showIcon: { |
| | | default: false, |
| | | }, |
| | |
| | | this.priceO2 = ".00"; |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | | priceNew() { |
| | | const priceO = (this.priceNew * 1.2 + "").split("."); |
| | | const priceN = (this.priceNew + "").split("."); |
| | | if (priceN.length > 1) { |
| | | this.priceN1 = priceN[0]; |
| | | this.priceN2 = "." + priceN[1]; |
| | | } else { |
| | | this.priceN1 = priceN[0]; |
| | | this.priceN2 = ".00"; |
| | | } |
| | | if (priceO.length > 1) { |
| | | this.priceO1 = priceO[0]; |
| | | this.priceO2 = "." + priceO[1]; |
| | | } else { |
| | | this.priceO1 = priceO[0]; |
| | | this.priceO2 = ".00"; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |