homework.vue 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="container">
  3. <!-- 返回按钮 -->
  4. <back text="作业详情"></back>
  5. <view class="detail-item">
  6. <view class="flex" style="width: 100%;height: 90rpx;">
  7. <view class="flex" style="margin: -30rpx 0 0 10rpx;">
  8. <view class="index" :style="{backgroundColor: singleDetail.work.progress === 'finish'? '#23b46c': '#ff8caf' }"></view>
  9. <view class="name">{{singleDetail.work.name}}</view>
  10. </view>
  11. <view class="t-icon t-icon-yiwancheng1" v-if="singleDetail.work.progress === 'finish'"
  12. style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
  13. <view class="t-icon t-icon-jinhangzhong-copy1" v-if="singleDetail.work.progress === 'going'"
  14. style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
  15. </view>
  16. <!-- 正文 -->
  17. <view class="content-box">
  18. <view class="flex-colum" style="padding: 0 30rpx;">
  19. <rich-text class="subtitle-info" style="margin-bottom: 15rpx;" :nodes="singleDetail.work.description"></rich-text>
  20. <view class="flex">
  21. <view class="subtitle">布置老师:</view>
  22. <view class="subtitle-info" style="margin-left: 10rpx;">{{singleDetail.work.creatorId}}</view>
  23. <view class="subtitle" style="margin-left: 20rpx;">截止时间:</view>
  24. <view class="subtitle-info" style="margin-left: 10rpx;">{{$timestampToTime(singleDetail.work.endTime)}}</view>
  25. </view>
  26. </view>
  27. <view class="content-detail-box" style="padding: 0 20rpx;">
  28. <view class="title-box" :style="{backgroundColor: singleDetail.work.progress === 'finish'? '#23b46c': '#ff8caf',top: -15 +'rpx' }">
  29. <view class="content-subtitle">作业附件</view>
  30. </view>
  31. <view v-for="(attachment,i) in singleDetail.work.attachments" :key="i" style="margin-bottom: 20rpx;">
  32. <view class="attachment-box" @click="openDocument(attachment.url)">
  33. <view v-if="attachment.type == 'word'" class="t-icon t-icon-WORD"></view>
  34. <view v-if="attachment.type == 'excel'" class="t-icon t-icon-ECEL"></view>
  35. <view v-if="attachment.type == 'pdf'" class="t-icon t-icon-PDF"></view>
  36. <view v-if="attachment.type == 'image'" class="t-icon t-icon-tupianziliao"></view>
  37. <view class="flex-colum" style="margin-left: 20rpx;">
  38. <view class="content-detail">文件名: {{attachment.name}}</view>
  39. <view class="content-subtitle" style="color: #aaa;">文件大小: {{fixNum(attachment.size/8/1024)}}KB</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. mapState,
  51. mapMutations
  52. } from 'vuex'
  53. export default {
  54. computed: {
  55. ...mapState('m_children', ['singleDetail'])
  56. },
  57. data(){
  58. return{
  59. };
  60. },
  61. onLoad() {
  62. },
  63. methods:{
  64. fixNum(num){
  65. return num.toFixed(2)
  66. },
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. @import '@/subpkg/common/detailpage.scss';
  72. .attachment-box{
  73. display: flex;
  74. align-items: center;
  75. padding: 15rpx 20rpx;
  76. background-color: #FFF;
  77. border-radius: 10rpx;
  78. }
  79. .flex-colum{
  80. display: flex;
  81. flex-direction: column;
  82. }
  83. </style>