accessories.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="courseModel" style="margin-top: 12px;">
  3. <h2 class="titles" v-if="accessOries.length > 0">
  4. <img :src="trainSmallBg" />
  5. <span>辅件</span>
  6. </h2>
  7. <div class="section" v-if="accessOries.length > 0" key="accessOries">
  8. <!-- <h2 class="titles">辅件</h2> -->
  9. <el-row class="title-row">
  10. <el-col :span="isShowSalePrice ? 14 : 19">辅件商品</el-col>
  11. <!-- -->
  12. <el-col :span="5" style="text-align: right">原价</el-col>
  13. <el-col :span="5" style="text-align: right" v-if="isShowSalePrice"
  14. >现价</el-col
  15. >
  16. </el-row>
  17. <div v-for="(instr, index) in accessOries" :key="index">
  18. <el-row class="option-row" @click.native="onAuxiliarie(instr)">
  19. <el-col :span="isShowSalePrice ? 14 : 19">
  20. <i
  21. class="check_default"
  22. :class="[instr.isStatus ? 'check_active' : '']"
  23. ></i
  24. >{{ instr.name }}
  25. </el-col>
  26. <el-col :span="5">
  27. <del style="color: #808080; font-size: 12px"
  28. >¥{{
  29. instr.goodsList[0]
  30. ? instr.goodsList[0].marketPrice
  31. : 0 | moneyFormat
  32. }}</del
  33. >
  34. </el-col>
  35. <el-col :span="5" v-if="isShowSalePrice">
  36. <span style="color: #1a1a1a" v-if="instr.price == 0">免费</span>
  37. <span style="color: #1a1a1a" v-else
  38. >¥{{ (isGiveAccessories ? 0 : instr.price) | moneyFormat }}</span
  39. >
  40. </el-col>
  41. </el-row>
  42. <el-row style="padding-left: 24px" v-if="instr.childGoodsList">
  43. <el-col
  44. v-for="(child, index) in instr.childGoodsList"
  45. :key="child.id"
  46. >
  47. <span style="font-size: 12px; color: #808080"
  48. >{{ child.name }}
  49. {{ instr.childGoodsList.length - 1 == index ? "" : "、" }}</span
  50. >
  51. </el-col>
  52. </el-row>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. export default {
  59. name: "courseModel",
  60. props: {
  61. trainSmallBg: String,
  62. accessOries: Array,
  63. isGiveAccessories: Boolean, // 是否赠送辅件,如果为是,则不价格为0
  64. isShowSalePrice: Boolean
  65. },
  66. data() {
  67. return {};
  68. },
  69. methods: {
  70. onAuxiliarie(item) {
  71. this.$emit("onAuxiliarie", item);
  72. }
  73. }
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. @import url("./signUpPayment.less");
  78. </style>