worklist.vue 5.6 KB

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