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.
Files changed (149) hide show
  1. package/.prettierrc.js +32 -6
  2. package/miniprogram_dist/GoodsItem/index.json +6 -6
  3. package/miniprogram_dist/GoodsItem/index.wxs +18 -18
  4. package/miniprogram_dist/LiveGoodsList/Header/index.js +54 -54
  5. package/miniprogram_dist/LiveGoodsList/Header/index.json +6 -6
  6. package/miniprogram_dist/LiveGoodsList/Header/index.less +45 -45
  7. package/miniprogram_dist/LiveGoodsList/Header/index.scss +105 -105
  8. package/miniprogram_dist/LiveGoodsList/Header/index.wxml +32 -32
  9. package/miniprogram_dist/LiveGoodsList/README.md +9 -9
  10. package/miniprogram_dist/LiveGoodsList/index.json +8 -8
  11. package/miniprogram_dist/LiveGoodsList/index.less +53 -53
  12. package/miniprogram_dist/LiveGoodsList/index.scss +92 -92
  13. package/miniprogram_dist/Task/TaskBubble/index.js +2 -1
  14. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +241 -166
  15. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +26 -0
  16. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +27 -8
  17. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxss +96 -0
  18. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +4 -0
  19. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.js +132 -0
  20. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.json +6 -0
  21. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.scss +192 -0
  22. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxml +65 -0
  23. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxs +79 -0
  24. package/miniprogram_dist/Task/TaskQuizPopup/components/quizContent/index.wxss +521 -0
  25. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.js +47 -0
  26. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.json +6 -0
  27. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.scss +7 -0
  28. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxml +2 -0
  29. package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.wxss +298 -0
  30. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -0
  31. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -0
  32. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -0
  33. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -0
  34. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -0
  35. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -0
  36. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -0
  37. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -0
  38. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -0
  39. package/miniprogram_dist/Task/TaskQuizPopup/components/wxParse/wxParse.wxss +316 -0
  40. package/miniprogram_dist/Task/TaskQuizPopup/index.js +232 -0
  41. package/miniprogram_dist/Task/TaskQuizPopup/index.json +8 -0
  42. package/miniprogram_dist/Task/TaskQuizPopup/index.scss +159 -0
  43. package/miniprogram_dist/Task/TaskQuizPopup/index.wxml +97 -0
  44. package/miniprogram_dist/Task/TaskQuizPopup/index.wxss +478 -0
  45. package/miniprogram_dist/Task/taskQuizRemindPopup/index.js +79 -0
  46. package/miniprogram_dist/Task/taskQuizRemindPopup/index.json +6 -0
  47. package/miniprogram_dist/Task/taskQuizRemindPopup/index.scss +108 -0
  48. package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxml +27 -0
  49. package/miniprogram_dist/Task/taskQuizRemindPopup/index.wxss +286 -0
  50. package/miniprogram_dist/common/utils/tool.js +54 -48
  51. package/package.json +1 -1
  52. package/src/AliveInvite/LiveRoomVertical/index.wxss +252 -252
  53. package/src/CollectionAddress/index.wxss +5 -5
  54. package/src/ConfirmOrder/components/AddressEdit/index.wxss +120 -120
  55. package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
  56. package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
  57. package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
  58. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxss +45 -45
  59. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxss +100 -100
  60. package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxss +55 -55
  61. package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxss +13 -13
  62. package/src/ConfirmOrder/components/Header/index.wxss +26 -26
  63. package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxss +85 -85
  64. package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxss +155 -155
  65. package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxss +51 -51
  66. package/src/ConfirmOrder/components/ModeSelect/index.wxss +44 -44
  67. package/src/ConfirmOrder/components/PickupSelect/index.wxss +22 -22
  68. package/src/ConfirmOrder/components/SelectSite/index.wxss +82 -82
  69. package/src/ConfirmOrder/components/Shipper/index.wxss +76 -76
  70. package/src/ConfirmOrder/components/ShipperEdit/index.wxss +78 -78
  71. package/src/ConfirmOrder/components/WechatAddress/index.wxss +22 -22
  72. package/src/ConfirmOrder/index.wxss +5 -5
  73. package/src/CouponList/couponMsg/index.wxss +3 -3
  74. package/src/CustomPopup/index.wxss +22 -22
  75. package/src/GoodsItem/index.json +6 -6
  76. package/src/GoodsItem/index.wxs +18 -18
  77. package/src/LiveGoodsList/Header/index.js +54 -54
  78. package/src/LiveGoodsList/Header/index.json +6 -6
  79. package/src/LiveGoodsList/Header/index.less +45 -45
  80. package/src/LiveGoodsList/Header/index.scss +105 -105
  81. package/src/LiveGoodsList/Header/index.wxml +32 -32
  82. package/src/LiveGoodsList/README.md +9 -9
  83. package/src/LiveGoodsList/index.json +8 -8
  84. package/src/LiveGoodsList/index.less +53 -53
  85. package/src/LiveGoodsList/index.scss +92 -92
  86. package/src/LiveGoodsList/index.wxss +218 -218
  87. package/src/PayComplete/Components/CouponItem/index.wxss +122 -122
  88. package/src/PayComplete/Components/Header/index.wxss +27 -27
  89. package/src/PayComplete/Components/LeadGroup/index.wxss +33 -33
  90. package/src/PayComplete/Components/PayGifts/index.wxss +157 -157
  91. package/src/PayComplete/Components/PayState/earnIntegral/index.wxss +23 -23
  92. package/src/PayComplete/Components/PayState/index.wxss +20 -20
  93. package/src/PayComplete/index.wxss +27 -27
  94. package/src/PayModule/wechatLoading/index.wxss +57 -57
  95. package/src/Recommend/index.wxss +110 -110
  96. package/src/Sku/Header/index.wxss +27 -27
  97. package/src/Sku/goods-info/index.wxss +52 -52
  98. package/src/Sku/index/index.wxss +52 -52
  99. package/src/Sku/row-item/index.wxss +50 -50
  100. package/src/Sku/step/index.wxss +11 -11
  101. package/src/Task/TaskBubble/index.js +2 -1
  102. package/src/Task/TaskBubble/index.wxss +289 -289
  103. package/src/Task/TaskIcon/index.wxss +130 -130
  104. package/src/Task/TaskPopup/component/RewardList/index.wxss +18 -18
  105. package/src/Task/TaskPopup/component/TaskItem/index.js +241 -166
  106. package/src/Task/TaskPopup/component/TaskItem/index.scss +26 -0
  107. package/src/Task/TaskPopup/component/TaskItem/index.wxml +27 -8
  108. package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -394
  109. package/src/Task/TaskPopup/component/TaskList/index.js +4 -0
  110. package/src/Task/TaskPopup/component/TaskList/index.wxss +118 -118
  111. package/src/Task/TaskPopup/component/TaskType/index.wxss +110 -110
  112. package/src/Task/TaskPopup/index.wxss +406 -406
  113. package/src/Task/TaskQuizPopup/components/quizContent/index.js +132 -0
  114. package/src/Task/TaskQuizPopup/components/quizContent/index.json +6 -0
  115. package/src/Task/TaskQuizPopup/components/quizContent/index.scss +192 -0
  116. package/src/Task/TaskQuizPopup/components/quizContent/index.wxml +65 -0
  117. package/src/Task/TaskQuizPopup/components/quizContent/index.wxs +79 -0
  118. package/src/Task/TaskQuizPopup/components/quizContent/index.wxss +1 -0
  119. package/src/Task/TaskQuizPopup/components/quizRichText/index.js +47 -0
  120. package/src/Task/TaskQuizPopup/components/quizRichText/index.json +6 -0
  121. package/src/Task/TaskQuizPopup/components/quizRichText/index.scss +7 -0
  122. package/src/Task/TaskQuizPopup/components/quizRichText/index.wxml +2 -0
  123. package/src/Task/TaskQuizPopup/components/quizRichText/index.wxss +1 -0
  124. package/src/Task/TaskQuizPopup/components/wxParse/base.wxml +50 -0
  125. package/src/Task/TaskQuizPopup/components/wxParse/html2json.js +623 -0
  126. package/src/Task/TaskQuizPopup/components/wxParse/htmlparser.js +183 -0
  127. package/src/Task/TaskQuizPopup/components/wxParse/iframeParse.js +216 -0
  128. package/src/Task/TaskQuizPopup/components/wxParse/loop.wxml +3563 -0
  129. package/src/Task/TaskQuizPopup/components/wxParse/showdown.js +2364 -0
  130. package/src/Task/TaskQuizPopup/components/wxParse/wxDiscode.js +209 -0
  131. package/src/Task/TaskQuizPopup/components/wxParse/wxParse.js +269 -0
  132. package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxml +1276 -0
  133. package/src/Task/TaskQuizPopup/components/wxParse/wxParse.wxss +283 -0
  134. package/src/Task/TaskQuizPopup/index.js +232 -0
  135. package/src/Task/TaskQuizPopup/index.json +8 -0
  136. package/src/Task/TaskQuizPopup/index.scss +159 -0
  137. package/src/Task/TaskQuizPopup/index.wxml +97 -0
  138. package/src/Task/TaskQuizPopup/index.wxss +1 -0
  139. package/src/Task/taskQuizRemindPopup/index.js +79 -0
  140. package/src/Task/taskQuizRemindPopup/index.json +6 -0
  141. package/src/Task/taskQuizRemindPopup/index.scss +108 -0
  142. package/src/Task/taskQuizRemindPopup/index.wxml +27 -0
  143. package/src/Task/taskQuizRemindPopup/index.wxss +1 -0
  144. package/src/Task/taskReceivePopup/customPrizes/index.wxss +220 -220
  145. package/src/Task/taskReceivePopup/index.wxss +1 -1
  146. package/src/Task/taskReceivePopup/integral/index.wxss +94 -94
  147. package/src/common/css/theme.wxss +16 -16
  148. package/src/common/utils/tool.js +54 -48
  149. package/src/miniprogram_npm/miniprogram-computed/index.js +1 -0
