xiaoe_mp_npm 1.0.0-live2 → 1.0.0-live4
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/TaskIcon/index.js +5 -1
- package/miniprogram_dist/Task/TaskIcon/index.wxml +1 -2
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +15 -12
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +2 -2
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +11 -5
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +16 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +6 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxss +60 -0
- package/miniprogram_dist/Task/TaskPopup/index.js +1 -0
- package/package.json +1 -1
- package/src/LiveGoodsList/index.wxss +230 -230
- package/src/Task/TaskIcon/index.js +5 -1
- package/src/Task/TaskIcon/index.wxml +1 -2
- package/src/Task/TaskIcon/index.wxss +127 -1
- package/src/Task/TaskPopup/component/TaskItem/index.js +15 -12
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +2 -2
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +362 -1
- package/src/Task/TaskPopup/component/TaskList/index.js +11 -5
- package/src/Task/TaskPopup/component/TaskList/index.scss +16 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxml +6 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxss +1 -1
- package/src/Task/TaskPopup/component/TaskType/index.wxss +98 -1
- package/src/Task/TaskPopup/index.js +1 -0
- package/src/Task/TaskPopup/index.wxss +250 -1
- package/src/Task/taskReceivePopup/index.wxss +1 -1
|
@@ -54,6 +54,7 @@ Component({
|
|
|
54
54
|
watch:{
|
|
55
55
|
taskItem:function(newVal){
|
|
56
56
|
const { task_type, task_condition } = newVal
|
|
57
|
+
console.log("taskItem",newVal)
|
|
57
58
|
let taskBelongType;
|
|
58
59
|
// 任务类型归属
|
|
59
60
|
if(task_type === 1){
|
|
@@ -61,15 +62,15 @@ Component({
|
|
|
61
62
|
taskBelongType = 1
|
|
62
63
|
}else if(task_type === 2){
|
|
63
64
|
switch(task_condition){
|
|
64
|
-
case 1:
|
|
65
|
+
case "1":
|
|
65
66
|
// 评论
|
|
66
67
|
taskBelongType = 2
|
|
67
68
|
break;
|
|
68
|
-
case 2:
|
|
69
|
+
case "2":
|
|
69
70
|
// 转发
|
|
70
71
|
taskBelongType = 3
|
|
71
72
|
break;
|
|
72
|
-
case 3:
|
|
73
|
+
case "3":
|
|
73
74
|
// 点赞
|
|
74
75
|
taskBelongType = 4
|
|
75
76
|
break
|
|
@@ -84,10 +85,11 @@ Component({
|
|
|
84
85
|
computed:{
|
|
85
86
|
// 任务标题
|
|
86
87
|
taskTitle(data){
|
|
88
|
+
console.log("taskItem",data.taskBelongType)
|
|
87
89
|
let title = ""
|
|
88
90
|
switch(data.taskBelongType){
|
|
89
91
|
case 1:
|
|
90
|
-
let task_condition = data.
|
|
92
|
+
let task_condition = data.taskItem.task_condition
|
|
91
93
|
title = `观看时长${getHoursMinutes(task_condition)}`
|
|
92
94
|
break;
|
|
93
95
|
case 2:
|
|
@@ -110,6 +112,11 @@ Component({
|
|
|
110
112
|
return "去使用"
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
// 任务状态已结束
|
|
116
|
+
if(data.taskItem.state === 2){
|
|
117
|
+
return "已结束"
|
|
118
|
+
}
|
|
119
|
+
|
|
113
120
|
// 任务同步失败列表
|
|
114
121
|
if(data.listType === LIST_TYPE.ERROR){
|
|
115
122
|
return "领奖励"
|
|
@@ -126,8 +133,8 @@ Component({
|
|
|
126
133
|
|
|
127
134
|
// 奖励内容
|
|
128
135
|
rewardText(data){
|
|
129
|
-
const { reward_type, reward_value } = data.
|
|
130
|
-
return `+${reward_value} ${reward_type===1?'积分':'优惠券'}`
|
|
136
|
+
const { reward_type, reward_value } = data.taskItem
|
|
137
|
+
return `+${reward_type===1?reward_value:1} ${reward_type===1?'积分':'优惠券'}`
|
|
131
138
|
},
|
|
132
139
|
|
|
133
140
|
// 奖励图标
|
|
@@ -153,15 +160,11 @@ Component({
|
|
|
153
160
|
btnClick(){
|
|
154
161
|
if(this.data.btnText === TASK_TYPE_TEXT[2]){
|
|
155
162
|
// 去评论
|
|
156
|
-
this.triggerEvent("btnClick",
|
|
157
|
-
data: "toComment"
|
|
158
|
-
})
|
|
163
|
+
this.triggerEvent("btnClick","toComment")
|
|
159
164
|
return
|
|
160
165
|
}else if(this.data.btnText === TASK_TYPE_TEXT[3]){
|
|
161
166
|
// 去转发
|
|
162
|
-
this.triggerEvent("btnClick",
|
|
163
|
-
data: "toShare"
|
|
164
|
-
})
|
|
167
|
+
this.triggerEvent("btnClick","toShare")
|
|
165
168
|
return
|
|
166
169
|
}
|
|
167
170
|
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<!-- 观看剩余时间 -->
|
|
32
32
|
<view
|
|
33
33
|
class="residue-time"
|
|
34
|
-
wx:if="{{
|
|
35
|
-
>再观看 {{filter.secondsToMinutes(taskItem.residue_time)}}分钟 获得奖励</view>
|
|
34
|
+
wx:if="{{taskItem.task_type === 1 && listType === 'task' && taskItem.residue_time}}"
|
|
35
|
+
>再观看 {{filter.secondsToMinutes(taskItem.residue_time)}} 分钟 获得奖励</view>
|
|
36
36
|
</view>
|
|
37
37
|
|
|
38
38
|
<!-- 右侧按钮 -->
|
|
@@ -27,9 +27,11 @@ Component({
|
|
|
27
27
|
})
|
|
28
28
|
},
|
|
29
29
|
showTaskList: function (newVal) {
|
|
30
|
+
// 先给任务列表排个序,观看直播-评论-分享-点赞
|
|
31
|
+
newVal.sort(this.customSort);
|
|
30
32
|
let typeList = []
|
|
31
33
|
typeList = newVal.reduce((acc,obj)=>{
|
|
32
|
-
let found = acc.find(item => item.task_type === obj.task_type)
|
|
34
|
+
let found = acc.find(item => item.task_type === obj.task_type && (item.task_type === 1 || item.task_condition === obj.task_condition))
|
|
33
35
|
|
|
34
36
|
let title;
|
|
35
37
|
let icon;
|
|
@@ -39,15 +41,15 @@ Component({
|
|
|
39
41
|
icon = "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lomu3vma0z2d.png"
|
|
40
42
|
}else if(obj.task_type === 2){
|
|
41
43
|
switch(obj.task_condition){
|
|
42
|
-
case 1:
|
|
44
|
+
case "1":
|
|
43
45
|
title = "评论"
|
|
44
46
|
icon = "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lonymngu00pw.png"
|
|
45
47
|
break;
|
|
46
|
-
case 2:
|
|
48
|
+
case "2":
|
|
47
49
|
title = "分享"
|
|
48
50
|
icon = "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lonymnhi03sf.png"
|
|
49
51
|
break;
|
|
50
|
-
case 3:
|
|
52
|
+
case "3":
|
|
51
53
|
title = "点赞"
|
|
52
54
|
icon = "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lonymnhk0dwo.png"
|
|
53
55
|
break;
|
|
@@ -57,7 +59,7 @@ Component({
|
|
|
57
59
|
if(found){
|
|
58
60
|
found.detailList.push(obj);
|
|
59
61
|
}else{
|
|
60
|
-
acc.push({task_type: obj.task_type, detailList: [obj], title, icon});
|
|
62
|
+
acc.push({task_type: obj.task_type,task_condition: obj.task_condition, detailList: [obj], title, icon});
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
return acc;
|
|
@@ -109,6 +111,10 @@ Component({
|
|
|
109
111
|
},
|
|
110
112
|
btnClick(e){
|
|
111
113
|
this.triggerEvent("btnClick",e.detail)
|
|
114
|
+
},
|
|
115
|
+
customSort(a, b) {
|
|
116
|
+
const order = { 1: 0, 2: 1, 3: 2, 4: 3 }; // 定义排序顺序
|
|
117
|
+
return order[a.task_type] - order[b.task_type];
|
|
112
118
|
}
|
|
113
119
|
},
|
|
114
120
|
})
|
|
@@ -13,6 +13,22 @@ $deviceWidth: 750;
|
|
|
13
13
|
border-radius: vmin(16);
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
.nothing{
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
margin-top: vmin(160);
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
image{
|
|
23
|
+
width: vmin(176);
|
|
24
|
+
height: vmin(176);
|
|
25
|
+
}
|
|
26
|
+
.text{
|
|
27
|
+
font-size: vmin(28);
|
|
28
|
+
color: #999999;
|
|
29
|
+
margin-top: vmin(32);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
.task-list {
|
|
@@ -22,4 +22,10 @@
|
|
|
22
22
|
typeIndex="{{index}}"
|
|
23
23
|
bind:btnClick="btnClick"
|
|
24
24
|
></task-type>
|
|
25
|
+
|
|
26
|
+
<!-- 空状态 -->
|
|
27
|
+
<view class="nothing" wx:if="{{!taskList.length}}">
|
|
28
|
+
<image src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lp3nncp20wh3.png"></image>
|
|
29
|
+
<view class="text">直播间暂还未设置任务~</view>
|
|
30
|
+
</view>
|
|
25
31
|
</scroll-view>
|
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
border-radius: 2.13333vmin;
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
}
|
|
9
|
+
.task-list .nothing {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
margin-top: 21.33333vmin;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
.task-list .nothing image {
|
|
16
|
+
width: 23.46667vmin;
|
|
17
|
+
height: 23.46667vmin;
|
|
18
|
+
}
|
|
19
|
+
.task-list .nothing .text {
|
|
20
|
+
font-size: 3.73333vmin;
|
|
21
|
+
color: #999999;
|
|
22
|
+
margin-top: 4.26667vmin;
|
|
23
|
+
}
|
|
9
24
|
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
10
25
|
.task-list .error-box {
|
|
11
26
|
background: #fff;
|
|
@@ -15,6 +30,21 @@
|
|
|
15
30
|
border-radius: 1.04167vmin;
|
|
16
31
|
overflow: hidden;
|
|
17
32
|
}
|
|
33
|
+
.task-list .nothing {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
margin-top: 10.41667vmin;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
}
|
|
39
|
+
.task-list .nothing image {
|
|
40
|
+
width: 11.45833vmin;
|
|
41
|
+
height: 11.45833vmin;
|
|
42
|
+
}
|
|
43
|
+
.task-list .nothing .text {
|
|
44
|
+
font-size: 1.82292vmin;
|
|
45
|
+
color: #999999;
|
|
46
|
+
margin-top: 2.08333vmin;
|
|
47
|
+
}
|
|
18
48
|
}
|
|
19
49
|
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
20
50
|
.task-list .error-box {
|
|
@@ -25,6 +55,21 @@
|
|
|
25
55
|
border-radius: 1.26984vmin;
|
|
26
56
|
overflow: hidden;
|
|
27
57
|
}
|
|
58
|
+
.task-list .nothing {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
margin-top: 12.69841vmin;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
}
|
|
64
|
+
.task-list .nothing image {
|
|
65
|
+
width: 13.96825vmin;
|
|
66
|
+
height: 13.96825vmin;
|
|
67
|
+
}
|
|
68
|
+
.task-list .nothing .text {
|
|
69
|
+
font-size: 2.22222vmin;
|
|
70
|
+
color: #999999;
|
|
71
|
+
margin-top: 2.53968vmin;
|
|
72
|
+
}
|
|
28
73
|
}
|
|
29
74
|
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
30
75
|
.task-list .error-box {
|
|
@@ -35,4 +80,19 @@
|
|
|
35
80
|
border-radius: 1.04167vmin;
|
|
36
81
|
overflow: hidden;
|
|
37
82
|
}
|
|
83
|
+
.task-list .nothing {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
margin-top: 10.41667vmin;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
}
|
|
89
|
+
.task-list .nothing image {
|
|
90
|
+
width: 11.45833vmin;
|
|
91
|
+
height: 11.45833vmin;
|
|
92
|
+
}
|
|
93
|
+
.task-list .nothing .text {
|
|
94
|
+
font-size: 1.82292vmin;
|
|
95
|
+
color: #999999;
|
|
96
|
+
margin-top: 2.08333vmin;
|
|
97
|
+
}
|
|
38
98
|
}
|