worklist.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="page-view">
  3. <top-return :color="'#FFF'" text="作业列表"></top-return>
  4. <view class="bg-box2"></view>
  5. <!-- 页面标题内容 -->
  6. <view class="top-box">
  7. <view class="flex-baseline">
  8. <view class="info-title" style="margin-left: 0;">{{dayTime.split('月')[0]}}</view>
  9. <view class="info-subtitle">月</view>
  10. <view class="info-title">{{dayTime.split('月')[1]}}</view>
  11. <view class="info-subtitle">日</view>
  12. <view class="info-subtitle" style="margin-left: 20rpx;">已完成</view>
  13. <view class="info-title">{{value}}%</view>
  14. </view>
  15. <view class="flex-baseline">
  16. <view class="data-subtitle" style="margin-left: 0;">孩子今日共</view>
  17. <view class="data-title">{{workData.length}}</view>
  18. <view class="data-subtitle">份作业</view>
  19. </view>
  20. </view>
  21. <view class="card-view">
  22. <view class="card-item" v-for="(item,index) in workData" :key="index" @click="navWorkReport(index)">
  23. <view class="card-title">
  24. <view class="t-icon t-icon-workicon">
  25. </view>
  26. <view class="YS-title" style="font-size: 45rpx;">{{item.work.name}}</view>
  27. <view
  28. :class="[item.work.progress === 'finish'?'t-icon t-icon-yiwancheng1':'t-icon t-icon-jinhangzhong-copy1','state-seal']">
  29. </view>
  30. </view>
  31. <view class="card-info">
  32. <view class="flex-baseline">
  33. <view class="info-type">布置老师:</view>
  34. <view class="YS-title" style="margin-left: 10rpx;">{{item.work.creatorId}}</view>
  35. <view class="info-type" style="margin-left: 20rpx;">截止时间:</view>
  36. <view class="YS-title" style="margin-left: 10rpx;">
  37. {{$timeStampToTime(item.work.endTime)}}
  38. </view>
  39. </view>
  40. <view class="flex-row" style="margin-top: 20rpx;">
  41. <u-parse class="YS-title" style="font-size: 30rpx;" :content="item.work.description"
  42. :selectable="true"></u-parse>
  43. </view>
  44. </view>
  45. <!-- 正文 -->
  46. <view class="content-box">
  47. <view class="title-box"
  48. :style="{backgroundColor: item.work.progress === 'finish'? '#23b46c': '#f9c752' }">
  49. <view class="title-text">作业附件</view>
  50. </view>
  51. <view v-for="(attachment,i) in item.work.attachments" :key="i">
  52. <view class="attachment-box">
  53. <view v-if="attachment.type == 'word'" class="t-icon t-icon-WORD"></view>
  54. <view v-if="attachment.type == 'excel'" class="t-icon t-icon-ECEL"></view>
  55. <view v-if="attachment.type == 'pdf'" class="t-icon t-icon-PDF"></view>
  56. <view v-if="attachment.type == 'image'" class="t-icon t-icon-tupianziliao"></view>
  57. <view v-if="attachment.type == 'ppt'" class="t-icon t-icon-PPT"></view>
  58. <view class="attachment-info" style="margin-left: 20rpx;">
  59. <view class="content-detail">文件名: {{attachment.name}}</view>
  60. <view class="content-subtitle">文件大小: {{fixNum(attachment.size/8/1024)}}KB</view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. import {
  71. mapState,
  72. mapMutations
  73. } from 'vuex'
  74. export default {
  75. computed: {
  76. ...mapState('m_children', ['workData'])
  77. },
  78. data() {
  79. return {
  80. value: '',
  81. dayTime: ''
  82. }
  83. },
  84. onLoad(parameter) {
  85. this.value = parameter.value
  86. this.dayTime = (new Date()).format('M-d').replace('-', '月')
  87. },
  88. methods: {
  89. fixNum(num) {
  90. return num.toFixed(2)
  91. },
  92. navWorkReport(index) {
  93. uni.navigateTo({
  94. url: `/subpkg/datalist/workReport?index=${index}`
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss">
  101. @import 'data_pages.scss';
  102. @import 'top_info.scss';
  103. .attachment-box {
  104. display: flex;
  105. margin-bottom: 20rpx;
  106. align-items: center;
  107. padding: 6rpx 20rpx;
  108. background-color: #FFF;
  109. border-radius: 10rpx;
  110. .t-icon {
  111. width: 60rpx;
  112. height: 60rpx;
  113. }
  114. .attachment-info {
  115. display: flex;
  116. flex-direction: column;
  117. margin: 20rpx 50rpx;
  118. }
  119. }
  120. </style>