traineeInterList.vue
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<view class="current2" :style="vuex_theme">
<view v-if="list.length > 0" >
<view class="list">
<view v-for="(item,index) in list" :key="index" @click="handelClick(item)">
<view class="list-item">
<view style="display: flex; align-items: center;">
<text>实习单号:</text>
<text class="green">{{item.number}}</text>
</view>
<view style="display: flex; align-items: center; margin-top: 15rpx;">
<text>实习时间: {{`${timeFormat(item.startTime,'yyyy/mm/dd')} - ${timeFormat(item.endTime,'yyyy/mm/dd')}`}}</text>
</view>
<view style="display: flex; align-items: center; margin-top: 15rpx;">
<text>实习企业: {{item.companyName}}</text>
</view>
<view style="display: flex; align-items: center; margin-top: 15rpx;">
<text>实习岗位: {{item.jobName}}</text>
</view>
</view>
</view>
</view>
<view style="height: 40rpx;"></view>
<c-loading :loading="loading"></c-loading>
<view style="height: 40rpx;"></view>
</view>
<view v-else style="width: 100%; height: 100%;">
<view style="margin: 150px auto 0; width: 187px;height: 110px;">
<image style="width: 187px;height: 110px;" :src="vuex_baseImgUrl && `${vuex_baseImgUrl}nodata.png`"></image>
</view>
<view style="width: 100%; margin-top: 10px; text-align: center; font-size: 13px; color: #121212;">暂无数据</view>
</view>
</view>
</template>
<script>
import {
getforminternshipInfoApi
} from '@/config/api.js';
import listMixin from "@/common/mixins/list-mixin.js";
export default {
mixins: [listMixin],
data() {
return {
id: '',
list: []
}
},
onLoad(e) {
console.log(e)
this.id = e.id
this.finished = false;
this.loading = "loadmore";
this.page = 0;
this.list = [];
this._getList();
},
methods: {
loadData() {
scoredetailUrl(this.id).then(res => {
if (res) {
this.detailObj = res;
this.detailObj.form.endTime = this.timeFormat(this.detailObj.form.endTime,'yyyy-mm-dd')
this.stuhandleDataspdf()
this.comhandleDataspdf()
this.schhandleDataspdf()
}
})
},
timeFormat(timestamp, format = 'yyyy-mm-dd hh:MM') {
return timestamp > 0 ? uni.$u.timeFormat(timestamp, format) : '--'
},
handelClick(e) {
// this.$u.route({
// url: `pages/main/home/achievementDetail/achievementDetail?&id=${e.id}`
// })
this.$u.route({
url: `pages/main/internship/intershipInfo/intershipInfo?id=${e.id}`
})
},
// 模拟后端分页
async getData(requestParams) {
const {
search = {}
} = requestParams;
let params = {};
params.pageNumber = requestParams.page + 1;
params.pageSize = 10;
params.entryId = this.id;
console.log(12312312,params)
return await getforminternshipInfoApi(params);
},
// 数据请求(没错就是这么少的代码)
async _getList() {
if (this.page == 0) {
this.list = [];
}
uni.showLoading({
title: '数据加载中~',
mask: true
})
// 根据实际情况修改自己修改key
let result = await this.getData({
page: this.page, // 传入页码
size: this.size, // 传入每页条数
search: this.search, // 传入搜索的对象
});
// console.log(result.records)
this.total = result.total;
result.records.map((item) => {
this.list.push(item);
});
if (this.list.length == this.total) {
this.finished = true;
this.loading = 'nomore';
}
uni.hideLoading();
},
}
}
</script>
<style>
page {
background-color: #F7F7F7;
}
</style>
<style lang="scss" scoped>
.current2 {
padding: 20rpx 20rpx 0;
.list-item {
// width: 100%;
// height: 150px;
padding: 36rpx 40rpx;
background: #FFFFFF;
margin-bottom: 10px;
text {
font-size: 14px;
font-family: PingFangSC-Light, PingFang SC;
font-weight: 300;
color: rgba(0,0,0,0.65);
max-width: 90%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.green {
margin-left: 5px;
color: var(--primary-color);
}
}
}
</style>