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.

122 lines
2.7 KiB

9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="pageBg">
  3. <!-- <topNavbar title="我的排课详情"></topNavbar> -->
  4. <view class="pad">
  5. <view class="card">
  6. <view class="info">
  7. <view class="row">
  8. <view class="lab">训练科目</view>
  9. <view class="val">{{subjectText[info.subject]}}</view>
  10. </view>
  11. <view class="row">
  12. <view class="lab">预约车辆</view>
  13. <view class="val">{{ info.carNumber }}</view>
  14. </view>
  15. <!-- <view class="row">
  16. <view class="lab">开放范围</view>
  17. <view class="val">{{ info.openRange==0?'自己的学员': '所有学员'}}</view>
  18. </view> -->
  19. </view>
  20. </view>
  21. <view class="h1">预约学员</view>
  22. <view class="ul">
  23. <view class="li" v-for="(item,index) in list" :key="index">
  24. <view class="name">{{ item.studentName}} <text> {{ item.studentPhone }}</text></view>
  25. <view class="time">提交预约时间{{item.classDate}} <text style="margin-left: 6px;">{{item.classTime}}</text></view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import { scheduleClassGetById, getBookingDetailByClassId } from '@/config/api.js'
  33. export default {
  34. data() {
  35. return {
  36. info: {},
  37. id: '',
  38. subjectText: ['不限', '科目二', '科目三'],//0:不限;2:科目二;3:科目三
  39. list: []
  40. }
  41. },
  42. onLoad(options) {
  43. this.id = options.id
  44. this.scheduleClassGetByIdFn()
  45. },
  46. onPullDownRefresh() {
  47. this.scheduleClassGetByIdFn().then(()=>{
  48. uni.stopPullDownRefresh()
  49. })
  50. },
  51. methods: {
  52. async scheduleClassGetByIdFn() {
  53. const {data: res} = await scheduleClassGetById({id: this.id})
  54. this.info = res
  55. console.log(res)
  56. this.getBookingDetailByClassIdFn(res.id)
  57. },
  58. async getBookingDetailByClassIdFn(id) {
  59. const {data: res} = await getBookingDetailByClassId({classId: id})
  60. if(!res.length) return
  61. this.list = res
  62. console.log(res)
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .pad {
  69. .card {
  70. padding: 0 28rpx;
  71. .info {
  72. padding: 20rpx 0;
  73. .row {
  74. display: flex;
  75. font-size: 28rpx;
  76. color: #333;
  77. padding: 20rpx 0;
  78. .lab {
  79. width: 150rpx;
  80. }
  81. .val {
  82. }
  83. }
  84. }
  85. }
  86. .h1 {
  87. line-height: 108rpx;
  88. }
  89. .ul {
  90. .li {
  91. height: 180rpx;
  92. display: flex;
  93. flex-direction: column;
  94. background: #FFFFFF;
  95. border-radius: 16rpx;
  96. justify-content: center;
  97. margin-bottom: 20rpx;
  98. padding: 0 28rpx;
  99. .name {
  100. font-size: 32rpx;
  101. font-weight: 600;
  102. text {
  103. font-weight: 400;
  104. margin-left: 10rpx;
  105. }
  106. }
  107. .time {
  108. font-size: 28rpx;
  109. margin-top: 24rpx;
  110. color: #ADADAD;
  111. }
  112. }
  113. }
  114. }
  115. </style>