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.

174 lines
4.8 KiB

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