123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <style lang="less">
- .all-file {
- width: 100%;
- }
- .bg {
- color: #ccc;
- }
- .file-item {
- width: 100%;
- height: 140rpx;
- border-bottom: 2rpx solid #F0F0F0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 18rpx;
- box-sizing:border-box;
- .dian {
- width:100rpx;
- height: 60rpx;
- image {
- width: 44rpx;
- height: 10rpx;
- }
- }
- .file {
- display: flex;
- image {
- width:80rpx;
- height: 76rpx;
- margin-right: 26rpx;
- }
- .file-explain {
- display: flex;
- flex-direction: column;
- justify-content: center;
- .title {
- font-size:28rpx;
- font-weight: bolder;
- }
- .time {
- font-size: 24rpx;
- color: #909090;
- }
- }
- }
- }
- </style>
- <template>
- <view class="all-file">
- <repeat for="{{fileList}}" key="index" index="index" item="item">
- <view class="file-item {{item.taskJoinUser.fileStatus === 'CLOSE' ? 'bg' : ''}}" wx:if="{{item.task}}" @tap="detail({{item.task}}, {{item.taskJoinUser.fileStatus}})">
- <view class="file">
- <image src="../static/img/file{{item.taskJoinUser.fileStatus === 'CLOSE' ? '_b' : ''}}.png"></image>
- <view class="file-explain">
- <text class="title">{{item.task.title}}</text>
- <text class="time">{{timeList[index]}}</text>
- </view>
- </view>
- <view class="dian" @tap.stop="operation({{index}}, {{item.taskJoinUser.fileStatus}})">
- <image src="../static/img/dian{{item.taskJoinUser.fileStatus === 'CLOSE' ? '_b' : ''}}.png"></image>
- </view>
- </view>
- </repeat>
- </view>
- <del :syncFlag.sync="flag" :index.sync="index" :fileList.sync="fileList"/>
- </template>
- <script>
- import wepy from 'wepy'
- import Del from './del'
- import { httpRequestApi } from '../util/httpRequestApi'
- import { formDate } from '../util/utils'
- export default class AllFile extends wepy.component {
- data = {
- fileList: [],
- flag: 'false',
- timeList: [],
- index: 0,
- totalNo: 0
- }
- components = {
- del: Del
- }
- methods = {
- detail (task, fileStatus) {
- if (fileStatus === 'CLOSE') {
- return false
- }
- const id = task.id ? task.id : ''
- const title = task.title ? task.title : ''
- this.$root.$navigate(`/pages/detail?id=${id}&title=${title}`)
- },
- operation (ind, fileStatus) {
- if (fileStatus === 'CLOSE') {
- return false
- }
- this.flag = 'true'
- this.index = ind
- },
- getTaskList: (pageNo, pageSize, type) => {
- httpRequestApi.getTaskList(pageNo, pageSize).success(res => {
- this.totalNo = res.data.data.totalNo
- if (type) {
- this.fileList = res.data.data.list
- }
- res.data.data.list.forEach(item => {
- if (!type) {
- this.fileList.push(item)
- }
- if (item.task) {
- this.timeList.push(formDate(item.task.gmtCreated))
- }
- })
- this.$apply()
- })
- }
- }
- }
- </script>
|