洛阳学员端
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.2 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="预约详情"></topNavbar>
  4. <!-- 详情 -->
  5. <view class="pad">
  6. <view class="card">
  7. <opera :info="info" ref="operaRef"/>
  8. </view>
  9. <view class="btnCon" >
  10. <!-- <view class="btnBg" @click.stop="$goPage('/pages/carEntry/evaluate/evaluate')" v-if="info.loginStatus==2">去评价</view> -->
  11. <view class="btnBorder" @click="canceClick" v-if="info.loginStatus==0">取消预约</view>
  12. </view>
  13. </view>
  14. <u-popup :show="show" mode="center" :round="20" >
  15. <cancelReservation @popupBtnClick="popupBtnClick"/>
  16. </u-popup>
  17. </view>
  18. </template>
  19. <script>
  20. import opera from './opera'
  21. import { masterDetail, masterCancelBooking } from "@/config/api.js"
  22. export default {
  23. components: { opera, },
  24. data() {
  25. return {
  26. type: 1,
  27. show: false,
  28. id: '',
  29. info: ''
  30. }
  31. },
  32. onLoad(options) {
  33. this.id = options.id
  34. this.masterDetailFn()
  35. },
  36. methods: {
  37. // 获得实操拟详情
  38. async masterDetailFn() {
  39. const {data: res} = await masterDetail({id: this.id})
  40. res.bookingDetailRespVOS = res.bookingDetailRespVOS.sort((a,b)=>{
  41. return parseInt(a.classTime.slice(0,2)) - parseInt(b.classTime.slice(0,2))
  42. })
  43. this.info = res
  44. },
  45. // 取消实操预约
  46. async masterCancelBookingFn() {
  47. let ids = this.$refs.operaRef.ids
  48. const {data: res} = await masterCancelBooking(ids.join())
  49. this.$refs.operaRef.ids = []
  50. this.$u.toast('取消成功')
  51. this.masterDetailFn()
  52. },
  53. // 取消预约事件
  54. popupBtnClick(val) {
  55. if(val==1) {
  56. this.masterCancelBookingFn()
  57. }
  58. this.show = false
  59. },
  60. canceClick() {
  61. let ids = this.$refs.operaRef.ids
  62. if(!ids.length) return this.$u.toast('请选择取消时间段')
  63. this.show=true
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .card {
  70. padding: 0 24rpx;
  71. }
  72. .btnCon {
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. justify-content: center;
  77. margin-top: 76rpx;
  78. .btnBg {
  79. width: 212rpx;
  80. margin-bottom: 40rpx;
  81. }
  82. .btnBorder {
  83. width: 396rpx;
  84. border: 2rpx solid #E8E9EC;
  85. background-color: #fff;
  86. color: #ADADAD;
  87. margin-bottom: 40rpx;
  88. }
  89. }
  90. </style>