workstats.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="page_view">
  3. <top-return color="#FFF" text="作业统计"></top-return>
  4. <!-- 背景 -->
  5. <view class="bg_box"></view>
  6. <!-- 页面标题内容 -->
  7. <view class="flex_cloumn">
  8. <view class="flex_baseline">
  9. <view class="content_title" style="font-size: 70rpx;">{{dayTime.split('月')[0]}}</view>
  10. <view class="content_title" style="margin-left: 10rpx;">月</view>
  11. <view class="content_title" style="font-size: 70rpx;margin-left: 10rpx;">{{dayTime.split('月')[1]}}
  12. </view>
  13. <view class="content_title" style="margin-left: 10rpx;">日</view>
  14. <view class="content_title" style="font-size: 70rpx;margin-left: 20rpx;">{{weekTime}}</view>
  15. </view>
  16. <view class="flex_baseline">
  17. <view class="content_subtitle" style="opacity: 0.8;">孩子今日共</view>
  18. <view class="content_subtitle" style="margin-left: 20rpx;font-size: 60rpx;">{{workData.length}}</view>
  19. <view class="content_subtitle" style="margin-left: 20rpx;opacity: 0.8;">份作业</view>
  20. </view>
  21. </view>
  22. <!-- 统计列表 -->
  23. <view class="card_view">
  24. <view class="card_item" style="width: 100%;">
  25. <view class="card_title">
  26. <view class="front_tag"></view>
  27. <view class="title">近期作业完成率</view>
  28. </view>
  29. <view class="chart_box">
  30. <qiun-data-charts type="column" ontouch="true" :chartData="workChartData[0]"
  31. tooltipFormat='HomeworkPercent' :canvas2d="true" canvasId="work_chart1" />
  32. </view>
  33. </view>
  34. <view class="card_item" style="width: 100%;">
  35. <view class="card_title">
  36. <view class="front_tag"></view>
  37. <view class="title">近期作业得分率</view>
  38. </view>
  39. <view class="chart_box">
  40. <qiun-data-charts type="area" ontouch="true" :chartData="workChartData[1]"
  41. tooltipFormat='HomeworkPercent' :canvas2d="true" canvasId="work_chart2" />
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. mapState
  50. } from 'vuex'
  51. export default {
  52. computed: {
  53. ...mapState('m_children', ['workData']),
  54. ...mapState('m_chart', ['workChartData']),
  55. },
  56. data() {
  57. return {
  58. dayTime: '',
  59. weekTime: ''
  60. };
  61. },
  62. onLoad() {
  63. this.getToday()
  64. },
  65. methods: {
  66. getToday() {
  67. this.dayTime = (new Date()).format('M-d').replace('-', '月')
  68. this.weekTime = "星期" + "日一二三四五六".charAt(new Date().getDay());
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .chart_box {
  75. width: 100%;
  76. height: 500rpx;
  77. }
  78. .flex_cloumn {
  79. margin: 140rpx 0 0 50rpx;
  80. height: 170rpx;
  81. justify-content: space-around;
  82. .content_title {
  83. font-size: 35rpx;
  84. font-family: YSfont;
  85. color: #FFF;
  86. z-index: 2;
  87. text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
  88. }
  89. .content_subtitle {
  90. font-size: 40rpx;
  91. color: #FFF;
  92. font-family: YSfont;
  93. z-index: 2;
  94. }
  95. }
  96. </style>