punchin-detail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <main-layout :showHome="true" :showBack="true">
  3. <uni-calendar />
  4. <viwe class="info-box">
  5. <view class="left">打卡:12次</view>
  6. <view class="right">全勤率:80%</view>
  7. </viwe>
  8. <view class="log-box">
  9. <uni-section title="打卡记录" type="line">
  10. <uni-list>
  11. <uni-list-item title="2024-12-07 08:30:22 福彩 幸运88 中奖100元" time="2020-02-02 20:20" ></uni-list-item>
  12. <uni-list-item title="2024-12-07 08:30:22 福彩 幸运88 中奖100元" time="2020-02-02 20:20" ></uni-list-item>
  13. <uni-list-item title="2024-12-07 08:30:22 福彩 幸运88 中奖100元" time="2020-02-02 20:20" ></uni-list-item>
  14. </uni-list>
  15. </uni-section>
  16. </view>
  17. <uni-fab ref="fab" :content="content" horizontal="right" vertical="bottom"
  18. direction="vertical" @trigger="trigger"/>
  19. </main-layout>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue';
  23. import { onLoad } from '@dcloudio/uni-app';
  24. import router from '@/common/constants/router';
  25. import { punchInApi } from '@/service/apis.js';
  26. const punchInId = ref(null);
  27. const content = [{
  28. text: '删除',
  29. active: false,
  30. iconPath: '/static/delete.svg',
  31. selectedIconPath: '/static/delete-active.svg',
  32. func: "delete"
  33. },
  34. {
  35. text: '归档',
  36. active: false,
  37. iconPath: '/static/archive.svg',
  38. selectedIconPath: '/static/archive-active.svg',
  39. func: "archive"
  40. },
  41. {
  42. text: '撤销',
  43. active: false,
  44. iconPath: '/static/revoke.svg',
  45. selectedIconPath: '/static/revoke_active.svg',
  46. func: "revoke"
  47. },
  48. {
  49. text: '补卡',
  50. active: false,
  51. iconPath: '/static/append.svg',
  52. selectedIconPath: '/static/append-active.svg',
  53. func: "remake"
  54. },
  55. {
  56. text: '编辑',
  57. active: false,
  58. iconPath: '/static/edit.svg',
  59. selectedIconPath: '/static/edit-active.svg',
  60. func: "edit"
  61. }
  62. ];
  63. const trigger = (e) => {
  64. if (e.item.func == 'delete') {
  65. punchInApi.deletePunchIn({id: punchInId.value});
  66. return;
  67. }
  68. if (e.item.func == 'archive') {
  69. punchInApi.archivePunchIn({id: punchInId.value});
  70. return;
  71. }
  72. if (e.item.func == 'revoke') {
  73. punchInApi.revokePunchIn({id: punchInId.value});
  74. return;
  75. }
  76. if (e.item.func == 'remake') {
  77. punchInApi.revokePunchIn({id: punchInId.value});
  78. return;
  79. }
  80. if (e.item.func == 'edit') {
  81. uni.navigateTo({
  82. url: router.PUNCHIN_EDIT_URL + "?id=" + punchInId.value
  83. });
  84. return;
  85. }
  86. }
  87. onLoad(async (e) => {
  88. if (e.id) {
  89. punchInId.value = e.id;
  90. console.log(punchInId.value);
  91. }
  92. });
  93. </script>
  94. <style lang="scss" scoped>
  95. .info-box, .log-box {
  96. margin-top: 24rpx;
  97. }
  98. .info-box {
  99. display: flex;
  100. background-color: #FFFFFF;
  101. padding: 20rpx 10rpx;
  102. .left, .right {
  103. flex: 1;
  104. display: flex;
  105. align-items: center;
  106. justify-content: center;
  107. }
  108. }
  109. </style>