@@ -0,0 +1,316 @@
1
+ .wxParse {
2
+ color: #666;
3
+ line-height: 1.8;
4
+ overflow: hidden;
5
+ }
6
+ .wxParse view {
7
+ white-space: pre-line;
8
+ word-wrap: break-word;
9
+ box-sizing: border-box;
10
+ }
11
+ .wxParse view,
12
+ .wxParse navigator,
13
+ .wxParse text,
14
+ .wxParse image,
15
+ .wxParse video,
16
+ .wxParse input,
17
+ .wxParse button,
18
+ .wxParse checkbox,
19
+ .wxParse label,
20
+ .wxParse textarea,
21
+ .wxParse form,
22
+ .wxParse radio,
23
+ .wxParse navigator {
24
+ max-width: 100% !important;
25
+ }
26
+ view {
27
+ word-wrap: break-word;
28
+ white-space: normal;
29
+ }
30
+ /* 是否需要可选中 */
31
+ .wxParse .user-select view,
32
+ .wxParse .user-select text {
33
+ user-select: text;
34
+ -webkit-user-select: text;
35
+ }
36
+ .wxParse-inline {
37
+ display: inline;
38
+ margin: 0;
39
+ padding: 0;
40
+ }
41
+ /*//标题 */
42
+ .wxParse-div {
43
+ margin: 0;
44
+ padding: 0;
45
+ }
46
+ .wxParse-h1 {
47
+ font-size: 2em;
48
+ margin: 0.67em 0;
49
+ }
50
+ .wxParse-h2 {
51
+ font-size: 1.5em;
52
+ margin: 0.75em 0;
53
+ }
54
+ .wxParse-h3 {
55
+ font-size: 1.17em;
56
+ margin: 0.83em 0;
57
+ }
58
+ .wxParse-h4 {
59
+ margin: 1.12em 0;
60
+ }
61
+ .wxParse-h5 {
62
+ font-size: 0.83em;
63
+ margin: 1.5em 0;
64
+ }
65
+ .wxParse-h6 {
66
+ font-size: 0.75em;
67
+ margin: 1.67em 0;
68
+ }
69
+ .wxParse-h1 {
70
+ font-size: 18px;
71
+ font-weight: 400;
72
+ margin-bottom: 0.9em;
73
+ }
74
+ .wxParse-h2 {
75
+ font-size: 16px;
76
+ font-weight: 400;
77
+ margin-bottom: 0.34em;
78
+ }
79
+ .wxParse-h3 {
80
+ font-weight: 400;
81
+ font-size: 15px;
82
+ margin-bottom: 0.34em;
83
+ }
84
+ .wxParse-h4 {
85
+ font-weight: 400;
86
+ font-size: 14px;
87
+ margin-bottom: 0.24em;
88
+ }
89
+ .wxParse-h5 {
90
+ font-weight: 400;
91
+ font-size: 13px;
92
+ margin-bottom: 0.14em;
93
+ }
94
+ .wxParse-h6 {
95
+ font-weight: 400;
96
+ font-size: 12px;
97
+ margin-bottom: 0.04em;
98
+ }
99
+ .wxParse-section {
100
+ width: 100%;
101
+ max-width: 100% !important;
102
+ box-sizing: border-box;
103
+ }
104
+ .wxParse-h1,
105
+ .wxParse-h2,
106
+ .wxParse-h3,
107
+ .wxParse-h4,
108
+ .wxParse-h5,
109
+ .wxParse-h6,
110
+ .wxParse-b,
111
+ .wxParse-strong {
112
+ font-weight: bolder;
113
+ }
114
+ .wxParse-i,
115
+ .wxParse-cite,
116
+ .wxParse-em,
117
+ .wxParse-var,
118
+ .wxParse-address {
119
+ font-style: italic;
120
+ }
121
+ .wxParse-pre,
122
+ .wxParse-tt,
123
+ .wxParse-code,
124
+ .wxParse-kbd,
125
+ .wxParse-samp {
126
+ font-family: monospace;
127
+ }
128
+ .wxParse-pre {
129
+ white-space: pre;
130
+ }
131
+ .wxParse-big {
132
+ font-size: 1.17em;
133
+ }
134
+ .wxParse-small,
135
+ .wxParse-sub,
136
+ .wxParse-sup {
137
+ font-size: 0.83em;
138
+ }
139
+ .wxParse-sub {
140
+ vertical-align: sub;
141
+ }
142
+ .wxParse-sup {
143
+ vertical-align: super;
144
+ }
145
+ .wxParse-s,
146
+ .wxParse-strike,
147
+ .wxParse-del {
148
+ text-decoration: line-through;
149
+ }
150
+ /*wxparse-自定义个性化的css样式*/
151
+ /*增加video的css样式*/
152
+ .wxParse-strong,
153
+ wxParse-s {
154
+ display: inline;
155
+ }
156
+ .wxParse-a {
157
+ color: blue;
158
+ word-break: break-all;
159
+ overflow: auto;
160
+ text-decoration: underline;
161
+ }
162
+ .wxParse-video {
163
+ text-align: center;
164
+ margin: 10px 0;
165
+ }
166
+ .wxParse-video-video,
167
+ .wxParse-iframe-video {
168
+ width: 100%;
169
+ margin-bottom: 10rpx;
170
+ }
171
+ video.xiaoe-iframe-video {
172
+ /* width:686rpx; */
173
+ height: 386rpx;
174
+ margin-bottom: 20rpx;
175
+ max-width: 100%;
176
+ box-sizing: border-box;
177
+ display: block;
178
+ }
179
+ .xiaoe-iframe-audio {
180
+ margin-bottom: 20rpx;
181
+ max-width: 100%;
182
+ display: block;
183
+ }
184
+ .wxParse-img {
185
+ /*background-color: #efefef;*/
186
+ overflow: hidden!important;
187
+ /*width:40px;
188
+ height: 40px;*/
189
+ }
190
+ .hidden {
191
+ visibility: hidden;
192
+ }
193
+ .box-center {
194
+ margin: 0 auto;
195
+ }
196
+ .wxParse-blockquote {
197
+ margin: 0;
198
+ padding: 10px 0 10px 5px;
199
+ font-family: Courier, Calibri, "宋体";
200
+ background: #f5f5f5;
201
+ border-left: 3px solid #dbdbdb;
202
+ }
203
+ .wxParse-code,
204
+ .wxParse-wxxxcode-style {
205
+ display: inline;
206
+ background: #f5f5f5;
207
+ }
208
+ .wxParse-ul {
209
+ margin: 20rpx 10rpx;
210
+ }
211
+ .wxParse-li,
212
+ .wxParse-li-inner {
213
+ display: flex;
214
+ align-items: baseline;
215
+ margin: 10rpx 0;
216
+ }
217
+ .wxParse-li .wxParse-li-init {
218
+ width: 90rpx;
219
+ height: 100%;
220
+ text-align: right;
221
+ overflow: hidden;
222
+ line-height: 40rpx;
223
+ height: 45rpx;
224
+ }
225
+ .wxParse-li-text {
226
+ align-items: center;
227
+ line-height: 20px;
228
+ }
229
+ .wxParse-hr {
230
+ display: block;
231
+ unicode-bidi: isolate;
232
+ margin-block-start: 0.5em;
233
+ margin-block-end: 0.5em;
234
+ margin-inline-start: auto;
235
+ margin-inline-end: auto;
236
+ overflow: hidden;
237
+ border-style: inset;
238
+ border-width: 1px;
239
+ }
240
+ .wxParse-li-circle {
241
+ width: 10rpx;
242
+ height: 10rpx;
243
+ background-color: #333;
244
+ margin: 0rpx 32rpx 4rpx;
245
+ border-radius: 10rpx;
246
+ }
247
+ .wxParse-li-square {
248
+ width: 10rpx;
249
+ height: 10rpx;
250
+ background-color: #333;
251
+ margin: 0rpx 32rpx 4rpx;
252
+ }
253
+ .wxParse-li-ring {
254
+ width: 10rpx;
255
+ height: 10rpx;
256
+ border: 2rpx solid #333;
257
+ border-radius: 50%;
258
+ background-color: #fff;
259
+ margin: 0rpx 30rpx 3rpx;
260
+ }
261
+ /*.wxParse-table{
262
+ width: 100%;
263
+ height: 400px;
264
+ }
265
+ .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
266
+ display: flex;
267
+ flex-direction: row;
268
+ }
269
+ .wxParse-th,.wxParse-td{
270
+ display: flex;
271
+ width: 580px;
272
+ overflow: auto;
273
+ }*/
274
+ .wxParse-u {
275
+ text-decoration: underline;
276
+ }
277
+ .wxParse-hide {
278
+ display: none;
279
+ }
280
+ .WxEmojiView {
281
+ align-items: center;
282
+ }
283
+ .wxEmoji {
284
+ width: 16px;
285
+ height: 16px;
286
+ }
287
+ .wxParse-tr {
288
+ display: flex;
289
+ border-right: 1px solid #e0e0e0;
290
+ border-bottom: 1px solid #e0e0e0;
291
+ }
292
+ .wxParse-th,
293
+ .wxParse-td {
294
+ flex: 1;
295
+ padding: 5px;
296
+ font-size: 28rpx;
297
+ border-left: 1px solid #e0e0e0;
298
+ word-wrap: break-word;
299
+ }
300
+ .wxParse-td:last {
301
+ border-top: 1px solid #e0e0e0;
302
+ }
303
+ .wxParse-th {
304
+ background: #f0f0f0;
305
+ border-top: 1px solid #e0e0e0;
306
+ }
307
+ .img {
308
+ max-width: 100%;
309
+ }
310
+ .wxParse-br {
311
+ min-height: 1em;
312
+ }
313
+ /* p标签没换行 故设此样式 */
314
+ .wxParse-p {
315
+ min-height: 1em;
316
+ }
@@ -0,0 +1,232 @@
1
+ const computedBehavior = require('miniprogram-computed').behavior
2
+ import { rpxToVmin } from '../../common/utils/index.js'
3
+ import Dialog from '@vant/weapp/dialog/dialog';
4
+
5
+ // 奖励icon配置
6
+ const reward_config = {
7
+ 1: {
8
+ label: '积分',
9
+ icon: 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltrgz5y1064s.png',
10
+ },
11
+ 2: {
12
+ label: '优惠券',
13
+ icon: 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltrgz5y00wfn.png',
14
+ },
15
+ 3: {
16
+ label: '红包',
17
+ icon: 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltrgz5xy0i8g.png',
18
+ },
19
+ 4: {
20
+ label: '课程',
21
+ icon: 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltrgz5xu04is.png',
22
+ },
23
+ 5: {
24
+ label: '奖品',
25
+ icon: 'https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltrgz5xz08pf.png',
26
+ },
27
+ }
28
+
29
+ Component({
30
+ behaviors: [computedBehavior],
31
+ /**
32
+ * 组件的属性列表
33
+ */
34
+ properties: {
35
+ showPopup:{
36
+ type: Boolean,
37
+ value: false
38
+ },
39
+ popPosition: {
40
+ type: String,
41
+ value: 'bottom'
42
+ },
43
+ orientation: {
44
+ type: String,
45
+ value: 'hor'
46
+ },
47
+ // 当前打开弹窗的任务
48
+ quiz_task_item: {
49
+ type: Object,
50
+ value: {}
51
+ },
52
+ // 当前任务的参与结果
53
+ join_result: {
54
+ type: Object,
55
+ value: {}
56
+ },
57
+ // 当前答题数组
58
+ show_quiz_list: {
59
+ type: Array,
60
+ value: []
61
+ },
62
+ // 当前查看解析的答题数组
63
+ show_quiz_analysis_list: {
64
+ type: Array,
65
+ value: []
66
+ },
67
+ // 整个任务列表数据
68
+ task_list: {
69
+ type: Array,
70
+ value: []
71
+ },
72
+ // 是否是结果解析
73
+ showAnalysis: {
74
+ type: Boolean,
75
+ value: false,
76
+ },
77
+ // 是否全屏互动
78
+ isFull: {
79
+ type: Boolean,
80
+ value: false
81
+ }
82
+ },
83
+
84
+ /**
85
+ * 组件的初始数据
86
+ */
87
+ data: {
88
+ currentIndex: 0, // 当前题目的下标
89
+ total: 0, // 总题目数
90
+ quizList: [], // 题目内容
91
+ },
92
+ computed: {
93
+ customStyle({ popPosition, orientation }) {
94
+ const position = `position: ${orientation === 'ver' ? 'fixed' : 'absolute'}; left: 0; bottom: 0`
95
+ return popPosition === "bottom" ? `${position}; width: ${orientation === 'ver' ? '100%' : ''}; height: calc(100% - ${rpxToVmin(422)});` : "height: 100%;width: 100vmin;border-radius: 0;"
96
+ },
97
+ // 奖励图标
98
+ rewardIcon({ quiz_task_item }) {
99
+ const { reward_type } = quiz_task_item
100
+ return reward_config[reward_type]?.icon
101
+ },
102
+
103
+ // 奖励内容
104
+ rewardText({ quiz_task_item }) {
105
+ const { reward_type, reward_value } = quiz_task_item
106
+ const onlyOneType = [2, 4, 5]
107
+ if (onlyOneType.includes(reward_type)) {
108
+ return `+1 ${reward_config[reward_type]?.label}`
109
+ } else if (reward_type === 3) {
110
+ return `+${(reward_value.money / 100).toFixed(2)} ${reward_config[reward_type]?.label}`
111
+ } else {
112
+ return `+${reward_value} ${reward_config[reward_type]?.label}`
113
+ }
114
+ },
115
+ },
116
+ observers: {
117
+ showPopup(val) {
118
+ if (val) {
119
+ this.setData({
120
+ currentIndex: 0,
121
+ total: this.data.show_quiz_list.length,
122
+ quizList: this.data[this.data.showAnalysis ? 'show_quiz_analysis_list' : 'show_quiz_list'],
123
+ }, ()=> {
124
+ console.error('jer=========进入弹窗', this.data);
125
+ })
126
+ }
127
+ }
128
+ },
129
+ /**
130
+ * 组件的方法列表
131
+ */
132
+ methods: {
133
+ closePop(){
134
+ this.triggerEvent("closePop")
135
+ this.setData({
136
+ currentIndex: 0,
137
+ total: 0,
138
+ quizList: [],
139
+ })
140
+ },
141
+ // 答题顺序恐惧
142
+ handleQuizOrder(e) {
143
+ let currentIndex = this.data.currentIndex;
144
+ switch (e.currentTarget.dataset.type) {
145
+ case "prev":
146
+ currentIndex--;
147
+ break;
148
+ case "next":
149
+ currentIndex++;
150
+ break;
151
+ case "submit":
152
+ Dialog.confirm({
153
+ context: this,
154
+ closeOnClickOverlay: false,
155
+ title: '确认提交?',
156
+ message: '提交后将无法修改答案,系统直接批改,确认要提交吗?',
157
+ confirmButtonText: '确认',
158
+ cancelButtonText: '取消',
159
+ confirmButtonColor: '#1472FF',
160
+ zIndex: 501,
161
+ })
162
+ .then(() => {
163
+ // 处理获取题目id和答案id
164
+ let params = this.data.quizList.map((item) => {
165
+ // 获取用户选择的答案
166
+ let userAnswer = [];
167
+ for (let index = 0; index < item.options.length; index++) {
168
+ const ele = item.options[index];
169
+ if (ele.selected) {
170
+ userAnswer.push(ele.op_id);
171
+ }
172
+ }
173
+ return {
174
+ qs_id: item.qs_id,
175
+ op_id: userAnswer,
176
+ };
177
+ });
178
+ // 获取列表中当前任务是否结束了,兼容提交前端校验
179
+ const taskFindItem =
180
+ this.data.task_list.find(
181
+ (item) => item.id === this.data.quiz_task_item.id
182
+ ) || {};
183
+ if (taskFindItem.state === 2) {
184
+ this.closePop()
185
+ wx.showToast({
186
+ title: '当前答题已结束,无法继续提交',
187
+ icon: 'none',
188
+ duration: 1000,
189
+ })
190
+ return;
191
+ }
192
+ // 存储用户答案,用于接口请求参数
193
+ // 调用完成任务接口
194
+ this.triggerEvent("commonFulfilTasks", {
195
+ user_answer: params,
196
+ ids: [this.data.quiz_task_item.id],
197
+ taskItem: this.data.quiz_task_item,
198
+ })
199
+ })
200
+ .catch((err) => {
201
+ // 暂无操作
202
+ });
203
+ break;
204
+
205
+ default:
206
+ break;
207
+ }
208
+ this.setData({ currentIndex })
209
+ },
210
+ // 点击选项进行操作答题
211
+ clickOption(e) {
212
+ const index = e.detail
213
+ console.error('jer=============选择11111', index);
214
+ const tempQuizItem =
215
+ this.data.quizList[this.data.currentIndex];
216
+ // 多选题
217
+ if (tempQuizItem.qs_type === 1) {
218
+ tempQuizItem.options[index].selected = !tempQuizItem.options[index].selected
219
+ } else {
220
+ for (let i = 0; i < tempQuizItem.options.length; i++) {
221
+ tempQuizItem.options[i].selected = false;
222
+ }
223
+ tempQuizItem.options[index].selected = true;
224
+ }
225
+ this.setData({
226
+ quizList: this.data.quizList
227
+ }, ()=> {
228
+ console.error('jer============更改之后的数组', this.data.quizList);
229
+ })
230
+ },
231
+ }
232
+ })
@@ -0,0 +1,8 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "van-dialog": "@vant/weapp/dialog/index",
5
+ "van-popup": "@vant/weapp/popup/index",
6
+ "quizContent": "./components/quizContent/index"
7
+ }
8
+ }
@@ -0,0 +1,159 @@
1
+ $deviceWidth: 750;
2
+
3
+ @function vmin($rpx) {
4
+ @return #{$rpx * 100 / $deviceWidth}vmin;
5
+ }
6
+
7
+ @mixin task-quiz-popup {
8
+ height: 100%;
9
+ .quiz-popup {
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: center;
13
+ background-color: #f5f5f5;
14
+ border-radius: vmin(24) vmin(24) 0 0;
15
+ z-index: 500;
16
+ .content-header {
17
+ width: 100%;
18
+ height: vmin(96);
19
+ font-size: vmin(32);
20
+ font-weight: 500;
21
+ display: flex;
22
+ justify-content: center;
23
+ align-items: center;
24
+ position: relative;
25
+ .popup-close-icon {
26
+ width: vmin(32);
27
+ height: vmin(32);
28
+ position: absolute;
29
+ top: vmin(32);
30
+ right: vmin(32);
31
+ }
32
+ }
33
+
34
+ .popup-content{
35
+ flex: 1;
36
+ box-sizing: border-box;
37
+ overflow-y: overlay;
38
+ padding: 0 vmin(32);
39
+ width: 100%;
40
+
41
+ .reward-show-box {
42
+ display: flex;
43
+ padding: vmin(32) vmin(24);
44
+ flex-direction: column;
45
+ align-items: flex-start;
46
+ border-radius: vmin(16);
47
+ background: #fff;
48
+ color: #333333;
49
+ font-family: "PingFang SC";
50
+ font-size: vmin(28);
51
+ font-style: normal;
52
+ font-weight: 400;
53
+ margin-bottom: vmin(32);
54
+ line-height: vmin(40);
55
+ .reward-condition {
56
+ font-weight: 500;
57
+ .orange-color {
58
+ color: #ff5429;
59
+ }
60
+ }
61
+ .reward-result {
62
+ display: flex;
63
+ align-items: center;
64
+ margin-top: vmin(8);
65
+ .reward-result-show {
66
+ margin-left: vmin(16);
67
+ color: #ff5429;
68
+ font-size: vmin(24);
69
+ display: inline-flex;
70
+ align-items: center;
71
+
72
+ .reward-img {
73
+ width: vmin(24);
74
+ height: vmin(24);
75
+ padding: vmin(4) 0;
76
+ vertical-align: top;
77
+ }
78
+ }
79
+ }
80
+ }
81
+ .analysis-tip {
82
+ font-size: vmin(32);
83
+ color: #333333;
84
+ font-family: "PingFang SC";
85
+ font-style: normal;
86
+ font-weight: 500;
87
+ line-height: vmin(48);
88
+ margin-bottom: vmin(32);
89
+ }
90
+ }
91
+
92
+ .content-footer {
93
+ width: 100%;
94
+ height: vmin(112);
95
+ font-size: vmin(32);
96
+ font-weight: 400;
97
+ color: #999;
98
+ line-height: vmin(40);
99
+ display: flex;
100
+ justify-content: center;
101
+ align-items: center;
102
+ padding: 0 vmin(32);
103
+ box-sizing: border-box;
104
+ view {
105
+ flex: 1;
106
+ height: vmin(80);
107
+ font-weight: 500;
108
+ line-height: vmin(80);
109
+ font-size: vmin(28);
110
+ text-align: center;
111
+ border-radius: vmin(40);
112
+ box-sizing: border-box;
113
+ }
114
+ .last-step {
115
+ margin-right: vmin(30);
116
+ }
117
+ .last-step,
118
+ .next-step {
119
+ color: #1472ff;
120
+ border: vmin(2) solid #1472ff;
121
+ }
122
+ .submit-step {
123
+ color: #fff;
124
+ background: #1472ff;
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ .task-quiz-popup {
131
+ @include task-quiz-popup;
132
+ }
133
+
134
+ // 竖屏pad
135
+ @media screen and (min-width: 768px) and (orientation: portrait) {
136
+ $deviceWidth: 1536 !global;
137
+
138
+ .task-quiz-popup {
139
+ @include task-quiz-popup;
140
+ }
141
+ }
142
+
143
+ // PC 放大适配
144
+ @media screen and (min-height: 630px) and (orientation: landscape) {
145
+ $deviceWidth: 1260 !global;
146
+
147
+ .task-quiz-popup {
148
+ @include task-quiz-popup;
149
+ }
150
+ }
151
+
152
+ // 横屏pad
153
+ @media screen and (min-height: 768px) and (orientation: landscape) {
154
+ $deviceWidth: 1536 !global;
155
+
156
+ .task-quiz-popup {
157
+ @include task-quiz-popup;
158
+ }
159
+ }