home.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="home-container">
  3. <!-- 头部区域 -->
  4. <top-box v-bind:timeStamp="timeStamp"></top-box>
  5. <!-- 滚动条 -->
  6. <view class="notice">
  7. <u-notice-bar :text="noticeMsg" mode="closable" bgColor="rgba(73, 125, 220, 0.25)" color="#FFF" url="/subpkg/mymsg/mymsg"></u-notice-bar>
  8. </view>
  9. <!-- 卡片区域 -->
  10. <view class="card-box">
  11. <!-- 今日打卡 -->
  12. <view class="card-item" style="width: 100%;">
  13. <view class="card-info">
  14. <view class="t-icon t-icon-xueshengdaka"></view>
  15. <text class="info-text">今日打卡情况(今日迟到情况)</text>
  16. </view>
  17. <!-- 内容 -->
  18. <view class="calendar_container">
  19. <zsyCalendar :sundayIndex="6" @change="chooseCalendar" :mode="'close'" />
  20. </view>
  21. </view>
  22. <view class="card-item">
  23. <view class="card-info">
  24. <view class="t-icon t-icon-chengjiguanli"></view>
  25. <text class="info-text">今日评测</text>
  26. </view>
  27. <view class="charts-box">
  28. <qiun-data-charts type="arcbar" :chartData="todayData.evaluationArcbar" :loadingType="4"
  29. :canvas2d='true' canvasId='canvans9313111' :opts="evaluationOpts" />
  30. </view>
  31. </view>
  32. <view class="card-item">
  33. <view class="card-info">
  34. <view class="t-icon t-icon-xuexiaobaobei"></view>
  35. <text class="info-text">今日作业</text>
  36. </view>
  37. <view class="charts-box">
  38. <qiun-data-charts type="arcbar" :chartData="todayData.homeworkArcbar" :loadingType="4"
  39. :canvas2d='true' canvasId='canvans9327676' :opts="homeworkOpts" />
  40. </view>
  41. </view>
  42. <!-- 今日课程 -->
  43. <view class="card-item">
  44. <view class="card-info">
  45. <view class="t-icon t-icon-jiaowuxunke"></view>
  46. <text class="info-text">今日课程</text>
  47. </view>
  48. <!-- 内容 -->
  49. <view style="display: flex; align-items: center;">
  50. <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">个人课程数:</view>
  51. <view class="card-content">{{classNum}}</view>
  52. </view>
  53. <view class="u-page__item">
  54. <u-collapse accordion :border="false">
  55. <u-collapse-item title="孩子今日课程:">
  56. <view style="display: flex; flex-wrap: wrap;">
  57. <u-tag v-for="(item,index) in classList" :key="index" :text="item" plain shape="circle"
  58. size="mini"></u-tag>
  59. </view>
  60. </u-collapse-item>
  61. <u-collapse-item title="今日授课老师:">
  62. <view style="display: flex; flex-wrap: wrap;">
  63. <u-tag v-for="(item,index) in teacherList" :key="index" :text="item" plain
  64. shape="circle" size="mini"></u-tag>
  65. </view>
  66. </u-collapse-item>
  67. </u-collapse>
  68. </view>
  69. </view>
  70. <!-- 今日问卷 -->
  71. <view class="card-item">
  72. <view class="card-info">
  73. <view class="t-icon t-icon-qingjiatiaoke"></view>
  74. <text class="info-text">今日活动</text>
  75. </view>
  76. <!-- 内容 -->
  77. <view style="display: flex; align-items: center;">
  78. <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">问卷完成率:</view>
  79. <view class="card-content">{{questionnaire}}%</view>
  80. </view>
  81. <view style="padding: 0rpx 20rpx 10rpx 20rpx;">
  82. <u-line-progress :showText="false" :percentage="questionnaire" activeColor="#5b7cff" height="15">
  83. </u-line-progress>
  84. </view>
  85. <!-- 内容 -->
  86. <view style="display: flex; align-items: center;">
  87. <view style="color: #3B4144;margin-left: 30rpx;font-size: 30rpx;font-weight: bold;">投票完成率:</view>
  88. <view class="card-content">{{vote}}%</view>
  89. </view>
  90. <view style="padding: 0rpx 20rpx 10rpx 20rpx;">
  91. <u-line-progress :showText="false" :percentage="vote" activeColor="#ff9db2" height="15">
  92. </u-line-progress>
  93. </view>
  94. </view>
  95. <!-- 今日记录模块 -->
  96. <todaydata-box></todaydata-box>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. mapState
  103. } from 'vuex'
  104. //日历组件
  105. import zsyCalendar from '@/components/zsy-calendar/zsy-calendar'
  106. export default {
  107. name: 'Calendar',
  108. computed: {
  109. ...mapState('m_chart', ['todayData']),
  110. ...mapState('m_children', ['childreninfo']),
  111. ...mapState('m_parent', ['myData'])
  112. },
  113. components: {
  114. zsyCalendar
  115. },
  116. data() {
  117. return {
  118. //滚动通知
  119. noticeMsg:'',
  120. //今日课堂数
  121. classNum: 5,
  122. //今日课程
  123. classList: ['数学', '语文', '英语', '体育', '思品'],
  124. //授课老师
  125. teacherList: ['张老师', '李老师', '王老师', '陈老师', '黄老师'],
  126. //问卷完成率
  127. questionnaire: 56,
  128. //投票完成率
  129. vote: 100,
  130. //评测进度条属性
  131. evaluationOpts: {},
  132. //作业进度条属性
  133. homeworkOpts: {},
  134. //时间戳
  135. timeStamp: '',
  136. }
  137. },
  138. onLoad() {
  139. this.setOpts()
  140. this.$getTimeStamp()
  141. this.getNoticeMsg()
  142. },
  143. onPullDownRefresh() {
  144. this.setOpts()
  145. this.$getTimeStamp()
  146. console.log('refresh')
  147. setTimeout(function() {
  148. uni.stopPullDownRefresh()
  149. }, 1000);
  150. },
  151. methods: {
  152. //获取滚动通知
  153. getNoticeMsg(){
  154. this.noticeMsg = `您有 ${this.myData.msgList.length} 个通知,请点击查看`
  155. },
  156. //设置更新
  157. setOpts() {
  158. //圆环图标题和副标题动态变化
  159. let evaluation = {
  160. title: {
  161. name: this.todayData.evaluationArcbar.series[0].data * 100 + "%",
  162. color: this.todayData.evaluationArcbar.series[0].color
  163. },
  164. subtitle: {
  165. name: this.todayData.evaluationArcbar.series[0].name
  166. },
  167. extra: {
  168. arcbar: {
  169. type: 'circle'
  170. }
  171. }
  172. }
  173. let homework = {
  174. title: {
  175. name: this.todayData.homeworkArcbar.series[0].data * 100 + "%",
  176. color: this.todayData.homeworkArcbar.series[0].color
  177. },
  178. subtitle: {
  179. name: this.todayData.homeworkArcbar.series[0].name
  180. },
  181. extra: {
  182. arcbar: {
  183. type: 'circle'
  184. }
  185. }
  186. }
  187. this.evaluationOpts = evaluation;
  188. this.homeworkOpts = homework;
  189. },
  190. // 日历选中日期改变事件回调
  191. chooseCalendar(e) {
  192. console.log(e)
  193. },
  194. },
  195. }
  196. </script>
  197. <style lang="scss">
  198. @import '@/pages/common/mainpage.scss';
  199. //日历
  200. .calendar_container {
  201. background-color: #FFF;
  202. padding: 10rpx;
  203. margin: 10rpx;
  204. box-sizing: border-box;
  205. }
  206. </style>