classScheduleDetails.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view>
  3. <u-navbar :title="detail.className"></u-navbar>
  4. <view class="main">
  5. <u-cell-group>
  6. <u-cell-item title="校区" :value="detail.schoolName" :arrow="false">
  7. </u-cell-item>
  8. <u-cell-item v-if="detail.courseStart!=null && detail.courseEnd!=null" title="开课/结课日期"
  9. :value="detail.courseStart+'至'+detail.courseEnd" :arrow="false">
  10. </u-cell-item>
  11. <u-cell-item title="上课时间" :value="detail.courseDate+' '+detail.coursePeriods" :arrow="false">
  12. </u-cell-item>
  13. <u-cell-item v-if="detail.courseAmount!=null && detail.freeAmount!=null" title="课次"
  14. :value="detail.courseAmount+detail.freeAmount+'次'" :arrow="false">
  15. </u-cell-item>
  16. <u-cell-item title="上课教室" :value="detail.classroomName" :arrow="false">
  17. </u-cell-item>
  18. <u-cell-item title="学员总数" :value="detail.studentCount+'人'" :arrow="false">
  19. </u-cell-item>
  20. <u-cell-item class="teacher" title="任课老师" :value="detail.teacherNames"
  21. @click="gotoUrl('pages/youth/teacherHomepage/teacherHomepage?id=' + detail.courseTeachers)"></u-cell-item>
  22. </u-cell-group>
  23. </view>
  24. <view class="main">
  25. <u-cell-group>
  26. <u-cell-item title="打卡签到" :value="rollcallLogs.rollcall" :arrow="false"></u-cell-item>
  27. <u-cell-item v-if="rollcallLogs.rollcallTime" title="签到时间" :value="rollcallLogs.rollcallTime" :arrow="false"></u-cell-item>
  28. </u-cell-group>
  29. </view>
  30. <!-- <view class="bottom" v-if="rollcallLogs != null">
  31. <button style="background-color: #DBDBDB" v-if="rollcallLogs.rollcallResult == '1'" disabled>
  32. 已上课
  33. </button>
  34. <button style="background-color: #DBDBDB" v-if="rollcallLogs.rollcallResult == '2'" disabled>
  35. 已请假
  36. </button>
  37. </view> -->
  38. <!-- <view class="bottom" v-else>
  39. <button @click="askForLeave">请假</button>
  40. </view> -->
  41. </view>
  42. </template>
  43. <script>
  44. import * as classScheduleApi from '@/apis/youth/classSchedule.js'
  45. export default {
  46. data() {
  47. return {
  48. studentId: '',
  49. scheduleId: '',
  50. detail: {},
  51. rollcallLogs: {
  52. rollcall: '',
  53. rollcallResult: '',
  54. rollcallTime: ''
  55. }
  56. }
  57. },
  58. onLoad(op) {
  59. if (op.id) {
  60. this.scheduleId = op.id;
  61. if (this.carhelp.getNsStudentId()) {
  62. this.studentId = this.carhelp.getNsStudentId().studentId;
  63. this.getCourseDetail();
  64. }
  65. }
  66. },
  67. methods: {
  68. askForLeave() {
  69. },
  70. getCourseDetail() {
  71. uni.showLoading({
  72. title: "加载中",
  73. mask: true,
  74. })
  75. classScheduleApi.getScheduleDtl({
  76. studentId: this.studentId,
  77. scheduleId: this.scheduleId
  78. }).then((response) => {
  79. uni.hideLoading();
  80. this.detail = response.data.scheduleDtl;
  81. if(response.data.rollcallLogs != null) {
  82. this.rollcallLogs = response.data.rollcallLogs;
  83. var date = new Date(response.data.rollcallLogs.rollcallTime);
  84. var hour = date.getHours();
  85. var minute = date.getMinutes();
  86. var second = date.getSeconds();
  87. if(hour < 10) {
  88. hour = '0' + hour;
  89. }
  90. if(minute < 10) {
  91. minute = '0' + minute;
  92. }
  93. if(second < 10) {
  94. second = '0' + second;
  95. }
  96. // this.rollcallLogs.rollcallTime = hour + ':' + minute + ':' + second;
  97. this.rollcallLogs.rollcallTime = ''
  98. }
  99. }).catch(error => {
  100. uni.showToast({
  101. title: error,
  102. icon: "none"
  103. })
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. page {
  111. padding-bottom: 150px;
  112. }
  113. .main {
  114. background-color: #fff;
  115. margin-bottom: 10px;
  116. }
  117. /deep/.u-cell_title {
  118. color: rgba(119, 119, 119, 1);
  119. }
  120. /deep/.u-cell__value {
  121. color: #333333;
  122. }
  123. .teacher {
  124. /deep/.u-cell__value {
  125. color: #00BAC8;
  126. }
  127. }
  128. .bottom {
  129. position: fixed;
  130. left: 0;
  131. right: 0;
  132. bottom: 0;
  133. padding: 10px 0;
  134. background-color: #fff;
  135. button {
  136. border-radius: 50px;
  137. background-color: rgba(13, 186, 199, 1);
  138. color: rgba(255, 255, 255, 1);
  139. font-size: 16px;
  140. line-height: 40px;
  141. width: 91.4%;
  142. }
  143. }
  144. </style>