123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <template>
- <view class="container">
- <!-- 返回按钮 -->
- <back text="详情列表"></back>
- <view style="margin: 20rpx;">
- <u-skeleton :rows="detailList.length" :rowsHeight="height" :loading="loading">
- </u-skeleton>
- </view>
- <view class="detail-box" v-if="!loading">
- <view class="detail-item" v-for="(item,index) in detailList" :key="index" @click="navSingleData(item)">
- <view class="flex" style="width: 100%;height: 90rpx;">
- <view class="flex" style="margin: -30rpx 0 0 10rpx;">
- <view class="index" :style="{backgroundColor: item.work.progress === 'finish'? '#23b46c': '#ff8caf' }"></view>
- <view class="name">{{item.work.name}}</view>
- </view>
-
- <view class="t-icon t-icon-yiwancheng1" v-if="item.work.progress === 'finish'"
- style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
- <view class="t-icon t-icon-jinhangzhong-copy1" v-if="item.work.progress === 'going'"
- style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
- </view>
- <!-- 正文 -->
- <view class="content-box">
- <view class="flex-colum" style="padding: 0 30rpx;">
- <rich-text class="subtitle-info" style="margin-bottom: 15rpx;" :nodes="item.work.description"></rich-text>
- <view class="flex">
- <view class="subtitle">布置老师:</view>
- <view class="subtitle-info" style="margin-left: 10rpx;">{{item.work.creatorId}}</view>
- <view class="subtitle" style="margin-left: 20rpx;">截止时间:</view>
- <view class="subtitle-info" style="margin-left: 10rpx;">{{$timestampToTime(item.work.endTime)}}</view>
- </view>
-
- </view>
- <view class="content-detail-box" style="padding: 0 20rpx;">
- <view class="title-box" :style="{backgroundColor: item.work.progress === 'finish'? '#23b46c': '#ff8caf',top: -15 +'rpx' }">
- <view class="content-subtitle">作业附件</view>
- </view>
- <view v-for="(attachment,i) in item.work.attachments" :key="i" style="margin-bottom: 20rpx;">
- <view class="attachment-box">
- <view v-if="attachment.type == 'word'" class="t-icon t-icon-WORD"></view>
- <view v-if="attachment.type == 'excel'" class="t-icon t-icon-ECEL"></view>
- <view v-if="attachment.type == 'pdf'" class="t-icon t-icon-PDF"></view>
- <view v-if="attachment.type == 'image'" class="t-icon t-icon-tupianziliao"></view>
- <view class="flex-colum" style="margin-left: 20rpx;">
- <view class="content-detail">文件名: {{attachment.name}}</view>
- <view class="content-subtitle" style="color: #aaa;">文件大小: {{fixNum(attachment.size/8/1024)}}KB</view>
- </view>
- </view>
- </view>
-
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapMutations
- } from 'vuex'
- export default {
- computed: {
- ...mapState('m_children', ['detailList'])
- },
- data() {
- return {
- //骨架页配置
- loading: true,
- height: ['200px', '200px', '200px', '200px', '200px', '200px', '200px', '200px', '200px', '200px'],
- };
- },
- onLoad(options) {
- uni.$u.sleep(1500).then(() => {
- this.loading = false
- })
- },
- methods: {
- ...mapMutations('m_children', ['updateDetail']),
- fixNum(num){
- return num.toFixed(2)
- },
- //导航到详情页面
- navSingleData(item){
- this.updateDetail(item)
- uni.navigateTo({
- url: `/subpkg/detail/homework`
- })
- },
- // openDocument(url) {
- // //下载并打开文档
- // uni.downloadFile({
- // url: url,
- // success: function(res) {
- // var filePath = res.tempFilePath;
- // uni.openDocument({
- // filePath: filePath,
- // success: function(res) {
- // console.log('打开文档成功');
- // }
- // });
- // }
- // })
- // }
-
-
- }
- }
- </script>
- <style lang="scss">
- @import '@/subpkg/common/detaillistpage.scss';
- .attachment-box{
- display: flex;
- align-items: center;
- padding: 15rpx 20rpx;
- background-color: #FFF;
- border-radius: 10rpx;
- }
- .flex-colum{
- display: flex;
- flex-direction: column;
- }
- </style>
|