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.

172 lines
4.8 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="上课学员"></topNavbar>
  4. <view class="con" v-if="list&&list.length">
  5. <view class="card" v-for="(item,index) in list" :key="index">
  6. <view class="consultItem">
  7. <view class="top_row">
  8. <view class="flex">
  9. <view class="schoolName">{{item.studentName}} <text style="margin-left: 6px;">{{ item.studentPhone}}</text></view>
  10. </view>
  11. <view class="status" >
  12. <view class="text" v-if="item.studyStatus=='计时中'">正在计时...</view>
  13. <view class="changeBtn btnBg" v-else-if="item.studyStatus=='已签到'" @click="timekeeping(item)">计时切换</view>
  14. <view class="" v-else>{{ item.studyStatus||'状态没返回' }} </view>
  15. </view>
  16. </view>
  17. <view class="target">
  18. <view class="row" v-if="item.studyStatus=='计时中'">
  19. <view class="iconImg">
  20. <image src="@/static/images/index/home_icon_zhuangtai@2x.png" mode="" style="width: 28rpx;height: 28rpx;"></image>
  21. </view>
  22. <view class="name" style="color: red;">计时开始时间{{item.startTime}}</view>
  23. </view>
  24. <!-- <view class="row" v-else-if="item.startTime">
  25. <view class="iconImg">
  26. <image src="@/static/images/index/timerIcon.png" mode=""></image>
  27. </view>
  28. <view class="name">计时时段 {{ item.startTime }}</view>
  29. </view> -->
  30. <view class="row">
  31. <view class="iconImg">
  32. <image src="@/static/images/index/listIcon.png" mode=""></image>
  33. </view>
  34. <view class="name">训练科目{{ item.subject }}</view>
  35. </view>
  36. <view class="row">
  37. <view class="iconImg">
  38. <image src="@/static/images/index/site.png" mode=""></image>
  39. </view>
  40. <view class="name">预约场地{{item.address}}</view>
  41. </view>
  42. <view class="row">
  43. <view class="iconImg">
  44. <image src="@/static/images/index/carIcon.png" mode=""></image>
  45. </view>
  46. <view class="name">预约车辆{{item.carNumber}}</view>
  47. </view>
  48. <view class="row">
  49. <view class="iconImg">
  50. <image src="@/static/images/index/timerIcon.png" mode=""></image>
  51. </view>
  52. <view class="name">预约时间 {{ item.bookingTimeStr }}</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <nodata v-else style="margin-top: 320rpx;"></nodata>
  59. </view>
  60. </template>
  61. <script>
  62. import { signStudentList, changeStudent, } from '@/config/api.js'
  63. export default {
  64. data() {
  65. return {
  66. list: null,
  67. loginStatusTxt: ['未签到', '已签到', '已签退', '已过期', '已取消'],//0:未签到,1:已签到,2:已签退,3:已过期,9:已取消
  68. }
  69. },
  70. onLoad() {
  71. this.signStudentListFn()
  72. },
  73. onPullDownRefresh() {
  74. this.signStudentListFn()
  75. },
  76. methods: {
  77. async signStudentListFn() {
  78. const {data: res} = await signStudentList()
  79. // let curTimeKeep = res.find(item=>item.studyStatus=='计时中')
  80. // curTimeKeep.timer = curTimeKeep.bookingTimeStr.split('-')[0]
  81. // let storCurTimer = uni.getStorageSync('curTimeKeep')
  82. // if(storCurTimer&&storCurTimer.studentId==curTimeKeep.studentId&&storCurTimer.bookingTimeStr==curTimeKeep.bookingTimeStr) {
  83. // curTimeKeep.timer = storCurTimer.timer
  84. // }
  85. console.log(res)
  86. this.list = res
  87. },
  88. async timekeeping(item) {
  89. const res = await changeStudent({studentId: item.studentId})
  90. this.signStudentListFn()
  91. // let timestamp = Date.now()
  92. // let starTime = this.$u.timeFormat(timestamp, 'hh:MM')
  93. // item.timer = starTime
  94. // item.studyStatus ='计时中'
  95. // uni.setStorageSync('curTimeKeep',item)
  96. console.log(item)
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .con {
  103. padding: 0 28rpx;
  104. .card {
  105. padding: 0 20rpx;
  106. margin-bottom: 20rpx;
  107. }
  108. }
  109. .consultItem {
  110. width: 100%;
  111. .top_row {
  112. display: flex;
  113. width: 100%;
  114. height: 116rpx;
  115. border-bottom: 2rpx dashed #E8E9EC;
  116. justify-content: space-between;
  117. align-items: center;
  118. .tag {
  119. // width: 176rpx;
  120. height: 60rpx;
  121. background: rgba(250, 149, 25, 0.1);
  122. border-radius: 8rpx;
  123. text-align: center;
  124. font-size: 28rpx;
  125. color: #FA7919;
  126. margin-right: 24rpx;
  127. padding: 10rpx 18rpx;
  128. }
  129. .schoolName {
  130. font-size: 28rpx;
  131. color: #333;
  132. margin-left: 20rpx;
  133. font-weight: 550;
  134. }
  135. .status {
  136. display: flex;
  137. align-items: center;
  138. .text {
  139. font-size: 28rpx;
  140. color: $themC;
  141. }
  142. }
  143. }
  144. .target {
  145. padding: 20rpx 0;
  146. }
  147. .row {
  148. padding: 16rpx 0;
  149. display: flex;
  150. align-items: center;
  151. .iconImg {
  152. width: 32rpx;
  153. height: 28rpx;
  154. }
  155. .name {
  156. font-size: 28rpx;
  157. color: #333;
  158. padding-left: 20rpx;
  159. }
  160. }
  161. }
  162. .changeBtn {
  163. line-height: 60rpx;
  164. height: 60rpx;
  165. padding: 0 12rpx;
  166. }
  167. </style>