xiaoe_mp_npm 1.0.22-test02 → 1.0.22-test04
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/miniprogram_dist/Task/TaskPopup/index.js +73 -71
- package/miniprogram_dist/Task/TaskPopup/index.json +2 -2
- package/miniprogram_dist/Task/TaskQuizPopup/components/quizRichText/index.json +1 -1
- package/miniprogram_dist/Task/TaskQuizPopup/index.js +87 -83
- package/miniprogram_dist/Task/taskQuizRemindPopup/index.js +27 -32
- package/package.json +1 -1
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -1
- package/src/Task/TaskPopup/index.js +73 -71
- package/src/Task/TaskPopup/index.json +2 -2
- package/src/Task/TaskQuizPopup/components/quizContent/index.wxss +1 -1
- package/src/Task/TaskQuizPopup/components/quizRichText/index.json +1 -1
- package/src/Task/TaskQuizPopup/components/quizRichText/index.wxss +1 -1
- package/src/Task/TaskQuizPopup/index.js +87 -83
- package/src/Task/TaskQuizPopup/index.wxss +1 -1
- package/src/Task/taskQuizRemindPopup/index.js +27 -32
- package/src/Task/taskQuizRemindPopup/index.wxss +1 -1
|
@@ -1,132 +1,134 @@
|
|
|
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
|
-
}
|
|
64
|
-
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
65
|
},
|
|
66
66
|
data: {
|
|
67
|
-
isShowTaskList:true
|
|
67
|
+
isShowTaskList: true,
|
|
68
68
|
},
|
|
69
69
|
lifetimes: {
|
|
70
70
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
71
|
-
attached: function () {
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
moved: function () { },
|
|
75
|
-
detached: function () { },
|
|
71
|
+
attached: function () {},
|
|
72
|
+
moved: function () {},
|
|
73
|
+
detached: function () {},
|
|
76
74
|
},
|
|
77
75
|
computed: {
|
|
78
76
|
customStyle(properties) {
|
|
79
77
|
const { popPosition, orientation } = properties
|
|
80
78
|
const position = `position: ${orientation === 'ver' ? 'fixed' : 'absolute'}; left: 0; bottom: 0`
|
|
81
|
-
return popPosition ===
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return
|
|
79
|
+
return popPosition === 'bottom'
|
|
80
|
+
? `${position}; width: ${orientation === 'ver' ? '100%' : ''}; height: calc(100% - ${rpxToVmin(422)});`
|
|
81
|
+
: 'height: 100%;width: 100vmin;'
|
|
82
|
+
},
|
|
83
|
+
popupContentBackground(data) {
|
|
84
|
+
if (data.isShowTaskList) {
|
|
85
|
+
return data.isFull
|
|
86
|
+
? 'background-image: url(https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltzgkkz00m0m.png)'
|
|
87
|
+
: 'background-image: url(https://commonresource-1252524126.cdn.xiaoeknow.com/image/ltqz384w02n9.png);'
|
|
88
|
+
} else {
|
|
89
|
+
return 'background: #FFEFD7;'
|
|
88
90
|
}
|
|
89
|
-
}
|
|
91
|
+
},
|
|
90
92
|
},
|
|
91
93
|
methods: {
|
|
92
|
-
toReward(){
|
|
93
|
-
if(!this.properties.hasRewardRecord){
|
|
94
|
+
toReward() {
|
|
95
|
+
if (!this.properties.hasRewardRecord) {
|
|
94
96
|
wx.showToast({
|
|
95
|
-
title:
|
|
96
|
-
icon:
|
|
97
|
+
title: '还未完成任务,加油~',
|
|
98
|
+
icon: 'none',
|
|
97
99
|
})
|
|
98
100
|
return
|
|
99
101
|
}
|
|
100
|
-
this.triggerEvent(
|
|
102
|
+
this.triggerEvent('toReward')
|
|
101
103
|
this.setData({
|
|
102
|
-
isShowTaskList: false
|
|
104
|
+
isShowTaskList: false,
|
|
103
105
|
})
|
|
104
106
|
},
|
|
105
|
-
toBack(){
|
|
107
|
+
toBack() {
|
|
106
108
|
this.setData({
|
|
107
|
-
isShowTaskList: true
|
|
109
|
+
isShowTaskList: true,
|
|
108
110
|
})
|
|
109
111
|
},
|
|
110
|
-
closePop(){
|
|
111
|
-
this.triggerEvent(
|
|
112
|
+
closePop() {
|
|
113
|
+
this.triggerEvent('closePop')
|
|
114
|
+
},
|
|
115
|
+
btnClick(e) {
|
|
116
|
+
this.triggerEvent('btnClick', e.detail)
|
|
112
117
|
},
|
|
113
|
-
|
|
114
|
-
this.triggerEvent(
|
|
118
|
+
onLoad(e) {
|
|
119
|
+
this.triggerEvent('onLoad', e)
|
|
115
120
|
},
|
|
116
|
-
|
|
117
|
-
this.triggerEvent(
|
|
121
|
+
getMoreList(e) {
|
|
122
|
+
this.triggerEvent('getMoreList', e)
|
|
118
123
|
},
|
|
119
|
-
getMoreList(e){
|
|
120
|
-
this.triggerEvent("getMoreList",e)
|
|
121
|
-
}
|
|
122
124
|
},
|
|
123
125
|
observers: {
|
|
124
|
-
showPopup(newVal){
|
|
125
|
-
if(newVal){
|
|
126
|
+
showPopup(newVal) {
|
|
127
|
+
if (newVal) {
|
|
126
128
|
this.setData({
|
|
127
|
-
isShowTaskList: true
|
|
129
|
+
isShowTaskList: true,
|
|
128
130
|
})
|
|
129
131
|
}
|
|
130
|
-
}
|
|
132
|
+
},
|
|
131
133
|
},
|
|
132
134
|
})
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
2
|
-
import { rpxToVmin } from '../../common/utils/index.js'
|
|
3
|
-
import Dialog from '@vant/weapp/dialog/dialog'
|
|
2
|
+
import { rpxToVmin } from '../../npm-compoent/miniprogram_npm/xiaoe_mp_npm/common/utils/index.js'
|
|
3
|
+
import Dialog from '@vant/weapp/dialog/dialog'
|
|
4
4
|
|
|
5
5
|
// 奖励icon配置
|
|
6
6
|
const reward_config = {
|
|
@@ -32,42 +32,42 @@ Component({
|
|
|
32
32
|
* 组件的属性列表
|
|
33
33
|
*/
|
|
34
34
|
properties: {
|
|
35
|
-
showPopup:{
|
|
35
|
+
showPopup: {
|
|
36
36
|
type: Boolean,
|
|
37
|
-
value: false
|
|
37
|
+
value: false,
|
|
38
38
|
},
|
|
39
39
|
popPosition: {
|
|
40
40
|
type: String,
|
|
41
|
-
value: 'bottom'
|
|
41
|
+
value: 'bottom',
|
|
42
42
|
},
|
|
43
43
|
orientation: {
|
|
44
44
|
type: String,
|
|
45
|
-
value: 'hor'
|
|
45
|
+
value: 'hor',
|
|
46
46
|
},
|
|
47
47
|
// 当前打开弹窗的任务
|
|
48
48
|
quiz_task_item: {
|
|
49
49
|
type: Object,
|
|
50
|
-
value: {}
|
|
50
|
+
value: {},
|
|
51
51
|
},
|
|
52
52
|
// 当前任务的参与结果
|
|
53
53
|
join_result: {
|
|
54
54
|
type: Object,
|
|
55
|
-
value: {}
|
|
55
|
+
value: {},
|
|
56
56
|
},
|
|
57
57
|
// 当前答题数组
|
|
58
58
|
show_quiz_list: {
|
|
59
59
|
type: Array,
|
|
60
|
-
value: []
|
|
60
|
+
value: [],
|
|
61
61
|
},
|
|
62
62
|
// 当前查看解析的答题数组
|
|
63
63
|
show_quiz_analysis_list: {
|
|
64
64
|
type: Array,
|
|
65
|
-
value: []
|
|
65
|
+
value: [],
|
|
66
66
|
},
|
|
67
67
|
// 整个任务列表数据
|
|
68
68
|
task_list: {
|
|
69
69
|
type: Array,
|
|
70
|
-
value: []
|
|
70
|
+
value: [],
|
|
71
71
|
},
|
|
72
72
|
// 是否是结果解析
|
|
73
73
|
showAnalysis: {
|
|
@@ -77,8 +77,8 @@ Component({
|
|
|
77
77
|
// 是否全屏互动
|
|
78
78
|
isFull: {
|
|
79
79
|
type: Boolean,
|
|
80
|
-
value: false
|
|
81
|
-
}
|
|
80
|
+
value: false,
|
|
81
|
+
},
|
|
82
82
|
},
|
|
83
83
|
|
|
84
84
|
/**
|
|
@@ -92,7 +92,9 @@ Component({
|
|
|
92
92
|
computed: {
|
|
93
93
|
customStyle({ popPosition, orientation }) {
|
|
94
94
|
const position = `position: ${orientation === 'ver' ? 'fixed' : 'absolute'}; left: 0; bottom: 0`
|
|
95
|
-
return popPosition ===
|
|
95
|
+
return popPosition === 'bottom'
|
|
96
|
+
? `${position}; width: ${orientation === 'ver' ? '100%' : ''}; height: calc(100% - ${rpxToVmin(422)});`
|
|
97
|
+
: 'height: 100%;width: 100vmin;border-radius: 0;'
|
|
96
98
|
},
|
|
97
99
|
// 奖励图标
|
|
98
100
|
rewardIcon({ quiz_task_item }) {
|
|
@@ -116,22 +118,25 @@ Component({
|
|
|
116
118
|
observers: {
|
|
117
119
|
showPopup(val) {
|
|
118
120
|
if (val) {
|
|
119
|
-
this.setData(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
this.setData(
|
|
122
|
+
{
|
|
123
|
+
currentIndex: 0,
|
|
124
|
+
total: this.data.show_quiz_list.length,
|
|
125
|
+
quizList: this.data[this.data.showAnalysis ? 'show_quiz_analysis_list' : 'show_quiz_list'],
|
|
126
|
+
},
|
|
127
|
+
() => {
|
|
128
|
+
console.error('jer=========进入弹窗', this.data)
|
|
129
|
+
},
|
|
130
|
+
)
|
|
126
131
|
}
|
|
127
|
-
}
|
|
132
|
+
},
|
|
128
133
|
},
|
|
129
134
|
/**
|
|
130
135
|
* 组件的方法列表
|
|
131
136
|
*/
|
|
132
137
|
methods: {
|
|
133
|
-
closePop(){
|
|
134
|
-
this.triggerEvent(
|
|
138
|
+
closePop() {
|
|
139
|
+
this.triggerEvent('closePop')
|
|
135
140
|
this.setData({
|
|
136
141
|
currentIndex: 0,
|
|
137
142
|
total: 0,
|
|
@@ -140,15 +145,15 @@ Component({
|
|
|
140
145
|
},
|
|
141
146
|
// 答题顺序恐惧
|
|
142
147
|
handleQuizOrder(e) {
|
|
143
|
-
let currentIndex = this.data.currentIndex
|
|
148
|
+
let currentIndex = this.data.currentIndex
|
|
144
149
|
switch (e.currentTarget.dataset.type) {
|
|
145
|
-
case
|
|
146
|
-
currentIndex
|
|
147
|
-
break
|
|
148
|
-
case
|
|
149
|
-
currentIndex
|
|
150
|
-
break
|
|
151
|
-
case
|
|
150
|
+
case 'prev':
|
|
151
|
+
currentIndex--
|
|
152
|
+
break
|
|
153
|
+
case 'next':
|
|
154
|
+
currentIndex++
|
|
155
|
+
break
|
|
156
|
+
case 'submit':
|
|
152
157
|
Dialog.confirm({
|
|
153
158
|
context: this,
|
|
154
159
|
closeOnClickOverlay: false,
|
|
@@ -159,74 +164,73 @@ Component({
|
|
|
159
164
|
confirmButtonColor: '#1472FF',
|
|
160
165
|
zIndex: 501,
|
|
161
166
|
})
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
.then(() => {
|
|
168
|
+
// 处理获取题目id和答案id
|
|
169
|
+
let params = this.data.quizList.map((item) => {
|
|
170
|
+
// 获取用户选择的答案
|
|
171
|
+
let userAnswer = []
|
|
172
|
+
for (let index = 0; index < item.options.length; index++) {
|
|
173
|
+
const ele = item.options[index]
|
|
174
|
+
if (ele.selected) {
|
|
175
|
+
userAnswer.push(ele.op_id)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
qs_id: item.qs_id,
|
|
180
|
+
op_id: userAnswer,
|
|
171
181
|
}
|
|
182
|
+
})
|
|
183
|
+
// 获取列表中当前任务是否结束了,兼容提交前端校验
|
|
184
|
+
const taskFindItem = this.data.task_list.find((item) => item.id === this.data.quiz_task_item.id) || {}
|
|
185
|
+
if (taskFindItem.state === 2) {
|
|
186
|
+
this.closePop()
|
|
187
|
+
wx.showToast({
|
|
188
|
+
title: '当前答题已结束,无法继续提交',
|
|
189
|
+
icon: 'none',
|
|
190
|
+
duration: 1000,
|
|
191
|
+
})
|
|
192
|
+
return
|
|
172
193
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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,
|
|
194
|
+
// 存储用户答案,用于接口请求参数
|
|
195
|
+
// 调用完成任务接口
|
|
196
|
+
this.triggerEvent('commonFulfilTasks', {
|
|
197
|
+
user_answer: params,
|
|
198
|
+
ids: [this.data.quiz_task_item.id],
|
|
199
|
+
taskItem: this.data.quiz_task_item,
|
|
189
200
|
})
|
|
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
201
|
})
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
break;
|
|
202
|
+
.catch((err) => {
|
|
203
|
+
// 暂无操作
|
|
204
|
+
})
|
|
205
|
+
break
|
|
204
206
|
|
|
205
207
|
default:
|
|
206
|
-
break
|
|
208
|
+
break
|
|
207
209
|
}
|
|
208
210
|
this.setData({ currentIndex })
|
|
209
211
|
},
|
|
210
212
|
// 点击选项进行操作答题
|
|
211
213
|
clickOption(e) {
|
|
212
214
|
const index = e.detail
|
|
213
|
-
console.error('jer=============选择11111', index)
|
|
214
|
-
const tempQuizItem =
|
|
215
|
-
this.data.quizList[this.data.currentIndex];
|
|
215
|
+
console.error('jer=============选择11111', index)
|
|
216
|
+
const tempQuizItem = this.data.quizList[this.data.currentIndex]
|
|
216
217
|
// 多选题
|
|
217
218
|
if (tempQuizItem.qs_type === 1) {
|
|
218
219
|
tempQuizItem.options[index].selected = !tempQuizItem.options[index].selected
|
|
219
220
|
} else {
|
|
220
221
|
for (let i = 0; i < tempQuizItem.options.length; i++) {
|
|
221
|
-
tempQuizItem.options[i].selected = false
|
|
222
|
+
tempQuizItem.options[i].selected = false
|
|
222
223
|
}
|
|
223
|
-
tempQuizItem.options[index].selected = true
|
|
224
|
+
tempQuizItem.options[index].selected = true
|
|
224
225
|
}
|
|
225
|
-
this.setData(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
this.setData(
|
|
227
|
+
{
|
|
228
|
+
quizList: this.data.quizList,
|
|
229
|
+
},
|
|
230
|
+
() => {
|
|
231
|
+
console.error('jer============更改之后的数组', this.data.quizList)
|
|
232
|
+
},
|
|
233
|
+
)
|
|
230
234
|
},
|
|
231
|
-
}
|
|
232
|
-
})
|
|
235
|
+
},
|
|
236
|
+
})
|
|
@@ -1,54 +1,53 @@
|
|
|
1
|
-
import { scatterRequest } from '../../common/utils/tool'
|
|
1
|
+
import { scatterRequest } from '../../npm-compoent/miniprogram_npm/xiaoe_mp_npm/common/utils/tool.js'
|
|
2
2
|
Component({
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* 组件的属性列表
|
|
6
5
|
*/
|
|
7
6
|
properties: {
|
|
8
|
-
showPopup:{
|
|
7
|
+
showPopup: {
|
|
9
8
|
type: Boolean,
|
|
10
|
-
value: false
|
|
9
|
+
value: false,
|
|
11
10
|
},
|
|
12
11
|
// 任务列表中进行中的答题任务
|
|
13
12
|
quiz_task_start_list: {
|
|
14
13
|
type: Object,
|
|
15
|
-
value: {}
|
|
14
|
+
value: {},
|
|
16
15
|
},
|
|
17
16
|
// 直播间人次
|
|
18
17
|
viewCount: {
|
|
19
18
|
type: Number,
|
|
20
|
-
value: 0
|
|
21
|
-
}
|
|
19
|
+
value: 0,
|
|
20
|
+
},
|
|
22
21
|
},
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* 组件的初始数据
|
|
26
25
|
*/
|
|
27
26
|
data: {
|
|
28
|
-
btnLock: false
|
|
27
|
+
btnLock: false,
|
|
29
28
|
},
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* 组件的方法列表
|
|
33
32
|
*/
|
|
34
33
|
methods: {
|
|
35
|
-
closePop(){
|
|
36
|
-
this.triggerEvent(
|
|
34
|
+
closePop() {
|
|
35
|
+
this.triggerEvent('closePop')
|
|
37
36
|
this.setData({ btnLock: false })
|
|
38
37
|
},
|
|
39
38
|
quizHandle() {
|
|
40
|
-
if (this.data.btnLock) return
|
|
39
|
+
if (this.data.btnLock) return
|
|
41
40
|
this.setData({ btnLock: true })
|
|
42
41
|
scatterRequest(
|
|
43
42
|
// 随机条件
|
|
44
43
|
() => {
|
|
45
|
-
let delay = 0
|
|
44
|
+
let delay = 0
|
|
46
45
|
if (this.data.viewCount > 10000) {
|
|
47
46
|
// pv: 10000,则0-3秒随机打散
|
|
48
|
-
const randomDelay = Math.random()
|
|
49
|
-
delay = Math.ceil(randomDelay * 3000)
|
|
47
|
+
const randomDelay = Math.random()
|
|
48
|
+
delay = Math.ceil(randomDelay * 3000) // 转换为毫秒
|
|
50
49
|
}
|
|
51
|
-
return delay
|
|
50
|
+
return delay
|
|
52
51
|
},
|
|
53
52
|
// 打散配置
|
|
54
53
|
{
|
|
@@ -58,22 +57,18 @@ Component({
|
|
|
58
57
|
async () => {
|
|
59
58
|
if (this.data.quiz_task_start_list.length === 1) {
|
|
60
59
|
// 如果只有一个拉起答题
|
|
61
|
-
this.triggerEvent(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
)
|
|
60
|
+
this.triggerEvent('openRelatedPop', {
|
|
61
|
+
quiz_task_item: this.data.quiz_task_start_list[0],
|
|
62
|
+
show_quiz_popup: true,
|
|
63
|
+
})
|
|
67
64
|
} else if (this.data.quiz_task_start_list.length > 1) {
|
|
68
|
-
this.triggerEvent(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
)
|
|
65
|
+
this.triggerEvent('openRelatedPop', {
|
|
66
|
+
show_task_popup: true,
|
|
67
|
+
})
|
|
73
68
|
}
|
|
74
|
-
this.closePop()
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
})
|
|
69
|
+
this.closePop()
|
|
70
|
+
},
|
|
71
|
+
)
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
})
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.item-box{display:flex;align-items:center;justify-content:space-between;padding:4.26667vmin 3.2vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:4.26667vmin;bottom:0;left:4.26667vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:2.13333vmin}.item-box.mb{margin-bottom:3.2vmin}.item-box .left{max-width:64.66667vmin}.item-box .left .first{line-height:5.33333vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:3.73333vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:38.66667vmin}.item-box .left .first .reward{margin-left:2.13333vmin;color:#FF5429;font-size:3.2vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:3.2vmin;height:3.2vmin}.item-box .left .first .reward .reward-text{margin-left:1.06667vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:1.06667vmin;font-size:3.2vmin;color:#999999;line-height:4.26667vmin}.item-box .left .task-tip{margin-top:1.06667vmin;font-size:3.2vmin;color:#FF5429;font-family:"PingFang SC";line-height:4.26667vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:2.66667vmin;font-style:normal;font-weight:400;line-height:4.26667vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:3.2vmin;height:3.2vmin;margin-left:-vmin(4)}.item-box .btn{width:19.2vmin;height:7.46667vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:9.6vmin;color:#FFFFFF;font-weight:500;font-size:3.2vmin;display:flex;justify-content:center;align-items:center;line-height:4.26667vmin}.item-box .btn.reward-btn{border:.13333vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}@media screen and (min-width: 768px) and (orientation: portrait){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.08333vmin 1.5625vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.08333vmin;bottom:0;left:2.08333vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.04167vmin}.item-box.mb{margin-bottom:1.5625vmin}.item-box .left{max-width:31.57552vmin}.item-box .left .first{line-height:2.60417vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:1.82292vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:18.88021vmin}.item-box .left .first .reward{margin-left:1.04167vmin;color:#FF5429;font-size:1.5625vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.5625vmin;height:1.5625vmin}.item-box .left .first .reward .reward-text{margin-left:.52083vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.52083vmin;font-size:1.5625vmin;color:#999999;line-height:2.08333vmin}.item-box .left .task-tip{margin-top:.52083vmin;font-size:1.5625vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.08333vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.30208vmin;font-style:normal;font-weight:400;line-height:2.08333vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.5625vmin;height:1.5625vmin;margin-left:-vmin(4)}.item-box .btn{width:9.375vmin;height:3.64583vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:4.6875vmin;color:#FFFFFF;font-weight:500;font-size:1.5625vmin;display:flex;justify-content:center;align-items:center;line-height:2.08333vmin}.item-box .btn.reward-btn{border:.0651vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}@media screen and (min-height: 630px) and (orientation: landscape){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.53968vmin 1.90476vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.53968vmin;bottom:0;left:2.53968vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.26984vmin}.item-box.mb{margin-bottom:1.90476vmin}.item-box .left{max-width:38.49206vmin}.item-box .left .first{line-height:3.1746vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:2.22222vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:23.01587vmin}.item-box .left .first .reward{margin-left:1.26984vmin;color:#FF5429;font-size:1.90476vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.90476vmin;height:1.90476vmin}.item-box .left .first .reward .reward-text{margin-left:.63492vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.63492vmin;font-size:1.90476vmin;color:#999999;line-height:2.53968vmin}.item-box .left .task-tip{margin-top:.63492vmin;font-size:1.90476vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.53968vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.5873vmin;font-style:normal;font-weight:400;line-height:2.53968vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.90476vmin;height:1.90476vmin;margin-left:-vmin(4)}.item-box .btn{width:11.42857vmin;height:4.44444vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:5.71429vmin;color:#FFFFFF;font-weight:500;font-size:1.90476vmin;display:flex;justify-content:center;align-items:center;line-height:2.53968vmin}.item-box .btn.reward-btn{border:.07937vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}@media screen and (min-height: 768px) and (orientation: landscape){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.08333vmin 1.5625vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.08333vmin;bottom:0;left:2.08333vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.04167vmin}.item-box.mb{margin-bottom:1.5625vmin}.item-box .left{max-width:31.57552vmin}.item-box .left .first{line-height:2.60417vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:1.82292vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:18.88021vmin}.item-box .left .first .reward{margin-left:1.04167vmin;color:#FF5429;font-size:1.5625vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.5625vmin;height:1.5625vmin}.item-box .left .first .reward .reward-text{margin-left:.52083vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.52083vmin;font-size:1.5625vmin;color:#999999;line-height:2.08333vmin}.item-box .left .task-tip{margin-top:.52083vmin;font-size:1.5625vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.08333vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.30208vmin;font-style:normal;font-weight:400;line-height:2.08333vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.5625vmin;height:1.5625vmin;margin-left:-vmin(4)}.item-box .btn{width:9.375vmin;height:3.64583vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:4.6875vmin;color:#FFFFFF;font-weight:500;font-size:1.5625vmin;display:flex;justify-content:center;align-items:center;line-height:2.08333vmin}.item-box .btn.reward-btn{border:.0651vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}
|
|
1
|
+
.item-box{display:flex;align-items:center;justify-content:space-between;padding:4.26667vmin 3.2vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:4.26667vmin;bottom:0;left:4.26667vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:2.13333vmin}.item-box.mb{margin-bottom:3.2vmin}.item-box .left{max-width:64.66667vmin}.item-box .left .first{line-height:5.33333vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:3.73333vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:38.66667vmin}.item-box .left .first .reward{margin-left:2.13333vmin;color:#FF5429;font-size:3.2vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:3.2vmin;height:3.2vmin}.item-box .left .first .reward .reward-text{margin-left:1.06667vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:1.06667vmin;font-size:3.2vmin;color:#999999;line-height:4.26667vmin}.item-box .left .task-tip{margin-top:1.06667vmin;font-size:3.2vmin;color:#FF5429;font-family:"PingFang SC";line-height:4.26667vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:2.66667vmin;font-style:normal;font-weight:400;line-height:4.26667vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:3.2vmin;height:3.2vmin;margin-left:-vmin(4)}.item-box .btn{width:19.2vmin;height:7.46667vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:9.6vmin;color:#FFFFFF;font-weight:500;font-size:3.2vmin;display:flex;justify-content:center;align-items:center;line-height:4.26667vmin}.item-box .btn.reward-btn{border:.13333vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}@media screen and (min-width: 768px) and (orientation: portrait){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.08333vmin 1.5625vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.08333vmin;bottom:0;left:2.08333vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.04167vmin}.item-box.mb{margin-bottom:1.5625vmin}.item-box .left{max-width:31.57552vmin}.item-box .left .first{line-height:2.60417vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:1.82292vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:18.88021vmin}.item-box .left .first .reward{margin-left:1.04167vmin;color:#FF5429;font-size:1.5625vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.5625vmin;height:1.5625vmin}.item-box .left .first .reward .reward-text{margin-left:.52083vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.52083vmin;font-size:1.5625vmin;color:#999999;line-height:2.08333vmin}.item-box .left .task-tip{margin-top:.52083vmin;font-size:1.5625vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.08333vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.30208vmin;font-style:normal;font-weight:400;line-height:2.08333vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.5625vmin;height:1.5625vmin;margin-left:-vmin(4)}.item-box .btn{width:9.375vmin;height:3.64583vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:4.6875vmin;color:#FFFFFF;font-weight:500;font-size:1.5625vmin;display:flex;justify-content:center;align-items:center;line-height:2.08333vmin}.item-box .btn.reward-btn{border:.0651vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}@media screen and (min-height: 630px) and (orientation: landscape){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.53968vmin 1.90476vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.53968vmin;bottom:0;left:2.53968vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.26984vmin}.item-box.mb{margin-bottom:1.90476vmin}.item-box .left{max-width:38.49206vmin}.item-box .left .first{line-height:3.1746vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:2.22222vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:23.01587vmin}.item-box .left .first .reward{margin-left:1.26984vmin;color:#FF5429;font-size:1.90476vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.90476vmin;height:1.90476vmin}.item-box .left .first .reward .reward-text{margin-left:.63492vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.63492vmin;font-size:1.90476vmin;color:#999999;line-height:2.53968vmin}.item-box .left .task-tip{margin-top:.63492vmin;font-size:1.90476vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.53968vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.5873vmin;font-style:normal;font-weight:400;line-height:2.53968vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.90476vmin;height:1.90476vmin;margin-left:-vmin(4)}.item-box .btn{width:11.42857vmin;height:4.44444vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:5.71429vmin;color:#FFFFFF;font-weight:500;font-size:1.90476vmin;display:flex;justify-content:center;align-items:center;line-height:2.53968vmin}.item-box .btn.reward-btn{border:.07937vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}@media screen and (min-height: 768px) and (orientation: landscape){.item-box{display:flex;align-items:center;justify-content:space-between;padding:2.08333vmin 1.5625vmin;background:#FFFFFF}.item-box.line-class{position:relative}.item-box.line-class::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:2.08333vmin;bottom:0;left:2.08333vmin;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(0.5);transform:scaleY(0.5)}.item-box.bg-change{background:linear-gradient(180deg, #FFF3EB 0%, #fff 100%)}.item-box.radius{border-radius:1.04167vmin}.item-box.mb{margin-bottom:1.5625vmin}.item-box .left{max-width:31.57552vmin}.item-box .left .first{line-height:2.60417vmin;display:flex;align-items:center}.item-box .left .first .title{font-size:1.82292vmin;font-weight:500;color:#333333;word-wrap:break-word;word-break:break-all;max-width:18.88021vmin}.item-box .left .first .reward{margin-left:1.04167vmin;color:#FF5429;font-size:1.5625vmin;display:flex;align-items:center}.item-box .left .first .reward .reward-img{width:1.5625vmin;height:1.5625vmin}.item-box .left .first .reward .reward-text{margin-left:.52083vmin;word-wrap:break-word;word-break:break-all}.item-box .left .time{margin-top:.52083vmin;font-size:1.5625vmin;color:#999999;line-height:2.08333vmin}.item-box .left .task-tip{margin-top:.52083vmin;font-size:1.5625vmin;color:#FF5429;font-family:"PingFang SC";line-height:2.08333vmin;align-items:center}.item-box .left .task-tip .finish-text{display:inline-block;color:#999999}.item-box .left .task-tip .show-answer{display:inline-flex;align-items:center;margin-left:1.30208vmin;font-style:normal;font-weight:400;line-height:2.08333vmin}.item-box .left .task-tip .show-answer .analysis-icon{width:1.5625vmin;height:1.5625vmin;margin-left:-vmin(4)}.item-box .btn{width:9.375vmin;height:3.64583vmin;background:linear-gradient(270deg, #FF9720 0%, #FF4040 100%);border-radius:4.6875vmin;color:#FFFFFF;font-weight:500;font-size:1.5625vmin;display:flex;justify-content:center;align-items:center;line-height:2.08333vmin}.item-box .btn.reward-btn{border:.0651vmin solid #1472FF;background:#FFF;color:#1472FF}.item-box .btn.gray-btn{background:#F5F5F5;color:#B2B2B2}.item-box .btn.orange-btn{color:#ffffff;opacity:0.4;background:#ff5429}}
|