stat.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="container">
  3. <!-- 头部月份区域 -->
  4. <view class="header">
  5. <view class="title">
  6. <view class="month">
  7. {{month}}月汇总
  8. </view>
  9. <view class="right" @click="goToDetail">
  10. <img src="../../static/right.png" alt="">
  11. </view>
  12. </view>
  13. <view class="state">
  14. <view class="err">
  15. <view class="number">
  16. 0
  17. </view>
  18. <view class="mes">
  19. 异常次数(次)
  20. </view>
  21. </view>
  22. <view class="success">
  23. <view class="number">
  24. 1
  25. </view>
  26. <view class="mes">
  27. 打卡成功(次)
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 日历区域 -->
  33. <view class="calendar">
  34. <view class="calendar_title">
  35. 每日记录
  36. <span>(5月)</span>
  37. </view>
  38. <view class="calendar_body">
  39. <uni-calendar :showMonth="false" @change="change" :selected="list" />
  40. </view>
  41. <view class="calendar_foot">
  42. <!-- 每一条记录区域 -->
  43. <view class="foot_item" v-for="item in list2" :key="item.id">
  44. <view>
  45. {{item.msg}}
  46. </view>
  47. <view class="box">
  48. <view class="circular" v-if="item.status==1"></view>
  49. <view class="circular color" v-else></view>
  50. {{item.status==0?"未打卡":"已打卡"}}
  51. <span>{{item.time}}</span>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. list: [{
  63. date: "2022-11-20",
  64. info: ''
  65. },
  66. {
  67. date: "2022-11-21",
  68. info: '',
  69. data: {
  70. custom: '自定义信息',
  71. name: '自定义消息头'
  72. }
  73. },
  74. {
  75. date: "2022-11-22",
  76. info: ''
  77. }
  78. ],
  79. list2: [{
  80. id: 1,
  81. msg: "规则:课间操考勤打卡09:00 - 09:15",
  82. status: 0,
  83. time: "09:25:25"
  84. },
  85. {
  86. id: 2,
  87. msg: "规则:考勤打卡19:00 - 20:15",
  88. status: 1,
  89. time: "19:25:25"
  90. },
  91. ],
  92. month: null
  93. };
  94. },
  95. onLoad() {
  96. this.getMonth()
  97. },
  98. methods: {
  99. // 获取当前时间月份
  100. getMonth() {
  101. let date = new Date()
  102. let month = date.getMonth() + 1
  103. this.month = month
  104. },
  105. // 点击日历日期回调
  106. change(e) {
  107. console.log('change 返回:', e)
  108. },
  109. // 跳转统计详情页面
  110. goToDetail() {
  111. uni.navigateTo({
  112. url: `/pages/statDetail/statDetail?month=${this.month}`
  113. })
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .container {
  120. padding-top: 20rpx;
  121. .header {
  122. margin: 0 auto;
  123. width: 690rpx;
  124. height: 236rpx;
  125. background-color: #fff;
  126. .title {
  127. display: flex;
  128. height: 92rpx;
  129. .month {
  130. flex: 8;
  131. margin: 30rpx 0 0 30rpx;
  132. font-size: 32rpx;
  133. font-weight: 500
  134. }
  135. .right {
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. flex: 1;
  140. img {
  141. width: 15rpx;
  142. height: 30rpx
  143. }
  144. }
  145. }
  146. .state {
  147. display: flex;
  148. height: 144rpx;
  149. .err {
  150. flex: 1;
  151. display: flex;
  152. flex-direction: column;
  153. justify-content: center;
  154. align-items: center;
  155. .number {
  156. font-size: 46rpx;
  157. font-weight: 700;
  158. }
  159. .mes {
  160. font-size: 28rpx;
  161. color: #999999;
  162. }
  163. }
  164. .success {
  165. flex: 1;
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: center;
  169. align-items: center;
  170. .number {
  171. font-size: 46rpx;
  172. font-weight: 700;
  173. }
  174. .mes {
  175. font-size: 28rpx;
  176. color: #999999;
  177. }
  178. }
  179. }
  180. }
  181. .calendar {
  182. margin: 0 auto;
  183. margin-top: 30rpx;
  184. width: 693rpx;
  185. background-color: #fff;
  186. .calendar_title {
  187. padding-left: 30rpx;
  188. height: 100rpx;
  189. line-height: 100rpx;
  190. font-size: 32rpx;
  191. font-weight: 500;
  192. span {
  193. font-size: 26rpx;
  194. color: #999999
  195. }
  196. }
  197. .calendar_body {
  198. height: 690rpx;
  199. background-color: skyblue;
  200. }
  201. .calendar_foot {
  202. padding: 0 30rpx;
  203. margin-bottom: 80rpx;
  204. .foot_item {
  205. box-sizing: border-box;
  206. padding: 30rpx;
  207. display: flex;
  208. flex-direction: column;
  209. justify-content: space-evenly;
  210. height: 130rpx;
  211. font-size: 24rpx;
  212. color: #808080;
  213. .box {
  214. display: flex;
  215. align-items: center;
  216. .circular {
  217. margin-right: 18rpx;
  218. width: 12rpx;
  219. height: 12rpx;
  220. border-radius: 6rpx;
  221. background-color: #31C20E;
  222. }
  223. .color {
  224. background-color: #999999;
  225. }
  226. span {
  227. margin-left: 18rpx;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. }
  234. // 修改选中日期盒子圆角
  235. ::v-deep .uni-calendar-item--isDay {
  236. border-radius: 50rpx;
  237. }
  238. ::v-deep .uni-calendar-item--checked {
  239. border-radius: 50rpx;
  240. }
  241. </style>