xiaoe_mp_npm 1.0.0-live2 → 1.0.0-live20
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/TaskBubble/index.js +47 -2
- package/miniprogram_dist/Task/TaskBubble/index.scss +2 -2
- package/miniprogram_dist/Task/TaskBubble/index.wxml +18 -25
- package/miniprogram_dist/Task/TaskBubble/index.wxss +6 -6
- package/miniprogram_dist/Task/TaskIcon/index.js +16 -5
- package/miniprogram_dist/Task/TaskIcon/index.scss +1 -0
- package/miniprogram_dist/Task/TaskIcon/index.wxml +2 -2
- package/miniprogram_dist/Task/TaskIcon/index.wxss +3 -0
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.js +13 -1
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.scss +40 -0
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxml +10 -1
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxss +18 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +43 -12
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +9 -1
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +5 -5
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxss +36 -4
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +53 -18
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +20 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +17 -3
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxss +80 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.js +39 -2
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.wxml +1 -1
- package/miniprogram_dist/Task/TaskPopup/index.js +46 -2
- package/miniprogram_dist/Task/TaskPopup/index.scss +14 -1
- package/miniprogram_dist/Task/TaskPopup/index.wxml +25 -13
- package/miniprogram_dist/Task/TaskPopup/index.wxss +60 -4
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.js +20 -0
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.scss +8 -0
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxml +22 -19
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxs +48 -0
- package/miniprogram_dist/Task/taskReceivePopup/coupon/index.wxss +24 -0
- package/miniprogram_dist/Task/taskReceivePopup/index.js +9 -9
- package/miniprogram_dist/Task/taskReceivePopup/index.wxml +15 -4
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.js +5 -0
- package/miniprogram_dist/Task/taskReceivePopup/integral/index.wxml +1 -1
- package/package.json +1 -1
- package/src/LiveGoodsList/index.wxss +230 -230
- package/src/Task/TaskBubble/index.js +47 -2
- package/src/Task/TaskBubble/index.scss +2 -2
- package/src/Task/TaskBubble/index.wxml +18 -25
- package/src/Task/TaskBubble/index.wxss +289 -1
- package/src/Task/TaskIcon/index.js +16 -5
- package/src/Task/TaskIcon/index.scss +1 -0
- package/src/Task/TaskIcon/index.wxml +2 -2
- package/src/Task/TaskIcon/index.wxss +130 -1
- package/src/Task/TaskPopup/component/RewardList/index.js +13 -1
- package/src/Task/TaskPopup/component/RewardList/index.scss +40 -0
- package/src/Task/TaskPopup/component/RewardList/index.wxml +10 -1
- package/src/Task/TaskPopup/component/RewardList/index.wxss +18 -0
- package/src/Task/TaskPopup/component/TaskItem/index.js +43 -12
- package/src/Task/TaskPopup/component/TaskItem/index.scss +9 -1
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +5 -5
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +394 -1
- package/src/Task/TaskPopup/component/TaskList/index.js +53 -18
- package/src/Task/TaskPopup/component/TaskList/index.scss +20 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxml +17 -3
- package/src/Task/TaskPopup/component/TaskList/index.wxss +118 -1
- package/src/Task/TaskPopup/component/TaskType/index.js +39 -2
- package/src/Task/TaskPopup/component/TaskType/index.wxml +1 -1
- package/src/Task/TaskPopup/component/TaskType/index.wxss +98 -1
- package/src/Task/TaskPopup/index.js +46 -2
- package/src/Task/TaskPopup/index.scss +14 -1
- package/src/Task/TaskPopup/index.wxml +25 -13
- package/src/Task/TaskPopup/index.wxss +306 -1
- package/src/Task/taskReceivePopup/coupon/index.js +20 -0
- package/src/Task/taskReceivePopup/coupon/index.scss +8 -0
- package/src/Task/taskReceivePopup/coupon/index.wxml +22 -19
- package/src/Task/taskReceivePopup/coupon/index.wxs +48 -0
- package/src/Task/taskReceivePopup/coupon/index.wxss +187 -1
- package/src/Task/taskReceivePopup/index.js +9 -9
- package/src/Task/taskReceivePopup/index.wxml +15 -4
- package/src/Task/taskReceivePopup/index.wxss +1 -1
- package/src/Task/taskReceivePopup/integral/index.js +5 -0
- package/src/Task/taskReceivePopup/integral/index.wxml +1 -1
- package/src/Task/taskReceivePopup/integral/index.wxss +94 -1
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
const computedBehavior = require('miniprogram-computed').behavior
|
|
1
2
|
Component({
|
|
3
|
+
behaviors: [computedBehavior],
|
|
2
4
|
/**
|
|
3
5
|
* 组件的属性列表
|
|
4
6
|
*/
|
|
5
7
|
properties: {
|
|
6
|
-
|
|
8
|
+
taskMsg: {
|
|
7
9
|
type: Object,
|
|
8
10
|
value: {},
|
|
9
11
|
},
|
|
12
|
+
zIndex: {
|
|
13
|
+
type: Number,
|
|
14
|
+
value: 1,
|
|
15
|
+
},
|
|
10
16
|
},
|
|
11
17
|
|
|
12
18
|
/**
|
|
@@ -14,6 +20,38 @@ Component({
|
|
|
14
20
|
*/
|
|
15
21
|
data: {
|
|
16
22
|
animationData: {},
|
|
23
|
+
taskIcon: {
|
|
24
|
+
1: "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lopitz1y0v93.png",
|
|
25
|
+
2: "https://commonresource-1252524126.cdn.xiaoeknow.com/image/lopitz1w0t4k.png"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
computed: {
|
|
30
|
+
// 奖品类型
|
|
31
|
+
rewardValue(data){
|
|
32
|
+
if(data.taskMsg.live_task?.task_type === 1){
|
|
33
|
+
const hours = Math.floor(data.taskMsg.live_task?.task_condition / 60);
|
|
34
|
+
const remainingMinutes = data.taskMsg.live_task?.task_condition % 60;
|
|
35
|
+
|
|
36
|
+
if (hours === 0) {
|
|
37
|
+
return `达${remainingMinutes}分钟`;
|
|
38
|
+
} else if (remainingMinutes === 0) {
|
|
39
|
+
return `达${hours}小时`;
|
|
40
|
+
} else {
|
|
41
|
+
return `达${hours}小时${remainingMinutes}分钟`;
|
|
42
|
+
}
|
|
43
|
+
}else {
|
|
44
|
+
return ['', '发表评论', '转发直播间', '完成点赞'][data.taskMsg.live_task?.task_condition] || ''
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// 奖品icon
|
|
48
|
+
taskIconImg(data){
|
|
49
|
+
return data.taskIcon[data.taskMsg.live_task?.reward_type]
|
|
50
|
+
},
|
|
51
|
+
// 奖品数量
|
|
52
|
+
prizeNum(data){
|
|
53
|
+
return data.taskMsg.live_task?.reward_type === 1? data.taskMsg.live_task?.reward_value: data.taskMsg.coupon_list?.length
|
|
54
|
+
}
|
|
17
55
|
},
|
|
18
56
|
|
|
19
57
|
lifetimes: {},
|
|
@@ -22,6 +60,12 @@ Component({
|
|
|
22
60
|
* 组件的方法列表
|
|
23
61
|
*/
|
|
24
62
|
methods: {
|
|
63
|
+
// 气泡点击事件
|
|
64
|
+
bubbleClick(){
|
|
65
|
+
this.triggerEvent("bubbleClick")
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// 显示气泡动画
|
|
25
69
|
showBubble() {
|
|
26
70
|
const animation = wx.createAnimation({
|
|
27
71
|
duration: 1500,
|
|
@@ -38,6 +82,7 @@ Component({
|
|
|
38
82
|
}, 1500)
|
|
39
83
|
},
|
|
40
84
|
|
|
85
|
+
// 隐藏气泡动画
|
|
41
86
|
hideBubble() {
|
|
42
87
|
const animation = wx.createAnimation({
|
|
43
88
|
duration: 1500,
|
|
@@ -49,7 +94,6 @@ Component({
|
|
|
49
94
|
this.setData({
|
|
50
95
|
animationData: animation.export(),
|
|
51
96
|
})
|
|
52
|
-
|
|
53
97
|
// 在动画结束后调用还原元素位置的函数
|
|
54
98
|
setTimeout(() => {
|
|
55
99
|
this.restoreElement()
|
|
@@ -57,6 +101,7 @@ Component({
|
|
|
57
101
|
}, 1500) // 设置延时与动画时长一致
|
|
58
102
|
},
|
|
59
103
|
|
|
104
|
+
// 重置气泡位置
|
|
60
105
|
restoreElement() {
|
|
61
106
|
const animation = wx.createAnimation({
|
|
62
107
|
duration: 0, // 立即执行,无过渡效果
|
|
@@ -7,7 +7,6 @@ $deviceWidth: 750;
|
|
|
7
7
|
@mixin barrage-container {
|
|
8
8
|
color: #fff;
|
|
9
9
|
font-size: vmin(20);
|
|
10
|
-
margin-bottom: vmin(76);
|
|
11
10
|
.barrage-wrap {
|
|
12
11
|
display: flex;
|
|
13
12
|
.barrage-item {
|
|
@@ -30,12 +29,13 @@ $deviceWidth: 750;
|
|
|
30
29
|
height: vmin(48);
|
|
31
30
|
border-radius: 50%;
|
|
32
31
|
margin-left: vmin(10);
|
|
32
|
+
margin-right: vmin(8);
|
|
33
33
|
flex-shrink: 0;
|
|
34
34
|
}
|
|
35
35
|
.task-type {
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
|
-
margin-
|
|
38
|
+
margin-right: vmin(8);
|
|
39
39
|
overflow: hidden;
|
|
40
40
|
text-overflow: ellipsis;
|
|
41
41
|
white-space: nowrap;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
<view>
|
|
2
|
-
<view class="barrage-
|
|
3
|
-
<view class="barrage-
|
|
4
|
-
<view class="barrage-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<image
|
|
20
|
-
class="right-arrow-icon"
|
|
21
|
-
src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lopitz1k0dzj.png"
|
|
22
|
-
alt
|
|
23
|
-
/>
|
|
24
|
-
</view>
|
|
1
|
+
<view class="barrage-container" catch:tap="bubbleClick" style="{{zIndex?'z-index:'+zIndex:''}}">
|
|
2
|
+
<view class="barrage-wrap">
|
|
3
|
+
<view class="barrage-item" animation="{{animationData}}">
|
|
4
|
+
<view class="barrage-content">
|
|
5
|
+
<image
|
|
6
|
+
class="task-completion-icon"
|
|
7
|
+
src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lopitz1y0c73.png"
|
|
8
|
+
alt
|
|
9
|
+
/>
|
|
10
|
+
<view wx:if="{{taskMsg.live_task.task_type === 1}}" class="task-type">观看时长</view>
|
|
11
|
+
<view>{{ rewardValue }}</view>
|
|
12
|
+
<image class="prize-icon" src="{{taskIconImg}}" alt="奖励" />
|
|
13
|
+
<view class="prize-num">+{{ prizeNum }}</view>
|
|
14
|
+
<image
|
|
15
|
+
class="right-arrow-icon"
|
|
16
|
+
src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lopitz1k0dzj.png"
|
|
17
|
+
alt
|
|
18
|
+
/>
|
|
25
19
|
</view>
|
|
26
20
|
</view>
|
|
27
21
|
</view>
|
|
28
22
|
</view>
|
|
29
|
-
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
.barrage-container {
|
|
2
2
|
color: #fff;
|
|
3
3
|
font-size: 2.66667vmin;
|
|
4
|
-
margin-bottom: 10.13333vmin;
|
|
5
4
|
}
|
|
6
5
|
.barrage-container .barrage-wrap {
|
|
7
6
|
display: flex;
|
|
@@ -25,12 +24,13 @@
|
|
|
25
24
|
height: 6.4vmin;
|
|
26
25
|
border-radius: 50%;
|
|
27
26
|
margin-left: 1.33333vmin;
|
|
27
|
+
margin-right: 1.06667vmin;
|
|
28
28
|
flex-shrink: 0;
|
|
29
29
|
}
|
|
30
30
|
.barrage-container .barrage-wrap .barrage-item .task-type {
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
|
-
margin-
|
|
33
|
+
margin-right: 1.06667vmin;
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
text-overflow: ellipsis;
|
|
36
36
|
white-space: nowrap;
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
.barrage-container {
|
|
98
98
|
color: #fff;
|
|
99
99
|
font-size: 1.30208vmin;
|
|
100
|
-
margin-bottom: 4.94792vmin;
|
|
101
100
|
}
|
|
102
101
|
.barrage-container .barrage-wrap {
|
|
103
102
|
display: flex;
|
|
@@ -121,12 +120,13 @@
|
|
|
121
120
|
height: 3.125vmin;
|
|
122
121
|
border-radius: 50%;
|
|
123
122
|
margin-left: 0.65104vmin;
|
|
123
|
+
margin-right: 0.52083vmin;
|
|
124
124
|
flex-shrink: 0;
|
|
125
125
|
}
|
|
126
126
|
.barrage-container .barrage-wrap .barrage-item .task-type {
|
|
127
127
|
display: flex;
|
|
128
128
|
flex-direction: column;
|
|
129
|
-
margin-
|
|
129
|
+
margin-right: 0.52083vmin;
|
|
130
130
|
overflow: hidden;
|
|
131
131
|
text-overflow: ellipsis;
|
|
132
132
|
white-space: nowrap;
|
|
@@ -194,7 +194,6 @@
|
|
|
194
194
|
.barrage-container {
|
|
195
195
|
color: #fff;
|
|
196
196
|
font-size: 1.30208vmin;
|
|
197
|
-
margin-bottom: 4.94792vmin;
|
|
198
197
|
}
|
|
199
198
|
.barrage-container .barrage-wrap {
|
|
200
199
|
display: flex;
|
|
@@ -218,12 +217,13 @@
|
|
|
218
217
|
height: 3.125vmin;
|
|
219
218
|
border-radius: 50%;
|
|
220
219
|
margin-left: 0.65104vmin;
|
|
220
|
+
margin-right: 0.52083vmin;
|
|
221
221
|
flex-shrink: 0;
|
|
222
222
|
}
|
|
223
223
|
.barrage-container .barrage-wrap .barrage-item .task-type {
|
|
224
224
|
display: flex;
|
|
225
225
|
flex-direction: column;
|
|
226
|
-
margin-
|
|
226
|
+
margin-right: 0.52083vmin;
|
|
227
227
|
overflow: hidden;
|
|
228
228
|
text-overflow: ellipsis;
|
|
229
229
|
white-space: nowrap;
|
|
@@ -2,17 +2,28 @@ Component({
|
|
|
2
2
|
/**
|
|
3
3
|
* 组件的属性列表
|
|
4
4
|
*/
|
|
5
|
-
properties: {
|
|
5
|
+
properties: {
|
|
6
|
+
aliveMode:{
|
|
7
|
+
type: Number,
|
|
8
|
+
value: 1
|
|
9
|
+
},
|
|
10
|
+
iconText:{
|
|
11
|
+
type: String,
|
|
12
|
+
value: '得奖励'
|
|
13
|
+
},
|
|
14
|
+
},
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
17
|
* 组件的初始数据
|
|
9
18
|
*/
|
|
10
|
-
data: {
|
|
11
|
-
alive_mode: 1,
|
|
12
|
-
},
|
|
19
|
+
data: {},
|
|
13
20
|
|
|
14
21
|
/**
|
|
15
22
|
* 组件的方法列表
|
|
16
23
|
*/
|
|
17
|
-
methods: {
|
|
24
|
+
methods: {
|
|
25
|
+
iconClick(){
|
|
26
|
+
this.triggerEvent("iconClick")
|
|
27
|
+
}
|
|
28
|
+
},
|
|
18
29
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<view class="taskIcon {{
|
|
1
|
+
<view class="taskIcon {{aliveMode === 1? 'verticalStyle' : ''}}" catch:tap="iconClick">
|
|
2
2
|
<view class="task-icon" />
|
|
3
|
-
<view class="task-text"
|
|
3
|
+
<view class="task-text">{{iconText}}</view>
|
|
4
4
|
</view>
|
|
5
5
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
height: 100%;
|
|
14
14
|
border-radius: 2.13333vmin;
|
|
15
15
|
margin: 0 4.26667vmin 3.2vmin 0;
|
|
16
|
+
pointer-events: auto;
|
|
16
17
|
}
|
|
17
18
|
.taskIcon .task-icon {
|
|
18
19
|
flex-shrink: 0;
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
height: 100%;
|
|
56
57
|
border-radius: 1.04167vmin;
|
|
57
58
|
margin: 0 2.08333vmin 1.5625vmin 0;
|
|
59
|
+
pointer-events: auto;
|
|
58
60
|
}
|
|
59
61
|
.taskIcon .task-icon {
|
|
60
62
|
flex-shrink: 0;
|
|
@@ -98,6 +100,7 @@
|
|
|
98
100
|
height: 100%;
|
|
99
101
|
border-radius: 1.04167vmin;
|
|
100
102
|
margin: 0 2.08333vmin 1.5625vmin 0;
|
|
103
|
+
pointer-events: auto;
|
|
101
104
|
}
|
|
102
105
|
.taskIcon .task-icon {
|
|
103
106
|
flex-shrink: 0;
|
|
@@ -8,6 +8,10 @@ Component({
|
|
|
8
8
|
return []
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
+
refreshStatus:{
|
|
12
|
+
type:Boolean,
|
|
13
|
+
value: false
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
16
|
data: {
|
|
13
17
|
activeNames:["1"],
|
|
@@ -21,7 +25,15 @@ Component({
|
|
|
21
25
|
detached: function () { },
|
|
22
26
|
},
|
|
23
27
|
methods: {
|
|
24
|
-
|
|
28
|
+
btnClick(e){
|
|
29
|
+
this.triggerEvent("btnClick",e.detail)
|
|
30
|
+
},
|
|
31
|
+
onLoad(){
|
|
32
|
+
this.triggerEvent("onLoad","rewardList")
|
|
33
|
+
},
|
|
34
|
+
getMoreList(){
|
|
35
|
+
this.triggerEvent("getMoreList","rewardList")
|
|
36
|
+
}
|
|
25
37
|
},
|
|
26
38
|
observers: {},
|
|
27
39
|
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
$deviceWidth: 750;
|
|
2
|
+
|
|
3
|
+
@function vmin($rpx) {
|
|
4
|
+
@return #{$rpx * 100 / $deviceWidth}vmin;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin reward-list{
|
|
8
|
+
height: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.reward-list {
|
|
12
|
+
@include reward-list;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 竖屏pad
|
|
16
|
+
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
17
|
+
$deviceWidth: 1536 !global;
|
|
18
|
+
|
|
19
|
+
.reward-list {
|
|
20
|
+
@include reward-list;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// PC 放大适配
|
|
25
|
+
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
26
|
+
$deviceWidth: 1260 !global;
|
|
27
|
+
|
|
28
|
+
.reward-list {
|
|
29
|
+
@include reward-list;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 横屏pad
|
|
34
|
+
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
35
|
+
$deviceWidth: 1536 !global;
|
|
36
|
+
|
|
37
|
+
.reward-list {
|
|
38
|
+
@include reward-list;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
<scroll-view
|
|
1
|
+
<scroll-view
|
|
2
|
+
class="reward-list"
|
|
3
|
+
scroll-y="true"
|
|
4
|
+
bindrefresherrefresh="onLoad"
|
|
5
|
+
refresher-enabled="{{true}}"
|
|
6
|
+
refresher-triggered="{{ refreshStatus }}"
|
|
7
|
+
bindscrolltolower="getMoreList"
|
|
8
|
+
>
|
|
2
9
|
<task-item
|
|
3
10
|
wx:for="{{rewardList}}"
|
|
4
11
|
wx:for-item="item"
|
|
@@ -6,5 +13,7 @@
|
|
|
6
13
|
listType="reward"
|
|
7
14
|
isRadius="{{true}}"
|
|
8
15
|
taskItem="{{item}}"
|
|
16
|
+
bind:btnClick="btnClick"
|
|
17
|
+
isMb="{{true}}"
|
|
9
18
|
/>
|
|
10
19
|
</scroll-view>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.reward-list {
|
|
2
|
+
height: 100%;
|
|
3
|
+
}
|
|
4
|
+
@media screen and (min-width: 768px) and (orientation: portrait) {
|
|
5
|
+
.reward-list {
|
|
6
|
+
height: 100%;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@media screen and (min-height: 630px) and (orientation: landscape) {
|
|
10
|
+
.reward-list {
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
@media screen and (min-height: 768px) and (orientation: landscape) {
|
|
15
|
+
.reward-list {
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -25,6 +25,13 @@ const TASK_TYPE_TEXT = {
|
|
|
25
25
|
4: "去点赞",
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
const taskType = {
|
|
29
|
+
1: "view",
|
|
30
|
+
2: "input",
|
|
31
|
+
3: "share",
|
|
32
|
+
4: "like"
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
Component({
|
|
29
36
|
behaviors: [computedBehavior],
|
|
30
37
|
properties: {
|
|
@@ -45,6 +52,10 @@ Component({
|
|
|
45
52
|
itemIndex:{
|
|
46
53
|
type: Number,
|
|
47
54
|
value: 0
|
|
55
|
+
},
|
|
56
|
+
isMb:{
|
|
57
|
+
type: Boolean,
|
|
58
|
+
value: false
|
|
48
59
|
}
|
|
49
60
|
},
|
|
50
61
|
data: {
|
|
@@ -61,15 +72,15 @@ Component({
|
|
|
61
72
|
taskBelongType = 1
|
|
62
73
|
}else if(task_type === 2){
|
|
63
74
|
switch(task_condition){
|
|
64
|
-
case 1:
|
|
75
|
+
case "1":
|
|
65
76
|
// 评论
|
|
66
77
|
taskBelongType = 2
|
|
67
78
|
break;
|
|
68
|
-
case 2:
|
|
79
|
+
case "2":
|
|
69
80
|
// 转发
|
|
70
81
|
taskBelongType = 3
|
|
71
82
|
break;
|
|
72
|
-
case 3:
|
|
83
|
+
case "3":
|
|
73
84
|
// 点赞
|
|
74
85
|
taskBelongType = 4
|
|
75
86
|
break
|
|
@@ -87,7 +98,7 @@ Component({
|
|
|
87
98
|
let title = ""
|
|
88
99
|
switch(data.taskBelongType){
|
|
89
100
|
case 1:
|
|
90
|
-
let task_condition = data.
|
|
101
|
+
let task_condition = data.taskItem.task_condition
|
|
91
102
|
title = `观看时长${getHoursMinutes(task_condition)}`
|
|
92
103
|
break;
|
|
93
104
|
case 2:
|
|
@@ -115,19 +126,28 @@ Component({
|
|
|
115
126
|
return "领奖励"
|
|
116
127
|
}
|
|
117
128
|
|
|
118
|
-
//
|
|
119
|
-
if
|
|
120
|
-
return
|
|
129
|
+
// 任务状态已结束
|
|
130
|
+
if(data.taskItem.join_state === 2){
|
|
131
|
+
return "已完成"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 任务状态已结束
|
|
135
|
+
if(data.taskItem.state === 2){
|
|
136
|
+
return "已结束"
|
|
121
137
|
}
|
|
122
138
|
|
|
139
|
+
if(data.taskItem.join_state === 0){
|
|
140
|
+
return "未开始"
|
|
141
|
+
}
|
|
142
|
+
|
|
123
143
|
// 正常参与任务
|
|
124
144
|
return TASK_TYPE_TEXT[data.taskBelongType] || "去参与"
|
|
125
145
|
},
|
|
126
146
|
|
|
127
147
|
// 奖励内容
|
|
128
148
|
rewardText(data){
|
|
129
|
-
const { reward_type, reward_value } = data.
|
|
130
|
-
return `+${reward_value} ${reward_type===1?'积分':'优惠券'}`
|
|
149
|
+
const { reward_type, reward_value } = data.taskItem
|
|
150
|
+
return `+${reward_type===1?reward_value:1} ${reward_type===1?'积分':'优惠券'}`
|
|
131
151
|
},
|
|
132
152
|
|
|
133
153
|
// 奖励图标
|
|
@@ -151,16 +171,27 @@ Component({
|
|
|
151
171
|
return `${hours>0?hours+'小时':''}${remainingMinutes>0?remainingMinutes+'分钟':''}`
|
|
152
172
|
},
|
|
153
173
|
btnClick(){
|
|
174
|
+
const { reward_type } = this.data.taskItem
|
|
154
175
|
if(this.data.btnText === TASK_TYPE_TEXT[2]){
|
|
155
176
|
// 去评论
|
|
177
|
+
this.triggerEvent("btnClick","toComment")
|
|
178
|
+
return
|
|
179
|
+
}else if(this.data.btnText === TASK_TYPE_TEXT[3]){
|
|
180
|
+
// 去转发
|
|
181
|
+
this.triggerEvent("btnClick","toShare")
|
|
182
|
+
return
|
|
183
|
+
}else if(this.data.btnText === "去使用"){
|
|
184
|
+
// 去使用
|
|
156
185
|
this.triggerEvent("btnClick",{
|
|
157
|
-
|
|
186
|
+
type:"reward",
|
|
187
|
+
reward_type
|
|
158
188
|
})
|
|
159
189
|
return
|
|
160
|
-
}else if(this.data.btnText ===
|
|
190
|
+
}else if(this.data.btnText === "领奖励"){
|
|
161
191
|
// 去转发
|
|
162
192
|
this.triggerEvent("btnClick",{
|
|
163
|
-
|
|
193
|
+
type:"toRetry",
|
|
194
|
+
taskBelongType: taskType[this.data.taskBelongType]
|
|
164
195
|
})
|
|
165
196
|
return
|
|
166
197
|
}
|
|
@@ -31,8 +31,11 @@ $deviceWidth: 750;
|
|
|
31
31
|
&.radius{
|
|
32
32
|
border-radius: vmin(16);
|
|
33
33
|
}
|
|
34
|
+
&.mb{
|
|
35
|
+
margin-bottom: vmin(24);
|
|
36
|
+
}
|
|
34
37
|
.left{
|
|
35
|
-
max-width: vmin(
|
|
38
|
+
max-width: vmin(485);
|
|
36
39
|
.first{
|
|
37
40
|
line-height: vmin(40);
|
|
38
41
|
display: flex;
|
|
@@ -41,6 +44,9 @@ $deviceWidth: 750;
|
|
|
41
44
|
font-size: vmin(28);
|
|
42
45
|
font-weight: 500;
|
|
43
46
|
color: #333333;
|
|
47
|
+
word-wrap: break-word;
|
|
48
|
+
word-break: break-all;
|
|
49
|
+
max-width: vmin(290);
|
|
44
50
|
}
|
|
45
51
|
.reward{
|
|
46
52
|
margin-left: vmin(16);
|
|
@@ -54,6 +60,8 @@ $deviceWidth: 750;
|
|
|
54
60
|
}
|
|
55
61
|
.reward-text{
|
|
56
62
|
margin-left: vmin(8);
|
|
63
|
+
word-wrap: break-word;
|
|
64
|
+
word-break: break-all;
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<wxs src="./index.wxs" module="filter" />
|
|
2
2
|
|
|
3
3
|
<view
|
|
4
|
-
class="item-box {{lineClass?'line-class':''}} {{listType === 'error' && itemIndex === 0?'bg-change':''}} {{isRadius?'radius':''}}"
|
|
4
|
+
class="item-box {{lineClass?'line-class':''}} {{listType === 'error' && itemIndex === 0?'bg-change':''}} {{isRadius?'radius':''}} {{isMb?'mb':''}}"
|
|
5
5
|
>
|
|
6
6
|
<!-- 左侧任务详情 -->
|
|
7
7
|
<view class="left">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<view
|
|
23
23
|
class="time"
|
|
24
24
|
wx:if="{{listType === 'task' || listType === 'error'}}"
|
|
25
|
-
>任务时间:{{taskItem.
|
|
25
|
+
>任务时间:{{taskItem.show_start_at}} 至 {{taskItem.show_end_at}}</view>
|
|
26
26
|
|
|
27
27
|
<view class="time" wx:if="{{listType === 'reward'}}">获得方式:{{ taskTitle }}</view>
|
|
28
28
|
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
<!-- 观看剩余时间 -->
|
|
32
32
|
<view
|
|
33
33
|
class="residue-time"
|
|
34
|
-
wx:if="{{
|
|
35
|
-
|
|
34
|
+
wx:if="{{taskItem.task_type === 1 && listType === 'task' && taskItem.join_state === 1 && taskItem.residue_time && taskItem.state !==2}}"
|
|
35
|
+
>{{taskItem.residue_time > 60 ? '再观看 '+ filter.secondsToMinutes(taskItem.residue_time) + '分钟 '+ '获得奖励':'即将获得奖励'}}</view>
|
|
36
36
|
</view>
|
|
37
37
|
|
|
38
38
|
<!-- 右侧按钮 -->
|
|
39
39
|
<view
|
|
40
|
-
class="btn {{listType === 'reward'?'reward-btn':''}} {{listType==='task' && (taskItem.join_state === 2 || taskItem.join_state === 3 || taskItem.join_state === 0)?'gray-btn':''}}"
|
|
40
|
+
class="btn {{listType === 'reward'?'reward-btn':''}} {{listType==='task' && (taskItem.join_state === 2 || taskItem.join_state === 3 || taskItem.join_state === 0 || taskItem.state === 2)?'gray-btn':''}}"
|
|
41
41
|
catch:tap="btnClick"
|
|
42
42
|
>{{btnText}}</view>
|
|
43
43
|
</view>
|