学员端小程序
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.

113 lines
2.7 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. <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 } 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. }
  45. },
  46. methods: {
  47. // 获得考场模拟详情
  48. async examSimulationGetFn() {
  49. const {data: res} = await examSimulationGet({id: this.id})
  50. this.info = res
  51. },
  52. // 获得模拟预约详情
  53. async simulationDetailFn(item) {
  54. const {data: res} = await simulationDetail({id: this.id})
  55. this.info = res
  56. },
  57. // 取消考场模拟预约
  58. async cancelSimulationFn() {
  59. const res = await cancelSimulation({id: this.id})
  60. console.log('没来到这里?')
  61. // console.log(res)
  62. // if(res.code==0) {
  63. this.$u.toast('取消成功')
  64. this.examSimulationGetFn()
  65. // }
  66. },
  67. // 取消模拟预约
  68. async cancelSimulationDeviceFn() {
  69. const {data: res} = await cancelSimulationDevice({id: this.id})
  70. this.$u.toast('取消成功')
  71. this.simulationDetailFn()
  72. },
  73. // 取消预约事件
  74. popupBtnClick(val) {
  75. if(val==1) {
  76. if(this.type==1) {
  77. this.cancelSimulationDeviceFn()
  78. }else if(this.type==3) {
  79. this.cancelSimulationFn()
  80. }
  81. }
  82. this.show = false
  83. console.log(val)
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .card {
  90. padding: 0 24rpx;
  91. }
  92. .btnCon {
  93. display: flex;
  94. flex-direction: column;
  95. align-items: center;
  96. justify-content: center;
  97. margin-top: 76rpx;
  98. .btnBg {
  99. width: 212rpx;
  100. margin-bottom: 40rpx;
  101. }
  102. .btnBorder {
  103. width: 396rpx;
  104. border: 2rpx solid #E8E9EC;
  105. background-color: #fff;
  106. color: #ADADAD;
  107. margin-bottom: 40rpx;
  108. }
  109. }
  110. </style>