oftenModular.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <!--常用功能-->
  3. <view class="card-container">
  4. <view class="header">
  5. <image :src="icon" class="h-icon"></image>
  6. <text class="title">
  7. {{ title }}
  8. </text>
  9. </view>
  10. <view class="card-content">
  11. <view
  12. @click="$u.route('/pages/attendanceClock/index')"
  13. class="kqdk-bg card-item"
  14. >
  15. <image
  16. class="card-img clock-icon"
  17. src="@/static/images/home/kqdk.png"
  18. ></image>
  19. <view class="kqdk-title c-title">考勤打卡</view>
  20. </view>
  21. <view class="bk-bg card-item" @click="goApproval('0')">
  22. <image
  23. class="card-img card-icon"
  24. src="@/static/images/home/bk.png"
  25. ></image>
  26. <view class="bk-title c-title">补卡</view>
  27. </view>
  28. <view class="jia-bg card-item" @click="goApproval('3')">
  29. <image
  30. class="card-img leave-icon"
  31. src="@/static/images/home/jia.png"
  32. ></image>
  33. <view class="jia-title c-title">请假</view>
  34. </view>
  35. <view class="jiaban-bg card-item" @click="goApproval('1')">
  36. <image
  37. class="card-img work-time-icon"
  38. src="@/static/images/home/jiaban.png"
  39. ></image>
  40. <view class="jb-title c-title">加班</view>
  41. </view>
  42. <view class="chuchai-bg card-item" @click="goApproval('2')">
  43. <image
  44. class="card-img travel-icon"
  45. src="@/static/images/home/chuchai.png"
  46. ></image>
  47. <view class="chuchai-title c-title">出差</view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. name: 'oftenModular',
  55. props: {
  56. title: String,
  57. icon: String,
  58. },
  59. methods: {
  60. goApproval(type) {
  61. uni.$u.route('pages/approval/index', { type });
  62. },
  63. },
  64. };
  65. </script>
  66. <style scoped lang="scss">
  67. .card-container {
  68. position: relative;
  69. z-index: 1;
  70. background-color: #fff;
  71. border-radius: 6px;
  72. padding: 32rpx;
  73. .header {
  74. display: flex;
  75. align-items: center;
  76. .h-icon {
  77. width: 48rpx;
  78. height: 48rpx;
  79. margin-right: 12rpx;
  80. }
  81. }
  82. .card-content {
  83. display: flex;
  84. flex-wrap: wrap;
  85. margin-top: 20rpx;
  86. .card-item {
  87. width: 22.75%;
  88. height: 158rpx;
  89. display: flex;
  90. flex-direction: column;
  91. align-items: center;
  92. justify-content: center;
  93. margin-right: 3%;
  94. margin-bottom: 20rpx;
  95. border-radius: 6px;
  96. overflow: hidden;
  97. &:nth-child(4n) {
  98. margin-right: 0;
  99. }
  100. &:last-child {
  101. margin-bottom: 0;
  102. }
  103. .card-img {
  104. margin-top: 10px;
  105. border-radius: 6px;
  106. overflow: hidden;
  107. }
  108. .clock-icon,
  109. .card-icon {
  110. width: 50rpx;
  111. height: 50rpx;
  112. }
  113. .leave-icon {
  114. width: 44rpx;
  115. height: 46rpx;
  116. }
  117. .work-time-icon {
  118. width: 44rpx;
  119. height: 52rpx;
  120. }
  121. .travel-icon {
  122. width: 48rpx;
  123. height: 48rpx;
  124. }
  125. .c-title {
  126. font-size: 14px;
  127. margin-top: 32rpx;
  128. }
  129. }
  130. .kqdk-bg {
  131. background: url('~@/static/images/home/kqdk-bg.png') no-repeat;
  132. background-size: cover;
  133. .kqdk-title {
  134. color: #083698;
  135. }
  136. }
  137. .bk-bg {
  138. background: url('~@/static/images/home/bk-bg.png') no-repeat;
  139. background-size: cover;
  140. .bk-title {
  141. color: #0a5a9c;
  142. }
  143. }
  144. .jia-bg {
  145. background: url('~@/static/images/home/jia-bg.png') no-repeat;
  146. background-size: cover;
  147. .jia-title {
  148. color: #9b4d0c;
  149. }
  150. }
  151. .jiaban-bg {
  152. background: url('~@/static/images/home/jiaban-bg.png') no-repeat;
  153. background-size: cover;
  154. .jb-title {
  155. color: #0d6c55;
  156. }
  157. }
  158. .chuchai-bg {
  159. background: url('~@/static/images/home/chuchai-bg.png')
  160. no-repeat;
  161. background-size: cover;
  162. .chuchai-title {
  163. color: #9b390c;
  164. }
  165. }
  166. }
  167. }
  168. </style>