GoodItem.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div>
  3. <div v-if="isVip">
  4. <div class="money font-color-red">
  5. <span class="iconfont icon-huiyuan" style="font-size: 0.3rem"></span
  6. ><span class="num" style="font-size: 0.3rem">
  7. ¥ {{ item.vip_price }}</span
  8. >
  9. </div>
  10. <div class="num" style="height: 0.4rem; font-size: 0.3rem">
  11. <span
  12. class="addfont icon-Icon-gou font-color-red"
  13. style="font-size: 0.3rem"
  14. ></span>
  15. ¥ {{ item.price }}
  16. </div>
  17. <div
  18. class="num font-color-green"
  19. style="height: 0.4rem; font-size: 0.3rem"
  20. >
  21. <span
  22. class="addfont icon-Icon-zhuan font-color-red"
  23. style="font-size: 0.3rem"
  24. ></span>
  25. ¥ {{ getPrice() }}
  26. </div>
  27. </div>
  28. <div v-else>
  29. <div class="money font-color-red">
  30. ¥<span class="num">{{ item.price }}</span>
  31. </div>
  32. <div class="ot-money" style="text-decoration:line-through;">
  33. ¥{{ item.ot_price }}
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. name: "GoodItem",
  41. props: {
  42. item: {},
  43. isVip: false
  44. },
  45. data: function() {
  46. return {};
  47. },
  48. mounted: function() {},
  49. methods: {
  50. getPrice() {
  51. var price = Number(this.item.price);
  52. var vip_price = Number(this.item.vip_price);
  53. return (price - vip_price).toFixed(2);
  54. }
  55. }
  56. };
  57. </script>
  58. <style></style>