|
@@ -21,47 +21,32 @@
|
|
|
<view class="msg" style="margin-left: 10rpx; font-size: 14px;color: #3C9CFF;" @click="navClass">
|
|
|
课程列表</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
<todayclass-box :classCurrent="classCurrent"></todayclass-box>
|
|
|
</view>
|
|
|
|
|
|
<!-- 今日打卡 -->
|
|
|
- <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>
|
|
|
+ <view class="card-item" @click="navCalendar">
|
|
|
+ <view class="card-info" style="padding-bottom: 0;">
|
|
|
+ <view :class="icon.isRecord" v-if="attendance==='已打卡'" style="width:150rpx;height: 60rpx;background-repeat: no-repeat;"></view>
|
|
|
+ <view :class="icon.noRecord" v-if="attendance==='未打卡'" style="width:150rpx;height: 60rpx;background-repeat: no-repeat;"></view>
|
|
|
+ <view class="t-icon t-icon-weizhidaka-dakachenggong" v-if="attendance==='已打卡'" style="width:60rpx;height: 60rpx;background-repeat: no-repeat;margin-left: auto;"></view>
|
|
|
+ <view class="t-icon t-icon-weizhidaka-dakacuowu" v-if="attendance==='未打卡'" style="width:60rpx;height: 60rpx;background-repeat: no-repeat;margin-left: auto;"></view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="space">
|
|
|
- <view class="home-title-text">
|
|
|
- <view class="msg">今日出勤:</view>
|
|
|
- <view class="card-content">{{attendanceData.attendance}}</view>
|
|
|
- </view>
|
|
|
- <view class="home-title-text">
|
|
|
- <view class="msg">打卡时间:</view>
|
|
|
- <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 class="state-box">
|
|
|
+ <view class="text-content">今日打卡:</view>
|
|
|
+ <view class="state"
|
|
|
+ :style="{backgroundColor: attendance==='已打卡'?'#3C9CFF':(attendance === '未打卡'?'#f9c752':'#FFF')}">
|
|
|
+ <view class="state-text">{{attendance}}</view>
|
|
|
</view>
|
|
|
- <view class="home-title-text">
|
|
|
- <view class="msg">出勤效率:</view>
|
|
|
- <view class="card-content">{{attendanceData.attendanceQuality}}</view>
|
|
|
+ <view class="text-content">打卡时间:</view>
|
|
|
+ <view class="state"
|
|
|
+ :style="{backgroundColor: attendance==='已打卡'?'#3C9CFF':(attendance === '未打卡'?'#f9c752':'#FFF')}">
|
|
|
+ <view class="state-text">{{attendanceTime}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
<!-- 评测 -->
|
|
|
<view class="card-item" @click="navHomework(0)">
|
|
|
<view class="card-info">
|
|
@@ -69,7 +54,7 @@
|
|
|
<text class="info-text">今日评测</text>
|
|
|
</view>
|
|
|
<view class="charts-box">
|
|
|
- <qiun-data-charts type="arcbar" :chartData="todayData.evaluationArcbar" :loadingType="4"
|
|
|
+ <qiun-data-charts type="arcbar" :chartData="homeData.evaluationArcbar" :loadingType="4"
|
|
|
:canvas2d='true' canvasId='canvans9313111' :opts="evaluationOpts" />
|
|
|
</view>
|
|
|
</view>
|
|
@@ -80,7 +65,7 @@
|
|
|
<text class="info-text">今日作业</text>
|
|
|
</view>
|
|
|
<view class="charts-box">
|
|
|
- <qiun-data-charts type="arcbar" :chartData="todayData.homeworkArcbar" :loadingType="4"
|
|
|
+ <qiun-data-charts type="arcbar" :chartData="homeData.homeworkArcbar" :loadingType="4"
|
|
|
:canvas2d='true' canvasId='canvans9327676' :opts="homeworkOpts" />
|
|
|
</view>
|
|
|
</view>
|
|
@@ -91,11 +76,10 @@
|
|
|
<text class="info-text">今日活动</text>
|
|
|
</view>
|
|
|
<view class="charts-box">
|
|
|
- <qiun-data-charts type="arcbar" :chartData="todayData.activityArcbar" :loadingType="4"
|
|
|
+ <qiun-data-charts type="arcbar" :chartData="homeData.activityArcbar" :loadingType="4"
|
|
|
:canvas2d='true' canvasId='canvans9313176' :opts="activityOpts" />
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -106,7 +90,7 @@
|
|
|
} from 'vuex'
|
|
|
export default {
|
|
|
computed: {
|
|
|
- ...mapState('m_chart', ['todayData']),
|
|
|
+ ...mapState('m_chart', ['homeData']),
|
|
|
...mapState('m_children', ['childreninfo', 'classList', 'records']),
|
|
|
...mapState('m_parent', ['myData'])
|
|
|
},
|
|
@@ -116,28 +100,9 @@
|
|
|
noticeMsg: '',
|
|
|
//当前课程索引
|
|
|
classCurrent: '',
|
|
|
- //打卡数据
|
|
|
- attendanceData: {
|
|
|
- //出勤状况
|
|
|
- attendance: '',
|
|
|
- //打卡时间
|
|
|
- attendanceTime: '',
|
|
|
- //处理后时间
|
|
|
- attendanceTimeAfter: [],
|
|
|
- //出勤质量
|
|
|
- attendanceQuality: ''
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ attendance: '',
|
|
|
+ attendanceTime: '',
|
|
|
//属性(不修改)
|
|
|
- //图标
|
|
|
- icon: {
|
|
|
- record: 't-icon t-icon-dakaqiandao',
|
|
|
- class: 't-icon t-icon-banji',
|
|
|
- evaluation: 't-icon t-icon-ceping',
|
|
|
- homework: 't-icon t-icon-bianji1',
|
|
|
- activity: 't-icon t-icon-huodong'
|
|
|
- },
|
|
|
//评测进度条属性
|
|
|
evaluationOpts: {},
|
|
|
//作业进度条属性
|
|
@@ -146,6 +111,15 @@
|
|
|
activityOpts: {},
|
|
|
//时间戳
|
|
|
timeStamp: '',
|
|
|
+ //图标
|
|
|
+ icon: {
|
|
|
+ isRecord: 't-icon t-icon-dakaxbeifen',
|
|
|
+ noRecord: 't-icon t-icon-dakaxbeifen-copy',
|
|
|
+ class: 't-icon t-icon-banji',
|
|
|
+ evaluation: 't-icon t-icon-ceping',
|
|
|
+ homework: 't-icon t-icon-bianji1',
|
|
|
+ activity: 't-icon t-icon-huodong'
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -161,36 +135,17 @@
|
|
|
//页面方法初始化
|
|
|
init() {
|
|
|
this.$getTimeStamp()
|
|
|
+ this.$initHome()
|
|
|
this.setOpts()
|
|
|
this.getNoticeMsg()
|
|
|
this.getClassCurrent()
|
|
|
- this.getTodayAttendance()
|
|
|
- this.getAttendanceTimeAfter()
|
|
|
+ this.getAttendance()
|
|
|
},
|
|
|
//获取滚动通知
|
|
|
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() {
|
|
|
//当前时间戳是否在课程时间段内
|
|
|
function CompareDate(start, finish) {
|
|
@@ -227,36 +182,30 @@
|
|
|
this.classCurrent = i
|
|
|
i = 0
|
|
|
},
|
|
|
- //处理打卡时间
|
|
|
- getAttendanceTimeAfter() {
|
|
|
- this.attendanceData.attendanceTimeAfter = this.attendanceData.attendanceTime.split(':')
|
|
|
- },
|
|
|
- //导航
|
|
|
- navHomework(index) {
|
|
|
- uni.reLaunch({
|
|
|
- url: `/pages/homework/homework?index=${index}`
|
|
|
- })
|
|
|
- },
|
|
|
- navCalendar(attendance, attendanceTime, attendanceQuality) {
|
|
|
- uni.navigateTo({
|
|
|
- url: `/subpkg/calendarmsg/calendarmsg?attendance=${attendance}&attendanceTime=${attendanceTime}&attendanceQuality=${attendanceQuality}`
|
|
|
- })
|
|
|
- },
|
|
|
- navClass() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/subpkg/classmsg/classmsg'
|
|
|
- })
|
|
|
+ //获得今日是否打卡
|
|
|
+ getAttendance() {
|
|
|
+ //获得当前时间时间戳
|
|
|
+ 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.attendance = '已打卡'
|
|
|
+ this.attendanceTime = info[0].time
|
|
|
+ } else {
|
|
|
+ this.attendance = '未打卡'
|
|
|
+ this.attendanceTime = '未记录'
|
|
|
+ }
|
|
|
},
|
|
|
//设置圆环图描述更新
|
|
|
setOpts() {
|
|
|
//圆环图标题和副标题动态变化
|
|
|
let evaluation = {
|
|
|
title: {
|
|
|
- name: this.todayData.evaluationArcbar.series[0].data * 100 + "%",
|
|
|
- color: this.todayData.evaluationArcbar.series[0].color
|
|
|
+ name: this.homeData.evaluationArcbar.series[0].data * 100 + "%",
|
|
|
+ color: this.homeData.evaluationArcbar.series[0].color
|
|
|
},
|
|
|
subtitle: {
|
|
|
- name: this.todayData.evaluationArcbar.series[0].name
|
|
|
+ name: this.homeData.evaluationArcbar.series[0].name
|
|
|
},
|
|
|
extra: {
|
|
|
arcbar: {
|
|
@@ -266,11 +215,11 @@
|
|
|
}
|
|
|
let homework = {
|
|
|
title: {
|
|
|
- name: this.todayData.homeworkArcbar.series[0].data * 100 + "%",
|
|
|
- color: this.todayData.homeworkArcbar.series[0].color
|
|
|
+ name: this.homeData.homeworkArcbar.series[0].data * 100 + "%",
|
|
|
+ color: this.homeData.homeworkArcbar.series[0].color
|
|
|
},
|
|
|
subtitle: {
|
|
|
- name: this.todayData.homeworkArcbar.series[0].name
|
|
|
+ name: this.homeData.homeworkArcbar.series[0].name
|
|
|
},
|
|
|
extra: {
|
|
|
arcbar: {
|
|
@@ -280,11 +229,11 @@
|
|
|
}
|
|
|
let activity = {
|
|
|
title: {
|
|
|
- name: this.todayData.activityArcbar.series[0].data * 100 + "%",
|
|
|
- color: this.todayData.activityArcbar.series[0].color
|
|
|
+ name: this.homeData.activityArcbar.series[0].data * 100 + "%",
|
|
|
+ color: this.homeData.activityArcbar.series[0].color
|
|
|
},
|
|
|
subtitle: {
|
|
|
- name: this.todayData.activityArcbar.series[0].name
|
|
|
+ name: this.homeData.activityArcbar.series[0].name
|
|
|
},
|
|
|
extra: {
|
|
|
arcbar: {
|
|
@@ -296,7 +245,22 @@
|
|
|
this.homeworkOpts = homework;
|
|
|
this.activityOpts = activity;
|
|
|
},
|
|
|
-
|
|
|
+ //导航
|
|
|
+ navHomework(index) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: `/pages/homework/homework?index=${index}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ navCalendar() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/subpkg/calendarmsg/calendarmsg'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ navClass() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/subpkg/classmsg/classmsg'
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -304,24 +268,32 @@
|
|
|
<style lang="scss">
|
|
|
@import '@/pages/common/mainpage.scss';
|
|
|
|
|
|
- .number-box {
|
|
|
- width: 40rpx;
|
|
|
- height: 40rpx;
|
|
|
- border-radius: 8rpx;
|
|
|
- background-color: #3C9CFF;
|
|
|
- color: #FFF;
|
|
|
- padding: 5rpx;
|
|
|
- margin: 5rpx;
|
|
|
+ .state-box {
|
|
|
display: flex;
|
|
|
- justify-content: center;
|
|
|
+ flex-direction: column;
|
|
|
align-items: center;
|
|
|
- }
|
|
|
-
|
|
|
- .space {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-around;
|
|
|
+
|
|
|
+ .state {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 50rpx;
|
|
|
+ height: 21%;
|
|
|
+ width: 90%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .state-text {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #FFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text-content {
|
|
|
+ font-size: 30rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: $color-title;
|
|
|
+ margin:20rpx auto 20rpx 7%;
|
|
|
}
|
|
|
</style>
|