result_list.vue
11.3 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<template>
<view class="wrap_box">
<!-- <uParse v-if="datas" :content="datas"></uParse> -->
<view class="tel_index_bg"></view>
<view class="vio_list">
<scroll-view scroll-x="" class="top_tabs scroll_x">
<view class="vip_tab_list">
<view v-if="options.type==0" v-for="(item,index) in tabs" class="vip_tab_li" :class="{active:active==index}" @click="setac_fuc(index)">
{{item.title}}
</view>
<view v-if="options.type==1" v-for="(item,index) in tabs1" class="vip_tab_li" :class="{active:active==index}" @click="setac_fuc(index)">
{{item.title}}
</view>
<view v-if="options.type==2" v-for="(item,index) in tabs2" class="vip_tab_li" :class="{active:active==index}" @click="setac_fuc(index)">
{{item.title}}
</view>
</view>
</scroll-view>
<view class="main_list">
<view class="vio_sx dis_flex aic ju_b">
<picker mode="date" :value="vio_time" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="vio_time">
{{vio_time?vio_time:'选择时间'}}<text class="icon icon-xiala"></text>
</view>
</picker>
<!-- 公务员 -->
<picker v-if="tabs[active].list && options.type==0" @change="bindpickerChange" :value="index" :range="tabs[active].list" range-key="title">
<view class="vio_time">
{{tabs[active].list?tabs[active].list[index].title:'选择时间'}}<text class="icon icon-xiala"></text>
</view>
</picker>
<!-- 事业单位 -->
<picker v-if="tabs1[active].list && options.type==1" @change="bindpickerChange" :value="index" :range="tabs1[active].list" range-key="title">
<view class="vio_time">
{{tabs1[active].list?tabs1[active].list[index].title:'选择时间'}}<text class="icon icon-xiala"></text>
</view>
</picker>
</view>
<view class="result_li" v-for="(item,index) in datas">
<view class="flex_1">
<view class="result_name">
{{item.title}}
</view>
<view class="result_time">
{{item.add_time}}
</view>
</view>
<view class="result_num">
<!-- {{item.num}}分 -->
{{item.num}}%
</view>
</view>
<u-empty v-if="datas.length==0"
mode="data"
text="暂无数据"
icon="/static/images/tch/img_blank.png"
>
</u-empty>
</view>
</view>
<!-- 阻止滑动 -->
<!-- <view @touchmove.stop.prevent='test'></view> -->
</view>
</template>
<script>
import Vue from 'vue'
import {
mapState,
mapMutations
} from 'vuex'
var that
export default {
data() {
return {
options:{},
//分类1、行测 2、申论 3、职业能力 4、综合运用 5、专业课’, 6行测模考 7申论模考
tabs:[
{
title:'行测模考成绩',
id:1
},
{
title:'申论模考成绩',
id:2
},
{
title:'行测模块成绩',
id:1,
list:[
{
title:'常识判断',
id:4
},
{
title:'逻辑填空',
id:5,
ids: 18
},
{
title:'片段阅读',
id:5,
ids: 19
},
{
title:'图形推理',
id:6,
ids: 20
},
{
title:'类比推理',
id:6,
ids: 21
},
{
title:'定义判断',
id:6,
ids: 22
},
{
title:'逻辑判断',
id:6,
ids: 23
},
{
title:'数量关系',
id:7,
ids: undefined
},
{
title:'资料分析',
id:8,
ids: undefined
},
]
},
{
title:'申论模块成绩',
id:2,
list:[
{
title:'申论概括',
id:10
},
{
title:'申论分析',
id:11
},
{
title:'申论公文',
id:12
},
{
title:'申论大作文',
id:13
},
]
},
{
title:'三支一扶',
id:40
}
],
tabs1:[
{
title:'职业能力测试模考成绩',
id:24,
ids: 30
},
{
title:'职业能力测试模块成绩',
id:24,
list:[
{
title:'常识判断',
id:25
},
{
title:'逻辑填空',
id:26,
ids: 31
},
{
title:'片段阅读',
id:26,
ids: 32
},
{
title:'图形推理',
id:27,
ids: 33
},
{
title:'类比推理',
id:27,
ids: 34
},
{
title:'定义判断',
id:27,
ids: 35
},
{
title:'逻辑判断',
id:27,
ids: 36
},
{
title:'数量关系',
id:28
},
{
title:'资料分析',
id:29
},
{
title:'综合分析',
id:37
},
{
title:'策略选择',
id:38
}
]
},
{
title:'综合运用能力模考成绩',
id:15
},
],
tabs2:[
{
title:'专业课成绩',
id:3,
ids: 16
},
{
title:'两学成绩',
id:3,
ids:17
},
{
title:'特岗模考',
id:3,
ids:39
}
],
active:0,
index:0,
vio_time:'',
datas:[]
}
},
computed: {
...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime']),
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
onLoad(e) {
that=this
that.options=e||{}
console.log(e)
if(e.type==0){
uni.setNavigationBarTitle({
title:'公务员成绩查看'
})
}
if(e.type==1){
uni.setNavigationBarTitle({
title:'事业单位成绩查看'
})
}
if(e.type==2){
uni.setNavigationBarTitle({
title:'特岗教师成绩查看'
})
}
// that.getdata()
that.onRetry()
},
onShow() {
},
methods: {
// ...mapMutations(['wxshouquan','login']),
test(){},
onRetry(){
that.page=1
that.getdata()
},
getdata(){
var mytype=1
var mytype_s=-1
let mytype_t=undefined
console.log(mytype)
if(that.options.type==0){
mytype=that.tabs[that.active].id
if(that.active === 2 || that.active === 3){
let selectItem = that.tabs[that.active].list[that.index]
mytype_s=selectItem.id
if(selectItem.ids){
mytype_t = selectItem.ids
}
}
}
if(that.options.type==1){
mytype=that.tabs1[that.active].id
mytype_s=that.tabs1[that.active].ids || that.tabs1[that.active].id
if(that.active === 1) {
let selectItem = that.tabs1[that.active].list[that.index]
mytype_s=selectItem.id
if(selectItem.ids){
mytype_t = selectItem.ids
}
}
}
if(that.options.type==2){
mytype=that.tabs2[that.active].id
mytype_s=that.tabs2[that.active].ids
}
var datas={
type: mytype,
page:that.page,
time:that.vio_time,
limit:20
}
if(mytype_s>0){
datas={
type: mytype,
type_s:mytype_s,
type_t: mytype_t,
page:that.page,
time:that.vio_time,
limit:20
}
}
if(mytype == 1 && that.active !== 2) {
datas.type_s = 9
}
if(mytype == 15) {
delete datas.type_s
}
if(that.btnkg==1){
return
}
that.btnkg=1
var nowpage=that.page
var jkurl='/result/see'
that.$service.P_post(jkurl, datas).then(res => {
that.btnkg = 0
console.log(res)
if (res.code == 1) {
that.htmlReset = 0
var datas = res.data
console.log(typeof datas)
if (typeof datas == 'string') {
datas = JSON.parse(datas)
}
console.log(res)
if(nowpage==1){
that.datas = datas.data
}else{
if (datas.length == 0) {
that.data_last = true
return
}
that.data_last = false
that.datas = that.datas.concat(datas.data)
}
that.page++
} else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '获取数据失败'
})
}
}
}).catch(e => {
that.htmlReset = 1
that.btnkg = 0
// that.$refs.htmlLoading.htmlReset_fuc(1)
console.log(e)
uni.showToast({
icon: 'none',
title: '获取数据失败,请检查您的网络连接'
})
})
},
setac_fuc(index){
if(that.active==index){
return
}
that.active=index
this.index=0
that.onRetry()
},
bindDateChange(e){
this.vio_time = e.detail.value
this.onRetry()
},
bindpickerChange(e){
this.index = e.detail.value
that.onRetry()
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
getimg(img){
return service.getimg(img)
},
jump(e) {
var that = this
if (that.btnkg == 1) {
return
} else {
that.btnkg = 1
setTimeout(function() {
that.btnkg = 0
}, 2000)
}
console.log(e.currentTarget.dataset.type)
service.jump(e)
},
goback(){
uni.navigateBack()
},
func(){
// that.$store.commit('setSystem',datas.system)
}
}
}
</script>
<style lang="scss" scoped>
.wrap_box{
width: 100%;
// padding: 30rpx;
min-height: 100vh;
// #ifdef H5
min-height: calc(100vh - 44px);
// #endif
background: #F8F8F8;
position: relative;
}
.tel_index_bg {
position: absolute;
top: 0;
z-index: 1;
width: 100%;
min-height: 220rpx;
background: linear-gradient(0deg, #f8f8f8 0%, #5D9DFD 60%, #428EFE 70%, #2D81FF 100%);
}
.top_tabs{
width: 100%;
}
.vip_tab_list{
// padding: 0 30rpx;
}
.vip_tab_li{
height: 90rpx;
display: inline-flex;
align-items: center;
font-size: 30rpx;
color: #FFFFFF;
opacity: 0.6;
position: relative;
&+.vip_tab_li{
margin-left: 50rpx;
}
&.active{
opacity: 1;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 50%;
margin-left: -18rpx;
width: 36rpx;
height: 6rpx;
background: #FFFFFF;
border-radius: 3rpx;
}
}
}
.vio_sx{
padding:0 30rpx;
justify-content: space-between;
}
.vio_time{
// padding: 0 24rpx;
font-size: 30rpx;
color: #7D8087;
letter-spacing: 0;
display: flex;
align-items: center;
.icon{
font-size: 20rpx;
margin-left: 5rpx;
color: #999999;
opacity: .5;
}
}
.vio_list{
width: 100%;
padding: 0 30rpx 30rpx;
position: relative;
z-index: 2;
.main_list{
margin-top: 20rpx;
background: #FFFFFF;
border-radius: 10rpx;
padding-top: 30rpx;
}
.result_li{
width: 100%;
min-height: 136rpx;
display: flex;
align-items: center;
padding:25rpx 30rpx;
&+.result_li{
border-top: 1rpx solid #eee;
}
.result_name{
font-size: 30rpx;
color: #545D71;
margin-bottom: 12rpx;
}
.result_time{
font-size: 28rpx;
font-family: Arial;
font-weight: 400;
color: #B2B5BB;
}
.result_num{
font-size: 32rpx;
color: #2D81FF;
}
}
}
</style>