123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <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">
- <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" v-if="item.work.progress === 'going'"
- style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
- <view class="t-icon t-icon-daifabu" v-if="item.work.progress === 'pending'"
- style="margin-left: auto; width: 90rpx; height: 90rpx;"></view>
- </view>
- <!-- 正文 -->
- <view class="content-box">
- <view style="display:flex;flex-direction: column;padding: 0 20rpx;">
- <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">
- <view class="attachment-box" @click="openDocument">
- <view class="t-icon t-icon-WORD"></view>
- <view style="display: flex;flex-direction: column;margin-left: 20rpx;">
- <view class="content-detail">文件名: {{item.work.attachments[0].name}}</view>
- <view class="content-subtitle">文件大小: {{item.work.attachments[0].size/8/1024}}KB</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: {
- openDocument() {
- //下载并打开文档
- uni.downloadFile({
- url: 'https://cdn.zhoukaiwen.com/kevin.pdf',
- success: function(res) {
- var filePath = res.tempFilePath;
- uni.openDocument({
- filePath: filePath,
- success: function(res) {
- console.log('打开文档成功');
- }
- });
- }
- })
- }
-
-
- }
- }
- </script>
- <style lang="scss">
- @import '@/subpkg/common/detailpage.scss';
- .attachment-box{
- display: flex;
- align-items: center;
- padding: 10rpx;
- border-radius: $card-border-radius;
- }
- </style>
|