app_evaluating/pages/index/index.vue

221 lines
4.8 KiB
Vue
Raw Normal View History

2020-01-09 16:29:09 +08:00
<template>
2020-01-10 14:30:31 +08:00
<view>
<view class="content" v-for="(evaluation,index) in evaluations" :key="index" @tap="itemClick(evaluation)"
:data-taskid="evaluation.taskId">
2020-01-09 17:45:45 +08:00
<view class="item-li">
2020-01-10 14:30:31 +08:00
<view class="item-title">{{index + 1}}.{{evaluation.taskName}}</view>
<view class="item-content">{{evaluation.evaluationName}}</view>
<view class="item-bottom-box">
<view class="item-tag-box">
<view class="item-time">
{{evaluation.taskStartTime.substring(0, 10)}}{{evaluation.taskEndTime.substring(0, 10)}}
</view>
<view class="item-tag">
2020-01-09 17:45:45 +08:00
<text v-if="evaluation.taskType === 1">{{evaluation.taskTypeContent.split('|')[1]}} [测评部门]</text>
<text v-if="evaluation.taskType === 2">{{evaluation.taskTypeContent.split('|')[2]}} [测评人员]</text>
</view>
</view>
2020-01-10 14:30:31 +08:00
<view class="item-count-tag">
<view class="item-count-yet">{{evaluation.taskRecordSubmitCount.substring(0,evaluation.taskRecordSubmitCount.lastIndexOf('|'))}}
2020-01-09 16:29:09 +08:00
</view>
2020-01-10 14:30:31 +08:00
<text style="color: #FFFFFF;" space="emsp" decode="true">{{divider}}</text>
<view class="item-count-not">
{{evaluation.taskRecordSubmitCount.substring(evaluation.taskRecordSubmitCount.lastIndexOf('未'),evaluation.taskRecordSubmitCount.length)}}</view>
2020-01-09 16:29:09 +08:00
</view>
</view>
2020-01-10 14:30:31 +08:00
</view>
</view>
2020-01-09 16:29:09 +08:00
</view>
2020-01-10 14:30:31 +08:00
2020-01-09 16:29:09 +08:00
</template>
<script>
import uniList from "@/components/uni-list/uni-list.vue"
import uniListItem from "@/components/uni-list-item/uni-list-item.vue"
import uniLoadMore from "@/components/uni-load-more/uni-load-more.vue"
import common from '../../common/common.js'
var _self;
export default {
components: {
uniList,
uniListItem,
uniLoadMore
},
data() {
return {
token: '',
2020-01-10 14:30:31 +08:00
divider: '&nbsp;|&nbsp;',
2020-01-09 16:29:09 +08:00
evaluations: [],
more: 'more',
uploadContentText: {
contentdown: '点击加载更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
}
}
},
onLoad() {
_self = this;
var appToken = uni.getStorageSync('appToken');
if (!appToken) {
uni.reLaunch({
url: '../login/index'
});
}
_self.token = appToken;
uni.startPullDownRefresh({});
_self.initData();
},
onPullDownRefresh() {
var self = this;
uni.startPullDownRefresh({});
self.initData();
},
methods: {
initData() {
var self = this;
var listUrl = common.evalutaionBaseUrl + '/app/apptask/listtasktoapp';
uni.request({
url: listUrl,
data: {
taskRecordIsSubmit: '0'
},
header: {
'token': _self.token
},
success(res) {
uni.stopPullDownRefresh();
if (res.data != undefined && res.data.length > 0) {
_self.evaluations = res.data
} else {
uni.showToast({
title: '暂无数据',
duration: 2000
})
}
},
fail(error) {
uni.stopPullDownRefresh();
uni.showToast({
title: '加载失败,请重试',
duration: 2000
})
}
})
},
itemClick(e) {
console.log(e);
uni.navigateTo({
url: '../evaluation/doEvaluation?taskId=' + e.taskId
})
},
clickLoadMore(e) {
var self = this;
self.more = 'loading';
setTimeout(() => {
self.more = 'noMore';
setTimeout(() => {
self.more = 'more';
}, 1000);
}, 2000);
}
}
}
</script>
<style>
2020-01-10 14:30:31 +08:00
.content {
width: 100%;
display: flex;
margin-top: 20rpx;
flex-direction: column;
align-items: center;
justify-content: center;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-count {
font-size: 15rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-li {
display: flex;
flex-direction: column;
height: auto;
justify-content: space-between;
align-items: flex-start;
min-width: 50%;
width: 95%;
min-width: 95%;
min-height: 180rpx;
margin: 10rpx;
background: #FFFFFF;
padding: 5rpx;
border-radius: 10rpx;
box-shadow: 8rpx 8rpx 10rpx #d9d9d9;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-title {
font-size: 28rpx;
font-weight: bold;
color: #000000;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-content {
font-size: 30rpx;
color: #000000;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-count-tag {
display: flex;
font-size: 20rpx;
color: #000000;
background: #008B8B;
padding: 10rpx;
height: 35rpx;
align-items: center;
text-align: center;
border-radius: 10rpx;
box-shadow: 8rpx 8rpx 10rpx #d9d9d9;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-count-yet {
color: #FFFFFF;
2020-01-09 16:29:09 +08:00
}
2020-01-10 14:30:31 +08:00
.item-count-not {
color: #f9e9c3;
2020-01-09 16:29:09 +08:00
}
2020-01-09 17:45:45 +08:00
2020-01-10 14:30:31 +08:00
.item-tag-box {
2020-01-09 17:45:45 +08:00
display: flex;
flex-direction: column;
2020-01-10 14:30:31 +08:00
align-items: flex-start;
}
.item-bottom-box {
display: flex;
margin-top: 15rpx;
flex-direction: row;
align-items: center;
2020-01-09 17:45:45 +08:00
justify-content: space-between;
2020-01-10 14:30:31 +08:00
width: 97%;
}
.item-time {
font-size: 25rpx;
color: #000000;
}
.item-tag {
display: flex;
justify-content: center;
2020-01-09 17:45:45 +08:00
align-items: flex-start;
2020-01-10 14:30:31 +08:00
text-align: left;
font-size: 25rpx;
2020-01-09 17:45:45 +08:00
}
2020-01-09 16:29:09 +08:00
</style>