index.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="bg-white rounded-32rpx p24rpx box-border" v-if="item">
  3. <view class="flex items-center">
  4. <view class="w-8rpx h-28rpx bg-#0074FF"></view>
  5. <view class="ml20rpx text-28rpx">
  6. {{ dayjs(item?.startTime).format("MM-DD HH:mm") }}
  7. {{ dayjs(item?.endTime).format("HH:mm") }}
  8. </view>
  9. </view>
  10. <view class="mt20rpx flex items-center justify-between pl20rpx">
  11. <!-- <view class="text-28rpx">{{ item.name }}</view> -->
  12. <wd-text :text="item.name" size="28rpx" :lines="1"></wd-text>
  13. <commonbtn
  14. bg-color="#0074FF"
  15. @click="handleGoPath(`/subPack/selectClass/index?id=${item.id}`)"
  16. v-if="type == 0 && showBtn"
  17. >拍照核销</commonbtn
  18. >
  19. <commonbtn
  20. bg-color="#0074FF"
  21. @click="handleGoPath(`/subPack/ReservationClass/index?id=${item.id}`)"
  22. v-if="type == 1 && showBtn"
  23. >预约这节</commonbtn
  24. ><commonbtn
  25. bg-color="#0074FF"
  26. @click="
  27. handleGoPath(
  28. `/subPack/ExtensionClass/index?coursesId=${item.coursesId}&id=${item.id}`,
  29. )
  30. "
  31. v-if="type == 2 && showBtn"
  32. >延期这节</commonbtn
  33. >
  34. <view v-if="!showBtn">
  35. <view class="text-gray font-semibold text-28rpx" v-if="item.orDone"
  36. >已完成</view
  37. >
  38. <view v-else class="text-[#0074FF] font-semibold text-28rpx"
  39. >未开始</view
  40. >
  41. </view>
  42. </view>
  43. <view
  44. class="mt20rpx pl20rpx flex items-center text-24rpx"
  45. @click="
  46. handleGoPath(
  47. `/subPack/PersonnelView/index?id=${item.id}&postponeNum=${item.postponeNum}&writtenOffNum=${item.writtenOffNum}&unwrittenOffNum=${item.unwrittenOffNum}`,
  48. )
  49. "
  50. >
  51. <view class="text-[rgb(0,0,0,0.3)] mr20rpx"
  52. >共{{ item?.totalNum }}人</view
  53. >
  54. <view class="text-[rgb(0,0,0,0.3)] mr20rpx"
  55. >延课
  56. <text class="text-#0074FF"> {{ item.postponeNum }} </text> 人</view
  57. >
  58. <view class="text-[rgb(0,0,0,0.3)] mr20rpx"
  59. >已核销<text class="text-#0074FF"> {{ item.writtenOffNum }} </text
  60. >人</view
  61. >
  62. <view class="text-[rgb(0,0,0,0.3)]"
  63. >未核销<text class="text-#0074FF"> {{ item.unwrittenOffNum }} </text
  64. >人</view
  65. >
  66. </view>
  67. </view>
  68. </template>
  69. <script setup lang="ts">
  70. import type { VerifyCourseInfoDTO } from "@/api/globals";
  71. import dayjs from "dayjs";
  72. interface IProps {
  73. /**
  74. * 当前组件在什么地方展示,0为验课,1为约课,2为课程延期
  75. */
  76. type: number;
  77. item?: VerifyCourseInfoDTO;
  78. showBtn: boolean;
  79. }
  80. const props = defineProps<IProps>();
  81. function handleGoPath(url: string) {
  82. uni.navigateTo({
  83. url,
  84. });
  85. }
  86. </script>
  87. <style scoped></style>