| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <template>
- <view class="container">
- <!-- 头部月份区域 -->
- <view class="header">
- <view class="title">
- <view class="month">
- {{month}}月汇总
- </view>
- <view class="right" @click="goToDetail">
- <img src="../../static/right.png" alt="">
- </view>
- </view>
- <view class="state">
- <view class="err">
- <view class="number">
- 0
- </view>
- <view class="mes">
- 异常次数(次)
- </view>
- </view>
- <view class="success">
- <view class="number">
- 1
- </view>
- <view class="mes">
- 打卡成功(次)
- </view>
- </view>
- </view>
- </view>
- <!-- 日历区域 -->
- <view class="calendar">
- <view class="calendar_title">
- 每日记录
- <span>(5月)</span>
- </view>
- <view class="calendar_body">
- <uni-calendar :showMonth="false" @change="change" :selected="list" />
- </view>
- <view class="calendar_foot">
- <!-- 每一条记录区域 -->
- <view class="foot_item" v-for="item in list2" :key="item.id">
- <view>
- {{item.msg}}
- </view>
- <view class="box">
- <view class="circular" v-if="item.status==1"></view>
- <view class="circular color" v-else></view>
- {{item.status==0?"未打卡":"已打卡"}}
- <span>{{item.time}}</span>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [{
- date: "2022-11-20",
- info: ''
- },
- {
- date: "2022-11-21",
- info: '',
- data: {
- custom: '自定义信息',
- name: '自定义消息头'
- }
- },
- {
- date: "2022-11-22",
- info: ''
- }
- ],
- list2: [{
- id: 1,
- msg: "规则:课间操考勤打卡09:00 - 09:15",
- status: 0,
- time: "09:25:25"
- },
- {
- id: 2,
- msg: "规则:考勤打卡19:00 - 20:15",
- status: 1,
- time: "19:25:25"
- },
- ],
- month: null
- };
- },
- onLoad() {
- this.getMonth()
- },
- methods: {
- // 获取当前时间月份
- getMonth() {
- let date = new Date()
- let month = date.getMonth() + 1
- this.month = month
- },
- // 点击日历日期回调
- change(e) {
- console.log('change 返回:', e)
- },
- // 跳转统计详情页面
- goToDetail() {
- uni.navigateTo({
- url: `/pages/statDetail/statDetail?month=${this.month}`
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- padding-top: 20rpx;
- .header {
- margin: 0 auto;
- width: 690rpx;
- height: 236rpx;
- background-color: #fff;
- .title {
- display: flex;
- height: 92rpx;
- .month {
- flex: 8;
- margin: 30rpx 0 0 30rpx;
- font-size: 32rpx;
- font-weight: 500
- }
- .right {
- display: flex;
- justify-content: center;
- align-items: center;
- flex: 1;
- img {
- width: 15rpx;
- height: 30rpx
- }
- }
- }
- .state {
- display: flex;
- height: 144rpx;
- .err {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .number {
- font-size: 46rpx;
- font-weight: 700;
- }
- .mes {
- font-size: 28rpx;
- color: #999999;
- }
- }
- .success {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .number {
- font-size: 46rpx;
- font-weight: 700;
- }
- .mes {
- font-size: 28rpx;
- color: #999999;
- }
- }
- }
- }
- .calendar {
- margin: 0 auto;
- margin-top: 30rpx;
- width: 693rpx;
- background-color: #fff;
- .calendar_title {
- padding-left: 30rpx;
- height: 100rpx;
- line-height: 100rpx;
- font-size: 32rpx;
- font-weight: 500;
- span {
- font-size: 26rpx;
- color: #999999
- }
- }
- .calendar_body {
- height: 690rpx;
- background-color: skyblue;
- }
- .calendar_foot {
- padding: 0 30rpx;
- margin-bottom: 80rpx;
- .foot_item {
- box-sizing: border-box;
- padding: 30rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- height: 130rpx;
- font-size: 24rpx;
- color: #808080;
- .box {
- display: flex;
- align-items: center;
- .circular {
- margin-right: 18rpx;
- width: 12rpx;
- height: 12rpx;
- border-radius: 6rpx;
- background-color: #31C20E;
- }
- .color {
- background-color: #999999;
- }
- span {
- margin-left: 18rpx;
- }
- }
- }
- }
- }
- }
- // 修改选中日期盒子圆角
- ::v-deep .uni-calendar-item--isDay {
- border-radius: 50rpx;
- }
- ::v-deep .uni-calendar-item--checked {
- border-radius: 50rpx;
- }
- </style>
|