xiaoe_mp_npm 1.0.21 → 1.0.22-test02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.js +32 -6
- package/miniprogram_dist/GoodsItem/index.json +6 -6
- package/miniprogram_dist/GoodsItem/index.wxs +18 -18
- package/miniprogram_dist/LiveGoodsList/Header/index.js +54 -54
- package/miniprogram_dist/LiveGoodsList/Header/index.json +6 -6
- package/miniprogram_dist/LiveGoodsList/Header/index.less +45 -45
- package/miniprogram_dist/LiveGoodsList/Header/index.scss +105 -105
- package/miniprogram_dist/LiveGoodsList/Header/index.wxml +32 -32
- package/miniprogram_dist/LiveGoodsList/README.md +9 -9
- package/miniprogram_dist/LiveGoodsList/index.json +8 -8
- package/miniprogram_dist/LiveGoodsList/index.less +53 -53
- package/miniprogram_dist/LiveGoodsList/index.scss +92 -92
- package/miniprogram_dist/Task/TaskBubble/index.js +2 -1
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +241 -166
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +26 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +27 -8
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxss +96 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +4 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.js +132 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.json +6 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.scss +192 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxml +65 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxs +79 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxss +521 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.js +47 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.json +6 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.scss +7 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxml +2 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxss +298 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -0
- package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxss +316 -0
- package/miniprogram_dist/Task/TaskQuizPopup/index.js +232 -0
- package/miniprogram_dist/Task/TaskQuizPopup/index.json +8 -0
- package/miniprogram_dist/Task/TaskQuizPopup/index.scss +159 -0
- package/miniprogram_dist/Task/TaskQuizPopup/index.wxml +97 -0
- package/miniprogram_dist/Task/TaskQuizPopup/index.wxss +478 -0
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.js +79 -0
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.json +6 -0
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.scss +108 -0
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxml +27 -0
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxss +286 -0
- package/miniprogram_dist/common/utils/tool.js +54 -48
- package/package.json +1 -1
- package/src/AliveInvite/LiveRoomVertical/index.wxss +252 -252
- package/src/CollectionAddress/index.wxss +5 -5
- package/src/ConfirmOrder/components/AddressEdit/index.wxss +120 -120
- package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
- package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
- package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxss +45 -45
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxss +100 -100
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxss +55 -55
- package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxss +13 -13
- package/src/ConfirmOrder/components/Header/index.wxss +26 -26
- package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxss +85 -85
- package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxss +155 -155
- package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxss +51 -51
- package/src/ConfirmOrder/components/ModeSelect/index.wxss +44 -44
- package/src/ConfirmOrder/components/PickupSelect/index.wxss +22 -22
- package/src/ConfirmOrder/components/SelectSite/index.wxss +82 -82
- package/src/ConfirmOrder/components/Shipper/index.wxss +76 -76
- package/src/ConfirmOrder/components/ShipperEdit/index.wxss +78 -78
- package/src/ConfirmOrder/components/WechatAddress/index.wxss +22 -22
- package/src/ConfirmOrder/index.wxss +5 -5
- package/src/CouponList/couponMsg/index.wxss +3 -3
- package/src/CustomPopup/index.wxss +22 -22
- package/src/GoodsItem/index.json +6 -6
- package/src/GoodsItem/index.wxs +18 -18
- package/src/LiveGoodsList/Header/index.js +54 -54
- package/src/LiveGoodsList/Header/index.json +6 -6
- package/src/LiveGoodsList/Header/index.less +45 -45
- package/src/LiveGoodsList/Header/index.scss +105 -105
- package/src/LiveGoodsList/Header/index.wxml +32 -32
- package/src/LiveGoodsList/README.md +9 -9
- package/src/LiveGoodsList/index.json +8 -8
- package/src/LiveGoodsList/index.less +53 -53
- package/src/LiveGoodsList/index.scss +92 -92
- package/src/LiveGoodsList/index.wxss +218 -218
- package/src/PayComplete/Components/CouponItem/index.wxss +122 -122
- package/src/PayComplete/Components/Header/index.wxss +27 -27
- package/src/PayComplete/Components/LeadGroup/index.wxss +33 -33
- package/src/PayComplete/Components/PayGifts/index.wxss +157 -157
- package/src/PayComplete/Components/PayState/earnIntegral/index.wxss +23 -23
- package/src/PayComplete/Components/PayState/index.wxss +20 -20
- package/src/PayComplete/index.wxss +27 -27
- package/src/PayModule/wechatLoading/index.wxss +57 -57
- package/src/Recommend/index.wxss +110 -110
- package/src/Sku/Header/index.wxss +27 -27
- package/src/Sku/goods-info/index.wxss +52 -52
- package/src/Sku/index/index.wxss +52 -52
- package/src/Sku/row-item/index.wxss +50 -50
- package/src/Sku/step/index.wxss +11 -11
- package/src/Task/TaskBubble/index.js +2 -1
- package/src/Task/TaskBubble/index.wxss +289 -289
- package/src/Task/TaskIcon/index.wxss +130 -130
- package/src/Task/TaskPopup/component/RewardList/index.wxss +18 -18
- package/src/Task/TaskPopup/component/TaskItem/index.js +241 -166
- package/src/Task/TaskPopup/component/TaskItem/index.scss +26 -0
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +27 -8
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -394
- package/src/Task/TaskPopup/component/TaskList/index.js +4 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxss +118 -118
- package/src/Task/TaskPopup/component/TaskType/index.wxss +110 -110
- package/src/Task/TaskPopup/index.wxss +406 -406
- package/src/Task/TaskQuizPopup/components/quizContent/index.js +132 -0
- package/src/Task/TaskQuizPopup/components/quizContent/index.json +6 -0
- package/src/Task/TaskQuizPopup/components/quizContent/index.scss +192 -0
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxml +65 -0
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxs +79 -0
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxss +1 -0
- package/src/Task/TaskQuizPopup/components/quizRichText/index.js +47 -0
- package/src/Task/TaskQuizPopup/components/quizRichText/index.json +6 -0
- package/src/Task/TaskQuizPopup/components/quizRichText/index.scss +7 -0
- package/src/Task/TaskQuizPopup/components/quizRichText/index.wxml +2 -0
- package/src/Task/TaskQuizPopup/components/quizRichText/index.wxss +1 -0
- package/src/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -0
- package/src/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -0
- package/src/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -0
- package/src/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -0
- package/src/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -0
- package/src/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -0
- package/src/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -0
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -0
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -0
- package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxss +283 -0
- package/src/Task/TaskQuizPopup/index.js +232 -0
- package/src/Task/TaskQuizPopup/index.json +8 -0
- package/src/Task/TaskQuizPopup/index.scss +159 -0
- package/src/Task/TaskQuizPopup/index.wxml +97 -0
- package/src/Task/TaskQuizPopup/index.wxss +1 -0
- package/src/Task/taskQuizRemindPopup/index.js +79 -0
- package/src/Task/taskQuizRemindPopup/index.json +6 -0
- package/src/Task/taskQuizRemindPopup/index.scss +108 -0
- package/src/Task/taskQuizRemindPopup/index.wxml +27 -0
- package/src/Task/taskQuizRemindPopup/index.wxss +1 -0
- package/src/Task/taskReceivePopup/customPrizes/index.wxss +220 -220
- package/src/Task/taskReceivePopup/index.wxss +1 -1
- package/src/Task/taskReceivePopup/integral/index.wxss +94 -94
- package/src/common/css/theme.wxss +16 -16
- package/src/common/utils/tool.js +54 -48
- package/src/miniprogram_npm/miniprogram-computed/index.js +1 -0
|
@@ -71,8 +71,27 @@
|
|
|
71
71
|
margin-top: 1.06667vmin;
|
|
72
72
|
font-size: 3.2vmin;
|
|
73
73
|
color: #FF5429;
|
|
74
|
+
font-family: "PingFang SC";
|
|
75
|
+
line-height: 4.26667vmin;
|
|
76
|
+
align-items: center;
|
|
77
|
+
}
|
|
78
|
+
.item-box .left .task-tip .finish-text {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
color: #999999;
|
|
81
|
+
}
|
|
82
|
+
.item-box .left .task-tip .show-answer {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
margin-left: 2.66667vmin;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 400;
|
|
74
88
|
line-height: 4.26667vmin;
|
|
75
89
|
}
|
|
90
|
+
.item-box .left .task-tip .show-answer .analysis-icon {
|
|
91
|
+
width: 3.2vmin;
|
|
92
|
+
height: 3.2vmin;
|
|
93
|
+
margin-left: -vmin(4);
|
|
94
|
+
}
|
|
76
95
|
.item-box .btn {
|
|
77
96
|
width: 19.2vmin;
|
|
78
97
|
height: 7.46667vmin;
|
|
@@ -95,6 +114,11 @@
|
|
|
95
114
|
background: #F5F5F5;
|
|
96
115
|
color: #B2B2B2;
|
|
97
116
|
}
|
|
117
|
+
.item-box .btn.orange-btn {
|
|
118
|
+
color: #ffffff;
|
|
119
|
+
opacity: 0.4;
|
|
120
|
+
background: #ff5429;
|
|
121
|
+
}
|
|
98
122
|
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
99
123
|
.item-box {
|
|
100
124
|
display: flex;
|
|
@@ -169,8 +193,27 @@
|
|
|
169
193
|
margin-top: 0.52083vmin;
|
|
170
194
|
font-size: 1.5625vmin;
|
|
171
195
|
color: #FF5429;
|
|
196
|
+
font-family: "PingFang SC";
|
|
197
|
+
line-height: 2.08333vmin;
|
|
198
|
+
align-items: center;
|
|
199
|
+
}
|
|
200
|
+
.item-box .left .task-tip .finish-text {
|
|
201
|
+
display: inline-block;
|
|
202
|
+
color: #999999;
|
|
203
|
+
}
|
|
204
|
+
.item-box .left .task-tip .show-answer {
|
|
205
|
+
display: inline-flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
margin-left: 1.30208vmin;
|
|
208
|
+
font-style: normal;
|
|
209
|
+
font-weight: 400;
|
|
172
210
|
line-height: 2.08333vmin;
|
|
173
211
|
}
|
|
212
|
+
.item-box .left .task-tip .show-answer .analysis-icon {
|
|
213
|
+
width: 1.5625vmin;
|
|
214
|
+
height: 1.5625vmin;
|
|
215
|
+
margin-left: -vmin(4);
|
|
216
|
+
}
|
|
174
217
|
.item-box .btn {
|
|
175
218
|
width: 9.375vmin;
|
|
176
219
|
height: 3.64583vmin;
|
|
@@ -193,6 +236,11 @@
|
|
|
193
236
|
background: #F5F5F5;
|
|
194
237
|
color: #B2B2B2;
|
|
195
238
|
}
|
|
239
|
+
.item-box .btn.orange-btn {
|
|
240
|
+
color: #ffffff;
|
|
241
|
+
opacity: 0.4;
|
|
242
|
+
background: #ff5429;
|
|
243
|
+
}
|
|
196
244
|
}
|
|
197
245
|
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
198
246
|
.item-box {
|
|
@@ -268,8 +316,27 @@
|
|
|
268
316
|
margin-top: 0.63492vmin;
|
|
269
317
|
font-size: 1.90476vmin;
|
|
270
318
|
color: #FF5429;
|
|
319
|
+
font-family: "PingFang SC";
|
|
320
|
+
line-height: 2.53968vmin;
|
|
321
|
+
align-items: center;
|
|
322
|
+
}
|
|
323
|
+
.item-box .left .task-tip .finish-text {
|
|
324
|
+
display: inline-block;
|
|
325
|
+
color: #999999;
|
|
326
|
+
}
|
|
327
|
+
.item-box .left .task-tip .show-answer {
|
|
328
|
+
display: inline-flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
margin-left: 1.5873vmin;
|
|
331
|
+
font-style: normal;
|
|
332
|
+
font-weight: 400;
|
|
271
333
|
line-height: 2.53968vmin;
|
|
272
334
|
}
|
|
335
|
+
.item-box .left .task-tip .show-answer .analysis-icon {
|
|
336
|
+
width: 1.90476vmin;
|
|
337
|
+
height: 1.90476vmin;
|
|
338
|
+
margin-left: -vmin(4);
|
|
339
|
+
}
|
|
273
340
|
.item-box .btn {
|
|
274
341
|
width: 11.42857vmin;
|
|
275
342
|
height: 4.44444vmin;
|
|
@@ -292,6 +359,11 @@
|
|
|
292
359
|
background: #F5F5F5;
|
|
293
360
|
color: #B2B2B2;
|
|
294
361
|
}
|
|
362
|
+
.item-box .btn.orange-btn {
|
|
363
|
+
color: #ffffff;
|
|
364
|
+
opacity: 0.4;
|
|
365
|
+
background: #ff5429;
|
|
366
|
+
}
|
|
295
367
|
}
|
|
296
368
|
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
297
369
|
.item-box {
|
|
@@ -367,8 +439,27 @@
|
|
|
367
439
|
margin-top: 0.52083vmin;
|
|
368
440
|
font-size: 1.5625vmin;
|
|
369
441
|
color: #FF5429;
|
|
442
|
+
font-family: "PingFang SC";
|
|
443
|
+
line-height: 2.08333vmin;
|
|
444
|
+
align-items: center;
|
|
445
|
+
}
|
|
446
|
+
.item-box .left .task-tip .finish-text {
|
|
447
|
+
display: inline-block;
|
|
448
|
+
color: #999999;
|
|
449
|
+
}
|
|
450
|
+
.item-box .left .task-tip .show-answer {
|
|
451
|
+
display: inline-flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
margin-left: 1.30208vmin;
|
|
454
|
+
font-style: normal;
|
|
455
|
+
font-weight: 400;
|
|
370
456
|
line-height: 2.08333vmin;
|
|
371
457
|
}
|
|
458
|
+
.item-box .left .task-tip .show-answer .analysis-icon {
|
|
459
|
+
width: 1.5625vmin;
|
|
460
|
+
height: 1.5625vmin;
|
|
461
|
+
margin-left: -vmin(4);
|
|
462
|
+
}
|
|
372
463
|
.item-box .btn {
|
|
373
464
|
width: 9.375vmin;
|
|
374
465
|
height: 3.64583vmin;
|
|
@@ -391,4 +482,9 @@
|
|
|
391
482
|
background: #F5F5F5;
|
|
392
483
|
color: #B2B2B2;
|
|
393
484
|
}
|
|
485
|
+
.item-box .btn.orange-btn {
|
|
486
|
+
color: #ffffff;
|
|
487
|
+
opacity: 0.4;
|
|
488
|
+
background: #ff5429;
|
|
489
|
+
}
|
|
394
490
|
}
|
|
@@ -47,6 +47,10 @@ const taskTypeConfig = {
|
|
|
47
47
|
9:{
|
|
48
48
|
title: "签到",
|
|
49
49
|
icon: "https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltpfaylp019h.png"
|
|
50
|
+
},
|
|
51
|
+
10:{
|
|
52
|
+
title: "答题",
|
|
53
|
+
icon: "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr74osf0jjo.svg"
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const computedBehavior = require('miniprogram-computed').behavior
|
|
2
|
+
Component({
|
|
3
|
+
behaviors: [computedBehavior],
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 组件的属性列表
|
|
7
|
+
*/
|
|
8
|
+
properties: {
|
|
9
|
+
// 展示的题目内容对象
|
|
10
|
+
questionContent: {
|
|
11
|
+
type: Object,
|
|
12
|
+
value: {},
|
|
13
|
+
observer(val){
|
|
14
|
+
// 获取正确答案和用户作答的选项
|
|
15
|
+
if (val?.id) {
|
|
16
|
+
// 获取富文本的内容操作
|
|
17
|
+
// this.getRichTextContent(val)
|
|
18
|
+
const correctAnswer = this.getAnswerMap(val, val.correct_answer)
|
|
19
|
+
const userAnswer = this.getAnswerMap(val, val.user_answer)
|
|
20
|
+
this.setData({
|
|
21
|
+
correctAnswer,
|
|
22
|
+
userAnswer
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
// 是否是结果解析
|
|
28
|
+
showAnalysis: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
value: false,
|
|
31
|
+
},
|
|
32
|
+
// 题目序号
|
|
33
|
+
quizIndex: {
|
|
34
|
+
type: Number,
|
|
35
|
+
value: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 组件的初始数据
|
|
41
|
+
*/
|
|
42
|
+
data: {
|
|
43
|
+
// 答案选项映射
|
|
44
|
+
optionIndexMap: [
|
|
45
|
+
'A',
|
|
46
|
+
'B',
|
|
47
|
+
'C',
|
|
48
|
+
'D',
|
|
49
|
+
'E',
|
|
50
|
+
'F',
|
|
51
|
+
'G',
|
|
52
|
+
'H',
|
|
53
|
+
'I',
|
|
54
|
+
'J',
|
|
55
|
+
'K',
|
|
56
|
+
'L',
|
|
57
|
+
'M',
|
|
58
|
+
'N',
|
|
59
|
+
'O',
|
|
60
|
+
'P',
|
|
61
|
+
'Q',
|
|
62
|
+
'R',
|
|
63
|
+
'S',
|
|
64
|
+
'T',
|
|
65
|
+
'U',
|
|
66
|
+
'V',
|
|
67
|
+
'W',
|
|
68
|
+
'X',
|
|
69
|
+
'Y',
|
|
70
|
+
'Z',
|
|
71
|
+
],
|
|
72
|
+
correctAnswer: '', // 正确答案
|
|
73
|
+
userAnswer: '', // 用户作答选项
|
|
74
|
+
},
|
|
75
|
+
computed: {
|
|
76
|
+
// 单选题/多选题/判断题才会显示答案
|
|
77
|
+
isShowOptionList({ questionContent }) {
|
|
78
|
+
return [0, 1, 3].includes(questionContent?.qs_type)
|
|
79
|
+
},
|
|
80
|
+
// 用户是否回答正确
|
|
81
|
+
isSuccess({ questionContent }) {
|
|
82
|
+
let correctAnswer = questionContent?.correct_answer
|
|
83
|
+
let userAnswer = questionContent?.user_answer
|
|
84
|
+
return (
|
|
85
|
+
correctAnswer &&
|
|
86
|
+
userAnswer &&
|
|
87
|
+
userAnswer.length === correctAnswer.length &&
|
|
88
|
+
userAnswer.every((val) => correctAnswer.includes(val))
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* 组件的方法列表
|
|
94
|
+
*/
|
|
95
|
+
methods: {
|
|
96
|
+
// 选择答案操作
|
|
97
|
+
clickOption(e) {
|
|
98
|
+
// 查看解析情况下,不能选择
|
|
99
|
+
if (this.data.showAnalysis) return
|
|
100
|
+
this.triggerEvent('clickOption', e.currentTarget.dataset.index)
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* 获取答案对应的结果
|
|
104
|
+
* @param questionContent 题目内容
|
|
105
|
+
* @param answerList 需要操作的答案列表
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
getAnswerMap(questionContent, answerList) {
|
|
109
|
+
if (!this.data.showAnalysis) return ''
|
|
110
|
+
let letters = []
|
|
111
|
+
let temp = JSON.parse(JSON.stringify(answerList))
|
|
112
|
+
if (typeof temp === 'number') {
|
|
113
|
+
temp = [temp]
|
|
114
|
+
}
|
|
115
|
+
questionContent.options.forEach((item, index) => {
|
|
116
|
+
if (temp.indexOf(String(item.op_id)) >= 0) {
|
|
117
|
+
// 如果是判断题写入的是正确,错误
|
|
118
|
+
if (questionContent.qs_type === 3) {
|
|
119
|
+
letters.push(
|
|
120
|
+
this.data.optionIndexMap[index] === 'A'
|
|
121
|
+
? '正确'
|
|
122
|
+
: '错误'
|
|
123
|
+
)
|
|
124
|
+
} else {
|
|
125
|
+
letters.push(this.data.optionIndexMap[index])
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
return letters.join(' ')
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
})
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
$deviceWidth: 750;
|
|
2
|
+
|
|
3
|
+
@function vmin($rpx) {
|
|
4
|
+
@return #{$rpx * 100 / $deviceWidth}vmin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin card-margin-bottom {
|
|
8
|
+
margin-bottom: vmin(32);
|
|
9
|
+
}
|
|
10
|
+
@mixin question-cover {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
padding: vmin(32) vmin(24);
|
|
15
|
+
background-color: #ffffff;
|
|
16
|
+
border-radius: vmin(16);
|
|
17
|
+
.question-type {
|
|
18
|
+
display: flex;
|
|
19
|
+
padding: vmin(4) vmin(8);
|
|
20
|
+
justify-content: center;
|
|
21
|
+
align-items: center;
|
|
22
|
+
border-radius: vmin(4);
|
|
23
|
+
background: #f5f5f5;
|
|
24
|
+
backdrop-filter: blur(0.1rem);
|
|
25
|
+
font-size: vmin(20);
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-weight: 500;
|
|
28
|
+
color: #b2b2b2;
|
|
29
|
+
margin-bottom: vmin(16);
|
|
30
|
+
}
|
|
31
|
+
.question-content-cover {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
width: 100%;
|
|
35
|
+
margin-bottom: vmin(48);
|
|
36
|
+
color: #333333;
|
|
37
|
+
font-family: "PingFang SC";
|
|
38
|
+
font-size: vmin(32);
|
|
39
|
+
font-style: normal;
|
|
40
|
+
font-weight: 500;
|
|
41
|
+
line-height: vmin(48);
|
|
42
|
+
.question-content {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.question-option-list {
|
|
46
|
+
width: 100%;
|
|
47
|
+
.question-option {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: flex-start;
|
|
50
|
+
min-height: vmin(48);
|
|
51
|
+
border-radius: vmin(16);
|
|
52
|
+
font-family: "PingFang SC";
|
|
53
|
+
font-size: vmin(32);
|
|
54
|
+
font-style: normal;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
margin-bottom: vmin(48);
|
|
57
|
+
&:last-child {
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
.img-cover {
|
|
61
|
+
height: vmin(48);
|
|
62
|
+
width: vmin(40);
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
align-items: center;
|
|
66
|
+
margin-right: vmin(16);
|
|
67
|
+
.check-icon {
|
|
68
|
+
width: vmin(40);
|
|
69
|
+
height: vmin(40);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.judge-item {
|
|
73
|
+
font-size: vmin(28);
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
line-height: vmin(44);
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.index {
|
|
80
|
+
line-height: vmin(48);
|
|
81
|
+
}
|
|
82
|
+
.title {
|
|
83
|
+
flex: 1;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
padding: 0;
|
|
86
|
+
word-wrap: break-word;
|
|
87
|
+
line-height: vmin(48);
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.question-analysis {
|
|
95
|
+
width: 100%;
|
|
96
|
+
margin-top: vmin(48);
|
|
97
|
+
font-size: vmin(28);
|
|
98
|
+
padding: vmin(32) vmin(24);
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
align-items: flex-start;
|
|
102
|
+
border-radius: vmin(8);
|
|
103
|
+
background: #f5f5f5;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
.question-analysis-top-part {
|
|
106
|
+
.question-result {
|
|
107
|
+
color: #ff4747;
|
|
108
|
+
font-size: vmin(28);
|
|
109
|
+
font-style: normal;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
margin-bottom: vmin(24);
|
|
112
|
+
}
|
|
113
|
+
.right-color {
|
|
114
|
+
color: #07c160;
|
|
115
|
+
}
|
|
116
|
+
.question-answer-box {
|
|
117
|
+
display: flex;
|
|
118
|
+
.question-answer {
|
|
119
|
+
margin-right: vmin(32);
|
|
120
|
+
font-weight: 400;
|
|
121
|
+
color: #666666;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.question-tip {
|
|
126
|
+
margin-top: vmin(24);
|
|
127
|
+
margin-bottom: vmin(8);
|
|
128
|
+
color: #666666;
|
|
129
|
+
line-height: vmin(40);
|
|
130
|
+
}
|
|
131
|
+
.question-analysis-content {
|
|
132
|
+
color: #333333;
|
|
133
|
+
font-family: "PingFang SC";
|
|
134
|
+
font-size: vmin(28);
|
|
135
|
+
font-style: normal;
|
|
136
|
+
font-weight: 400;
|
|
137
|
+
line-height: vmin(40);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
image {
|
|
143
|
+
vertical-align: middle;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.card-margin-bottom {
|
|
147
|
+
@include card-margin-bottom;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.question-cover {
|
|
151
|
+
@include question-cover;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// 竖屏pad
|
|
155
|
+
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
156
|
+
$deviceWidth: 1536 !global;
|
|
157
|
+
|
|
158
|
+
.card-margin-bottom {
|
|
159
|
+
@include card-margin-bottom;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.question-cover {
|
|
163
|
+
@include question-cover;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// PC 放大适配
|
|
169
|
+
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
170
|
+
$deviceWidth: 1260 !global;
|
|
171
|
+
|
|
172
|
+
.card-margin-bottom {
|
|
173
|
+
@include card-margin-bottom;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.question-cover {
|
|
177
|
+
@include question-cover;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// 横屏pad
|
|
182
|
+
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
183
|
+
$deviceWidth: 1536 !global;
|
|
184
|
+
|
|
185
|
+
.card-margin-bottom {
|
|
186
|
+
@include card-margin-bottom;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.question-cover {
|
|
190
|
+
@include question-cover;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<wxs src="./index.wxs" module="quizTools" />
|
|
2
|
+
<view
|
|
3
|
+
wx:if="{{ questionContent }}"
|
|
4
|
+
class="question-cover {{ showAnalysis && 'card-margin-bottom' }}"
|
|
5
|
+
>
|
|
6
|
+
<!-- 题目类型 -->
|
|
7
|
+
<view class="question-type">{{ quizTools.typeText(questionContent.qs_type) }}</view>
|
|
8
|
+
<!-- 题目 -->
|
|
9
|
+
<view class="question-content-cover">
|
|
10
|
+
<view class="question-order">{{ quizIndex }}.</view>
|
|
11
|
+
<quizRichText wx:if="{{ questionContent.qs_content }}" richTextContent="{{ questionContent.qs_content }}" />
|
|
12
|
+
</view>
|
|
13
|
+
<!-- 选项 -->
|
|
14
|
+
<view class="question-option-list">
|
|
15
|
+
<view
|
|
16
|
+
class="question-option"
|
|
17
|
+
wx:for="{{ questionContent.options }}"
|
|
18
|
+
>
|
|
19
|
+
<!-- 单选题/多选题/判断题 -->
|
|
20
|
+
<block wx:if="{{ isShowOptionList }}">
|
|
21
|
+
<view class="img-cover" data-index="{{ index }}" catchtap="clickOption">
|
|
22
|
+
<image
|
|
23
|
+
src="{{ quizTools.getChoiceIcon(item, questionContent.qs_type, questionContent.correct_answer, questionContent.user_answer, showAnalysis) }}"
|
|
24
|
+
class="check-icon"
|
|
25
|
+
/>
|
|
26
|
+
</view>
|
|
27
|
+
<!-- 判断题答案选项无需使用富文本 -->
|
|
28
|
+
<block wx:if="{{ questionContent.qs_type === 3 }}">
|
|
29
|
+
<view class="judge-item" data-index="{{ index }}" catchtap="clickOption">
|
|
30
|
+
{{ item.op_content }}
|
|
31
|
+
</view>
|
|
32
|
+
</block>
|
|
33
|
+
<!-- 单选题/多选题答案选项使用富文本 -->
|
|
34
|
+
<block wx:else>
|
|
35
|
+
<view class="index">{{ optionIndexMap[index] }}.</view>
|
|
36
|
+
<view class="title" data-index="{{ index }}" catchtap="clickOption">
|
|
37
|
+
<quizRichText wx:if="{{ item.op_content }}" richTextContent="{{ item.op_content }}" />
|
|
38
|
+
</view>
|
|
39
|
+
</block>
|
|
40
|
+
</block>
|
|
41
|
+
</view>
|
|
42
|
+
</view>
|
|
43
|
+
<!-- 解析 -->
|
|
44
|
+
<view class="question-analysis" wx:if="{{ showAnalysis }}">
|
|
45
|
+
<view class="question-analysis-top-part">
|
|
46
|
+
<view class="question-result {{ isSuccess && 'right-color' }}">
|
|
47
|
+
{{ isSuccess ? '回答正确' : '回答错误' }}
|
|
48
|
+
</view>
|
|
49
|
+
<view class="question-answer-box">
|
|
50
|
+
<view class="question-answer">
|
|
51
|
+
正确答案:{{ correctAnswer }}
|
|
52
|
+
</view>
|
|
53
|
+
<view class="question-answer">
|
|
54
|
+
我的答案:{{ userAnswer }}
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
</view>
|
|
58
|
+
<view class="question-tip" wx:if="{{ questionContent.qs_analysis }}">
|
|
59
|
+
解析
|
|
60
|
+
</view>
|
|
61
|
+
<view class="question-analysis-content">
|
|
62
|
+
<quizRichText wx:if="{{ questionContent.qs_analysis }}" richTextContent="{{ questionContent.qs_analysis }}" />
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
</view>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
// 题目类型
|
|
3
|
+
var typeText = function(type) {
|
|
4
|
+
var text = '';
|
|
5
|
+
switch (type) {
|
|
6
|
+
// 单选
|
|
7
|
+
case 0:
|
|
8
|
+
text = '单选题';
|
|
9
|
+
break;
|
|
10
|
+
// 多选
|
|
11
|
+
case 1:
|
|
12
|
+
text = '多选题';
|
|
13
|
+
break;
|
|
14
|
+
// 判断
|
|
15
|
+
case 3:
|
|
16
|
+
text = '判断题';
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
return text;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 获取展示的勾选icon
|
|
27
|
+
* @param item 当前选项的item
|
|
28
|
+
* @param type 题目类型,单选/多选/判断
|
|
29
|
+
* @param correct_answer 正确的答案
|
|
30
|
+
* @param user_answer 用户选择的答案
|
|
31
|
+
* @param showAnalysis 是否是展示题目解析情况
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
var getChoiceIcon = function (item, type, correct_answer, user_answer, showAnalysis) {
|
|
35
|
+
var judgeAnswer = function(item) {
|
|
36
|
+
if (!showAnalysis) return '';
|
|
37
|
+
var correctAnswer = correct_answer;
|
|
38
|
+
var userAnswer = user_answer;
|
|
39
|
+
var type = '';
|
|
40
|
+
// 选项是否在用户选择内
|
|
41
|
+
for (var i = 0; i < userAnswer.length; i++) {
|
|
42
|
+
if (userAnswer[i] === item.op_id) {
|
|
43
|
+
// 判断答案正确与否
|
|
44
|
+
for (var index = 0; index < correctAnswer.length; index++) {
|
|
45
|
+
if (correctAnswer[index] === item.op_id) {
|
|
46
|
+
type = 'right';
|
|
47
|
+
break
|
|
48
|
+
} else {
|
|
49
|
+
type = 'wrong';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
break
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return type;
|
|
56
|
+
}
|
|
57
|
+
var iconSrc = '';
|
|
58
|
+
// 区别多选和单选、判断
|
|
59
|
+
if (item.selected) {
|
|
60
|
+
// 选中状态
|
|
61
|
+
iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr12yki0h1u.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr114sn0g54.svg';
|
|
62
|
+
} else if (judgeAnswer(item) === 'right') {
|
|
63
|
+
// 正确状态
|
|
64
|
+
iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyki0skx.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykn0iix.svg';
|
|
65
|
+
} else if (judgeAnswer(item) === 'wrong') {
|
|
66
|
+
// 错误状态
|
|
67
|
+
iconSrc = type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zykm0zhs.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr2zyko0tts.svg';
|
|
68
|
+
} else {
|
|
69
|
+
// 空状态
|
|
70
|
+
iconSrc =
|
|
71
|
+
type === 1 ? 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0ve6b0ezt.svg' : 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/lyr0mnyy0uwf.svg';
|
|
72
|
+
}
|
|
73
|
+
return iconSrc;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
module.exports = {
|
|
77
|
+
typeText:typeText,
|
|
78
|
+
getChoiceIcon:getChoiceIcon
|
|
79
|
+
}
|