clockableView.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <!--未打上班卡,在时间范围内,可打卡-->
  3. <view class="not-checked-in">
  4. <text class="running-time">{{ currentTime }}</text>
  5. <c-button
  6. type="primary"
  7. class="punch-clock-btn"
  8. @click="handleClick"
  9. >
  10. <view class="dflex acenter">
  11. <text>{{ type === '0' ? '上班' : '下班' }}打卡</text>
  12. <image
  13. class="ml-15"
  14. style="width: 18px; height: 22px"
  15. src="@/static/images/attendanceClock/hand.png"
  16. ></image>
  17. </view>
  18. </c-button>
  19. <view class="range-box">
  20. <image
  21. class="range-icon"
  22. src="@/static/images/attendanceClock/success.png"
  23. ></image>
  24. <text class="range-txt">您已进入打卡范围</text>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'clockableView',
  31. props: {
  32. currentTime: String,
  33. type: {
  34. default: '0', // 0上班,1下班
  35. type: String,
  36. },
  37. },
  38. methods: {
  39. handleClick() {
  40. this.$emit('punchClock', this.type); //0上班,1下班
  41. },
  42. },
  43. };
  44. </script>
  45. <style scoped lang="scss">
  46. .not-checked-in {
  47. display: flex;
  48. flex-direction: column;
  49. align-items: center;
  50. .range-box {
  51. display: flex;
  52. align-items: center;
  53. }
  54. .range-icon {
  55. width: 14px;
  56. height: 14px;
  57. margin-right: 10rpx;
  58. }
  59. .range-txt {
  60. font-size: 14px;
  61. color: #a6a9b0;
  62. }
  63. .running-time {
  64. font-size: 30px;
  65. color: #697c9d;
  66. }
  67. .punch-clock-btn {
  68. border-radius: 46rpx;
  69. margin-top: 20rpx;
  70. margin-bottom: 20rpx;
  71. width: 160px;
  72. box-shadow: 0px 2px 6px 0px rgba(34, 83, 234, 0.42);
  73. }
  74. }
  75. </style>