xiaoe_mp_npm 1.0.21 → 1.0.22-store1
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/Task/TaskBubble/index.js +2 -1
- package/miniprogram_dist/Task/TaskBubble/index.json +3 -3
- package/miniprogram_dist/Task/TaskBubble/index.scss +125 -125
- package/miniprogram_dist/Task/TaskBubble/index.wxml +22 -22
- package/miniprogram_dist/Task/TaskIcon/index.js +29 -29
- package/miniprogram_dist/Task/TaskIcon/index.json +4 -4
- package/miniprogram_dist/Task/TaskIcon/index.scss +70 -70
- package/miniprogram_dist/Task/TaskIcon/index.wxml +5 -5
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.js +39 -39
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.json +6 -6
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.scss +39 -39
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxml +19 -19
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +266 -168
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.json +5 -5
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +26 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +32 -13
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxs +7 -7
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxss +96 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +8 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.json +7 -7
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +66 -66
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +1 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.js +4 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.json +9 -9
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.scss +62 -62
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.wxml +1 -0
- package/miniprogram_dist/Task/TaskPopup/index.js +76 -70
- package/miniprogram_dist/Task/TaskPopup/index.json +2 -2
- package/miniprogram_dist/Task/TaskPopup/index.scss +140 -140
- package/miniprogram_dist/Task/TaskPopup/index.wxml +1 -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 +40 -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 +225 -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 +74 -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/Task/taskReceivePopup/coupon/index.json +6 -6
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxs +48 -48
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.js +44 -44
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.json +6 -6
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.scss +106 -106
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.wxml +38 -38
- package/miniprogram_dist/Task/taskReceivePopup/customPrizes/index.wxs +48 -48
- package/miniprogram_dist/Task/taskReceivePopup/index.js +34 -34
- package/miniprogram_dist/Task/taskReceivePopup/index.json +13 -13
- package/miniprogram_dist/Task/taskReceivePopup/index.wxml +25 -25
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.js +61 -61
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.json +6 -6
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.scss +60 -60
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.wxml +12 -12
- package/miniprogram_dist/common/utils/tool.js +54 -48
- package/package.json +1 -1
- package/src/CustomPopup/index.wxss +22 -22
- package/src/Task/TaskBubble/index.js +2 -1
- package/src/Task/TaskBubble/index.json +3 -3
- package/src/Task/TaskBubble/index.scss +125 -125
- package/src/Task/TaskBubble/index.wxml +22 -22
- package/src/Task/TaskBubble/index.wxss +289 -289
- package/src/Task/TaskIcon/index.js +29 -29
- package/src/Task/TaskIcon/index.json +4 -4
- package/src/Task/TaskIcon/index.scss +70 -70
- package/src/Task/TaskIcon/index.wxml +5 -5
- package/src/Task/TaskIcon/index.wxss +130 -130
- package/src/Task/TaskPopup/component/RewardList/index.js +39 -39
- package/src/Task/TaskPopup/component/RewardList/index.json +6 -6
- package/src/Task/TaskPopup/component/RewardList/index.scss +39 -39
- package/src/Task/TaskPopup/component/RewardList/index.wxml +19 -19
- package/src/Task/TaskPopup/component/RewardList/index.wxss +18 -18
- package/src/Task/TaskPopup/component/TaskItem/index.js +266 -168
- package/src/Task/TaskPopup/component/TaskItem/index.json +5 -5
- package/src/Task/TaskPopup/component/TaskItem/index.scss +26 -0
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +32 -13
- package/src/Task/TaskPopup/component/TaskItem/index.wxs +7 -7
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -394
- package/src/Task/TaskPopup/component/TaskList/index.js +8 -0
- package/src/Task/TaskPopup/component/TaskList/index.json +7 -7
- package/src/Task/TaskPopup/component/TaskList/index.scss +66 -66
- package/src/Task/TaskPopup/component/TaskList/index.wxml +1 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxss +118 -118
- package/src/Task/TaskPopup/component/TaskType/index.js +4 -0
- package/src/Task/TaskPopup/component/TaskType/index.json +9 -9
- package/src/Task/TaskPopup/component/TaskType/index.scss +62 -62
- package/src/Task/TaskPopup/component/TaskType/index.wxml +1 -0
- package/src/Task/TaskPopup/component/TaskType/index.wxss +110 -110
- package/src/Task/TaskPopup/index.js +76 -70
- package/src/Task/TaskPopup/index.json +2 -2
- package/src/Task/TaskPopup/index.scss +140 -140
- package/src/Task/TaskPopup/index.wxml +1 -0
- 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 +40 -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 +225 -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 +74 -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/coupon/index.json +6 -6
- package/src/Task/taskReceivePopup/coupon/index.wxs +48 -48
- package/src/Task/taskReceivePopup/customPrizes/index.js +44 -44
- package/src/Task/taskReceivePopup/customPrizes/index.json +6 -6
- package/src/Task/taskReceivePopup/customPrizes/index.scss +106 -106
- package/src/Task/taskReceivePopup/customPrizes/index.wxml +38 -38
- package/src/Task/taskReceivePopup/customPrizes/index.wxs +48 -48
- package/src/Task/taskReceivePopup/index.js +34 -34
- package/src/Task/taskReceivePopup/index.json +13 -13
- package/src/Task/taskReceivePopup/index.wxml +25 -25
- package/src/Task/taskReceivePopup/index.wxss +1 -1
- package/src/Task/taskReceivePopup/integral/index.js +61 -61
- package/src/Task/taskReceivePopup/integral/index.json +6 -6
- package/src/Task/taskReceivePopup/integral/index.scss +60 -60
- package/src/Task/taskReceivePopup/integral/index.wxml +12 -12
- package/src/Task/taskReceivePopup/integral/index.wxss +94 -94
- package/src/common/utils/tool.js +54 -48
|
@@ -1,132 +1,138 @@
|
|
|
1
1
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
2
|
-
import { rpxToVmin } from '../../common/utils/index.js'
|
|
2
|
+
import { rpxToVmin } from '../../npm-compoent/miniprogram_npm/xiaoe_mp_npm/common/utils/index.js'
|
|
3
3
|
Component({
|
|
4
4
|
options: {
|
|
5
5
|
styleIsolation: 'shared',
|
|
6
6
|
},
|
|
7
7
|
behaviors: [computedBehavior],
|
|
8
8
|
properties: {
|
|
9
|
-
showPopup:{
|
|
9
|
+
showPopup: {
|
|
10
10
|
type: Boolean,
|
|
11
|
-
value: false
|
|
11
|
+
value: false,
|
|
12
12
|
},
|
|
13
|
-
taskList:{
|
|
14
|
-
type:Array,
|
|
15
|
-
value:()=>{
|
|
13
|
+
taskList: {
|
|
14
|
+
type: Array,
|
|
15
|
+
value: () => {
|
|
16
16
|
return []
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
18
|
},
|
|
19
|
-
errorList:{
|
|
20
|
-
type:Array,
|
|
21
|
-
value:()=>{
|
|
19
|
+
errorList: {
|
|
20
|
+
type: Array,
|
|
21
|
+
value: () => {
|
|
22
22
|
return []
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
24
|
},
|
|
25
|
-
rewardList:{
|
|
26
|
-
type:Array,
|
|
27
|
-
value:()=>{
|
|
25
|
+
rewardList: {
|
|
26
|
+
type: Array,
|
|
27
|
+
value: () => {
|
|
28
28
|
return []
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
30
|
},
|
|
31
|
-
hasRewardRecord:{
|
|
32
|
-
type:Boolean,
|
|
33
|
-
value: false
|
|
31
|
+
hasRewardRecord: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
value: false,
|
|
34
34
|
},
|
|
35
35
|
popPosition: {
|
|
36
36
|
type: String,
|
|
37
|
-
value: 'bottom'
|
|
37
|
+
value: 'bottom',
|
|
38
38
|
},
|
|
39
|
-
isShowClose:{
|
|
40
|
-
type:Boolean,
|
|
41
|
-
value: true
|
|
39
|
+
isShowClose: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
value: true,
|
|
42
42
|
},
|
|
43
|
-
rewardListRefreshStatus:{
|
|
44
|
-
type:Boolean,
|
|
45
|
-
value: false
|
|
43
|
+
rewardListRefreshStatus: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
value: false,
|
|
46
46
|
},
|
|
47
|
-
taskListRefreshStatus:{
|
|
48
|
-
type:Boolean,
|
|
49
|
-
value: false
|
|
47
|
+
taskListRefreshStatus: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
value: false,
|
|
50
50
|
},
|
|
51
51
|
orientation: {
|
|
52
52
|
type: String,
|
|
53
|
-
value: 'hor'
|
|
53
|
+
value: 'hor',
|
|
54
54
|
},
|
|
55
55
|
isFull: {
|
|
56
|
-
type:Boolean,
|
|
57
|
-
value: false
|
|
56
|
+
type: Boolean,
|
|
57
|
+
value: false,
|
|
58
58
|
},
|
|
59
|
-
viewingInProgress:{
|
|
60
|
-
type:Array,
|
|
61
|
-
value:()=>{
|
|
59
|
+
viewingInProgress: {
|
|
60
|
+
type: Array,
|
|
61
|
+
value: () => {
|
|
62
62
|
return []
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
teamId:{
|
|
66
|
+
type: String,
|
|
67
|
+
value: '',
|
|
64
68
|
}
|
|
65
69
|
},
|
|
66
70
|
data: {
|
|
67
|
-
isShowTaskList:true
|
|
71
|
+
isShowTaskList: true,
|
|
68
72
|
},
|
|
69
73
|
lifetimes: {
|
|
70
74
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
71
|
-
attached: function () {
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
moved: function () { },
|
|
75
|
-
detached: function () { },
|
|
75
|
+
attached: function () {},
|
|
76
|
+
moved: function () {},
|
|
77
|
+
detached: function () {},
|
|
76
78
|
},
|
|
77
79
|
computed: {
|
|
78
80
|
customStyle(properties) {
|
|
79
81
|
const { popPosition, orientation } = properties
|
|
80
82
|
const position = `position: ${orientation === 'ver' ? 'fixed' : 'absolute'}; left: 0; bottom: 0`
|
|
81
|
-
return popPosition ===
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return
|
|
83
|
+
return popPosition === 'bottom'
|
|
84
|
+
? `${position}; width: ${orientation === 'ver' ? '100%' : ''}; height: calc(100% - ${rpxToVmin(422)});`
|
|
85
|
+
: 'height: 100%;width: 100vmin;'
|
|
86
|
+
},
|
|
87
|
+
popupContentBackground(data) {
|
|
88
|
+
if (data.isShowTaskList) {
|
|
89
|
+
return data.isFull
|
|
90
|
+
? 'background-image: url(https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltzgkkz00m0m.png)'
|
|
91
|
+
: 'background-image: url(https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltqz384w02n9.png);'
|
|
92
|
+
} else {
|
|
93
|
+
return 'background: #FFEFD7;'
|
|
88
94
|
}
|
|
89
|
-
}
|
|
95
|
+
},
|
|
90
96
|
},
|
|
91
97
|
methods: {
|
|
92
|
-
toReward(){
|
|
93
|
-
if(!this.properties.hasRewardRecord){
|
|
98
|
+
toReward() {
|
|
99
|
+
if (!this.properties.hasRewardRecord) {
|
|
94
100
|
wx.showToast({
|
|
95
|
-
title:
|
|
96
|
-
icon:
|
|
101
|
+
title: '还未完成任务,加油~',
|
|
102
|
+
icon: 'none',
|
|
97
103
|
})
|
|
98
104
|
return
|
|
99
105
|
}
|
|
100
|
-
this.triggerEvent(
|
|
106
|
+
this.triggerEvent('toReward')
|
|
101
107
|
this.setData({
|
|
102
|
-
isShowTaskList: false
|
|
108
|
+
isShowTaskList: false,
|
|
103
109
|
})
|
|
104
110
|
},
|
|
105
|
-
toBack(){
|
|
111
|
+
toBack() {
|
|
106
112
|
this.setData({
|
|
107
|
-
isShowTaskList: true
|
|
113
|
+
isShowTaskList: true,
|
|
108
114
|
})
|
|
109
115
|
},
|
|
110
|
-
closePop(){
|
|
111
|
-
this.triggerEvent(
|
|
116
|
+
closePop() {
|
|
117
|
+
this.triggerEvent('closePop')
|
|
112
118
|
},
|
|
113
|
-
btnClick(e){
|
|
114
|
-
this.triggerEvent(
|
|
119
|
+
btnClick(e) {
|
|
120
|
+
this.triggerEvent('btnClick', e.detail)
|
|
115
121
|
},
|
|
116
|
-
onLoad(e){
|
|
117
|
-
this.triggerEvent(
|
|
122
|
+
onLoad(e) {
|
|
123
|
+
this.triggerEvent('onLoad', e)
|
|
124
|
+
},
|
|
125
|
+
getMoreList(e) {
|
|
126
|
+
this.triggerEvent('getMoreList', e)
|
|
118
127
|
},
|
|
119
|
-
getMoreList(e){
|
|
120
|
-
this.triggerEvent("getMoreList",e)
|
|
121
|
-
}
|
|
122
128
|
},
|
|
123
129
|
observers: {
|
|
124
|
-
showPopup(newVal){
|
|
125
|
-
if(newVal){
|
|
130
|
+
showPopup(newVal) {
|
|
131
|
+
if (newVal) {
|
|
126
132
|
this.setData({
|
|
127
|
-
isShowTaskList: true
|
|
133
|
+
isShowTaskList: true,
|
|
128
134
|
})
|
|
129
135
|
}
|
|
130
|
-
}
|
|
136
|
+
},
|
|
131
137
|
},
|
|
132
138
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"component": true,
|
|
3
3
|
"usingComponents": {
|
|
4
|
-
"custom-popup": "../../CustomPopup/index",
|
|
4
|
+
"custom-popup": "../../npm-compoent/miniprogram_npm/xiaoe_mp_npm/CustomPopup/index",
|
|
5
5
|
"task-list": "./component/TaskList",
|
|
6
6
|
"reward-list": "./component/RewardList"
|
|
7
7
|
}
|
|
8
|
-
}
|
|
8
|
+
}
|
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
$deviceWidth: 750;
|
|
2
|
-
|
|
3
|
-
@function vmin($rpx) {
|
|
4
|
-
@return #{$rpx * 100 / $deviceWidth}vmin;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@mixin task-popup {
|
|
8
|
-
z-index: 500;
|
|
9
|
-
.decorate{
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
position: relative;
|
|
13
|
-
.close{
|
|
14
|
-
position: absolute;
|
|
15
|
-
right: vmin(26);
|
|
16
|
-
top: vmin(96);
|
|
17
|
-
width: vmin(64);
|
|
18
|
-
height: vmin(64);
|
|
19
|
-
&.hidden{
|
|
20
|
-
opacity: 0;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
.gift-box{
|
|
24
|
-
left: vmin(0);
|
|
25
|
-
top: vmin(-60);
|
|
26
|
-
width: 100vmin;
|
|
27
|
-
height: vmin(192);
|
|
28
|
-
&.hidden{
|
|
29
|
-
opacity: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.task-popup-header{
|
|
36
|
-
padding: vmin(24) vmin(32);
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
height: vmin(96);
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
background: url('https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltqz384r04hx.png') no-repeat;
|
|
43
|
-
background-size: contain;
|
|
44
|
-
|
|
45
|
-
.to-reward{
|
|
46
|
-
padding: vmin(8) 0 vmin(8) vmin(16);
|
|
47
|
-
margin-left: vmin(24);
|
|
48
|
-
font-size: vmin(24);
|
|
49
|
-
display: flex;
|
|
50
|
-
color: #701616;
|
|
51
|
-
align-items: center;
|
|
52
|
-
image{
|
|
53
|
-
width: vmin(32);
|
|
54
|
-
height: vmin(32);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
.not-reward{
|
|
58
|
-
opacity: 0.4;
|
|
59
|
-
}
|
|
60
|
-
&.full-header{
|
|
61
|
-
background-image: url('https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltzgkkyr0wfj.png');
|
|
62
|
-
height: vmin(152);
|
|
63
|
-
display: block;
|
|
64
|
-
background-size: contain;
|
|
65
|
-
.to-reward{
|
|
66
|
-
margin-top: vmin(64);
|
|
67
|
-
margin-left: 0;
|
|
68
|
-
padding-left: 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
.reward-popup-header{
|
|
73
|
-
background: #FFEFD7;
|
|
74
|
-
display: flex;
|
|
75
|
-
padding: vmin(24) vmin(32);
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: space-between;
|
|
78
|
-
height: vmin(96);
|
|
79
|
-
box-sizing: border-box;
|
|
80
|
-
border-top-left-radius: vmin(24);
|
|
81
|
-
border-top-right-radius: vmin(24);
|
|
82
|
-
color: #701616;
|
|
83
|
-
&.full-header{
|
|
84
|
-
border-top-right-radius: 0;
|
|
85
|
-
}
|
|
86
|
-
.back{
|
|
87
|
-
width: vmin(32);
|
|
88
|
-
height: vmin(32);
|
|
89
|
-
}
|
|
90
|
-
.title{
|
|
91
|
-
font-size: vmin(32);
|
|
92
|
-
}
|
|
93
|
-
.reward-close{
|
|
94
|
-
width: vmin(32);
|
|
95
|
-
height: vmin(32);
|
|
96
|
-
&.hidden{
|
|
97
|
-
opacity: 0;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.popup-content{
|
|
103
|
-
box-sizing: border-box;
|
|
104
|
-
margin-bottom: vmin(32);
|
|
105
|
-
padding: 0 vmin(32) vmin(32) vmin(32);
|
|
106
|
-
min-height: 40vmin;
|
|
107
|
-
height: 100%;
|
|
108
|
-
background-size: 100% 100%;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.task-popup {
|
|
113
|
-
@include task-popup;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// 竖屏pad
|
|
117
|
-
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
118
|
-
$deviceWidth: 1536 !global;
|
|
119
|
-
|
|
120
|
-
.task-popup {
|
|
121
|
-
@include task-popup;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// PC 放大适配
|
|
126
|
-
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
127
|
-
$deviceWidth: 1260 !global;
|
|
128
|
-
|
|
129
|
-
.task-popup {
|
|
130
|
-
@include task-popup;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// 横屏pad
|
|
135
|
-
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
136
|
-
$deviceWidth: 1536 !global;
|
|
137
|
-
|
|
138
|
-
.task-popup {
|
|
139
|
-
@include task-popup;
|
|
140
|
-
}
|
|
1
|
+
$deviceWidth: 750;
|
|
2
|
+
|
|
3
|
+
@function vmin($rpx) {
|
|
4
|
+
@return #{$rpx * 100 / $deviceWidth}vmin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin task-popup {
|
|
8
|
+
z-index: 500;
|
|
9
|
+
.decorate{
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
position: relative;
|
|
13
|
+
.close{
|
|
14
|
+
position: absolute;
|
|
15
|
+
right: vmin(26);
|
|
16
|
+
top: vmin(96);
|
|
17
|
+
width: vmin(64);
|
|
18
|
+
height: vmin(64);
|
|
19
|
+
&.hidden{
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.gift-box{
|
|
24
|
+
left: vmin(0);
|
|
25
|
+
top: vmin(-60);
|
|
26
|
+
width: 100vmin;
|
|
27
|
+
height: vmin(192);
|
|
28
|
+
&.hidden{
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
.task-popup-header{
|
|
36
|
+
padding: vmin(24) vmin(32);
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
height: vmin(96);
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
background: url('https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltqz384r04hx.png') no-repeat;
|
|
43
|
+
background-size: contain;
|
|
44
|
+
|
|
45
|
+
.to-reward{
|
|
46
|
+
padding: vmin(8) 0 vmin(8) vmin(16);
|
|
47
|
+
margin-left: vmin(24);
|
|
48
|
+
font-size: vmin(24);
|
|
49
|
+
display: flex;
|
|
50
|
+
color: #701616;
|
|
51
|
+
align-items: center;
|
|
52
|
+
image{
|
|
53
|
+
width: vmin(32);
|
|
54
|
+
height: vmin(32);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
.not-reward{
|
|
58
|
+
opacity: 0.4;
|
|
59
|
+
}
|
|
60
|
+
&.full-header{
|
|
61
|
+
background-image: url('https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltzgkkyr0wfj.png');
|
|
62
|
+
height: vmin(152);
|
|
63
|
+
display: block;
|
|
64
|
+
background-size: contain;
|
|
65
|
+
.to-reward{
|
|
66
|
+
margin-top: vmin(64);
|
|
67
|
+
margin-left: 0;
|
|
68
|
+
padding-left: 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
.reward-popup-header{
|
|
73
|
+
background: #FFEFD7;
|
|
74
|
+
display: flex;
|
|
75
|
+
padding: vmin(24) vmin(32);
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
height: vmin(96);
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
border-top-left-radius: vmin(24);
|
|
81
|
+
border-top-right-radius: vmin(24);
|
|
82
|
+
color: #701616;
|
|
83
|
+
&.full-header{
|
|
84
|
+
border-top-right-radius: 0;
|
|
85
|
+
}
|
|
86
|
+
.back{
|
|
87
|
+
width: vmin(32);
|
|
88
|
+
height: vmin(32);
|
|
89
|
+
}
|
|
90
|
+
.title{
|
|
91
|
+
font-size: vmin(32);
|
|
92
|
+
}
|
|
93
|
+
.reward-close{
|
|
94
|
+
width: vmin(32);
|
|
95
|
+
height: vmin(32);
|
|
96
|
+
&.hidden{
|
|
97
|
+
opacity: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.popup-content{
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
margin-bottom: vmin(32);
|
|
105
|
+
padding: 0 vmin(32) vmin(32) vmin(32);
|
|
106
|
+
min-height: 40vmin;
|
|
107
|
+
height: 100%;
|
|
108
|
+
background-size: 100% 100%;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.task-popup {
|
|
113
|
+
@include task-popup;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// 竖屏pad
|
|
117
|
+
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
118
|
+
$deviceWidth: 1536 !global;
|
|
119
|
+
|
|
120
|
+
.task-popup {
|
|
121
|
+
@include task-popup;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// PC 放大适配
|
|
126
|
+
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
127
|
+
$deviceWidth: 1260 !global;
|
|
128
|
+
|
|
129
|
+
.task-popup {
|
|
130
|
+
@include task-popup;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 横屏pad
|
|
135
|
+
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
136
|
+
$deviceWidth: 1536 !global;
|
|
137
|
+
|
|
138
|
+
.task-popup {
|
|
139
|
+
@include task-popup;
|
|
140
|
+
}
|
|
141
141
|
}
|
|
@@ -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
|
+
})
|