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

81 lines
2.3 KiB

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' :chooseDay="chooseDay"></zeng-calen>
  4. <view class="btnBg" style="margin: 20rpx 0;">去签到/去签退</view>
  5. <view class="card">
  6. <view class="h1"><text class="active">签到记录</text></view>
  7. <view class="ul">
  8. <view class="li" v-for="(item,index) in 4" :key="index">
  9. <view class="lab">{{ index%2==0? '签退成功':'签到成功'}}</view>
  10. <view class="date">2024-01-29 11:29</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. export default {
  19. components: {zengCalen},
  20. data() {
  21. return {
  22. actDay: [], //用户选择的日期
  23. chooseDay: ["2024-01-29", "2024-01-27", "2024-01-19", "2024-01-10"], //已被投标的数据
  24. chooseDayLack: ["2024-01-29", ], //已被投标的数据
  25. }
  26. },
  27. onLoad() {
  28. },
  29. methods: {
  30. // 展开日历
  31. onDayClick(data) {
  32. this.actDay = [data]
  33. return
  34. let choose = data.date //用户点中的数据
  35. if (this.actDay.includes(choose)) { //如果用户点击的日期已经存在
  36. // 移除元素下标
  37. const index = this.actDay.indexOf(choose);
  38. //删除用户点击的日期
  39. this.actDay.splice(index, 1)
  40. } else if (this.chooseDay.includes(choose)) { //判断是否已经被投标
  41. uni.showToast({
  42. title: "这个日期已经被投标了",
  43. icon: "none"
  44. })
  45. } else {
  46. //添加用户点击的日期
  47. this.actDay.push(choose)
  48. }
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .pageBg {
  55. padding-bottom: 30rpx;
  56. }
  57. .card {
  58. padding: 20rpx;
  59. .ul {
  60. .li {
  61. padding: 30rpx 0;
  62. border-bottom: 1px solid #f4f4f4;
  63. &:last-child {
  64. border: none;
  65. }
  66. .lab {
  67. font-size: 28rpx;
  68. color: #333;
  69. }
  70. .date {
  71. font-size: 24rpx;
  72. color: #999;
  73. margin-top: 16rpx;
  74. }
  75. }
  76. }
  77. }
  78. </style>