cshenfu
2024-06-27 58aa6e282bb343503be3cb198948328ea3ed7b79
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
<template>
    <view class="page_bg">
        <!-- #ifdef APP-PLUS -->
        <view class="status_bar">
            <view class="top_view"></view>
        </view>
        <!-- #endif -->
        <view class="top_nav">
            <image src="/static/local/3546451940011a031009b939a8b26314.png" class="image_1" @click="pageBack" />
            <view class="cate">练习报告</view>
        </view>
        <scroll-view scroll-y="true" class="scroll_bg">
            <view class="flex-col section_2">
                <view class="flex-col items-center group_2">
                    <custom-progress :value="rightPro" :border_width="16" class="cus_pro" :progress_time="600">
                    </custom-progress>
                    <view class="content">
                        <text class="uni-text">答对</text>
                        <text class="uni-text"><text class="hav">{{rightLength}}</text> /{{questionLength}}</text>
                    </view>
                </view>
                <view class="flex-col group_4">
                    <image src="/static/local/f763a2c78a597fab3f429dc5644387de.png" class="image_2" />
                    <view class="flex-row group_5">
                        <text class="text_4">{{type}}:</text>
                        <text class="text_5">{{title}}</text>
                    </view>
                    <view class="flex-row group_6">
                        <text class="text_6">交卷时间:</text>
                        <text class="text_7">{{time}}</text>
                    </view>
                </view>
            </view>
            <view class="answer_card">
                <view class="justify-between group_7">
                    <text class="text_8">答题卡</text>
                    <view class="flex-row group_8">
                        <view class="flex-row">
                            <image src="/static/local/0f815703ecb73750726312b7eed067da.png" class="image_3" />
                            <text class="text_9">答对</text>
                        </view>
                        <view class="flex-row group_10">
                            <image src="/static/local/8ccc46396aea17e452a88d24d521f0b3.png" class="image_3" />
                            <text class="text_10">答错</text>
                        </view>
                        <view class="flex-row group_11">
                            <image src="/static/local/db165dd417d5ea7ae30be04e28bcb3bc.png" class="image_3" />
                            <text class="text_11">未答</text>
                        </view>
                    </view>
                </view>
                <view class="answer_show">
                    <view class="group_12" v-if="single.length > 0">
                        <view class="title">单选题</view>
                        <view class="base_circle" :class="cType(item)" v-for="item in single">{{item.no}}</view>
                    </view>
 
                    <view class="group_12" v-if="more.length > 0">
                        <view class="title">多选题</view>
                        <view class="base_circle" :class="cType(item)" v-for="item in more">{{item.no}}</view>
                    </view>
 
                    <view class="group_12" v-if="judge.length > 0">
                        <view class="title">判断题</view>
                        <view class="base_circle" :class="cType(item)" v-for="item in judge">{{item.no}}</view>
                    </view>
                </view>
            </view>
            <view class="empty"></view>
        </scroll-view>
        <view class="end_btns">
            <block v-if="questionLength > 0 && rightLength < questionLength">
                <view class="btn" @tap="jumpToCheck">全部解析</view>
                <view class="btn wrong" @tap="jumpToCheck">错误解析</view>
            </block>
            <block v-else>
                <view class="btn" @tap="back">返回题库</view>
            </block>
        </view>
    </view>
</template>
 
<script>
    var that; // 当前页面对象
    var vk; // vk依赖
    export default {
        data() {
            // 页面数据变量
            return {
                typeId: '',
                title: '',
                type: '',
                time: '',
                questionLength: 0,
                rightLength: 0,
                single: [],
                more: [],
                judge: []
            }
        },
        // 监听 - 页面每次【加载时】执行(如:前进)
        onLoad(options = {}) {
            that = this;
            vk = that.vk;
            that.init(options)
        },
        // 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快,会在页面进入动画完成前触发
        onReady() {},
        // 监听 - 页面每次【显示时】执行(如:前进和返回) (页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面)
        onShow() {},
        // 监听 - 页面每次【隐藏时】执行(如:返回)
        onHide() {},
        // 函数
        computed: {
            // 准确率
            rightPro() {
                return this.rightLength / this.questionLength * 100
            },
            // 回答状态class
            cType() {
                return (item) => {
                    switch (item.status) {
                        case 1:
                            return 'right'
                        case 2:
                            return 'wrong'
                        default:
                            return ''
                    }
                }
            }
        },
        methods: {
            // 页面数据初始化函数
            init(options) {
                this.typeId = options.id
                this.title = options.title
                this.type = options.type
                this.time = options.time
                let data = vk.getStorageSync('exam-result')
                if (!data) return console.log('data is null!')
                this.questionLength = data.questions.length
                data.questions.map(v => {
                    let obj = { no: v.no, status: null }
                    let obj2 = data.answerCardNow[v._id]
                    if (obj2) obj.status = obj2.a != null ? obj2.r : null
                    if (obj.status == 1) this.rightLength++
                    switch (v.type) {
                        case '1':
                            that.single.push(obj)
                            break
                        case '2':
                            that.more.push(obj)
                            break
                        case '3':
                            that.judge.push(obj)
                            break
                    }
                })
            },
            pageBack() {
                uni.navigateBack({
                    delta: 1
                })
            },
            // 跳转解析
            jumpToCheck() {
                uni.navigateTo({
                    url: `/pages/question-bank/practice-page?pageTitle=${this.type}&id=${this.typeId}&check=true`
                });
            },
            back() {
                vk.navigateTo('/pages/question-bank/index');
                uni.$emit('bankUpdate');
            }
        },
    }
</script>
 
