xiaoe_mp_npm 1.0.21 → 1.0.22-test01

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 +226 -0
  41. package/miniprogram_dist/Task/TaskQuizPopup/index.json +8 -0
  42. package/miniprogram_dist/Task/TaskQuizPopup/index.scss +158 -0
  43. package/miniprogram_dist/Task/TaskQuizPopup/index.wxml +96 -0
  44. package/miniprogram_dist/Task/TaskQuizPopup/index.wxss +474 -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 +226 -0
  135. package/src/Task/TaskQuizPopup/index.json +8 -0
  136. package/src/Task/TaskQuizPopup/index.scss +158 -0
  137. package/src/Task/TaskQuizPopup/index.wxml +96 -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,283 @@
1
+
2
+ .wxParse{
3
+ color: #666;
4
+ line-height: 1.8;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .wxParse view{
9
+ white-space:pre-line;
10
+ word-wrap:break-word;
11
+ box-sizing: border-box;
12
+
13
+ }
14
+
15
+ .wxParse view,
16
+ .wxParse navigator,
17
+ .wxParse text,
18
+ .wxParse image,
19
+ .wxParse video,
20
+ .wxParse input,
21
+ .wxParse button,
22
+ .wxParse checkbox,
23
+ .wxParse label,
24
+ .wxParse textarea,
25
+ .wxParse form,
26
+ .wxParse radio,
27
+ .wxParse navigator{
28
+ max-width: 100% !important;
29
+ }
30
+
31
+ view{
32
+ word-wrap:break-word;
33
+ white-space:normal;
34
+ }
35
+
36
+ /* 是否需要可选中 */
37
+ .wxParse .user-select view,
38
+ .wxParse .user-select text{
39
+ user-select:text;
40
+ -webkit-user-select:text;
41
+ }
42
+
43
+ .wxParse-inline{
44
+ display: inline;
45
+ margin: 0;
46
+ padding: 0;
47
+ }
48
+ /*//标题 */
49
+ .wxParse-div{margin: 0;padding: 0;}
50
+ .wxParse-h1{ font-size:2em; margin: .67em 0 }
51
+ .wxParse-h2{ font-size:1.5em; margin: .75em 0 }
52
+ .wxParse-h3{ font-size:1.17em; margin: .83em 0 }
53
+ .wxParse-h4{ margin: 1.12em 0}
54
+ .wxParse-h5 { font-size:.83em; margin: 1.5em 0 }
55
+ .wxParse-h6{ font-size:.75em; margin: 1.67em 0 }
56
+
57
+ .wxParse-h1 {
58
+ font-size: 18px;
59
+ font-weight: 400;
60
+ margin-bottom: .9em;
61
+ }
62
+ .wxParse-h2 {
63
+ font-size: 16px;
64
+ font-weight: 400;
65
+ margin-bottom: .34em;
66
+ }
67
+ .wxParse-h3 {
68
+ font-weight: 400;
69
+ font-size: 15px;
70
+ margin-bottom: .34em;
71
+ }
72
+ .wxParse-h4 {
73
+ font-weight: 400;
74
+ font-size: 14px;
75
+ margin-bottom: .24em;
76
+ }
77
+ .wxParse-h5 {
78
+ font-weight: 400;
79
+ font-size: 13px;
80
+ margin-bottom: .14em;
81
+ }
82
+ .wxParse-h6 {
83
+ font-weight: 400;
84
+ font-size: 12px;
85
+ margin-bottom: .04em;
86
+ }
87
+ .wxParse-section {
88
+ width: 100%;
89
+ max-width: 100% !important;
90
+ box-sizing: border-box;
91
+ }
92
+
93
+ .wxParse-h1, .wxParse-h2, .wxParse-h3, .wxParse-h4, .wxParse-h5, .wxParse-h6, .wxParse-b, .wxParse-strong { font-weight: bolder }
94
+
95
+ .wxParse-i,.wxParse-cite,.wxParse-em,.wxParse-var,.wxParse-address{font-style:italic}
96
+ .wxParse-pre,.wxParse-tt,.wxParse-code,.wxParse-kbd,.wxParse-samp{font-family:monospace}
97
+ .wxParse-pre{white-space:pre}
98
+ .wxParse-big{font-size:1.17em}
99
+ .wxParse-small,.wxParse-sub,.wxParse-sup{font-size:.83em}
100
+ .wxParse-sub{vertical-align:sub}
101
+ .wxParse-sup{vertical-align:super}
102
+ .wxParse-s,.wxParse-strike,.wxParse-del{text-decoration:line-through}
103
+ /*wxparse-自定义个性化的css样式*/
104
+ /*增加video的css样式*/
105
+ .wxParse-strong,wxParse-s{display: inline}
106
+ .wxParse-a{
107
+ color: blue;
108
+ word-break:break-all;
109
+ overflow:auto;
110
+ text-decoration: underline;
111
+ }
112
+
113
+ .wxParse-video{
114
+ text-align: center;
115
+ margin: 10px 0;
116
+ }
117
+
118
+ .wxParse-video-video, .wxParse-iframe-video{
119
+ width:100%;
120
+ margin-bottom: 10rpx;
121
+ }
122
+
123
+ video.xiaoe-iframe-video {
124
+ /* width:686rpx; */
125
+ height:386rpx;
126
+ margin-bottom: 20rpx;
127
+ max-width: 100%;
128
+ box-sizing: border-box;
129
+ display: block;
130
+ }
131
+
132
+ .xiaoe-iframe-audio {
133
+ margin-bottom: 20rpx;
134
+ max-width: 100%;
135
+ display: block;
136
+ }
137
+
138
+ .wxParse-img{
139
+ /*background-color: #efefef;*/
140
+ overflow: hidden!important;
141
+ /*width:40px;
142
+ height: 40px;*/
143
+ }
144
+
145
+ .hidden{
146
+ visibility: hidden;
147
+ }
148
+
149
+ .box-center{
150
+ margin: 0 auto;
151
+ }
152
+
153
+ .wxParse-blockquote {
154
+ margin: 0;
155
+ padding:10px 0 10px 5px;
156
+ font-family:Courier, Calibri,"宋体";
157
+ background:#f5f5f5;
158
+ border-left: 3px solid #dbdbdb;
159
+ }
160
+
161
+ .wxParse-code,.wxParse-wxxxcode-style{
162
+ display: inline;
163
+ background:#f5f5f5;
164
+ }
165
+ .wxParse-ul{
166
+ margin: 20rpx 10rpx;
167
+ }
168
+
169
+ .wxParse-li,.wxParse-li-inner{
170
+ display: flex;
171
+ align-items: baseline;
172
+ margin: 10rpx 0;
173
+ }
174
+
175
+ .wxParse-li .wxParse-li-init {
176
+ width: 90rpx;
177
+ height: 100%;
178
+ text-align: right;
179
+ overflow:hidden;
180
+ line-height:40rpx;
181
+ height:45rpx;
182
+ }
183
+
184
+ .wxParse-li-text{
185
+ align-items: center;
186
+ line-height: 20px;
187
+ }
188
+
189
+ .wxParse-hr {
190
+ display: block;
191
+ unicode-bidi: isolate;
192
+ margin-block-start: 0.5em;
193
+ margin-block-end: 0.5em;
194
+ margin-inline-start: auto;
195
+ margin-inline-end: auto;
196
+ overflow: hidden;
197
+ border-style: inset;
198
+ border-width: 1px;
199
+ }
200
+
201
+ .wxParse-li-circle{
202
+ width: 10rpx;
203
+ height: 10rpx;
204
+ background-color: #333;
205
+ margin: 0rpx 32rpx 4rpx;
206
+ border-radius: 10rpx;
207
+ }
208
+
209
+ .wxParse-li-square{
210
+ width: 10rpx;
211
+ height: 10rpx;
212
+ background-color: #333;
213
+ margin: 0rpx 32rpx 4rpx;
214
+ }
215
+ .wxParse-li-ring{
216
+ width: 10rpx;
217
+ height: 10rpx;
218
+ border: 2rpx solid #333;
219
+ border-radius: 50%;
220
+ background-color: #fff;
221
+ margin: 0rpx 30rpx 3rpx;
222
+ }
223
+
224
+ /*.wxParse-table{
225
+ width: 100%;
226
+ height: 400px;
227
+ }
228
+ .wxParse-thead,.wxParse-tfoot,.wxParse-tr{
229
+ display: flex;
230
+ flex-direction: row;
231
+ }
232
+ .wxParse-th,.wxParse-td{
233
+ display: flex;
234
+ width: 580px;
235
+ overflow: auto;
236
+ }*/
237
+
238
+ .wxParse-u {
239
+ text-decoration: underline;
240
+ }
241
+ .wxParse-hide{
242
+ display: none;
243
+ }
244
+ .WxEmojiView{
245
+ align-items: center;
246
+ }
247
+ .wxEmoji{
248
+ width: 16px;
249
+ height:16px;
250
+ }
251
+ .wxParse-tr{
252
+ display: flex;
253
+ border-right:1px solid #e0e0e0;
254
+ border-bottom:1px solid #e0e0e0;
255
+ }
256
+ .wxParse-th,
257
+ .wxParse-td{
258
+ flex:1;
259
+ padding:5px;
260
+ font-size:28rpx;
261
+ border-left:1px solid #e0e0e0;
262
+ word-wrap:break-word;
263
+ }
264
+ .wxParse-td:last{
265
+ border-top:1px solid #e0e0e0;
266
+ }
267
+ .wxParse-th{
268
+ background:#f0f0f0;
269
+ border-top:1px solid #e0e0e0;
270
+ }
271
+
272
+ .img{
273
+ max-width: 100%;
274
+ }
275
+
276
+ .wxParse-br{
277
+ min-height: 1em;
278
+ }
279
+
280
+ /* p标签没换行 故设此样式 */
281
+ .wxParse-p{
282
+ min-height: 1em;
283
+ }
@@ -0,0 +1,226 @@
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
+
79
+ /**
80
+ * 组件的初始数据
81
+ */
82
+ data: {
83
+ currentIndex: 0, // 当前题目的下标
84
+ total: 0, // 总题目数
85
+ quizList: [], // 题目内容
86
+ },
87
+ computed: {
88
+ customStyle({ popPosition, orientation }) {
89
+ const position = `position: ${orientation === 'ver' ? 'fixed' : 'absolute'}; left: 0; bottom: 0`
90
+ return popPosition === "bottom" ? `${position}; width: ${orientation === 'ver' ? '100%' : ''}; height: calc(100% - ${rpxToVmin(422)});` : "height: 100%;width: 100vmin;"
91
+ },
92
+ // 奖励图标
93
+ rewardIcon({ quiz_task_item }) {
94
+ const { reward_type } = quiz_task_item
95
+ return reward_config[reward_type]?.icon
96
+ },
97
+
98
+ // 奖励内容
99
+ rewardText({ quiz_task_item }) {
100
+ const { reward_type, reward_value } = quiz_task_item
101
+ const onlyOneType = [2, 4, 5]
102
+ if (onlyOneType.includes(reward_type)) {
103
+ return `+1 ${reward_config[reward_type]?.label}`
104
+ } else if (reward_type === 3) {
105
+ return `+${(reward_value.money / 100).toFixed(2)} ${reward_config[reward_type]?.label}`
106
+ } else {
107
+ return `+${reward_value} ${reward_config[reward_type]?.label}`
108
+ }
109
+ },
110
+ },
111
+ observers: {
112
+ showPopup(val) {
113
+ if (val) {
114
+ this.setData({
115
+ currentIndex: 0,
116
+ total: this.data.show_quiz_list.length,
117
+ quizList: this.data[this.data.showAnalysis ? 'show_quiz_analysis_list' : 'show_quiz_list'],
118
+ }, ()=> {
119
+ console.error('jer=========进入弹窗', this.data);
120
+ })
121
+ }
122
+ }
123
+ },
124
+ /**
125
+ * 组件的方法列表
126
+ */
127
+ methods: {
128
+ closePop(){
129
+ this.triggerEvent("closePop")
130
+ this.setData({
131
+ currentIndex: 0,
132
+ total: 0,
133
+ quizList: [],
134
+ })
135
+ },
136
+ // 答题顺序恐惧
137
+ handleQuizOrder(e) {
138
+ let currentIndex = this.data.currentIndex;
139
+ switch (e.currentTarget.dataset.type) {
140
+ case "prev":
141
+ currentIndex--;
142
+ break;
143
+ case "next":
144
+ currentIndex++;
145
+ break;
146
+ case "submit":
147
+ Dialog.confirm({
148
+ context: this,
149
+ closeOnClickOverlay: false,
150
+ title: '确认提交?',
151
+ message: '提交后将无法修改答案,系统直接批改,确认要提交吗?',
152
+ confirmButtonText: '确认',
153
+ cancelButtonText: '取消',
154
+ confirmButtonColor: '#1472FF',
155
+ })
156
+ .then(() => {
157
+ // 处理获取题目id和答案id
158
+ let params = this.data.quizList.map((item) => {
159
+ // 获取用户选择的答案
160
+ let userAnswer = [];
161
+ for (let index = 0; index < item.options.length; index++) {
162
+ const ele = item.options[index];
163
+ if (ele.selected) {
164
+ userAnswer.push(ele.op_id);
165
+ }
166
+ }
167
+ return {
168
+ qs_id: item.qs_id,
169
+ op_id: userAnswer,
170
+ };
171
+ });
172
+ // 获取列表中当前任务是否结束了,兼容提交前端校验
173
+ const taskFindItem =
174
+ this.data.task_list.find(
175
+ (item) => item.id === this.data.quiz_task_item.id
176
+ ) || {};
177
+ if (taskFindItem.state === 2) {
178
+ this.closePop()
179
+ wx.showToast({
180
+ title: '当前答题已结束,无法继续提交',
181
+ icon: 'none',
182
+ duration: 1000,
183
+ })
184
+ return;
185
+ }
186
+ // 存储用户答案,用于接口请求参数
187
+ // 调用完成任务接口
188
+ this.triggerEvent("commonFulfilTasks", {
189
+ user_answer: params,
190
+ ids: [this.data.quiz_task_item.id],
191
+ taskItem: this.data.quiz_task_item,
192
+ })
193
+ })
194
+ .catch((err) => {
195
+ // 暂无操作
196
+ });
197
+ break;
198
+
199
+ default:
200
+ break;
201
+ }
202
+ this.setData({ currentIndex })
203
+ },
204
+ // 点击选项进行操作答题
205
+ clickOption(e) {
206
+ const index = e.detail
207
+ console.error('jer=============选择11111', index);
208
+ const tempQuizItem =
209
+ this.data.quizList[this.data.currentIndex];
210
+ // 多选题
211
+ if (tempQuizItem.qs_type === 1) {
212
+ tempQuizItem.options[index].selected = !tempQuizItem.options[index].selected
213
+ } else {
214
+ for (let i = 0; i < tempQuizItem.options.length; i++) {
215
+ tempQuizItem.options[i].selected = false;
216
+ }
217
+ tempQuizItem.options[index].selected = true;
218
+ }
219
+ this.setData({
220
+ quizList: this.data.quizList
221
+ }, ()=> {
222
+ console.error('jer============更改之后的数组', this.data.quizList);
223
+ })
224
+ },
225
+ }
226
+ })
@@ -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,158 @@
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
+ font-size: vmin(32);
95
+ font-weight: 400;
96
+ color: #999;
97
+ line-height: vmin(40);
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+ padding: 0 vmin(32);
102
+ box-sizing: border-box;
103
+ view {
104
+ flex: 1;
105
+ height: vmin(80);
106
+ font-weight: 500;
107
+ line-height: vmin(80);
108
+ font-size: vmin(28);
109
+ text-align: center;
110
+ border-radius: vmin(40);
111
+ box-sizing: border-box;
112
+ }
113
+ .last-step {
114
+ margin-right: vmin(30);
115
+ }
116
+ .last-step,
117
+ .next-step {
118
+ color: #1472ff;
119
+ border: vmin(2) solid #1472ff;
120
+ }
121
+ .submit-step {
122
+ color: #fff;
123
+ background: #1472ff;
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ .task-quiz-popup {
130
+ @include task-quiz-popup;
131
+ }
132
+
133
+ // 竖屏pad
134
+ @media screen and (min-width: 768px) and (orientation: portrait) {
135
+ $deviceWidth: 1536 !global;
136
+
137
+ .task-quiz-popup {
138
+ @include task-quiz-popup;
139
+ }
140
+ }
141
+
142
+ // PC 放大适配
143
+ @media screen and (min-height: 630px) and (orientation: landscape) {
144
+ $deviceWidth: 1260 !global;
145
+
146
+ .task-quiz-popup {
147
+ @include task-quiz-popup;
148
+ }
149
+ }
150
+
151
+ // 横屏pad
152
+ @media screen and (min-height: 768px) and (orientation: landscape) {
153
+ $deviceWidth: 1536 !global;
154
+
155
+ .task-quiz-popup {
156
+ @include task-quiz-popup;
157
+ }
158
+ }