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

95 lines
2.1 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. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="预约详情"></topNavbar>
  4. <!-- 详情 -->
  5. <view class="pad">
  6. <view class="card">
  7. <imitate v-if="type==1"/>
  8. <opera v-else-if="type==2"/>
  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 } 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. }
  43. },
  44. methods: {
  45. async examSimulationGetFn() {
  46. const {data: res} = await examSimulationGet({id: this.id})
  47. this.info = res
  48. },
  49. // 取消考场模拟预约
  50. async cancelSimulationFn() {
  51. const res = await cancelSimulation({id: this.id})
  52. console.log('没来到这里?')
  53. // console.log(res)
  54. // if(res.code==0) {
  55. this.$u.toast('取消成功')
  56. this.examSimulationGetFn()
  57. // }
  58. },
  59. // 取消预约事件
  60. popupBtnClick(val) {
  61. if(val==1) {
  62. this.cancelSimulationFn()
  63. }
  64. this.show = false
  65. console.log(val)
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .card {
  72. padding: 24rpx;
  73. }
  74. .btnCon {
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. justify-content: center;
  79. margin-top: 76rpx;
  80. .btnBg {
  81. width: 212rpx;
  82. margin-bottom: 40rpx;
  83. }
  84. .btnBorder {
  85. width: 396rpx;
  86. border: 2rpx solid #E8E9EC;
  87. background-color: #fff;
  88. color: #ADADAD;
  89. margin-bottom: 40rpx;
  90. }
  91. }
  92. </style>