<style lang="scss" scoped>
    .page_bg {
        width: 100%;
        height: 100vh;
        background-image: url('../../static/local/16403089590017478445.png');
        background-position: 0px 0px;
        background-size: 100% 479rpx;
        background-repeat: no-repeat;
 
        .status_bar,
        .top_view {
            background-color: #FDCF03;
        }
 
        .top_nav {
            padding-bottom: 24rpx;
            color: rgb(51, 51, 51);
            font-size: 34rpx;
            line-height: 41rpx;
            white-space: nowrap;
            // height: 90rpx;
            position: relative;
 
            .image_1 {
                left: 21rpx;
                top: 27rpx;
                width: 19rpx;
                height: 35rpx;
                position: absolute;
            }
 
            .cate {
                width: 100%;
                padding: 20rpx 0;
                color: rgb(51, 51, 51);
                font-size: 34rpx;
                font-weight: 500;
                line-height: 41rpx;
                white-space: nowrap;
                text-align: center;
            }
        }
 
        .scroll_bg {
            height: calc(100% - 206rpx);
        }
 
        .section_2 {
            background-color: rgb(255, 255, 255);
            box-shadow: 0px 6rpx 16rpx 0px rgba(174, 99, 0, 0.12);
            border-radius: 12rpx;
            margin: 0 20rpx 16rpx;
 
            .group_2 {
                padding: 126rpx 0;
                position: relative;
 
                .cus_pro {
                    transform: scale(0.7);
                    position: absolute;
                    top: 60rpx;
                }
 
                .content {
                    font-size: 24rpx;
                    position: absolute;
                    top: 120rpx;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    color: #666666;
 
                    .uni-text {
                        text-align: center;
                    }
 
                    .hav {
                        font-size: 52rpx;
                        font-weight: bold;
                        margin-right: 4rpx;
                        line-height: 58rpx;
                        color: #333;
                    }
                }
            }
 
            .group_4 {
                padding-bottom: 34rpx;
 
                .image_2 {
                    width: 94.5vw;
                    height: 0.5vw;
                }
 
                .group_5 {
                    margin-top: 24rpx;
                    padding: 0 20rpx;
 
                    .text_4 {
                        color: rgb(153, 153, 153);
                        font-size: 24rpx;
                        line-height: 29rpx;
                        white-space: nowrap;
                    }
 
                    .text_5 {
                        margin-left: 15rpx;
                        flex: 1 1 auto;
                        color: rgb(51, 51, 51);
                        font-size: 24rpx;
                        line-height: 28rpx;
                        text-align: left;
                    }
                }
 
                .group_6 {
                    margin-top: 35rpx;
                    padding: 0 20rpx;
 
                    .text_6 {
                        color: rgb(153, 153, 153);
                        font-size: 24rpx;
                        line-height: 29rpx;
                        white-space: nowrap;
                    }
 
                    .text_7 {
                        margin-left: 15rpx;
                        color: rgb(51, 51, 51);
                        font-size: 24rpx;
                        line-height: 29rpx;
                        white-space: nowrap;
                    }
                }
            }
        }
 
        .answer_card {
            background: #FFFFFF;
            box-shadow: 0px 6rpx 16rpx rgba(174, 99, 0, 0.12);
            border-radius: 12rpx;
            margin: 20rpx;
            padding: 34rpx 20rpx;
 
            .group_7 {
                padding-left: 16rpx;
                padding-right: 11rpx;
                align-items: center;
 
                .text_8 {
                    color: rgb(51, 51, 51);
                    font-size: 32rpx;
                    line-height: 38rpx;
                    white-space: nowrap;
                }
 
                .group_8 {
                    color: rgb(51, 51, 51);
                    font-size: 24rpx;
                    white-space: nowrap;
 
                    .flex-row {
                        align-items: center;
                    }
 
                    .group_10 {
                        margin-left: 39rpx;
 
                        .text_10 {
                            margin-left: 8rpx;
                        }
                    }
 
                    .group_11 {
                        margin-left: 39rpx;
 
                        .text_11 {
                            margin-left: 8rpx;
                        }
                    }
 
                    .text_9 {
                        margin-left: 8rpx;
                    }
 
                    .image_3 {
                        margin: 5rpx 0;
                        width: 18rpx;
                        height: 18rpx;
                    }
                }
            }
 
            .answer_show {
                .group_12 {
                    display: flex;
                    flex-wrap: wrap;
 
                    .title {
                        width: 100%;
                        padding: 28rpx 0 12rpx 20rpx;
                    }
 
                    .base_circle {
                        width: 72rpx;
                        height: 72rpx;
                        background: rgba(255, 255, 255, 0.39);
                        border: 2rpx solid #999999;
                        border-radius: 50%;
                        text-align: center;
                        line-height: 72rpx;
                        margin: 0 4.4% 20rpx;
                    }
 
                    .wrong {
                        color: #FFFFFF;
                        background-color: #f90909;
                        border-color: #f90909;
                    }
 
                    .right {
                        color: #FFFFFF;
                        background-color: #333;
                        border-color: #333;
                    }
                }
            }
        }
 
        .empty {
            height: 40rpx;
        }
 
        .end_btns {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 26rpx 20rpx;
            background: #FFFFFF;
            font-size: 28rpx;
            box-shadow: 0px -6rpx 16rpx rgba(0, 0, 0, 0.08);
            display: flex;
            justify-content: space-around;
 
            .btn {
                width: 48%;
                height: 66rpx;
                background: #FFFFFF;
                border: 2rpx solid #333333;
                border-radius: 33rpx;
                display: flex;
                align-items: center;
                justify-content: center;
            }
 
            .wrong {
                background-color: #333333;
                color: #FFFFFF;
            }
        }
    }
</style>