index.vue 2.8 KB

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