worklist.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="page_view">
  3. <top-return :color="'#FFF'" text="作业列表"></top-return>
  4. <view class="bg_card"></view>
  5. <!-- 页面标题内容 -->
  6. <view class="flex_cloumn">
  7. <view class="flex_baseline">
  8. <view class="content_title" style="font-size: 60rpx;">{{dayTime.split('月')[0]}}</view>
  9. <view class="content_title" style="margin-left: 10rpx;">月</view>
  10. <view class="content_title" style="font-size: 60rpx; margin-left: 10rpx;">{{dayTime.split('月')[1]}}
  11. </view>
  12. <view class="content_title" style="margin-left: 10rpx;">日</view>
  13. <view class="content_title" style="font-size: 40rpx;margin-left: 20rpx;">完成率</view>
  14. <view class="content_title" style="margin-left: 10rpx;font-size: 60rpx;">{{value}}%</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: 40rpx;transform: skew(-15deg);">
  19. {{workData.length}}</view>
  20. <view class="content_subtitle" style="margin-left: 20rpx;opacity: 0.8;">份作业</view>
  21. </view>
  22. </view>
  23. <view class="card_view">
  24. <view class="card_item" style="width: 100%;" v-for="(item,index) in workData" :key="index"
  25. @click="navWorkData(index)">
  26. <view class="card_title">
  27. <view class="front_tag" style="height: 40rpx;"></view>
  28. <view class="title" style="font-size: 36rpx;">{{item.work.name}}</view>
  29. <view
  30. :class="item.work.progress === 'finish'?'t-icon t-icon-yiwancheng1':'t-icon t-icon-jinhangzhong-copy1'"
  31. style="position: absolute; width: 100rpx; height: 100rpx;margin-left: 570rpx;margin-top: 50rpx;">
  32. </view>
  33. </view>
  34. <view class="cloumn">
  35. <view class="flex_row">
  36. <u-parse class="title" style="font-size: 30rpx;" :content="item.work.description"
  37. :selectable="true"></u-parse>
  38. </view>
  39. <view class="flex_baseline" style="margin-top: 20rpx;">
  40. <view class="subtitle">布置老师:</view>
  41. <view class="title" style="margin-left: 20rpx; font-size: 30rpx;">{{item.work.creatorId}}</view>
  42. <view class="subtitle" style="margin-left: 20rpx;">截至时间:</view>
  43. <view class="title" style="margin-left: 20rpx; font-size: 30rpx;">
  44. {{$timeStampToTime(item.work.endTime)}}</view>
  45. </view>
  46. </view>
  47. <!-- 正文 -->
  48. <view class="content_box">
  49. <view class="title_box"
  50. :style="{backgroundColor: item.work.progress === 'finish'? '#23b46c': '#f9c752' }">
  51. <view class="title_text">作业附件</view>
  52. </view>
  53. <view v-for="(attachment,i) in item.work.attachments" :key="i">
  54. <view class="attachment_box">
  55. <view v-if="attachment.type == 'word'" class="t-icon t-icon-WORD"></view>
  56. <view v-if="attachment.type == 'excel'" class="t-icon t-icon-ECEL"></view>
  57. <view v-if="attachment.type == 'pdf'" class="t-icon t-icon-PDF"></view>
  58. <view v-if="attachment.type == 'image'" class="t-icon t-icon-tupianziliao"></view>
  59. <view v-if="attachment.type == 'ppt'" class="t-icon t-icon-PPT"></view>
  60. <view class="cloumn" style="margin-left: 20rpx;">
  61. <view class="content_detail">文件名: {{attachment.name}}</view>
  62. <view class="content_subtitle">文件大小: {{fixNum(attachment.size/8/1024)}}KB</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import {
  73. mapState,
  74. mapMutations
  75. } from 'vuex'
  76. export default {
  77. computed: {
  78. ...mapState('m_children', ['workData'])
  79. },
  80. data() {
  81. return {
  82. value: '',
  83. dayTime: ''
  84. }
  85. },
  86. onLoad(parameter) {
  87. this.value = parameter.value
  88. this.dayTime = (new Date()).format('M-d').replace('-', '月')
  89. },
  90. methods: {
  91. fixNum(num) {
  92. return num.toFixed(2)
  93. },
  94. navWorkData(index) {
  95. uni.navigateTo({
  96. url: `/subpkg/datalist/workdata?index=${index}`
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. .subtitle {
  104. font-weight: 400;
  105. font-size: 26rpx;
  106. }
  107. .tag {
  108. border-radius: 6rpx;
  109. border: 1rpx solid $color-blue;
  110. padding: 5rpx 16rpx;
  111. .tag_text {
  112. font-size: 22rpx;
  113. color: $color-blue;
  114. }
  115. }
  116. .content_box {
  117. margin: 20rpx;
  118. padding: 0 20rpx;
  119. background-color: #f6f6f6;
  120. border-radius: 10rpx;
  121. .title_box {
  122. position: relative;
  123. top: -20rpx;
  124. width: fit-content;
  125. height: 36rpx;
  126. border-radius: 10rpx;
  127. padding: 5rpx 20rpx;
  128. .title_text {
  129. font-size: 25rpx;
  130. font-weight: bold;
  131. color: #FFF;
  132. }
  133. }
  134. .content_detail {
  135. font-size: 30rpx;
  136. font-weight: bold;
  137. color: $title;
  138. word-break: break-all;
  139. }
  140. .content_subtitle {
  141. font-size: 25rpx;
  142. font-weight: bold;
  143. color: $subtitle;
  144. }
  145. }
  146. .attachment_box {
  147. display: flex;
  148. margin-bottom: 20rpx;
  149. align-items: center;
  150. padding: 15rpx 20rpx;
  151. background-color: #FFF;
  152. border-radius: 10rpx;
  153. .t-icon {
  154. width: 60rpx;
  155. height: 60rpx;
  156. }
  157. }
  158. .flex_cloumn {
  159. margin: 140rpx 0 0 50rpx;
  160. height: 170rpx;
  161. justify-content: space-around;
  162. .content_title {
  163. font-size: 35rpx;
  164. font-weight: bold;
  165. transform: skew(-15deg);
  166. color: #FFF;
  167. z-index: 2;
  168. text-shadow: 1px -1px 0px #c0c0c0, 2px -2px 0px #b0b0b0, 1px -1px 0px #a0a0a0, 2px -2px 0px #909090;
  169. }
  170. .content_subtitle {
  171. font-size: 35rpx;
  172. color: #FFF;
  173. z-index: 2;
  174. }
  175. }
  176. .cloumn {
  177. display: flex;
  178. flex-direction: column;
  179. margin: 20rpx 50rpx;
  180. }
  181. </style>