123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <view class="page_view">
- <!-- 统计 -->
- <view class="bg1">
- <view class="circle_line1"></view>
- <view class="circle_line2"></view>
- <view class="circle_line3"></view>
- <top-info :timeStamp="timeStamp"></top-info>
- <scroll-view class="scroll_view" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
- <view class="view_box">
- <view class="scroll_view_item" v-for="(item,index) in cardList" :key="index" @click="navWorkStats">
- <view class="card_info">
- <view :class="item.icon"></view>
- <view class="title">{{item.title}}</view>
- </view>
- <view class="chart_box">
- <qiun-data-charts :type="item.type" :chartData="item.data" />
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- <!-- 统计卡片 -->
- <view class="card_view">
- <view class="total_card" style="background-color:#f9c752">
- <view class="flex_cloumn" style="justify-content: space-around;margin: 20rpx 0 20rpx 20rpx;">
- <view class="flex_baseline">
- <text class="_title">今日作业</text>
- <text class="_title" style="margin-left: 20rpx;">{{workData.length}}</text>
- <text class="_unit">例</text>
- </view>
- <view class="flex_baseline">
- <text class="_subtitle">已完成</text>
- <text class="_subtitle" style="margin-left: 20rpx;">{{finishData.length}}</text>
- <text class="_unit">例</text>
- </view>
- <view class="flex_baseline">
- <text class="_subtitle">完成情况</text>
- <text class="_subtitle" style="margin-left: 20rpx;font-weight: bold;">{{performance}}</text>
- </view>
- </view>
- <view class="image" :style="{backgroundImage:`url(${image})`}"></view>
- </view>
- <!-- 列表卡片 -->
- <view class="card_item" style="width: 100%;">
- <view class="card_title">
- <view class="front_tag"></view>
- <view class="title">今日作业</view>
- <view class="flex_row" style="margin: 0 0 0 auto;" @click="navWorkList" v-if="workData.length != 0">
- <view class="t-icon t-icon-fenlei"></view>
- <view class="title" style="color: #4169E1;margin-left: 10rpx;">作业列表</view>
- </view>
- </view>
- <view class="class_list">
- <view class="class_item" :style="{borderImage: item.work.progress === 'finish'?none:'linear-gradient(to right, #f9c752, #FFF) 1'}" v-for="(item,index) in workData" :key="index" @click="navWorkData(index)" v-if="workData.length != 0">
- <view class="flex_row" style="margin: 0 20rpx;">
- <view class="t-icon t-icon-workicon" style="width: 60rpx; height: 60rpx;"></view>
- <view class="flex_cloumn">
- <view class="flex_row">
- <view class="class_item_title">{{item.work.name}}</view>
- <view class="tag_fill" style="background-color: #f9c752;">
- <view class="tag_text">{{item.work.scope === 'private' ? '个人':'学校'}}</view>
- </view>
- <view class="tag_fill"
- :style="{backgroundColor: item.work.progress === 'finish'? '#23b46c':'#ff5959'}">
- <view class="tag_text">{{item.work.progress === 'finish' ? '已完成' : '进行中'}}
- </view>
- </view>
- </view>
- <view class="flex_row"
- style="width:510rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis">
- <view class="class_item_subtitle" style="font-size: 26rpx;font-weight: 400;">
- {{item.work.description}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="image_box" v-if="workData.length === 0">
- <view class="detail_image_none" :style="{backgroundImage:`url(${image1})`}"></view>
- <view class="subtitle">今日孩子暂无作业活动</view>
- </view>
- </view>
- </view>
- <view class="flex_cloumn" style="margin: 15rpx 0 10rpx 20rpx;">
- <view class="title" style="font-size: 32rpx;">作业例题</view>
- <view class="bottom_tag"></view>
- </view>
- <view class="flex_row" style="width: 70%;"></view>
- </view>
- <scroll-view class="scroll_view_bottom" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
- <view class="_item"></view>
- <view class="_item"></view>
- <view class="_item"></view>
- <view class="_item"></view>
- <view class="_item"></view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex'
- export default {
- computed: {
- ...mapState('m_children', ['workData']),
- ...mapState('m_chart', ['workChartData'])
- },
- data() {
- return {
- cardList: [{
- icon: 't-icon t-icon-gongzuo',
- title: '近期作业完成率',
- type: 'mini-column',
- data: ''
- }, {
- icon: 't-icon t-icon-renzheng',
- title: '近期作业得分率',
- type: 'mini-area',
- data: ''
- }],
- image: 'https://ouch-cdn2.icons8.com/AVOwJ9emg_ZOeHvQaunQAZlgeLsG-b1cGhiYvgoJ06g/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNTAw/LzI5YjU1YWQ4LWMw/YTEtNDE1MS1iYmQw/LWIyMDdhYmRkOTE0/Mi5wbmc.png',
- //完成情况
- performance: '',
- //完成数据
- finishData: '',
- timeStamp: '',
- image1: 'https://image.meiye.art/pic_16314118207650DBDbJB8Ao3fE8_1bY3Fj'
- };
- },
- onLoad() {
- this.init()
- },
- //刷新页面
- onPullDownRefresh() {
- this.init()
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- methods: {
- //初始化
- init() {
- this.timeStamp = (new Date()).format("hh:mm")
- this.$initWork()
- this.getWorkChartData()
- this.getPerformance()
- },
- //获得作业图表信息
- getWorkChartData() {
- this.cardList[0].data = this.workChartData[0]
- this.cardList[1].data = this.workChartData[1]
- },
- //获得评判信息
- getPerformance() {
- if (this.workData.length != 0) {
- this.finishData = this.workData.filter(x => x.work.progress === 'finish')
- this.performance = this.finishData.length / this.workData.length >= 0.4 ?
- (this.finishData.length / this.workData.length >= 0.7 ? '优秀' : '良好') : '较差'
- } else {
- this.finishData = []
- this.performance = '无作业'
- }
- },
- navWorkStats() {
- uni.navigateTo({
- url: '/subpkg/statslist/workstats'
- })
- },
- navWorkList() {
- let value = this.performance
- uni.navigateTo({
- url: `/subpkg/datalist/worklist?value=${value}`
- })
- },
- navWorkData(index) {
- uni.navigateTo({
- url: `/subpkg/datalist/workdata?index=${index}`
- })
- }
- }
- }
- </script>
- <style lang="scss">
- @import '@/pages/style/tab_pages.scss';
- .bg1 {
- background-color: $color-yellow;
- }
- .flex_row {
- margin: 5rpx 20rpx;
- }
- .tag_fill {
- background-color: $color-pink;
- margin-left: 20rpx;
- }
- .image {
- top: -50rpx;
- }
- .circle_line1 {
- background-image: linear-gradient(to right, #f9c752, #f9c752), linear-gradient(90deg, #FFF -50%, rgba(255, 255, 255, 0.0));
- }
- .circle_line2 {
- background-image: linear-gradient(to right, #f9c752, #f9c752), linear-gradient(180deg, #FFF -50%, rgba(255, 255, 255, 0.0));
- }
- .circle_line3 {
- background-image: linear-gradient(to right, #f9c752, #f9c752), linear-gradient(0deg, #FFF -50%, rgba(255, 255, 255, 0.0));
- }
- </style>
|