学员端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
3.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="预约详情"></topNavbar>
  4. <!-- 详情 -->
  5. <view class="pad">
  6. <view class="card">
  7. <imitate v-if="type==1" :info="info"/>
  8. <opera v-else-if="type==2" :info="info"/>
  9. <examin v-else-if="type==3" :info="info"/>
  10. </view>
  11. <view class="btnCon">
  12. <view class="btnBg" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate')" v-if="info.writtenoffStatus==2">去评价</view>
  13. <view class="btnBorder" @click="show=true" v-if="info.recordStatus==0">取消预约</view>
  14. <view class="btnBorder" v-if="info.payStatus==1">申请退款</view>
  15. </view>
  16. </view>
  17. <u-popup :show="show" mode="center" :round="20" >
  18. <cancelReservation @popupBtnClick="popupBtnClick"/>
  19. </u-popup>
  20. </view>
  21. </template>
  22. <script>
  23. import imitate from './imitate'
  24. import opera from './opera'
  25. import examin from './examin'
  26. import { examSimulationGet, cancelSimulation, simulationDetail, cancelSimulationDevice, masterDetail, masterCancelBooking } from "@/config/api.js"
  27. export default {
  28. components: { imitate, opera, examin},
  29. data() {
  30. return {
  31. type: 1,
  32. show: false,
  33. id: '',
  34. info: ''
  35. }
  36. },
  37. onLoad(options) {
  38. this.type = options.type
  39. this.id = options.id
  40. if(this.type==3) {
  41. this.examSimulationGetFn()
  42. }else if(this.type==1) {
  43. this.simulationDetailFn()
  44. }else {
  45. this.masterDetailFn()
  46. }
  47. },
  48. methods: {
  49. // 获得考场模拟详情
  50. async examSimulationGetFn() {
  51. const {data: res} = await examSimulationGet({id: this.id})
  52. this.info = res
  53. },
  54. // 获得考场模拟详情
  55. async masterDetailFn() {
  56. const {data: res} = await masterDetail({id: this.id})
  57. this.info = res
  58. },
  59. // 获得模拟预约详情
  60. async simulationDetailFn(item) {
  61. const {data: res} = await simulationDetail({id: this.id})
  62. this.info = res
  63. },
  64. // 取消考场模拟预约
  65. async cancelSimulationFn() {
  66. const res = await cancelSimulation({id: this.id})
  67. console.log('没来到这里?')
  68. // console.log(res)
  69. // if(res.code==0) {
  70. this.$u.toast('取消成功')
  71. this.examSimulationGetFn()
  72. // }
  73. },
  74. // 取消模拟预约
  75. async cancelSimulationDeviceFn() {
  76. const {data: res} = await cancelSimulationDevice({id: this.id})
  77. this.$u.toast('取消成功')
  78. this.simulationDetailFn()
  79. },
  80. // 取消实操预约
  81. async masterCancelBookingFn() {
  82. const {data: res} = await masterCancelBooking({id: this.id})
  83. this.$u.toast('取消成功')
  84. this.masterDetailFn()
  85. },
  86. // 取消预约事件
  87. popupBtnClick(val) {
  88. if(val==1) {
  89. if(this.type==1) {
  90. this.cancelSimulationDeviceFn()
  91. }else if(this.type==3) {
  92. this.cancelSimulationFn()
  93. }else {
  94. this.masterCancelBookingFn()
  95. }
  96. }
  97. this.show = false
  98. console.log(val)
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .card {
  105. padding: 0 24rpx;
  106. }
  107. .btnCon {
  108. display: flex;
  109. flex-direction: column;
  110. align-items: center;
  111. justify-content: center;
  112. margin-top: 76rpx;
  113. .btnBg {
  114. width: 212rpx;
  115. margin-bottom: 40rpx;
  116. }
  117. .btnBorder {
  118. width: 396rpx;
  119. border: 2rpx solid #E8E9EC;
  120. background-color: #fff;
  121. color: #ADADAD;
  122. margin-bottom: 40rpx;
  123. }
  124. }
  125. </style>