|
@@ -4,7 +4,8 @@
|
|
|
<top-box v-bind:timeStamp="timeStamp"></top-box>
|
|
|
<!-- 滚动条 -->
|
|
|
<view class="notice">
|
|
|
- <u-notice-bar :text="noticeMsg" mode="closable" bgColor="rgba(73, 125, 220, 0.25)" color="#FFF" url="/subpkg/mymsg/mymsg"></u-notice-bar>
|
|
|
+ <u-notice-bar :text="noticeMsg" mode="closable" bgColor="rgba(73, 125, 220, 0.25)" color="#FFF"
|
|
|
+ url="/subpkg/mymsg/mymsg"></u-notice-bar>
|
|
|
</view>
|
|
|
<!-- 卡片区域 -->
|
|
|
<view class="card-box">
|
|
@@ -15,9 +16,10 @@
|
|
|
<view :class="icon.class"></view>
|
|
|
<text class="info-text">今日课程</text>
|
|
|
<view style="display: flex; align-items: center;margin: 0 10rpx 0 auto;">
|
|
|
- <view class="t-icon t-icon-liebiao" style="width: 30rpx; height: 30rpx;"
|
|
|
- @click="navClass"></view>
|
|
|
- <view class="msg" style="margin-left: 10rpx; font-size: 14px;color: #3C9CFF;" @click="navClass">课程列表</view>
|
|
|
+ <view class="t-icon t-icon-liebiao" style="width: 30rpx; height: 30rpx;" @click="navClass">
|
|
|
+ </view>
|
|
|
+ <view class="msg" style="margin-left: 10rpx; font-size: 14px;color: #3C9CFF;" @click="navClass">
|
|
|
+ 课程列表</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -25,7 +27,8 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 今日打卡 -->
|
|
|
- <view class="card-item" @click="navCalendar(attendanceData.attendance,attendanceData.attendanceTime,attendanceData.attendanceQuality)">
|
|
|
+ <view class="card-item"
|
|
|
+ @click="navCalendar(attendanceData.attendance,attendanceData.attendanceTime,attendanceData.attendanceQuality)">
|
|
|
<view class="card-info">
|
|
|
<view :class="icon.record"></view>
|
|
|
<text class="info-text">今日打卡</text>
|
|
@@ -38,17 +41,21 @@
|
|
|
</view>
|
|
|
<view class="home-title-text">
|
|
|
<view class="msg">打卡时间:</view>
|
|
|
- <view style="margin-left: 10rpx;">
|
|
|
- <!-- <u-tag text="8点15分" plain shape="circle"></u-tag> -->
|
|
|
+ <view style="margin-left: 10rpx;" v-if="attendanceData.attendance === '已打卡'">
|
|
|
+
|
|
|
<view style="display: flex; align-items: center; margin-left: 10rpx;">
|
|
|
<view class="number-box">{{attendanceData.attendanceTimeAfter[0]}}</view>
|
|
|
<view style="color: #3C9CFF;">:</view>
|
|
|
<view class="number-box">{{attendanceData.attendanceTimeAfter[1]}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if="attendanceData.attendance === '未打卡'" style="margin: 10rpx 0 10rpx 25rpx;">
|
|
|
+ <u-tag :text="attendanceData.attendanceTime" plain shape="circle"></u-tag>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="home-title-text">
|
|
|
- <view class="msg">本日出勤:</view>
|
|
|
+ <view class="msg">出勤效率:</view>
|
|
|
<view class="card-content">{{attendanceData.attendanceQuality}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -100,7 +107,7 @@
|
|
|
export default {
|
|
|
computed: {
|
|
|
...mapState('m_chart', ['todayData']),
|
|
|
- ...mapState('m_children', ['childreninfo', 'classList']),
|
|
|
+ ...mapState('m_children', ['childreninfo', 'classList', 'records']),
|
|
|
...mapState('m_parent', ['myData'])
|
|
|
},
|
|
|
data() {
|
|
@@ -112,14 +119,16 @@
|
|
|
//打卡数据
|
|
|
attendanceData: {
|
|
|
//出勤状况
|
|
|
- attendance: '已打卡',
|
|
|
+ attendance: '',
|
|
|
//打卡时间
|
|
|
- attendanceTime: '08:27',
|
|
|
+ attendanceTime: '',
|
|
|
//处理后时间
|
|
|
attendanceTimeAfter: [],
|
|
|
//出勤质量
|
|
|
- attendanceQuality: '良好'
|
|
|
+ attendanceQuality: ''
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
//属性(不修改)
|
|
|
//图标
|
|
|
icon: {
|
|
@@ -137,29 +146,50 @@
|
|
|
activityOpts: {},
|
|
|
//时间戳
|
|
|
timeStamp: '',
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.setOpts()
|
|
|
- this.$getTimeStamp()
|
|
|
- this.getNoticeMsg()
|
|
|
- this.getClassCurrent()
|
|
|
- this.getAttendanceTimeAfter()
|
|
|
+ this.init()
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
- this.$getTimeStamp()
|
|
|
- this.getClassCurrent()
|
|
|
- console.log('refresh')
|
|
|
+ this.init()
|
|
|
setTimeout(function() {
|
|
|
uni.stopPullDownRefresh()
|
|
|
}, 1000);
|
|
|
},
|
|
|
methods: {
|
|
|
+ //页面方法初始化
|
|
|
+ init() {
|
|
|
+ this.$getTimeStamp()
|
|
|
+ this.setOpts()
|
|
|
+ this.getNoticeMsg()
|
|
|
+ this.getClassCurrent()
|
|
|
+ this.getTodayAttendance()
|
|
|
+ this.getAttendanceTimeAfter()
|
|
|
+ },
|
|
|
//获取滚动通知
|
|
|
getNoticeMsg() {
|
|
|
this.noticeMsg = `您有 ${this.myData.msgList.length} 个通知,请点击查看`
|
|
|
},
|
|
|
+ //展示今日打卡
|
|
|
+ getTodayAttendance() {
|
|
|
+ //获得当前时间时间戳
|
|
|
+ let timeNow = (new Date()).format("yyyy-M-dd")
|
|
|
+ let timeArr = timeNow.split("-")
|
|
|
+ let info = this.records.filter(x => x.year == timeArr[0] && x.month == timeArr[1] && x.date == timeArr[2])
|
|
|
+ if (info.length === 0) {
|
|
|
+ //出勤状况
|
|
|
+ this.attendanceData.attendance = '未打卡',
|
|
|
+ //打卡时间
|
|
|
+ this.attendanceData.attendanceTime = '未记录',
|
|
|
+ //出勤质量
|
|
|
+ this.attendanceData.attendanceQuality = '未记录'
|
|
|
+ } else {
|
|
|
+ this.attendanceData.attendance = '已打卡'
|
|
|
+ this.attendanceData.attendanceTime = info[0].time
|
|
|
+ this.attendanceData.attendanceQuality = info[0].time>'08:15'? '一般':'优秀'
|
|
|
+ }
|
|
|
+ },
|
|
|
//计算当前课程
|
|
|
getClassCurrent() {
|
|
|
//当前时间戳是否在课程时间段内
|
|
@@ -207,7 +237,7 @@
|
|
|
url: `/pages/homework/homework?index=${index}`
|
|
|
})
|
|
|
},
|
|
|
- navCalendar(attendance,attendanceTime,attendanceQuality) {
|
|
|
+ navCalendar(attendance, attendanceTime, attendanceQuality) {
|
|
|
uni.navigateTo({
|
|
|
url: `/subpkg/calendarmsg/calendarmsg?attendance=${attendance}&attendanceTime=${attendanceTime}&attendanceQuality=${attendanceQuality}`
|
|
|
})
|