123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <view class="home-container">
- <!-- 头部区域 -->
- <top-box v-bind:timeStamp="timeStamp"></top-box>
- <!-- 滚动条 -->
- <view class="notice">
- <u-notice-bar :text="myData.msgList[0]" mode="closable" bgColor="#6495ED" color="#FFFFFF"></u-notice-bar>
- </view>
- <!-- 卡片区域 -->
- <view class="card-box">
- <!-- 今日打卡 -->
- <view class="card-item" style="width: 100%;">
- <view class="card-info">
- <view class="t-icon t-icon-xueshengdaka"></view>
- <text class="info-text">今日打卡情况(今日迟到情况)</text>
- </view>
- <!-- 内容 -->
- <view class="calendar_container">
- <zsyCalendar :sundayIndex="6" @change="chooseCalendar" :mode="'close'" />
- </view>
- </view>
- <view class="card-item">
- <view class="card-info">
- <view class="t-icon t-icon-chengjiguanli"></view>
- <text class="info-text">今日评测</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="arcbar" :chartData="todayData.evaluationArcbar" :loadingType="4"
- :canvas2d='true' canvasId='canvans931' :opts="evaluationOpts" />
- </view>
- </view>
- <view class="card-item">
- <view class="card-info">
- <view class="t-icon t-icon-xuexiaobaobei"></view>
- <text class="info-text">今日作业</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="arcbar" :chartData="todayData.homeworkArcbar" :loadingType="4"
- :canvas2d='true' canvasId='canvans932' :opts="homeworkOpts" />
- </view>
- </view>
- <!-- 今日课程 -->
- <view class="card-item">
- <view class="card-info">
- <view class="t-icon t-icon-jiaowuxunke"></view>
- <text class="info-text">今日课程</text>
- </view>
- <!-- 内容 -->
- <view style="display: flex; align-items: center;">
- <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">个人课程数:</view>
- <view class="card-content">{{classNum}}</view>
- </view>
- <view class="u-page__item">
- <u-collapse accordion :border="false">
- <u-collapse-item title="孩子今日课程:">
- <view style="display: flex; flex-wrap: wrap;">
- <u-tag v-for="(item,index) in classList" :key="index" :text="item" plain shape="circle"
- size="mini"></u-tag>
- </view>
- </u-collapse-item>
- <u-collapse-item title="今日授课老师:">
- <view style="display: flex; flex-wrap: wrap;">
- <u-tag v-for="(item,index) in teacherList" :key="index" :text="item" plain
- shape="circle" size="mini"></u-tag>
- </view>
- </u-collapse-item>
- </u-collapse>
- </view>
- </view>
- <!-- 今日问卷 -->
- <view class="card-item">
- <view class="card-info">
- <view class="t-icon t-icon-qingjiatiaoke"></view>
- <text class="info-text">今日活动</text>
- </view>
- <!-- 内容 -->
- <view style="display: flex; align-items: center;">
- <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">问卷完成率:</view>
- <view class="card-content">{{questionnaire}}%</view>
- </view>
- <view style="padding: 0rpx 20rpx 10rpx 20rpx;">
- <u-line-progress :showText="false" :percentage="questionnaire" activeColor="#6495ed" height="15">
- </u-line-progress>
- </view>
- <!-- 内容 -->
- <view style="display: flex; align-items: center;">
- <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">投票完成率:</view>
- <view class="card-content">{{vote}}%</view>
- </view>
- <view style="padding: 0rpx 20rpx 10rpx 20rpx;">
- <u-line-progress :showText="false" :percentage="vote" activeColor="#fd7193" height="15">
- </u-line-progress>
- </view>
- </view>
- <!-- 今日记录模块 -->
- <todaydata-box></todaydata-box>
-
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex'
- //日历组件
- import zsyCalendar from '@/components/zsy-calendar/zsy-calendar'
- export default {
- name: 'Calendar',
- computed: {
- ...mapState('m_chart', ['todayData']),
- ...mapState('m_children', ['childreninfo']),
- ...mapState('m_parent', ['myData'])
- },
- components: {
- zsyCalendar
- },
- data() {
- return {
- //今日课堂数
- classNum: 5,
- //今日课程
- classList: ['数学', '语文', '英语', '体育', '思品'],
- //授课老师
- teacherList: ['张老师', '李老师', '王老师', '陈老师', '黄老师'],
- //评测进度条属性
- evaluationOpts: {},
- //作业进度条属性
- homeworkOpts: {},
- //时间戳
- timeStamp: '',
- //问卷完成率
- questionnaire: 56,
- //投票完成率
- vote: 100,
- }
- },
- onLoad() {
- this.setOpts()
- this.getTimeStamp()
- },
- onPullDownRefresh() {
- this.setOpts()
- this.getTimeStamp()
- console.log('refresh')
- setTimeout(function() {
- uni.stopPullDownRefresh()
- }, 1000);
- },
- methods: {
- //设置更新
- setOpts() {
- //圆环图标题和副标题动态变化
- let evaluation = {
- title: {
- name: this.todayData.evaluationArcbar.series[0].data * 100 + "%",
- color: this.todayData.evaluationArcbar.series[0].color
- },
- subtitle: {
- name: this.todayData.evaluationArcbar.series[0].name
- },
- extra: {
- arcbar: {
- type: 'circle'
- }
- }
- }
- let homework = {
- title: {
- name: this.todayData.homeworkArcbar.series[0].data * 100 + "%",
- color: this.todayData.homeworkArcbar.series[0].color
- },
- subtitle: {
- name: this.todayData.homeworkArcbar.series[0].name
- },
- extra: {
- arcbar: {
- type: 'circle'
- }
- }
- }
- this.evaluationOpts = evaluation;
- this.homeworkOpts = homework;
- },
- // 日历选中日期改变事件回调
- chooseCalendar(e) {
- console.log(e)
- },
- //更新时间戳
- getTimeStamp() {
- var date = new Date(),
- hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
- minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
- this.timeStamp = (hour + ':' + minute).toString();
- }
- },
- }
- </script>
- <style lang="scss">
- .home-container {
- width: 100%;
- height: 100%;
- overflow-x: hidden; //隐藏多余的页面
- .notice {
- margin: -50rpx 20rpx 20rpx 20rpx;
- }
- .card-box {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- margin: 0 20rpx 0 20rpx;
- justify-content: space-between;
- .card-item {
- margin: 10rpx 0;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- background-color: #FFFFFF;
- box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
- border-radius: 16rpx;
- width: 347rpx;
- height: auto;
- .card-info {
- display: flex;
- align-items: center;
- padding: 15rpx;
- .info-text {
- font-size: 30rpx;
- font-weight: bold;
- color: #3B4144;
- margin-left: 10rpx;
- }
- }
- .card-content {
- font-size: 35rpx;
- margin: 10rpx 0 10rpx 25rpx;
- color: #3B4144;
- font-weight: bold;
- }
- }
- }
- }
- .charts-box {
- width: 100%;
- height: 300rpx;
- padding-bottom: 20rpx;
- }
- .t-icon {
- width: 40rpx;
- height: 40rpx;
- }
- //日历
- .calendar_container {
- background-color: #FFFFFF;
- padding: 10rpx;
- margin: 10rpx;
- box-sizing: border-box;
- }
- </style>
|