洛阳学员端
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.

93 lines
2.4 KiB

9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
7 months ago
8 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="pageBg pad">
  3. <zeng-calen :actDay="actDay" :chooseDayLack="chooseDayLack" @onDayClick='onDayClick' @changeMonth="changeMonth" :chooseDay="chooseDay"></zeng-calen>
  4. <view class="btnBg" style="margin: 20rpx 0;" @click="scanCodeClick">去签到/去签退</view>
  5. <view class="card" v-if="list.length">
  6. <view class="h1"><text class="active">签到记录</text></view>
  7. <view class="ul">
  8. <view class="li" v-for="(item,index) in list" :key="index">
  9. <view class="lab">{{ item.loginStatus==1? '签退成功':'签到成功'}}</view>
  10. <view class="date">{{item.signDate}} <text style="margin-left: 10rpx;">{{ item.time }}</text></view>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import zengCalen from '@/uni_modules/zeng-calen/components/zeng-calen/zeng-calen'
  18. import { scanCodeFn } from '@/config/utils.js'
  19. import { monthSignRecord, signDetail } from '@/config/api.js'
  20. export default {
  21. components: {zengCalen},
  22. data() {
  23. return {
  24. actDay: [], //用户选择的日期
  25. chooseDay: [], //已被投标的数据
  26. chooseDayLack: [], //已被投标的数据
  27. list: [],
  28. signMonth: ''
  29. }
  30. },
  31. onLoad() {
  32. this.signMonth = this.$u.timeFormat(Date.now(), 'yyyy-mm')
  33. this.monthSignRecordFn()
  34. },
  35. methods: {
  36. // 按月查询签到天数
  37. async monthSignRecordFn() {
  38. const {data: res} = await monthSignRecord({signMonth: this.signMonth})
  39. this.chooseDay = res
  40. if(res&&res.length) {
  41. let day = res[res.length-1]
  42. this.actDay = [day]
  43. this.onDayClick(day)
  44. }
  45. },
  46. changeMonth(ym) {
  47. console.log(ym)
  48. this.signMonth = ym
  49. this.monthSignRecordFn(ym)
  50. this.list = []
  51. },
  52. // 展开日历
  53. async onDayClick(data) {
  54. this.actDay = [data]
  55. const {data: res} = await signDetail({signDate: data})
  56. this.list = res || []
  57. },
  58. // 扫码
  59. scanCodeClick() {
  60. scanCodeFn(this)
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .pageBg {
  67. padding-bottom: 30rpx;
  68. }
  69. .card {
  70. padding: 20rpx;
  71. .ul {
  72. .li {
  73. padding: 30rpx 0;
  74. border-bottom: 1px solid #f4f4f4;
  75. &:last-child {
  76. border: none;
  77. }
  78. .lab {
  79. font-size: 28rpx;
  80. color: #333;
  81. }
  82. .date {
  83. font-size: 24rpx;
  84. color: #999;
  85. margin-top: 16rpx;
  86. }
  87. }
  88. }
  89. }
  90. </style>