worklist.vue 5.3 KB

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