xiaoe_mp_npm 1.0.0-live3 → 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.
Files changed (40) hide show
  1. package/miniprogram_dist/Task/TaskIcon/index.js +5 -1
  2. package/miniprogram_dist/Task/TaskIcon/index.wxml +1 -2
  3. package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.js +27 -27
  4. package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.json +6 -6
  5. package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxml +10 -10
  6. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +12 -9
  7. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.json +5 -5
  8. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +131 -131
  9. package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +2 -2
  10. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +8 -2
  11. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.json +7 -7
  12. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +62 -46
  13. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +6 -0
  14. package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxss +60 -0
  15. package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.json +9 -9
  16. package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.scss +59 -59
  17. package/miniprogram_dist/Task/TaskPopup/index.js +1 -0
  18. package/package.json +1 -1
  19. package/src/Task/TaskIcon/index.js +5 -1
  20. package/src/Task/TaskIcon/index.wxml +1 -2
  21. package/src/Task/TaskIcon/index.wxss +127 -1
  22. package/src/Task/TaskPopup/component/RewardList/index.js +27 -27
  23. package/src/Task/TaskPopup/component/RewardList/index.json +6 -6
  24. package/src/Task/TaskPopup/component/RewardList/index.wxml +10 -10
  25. package/src/Task/TaskPopup/component/TaskItem/index.js +12 -9
  26. package/src/Task/TaskPopup/component/TaskItem/index.json +5 -5
  27. package/src/Task/TaskPopup/component/TaskItem/index.scss +131 -131
  28. package/src/Task/TaskPopup/component/TaskItem/index.wxml +2 -2
  29. package/src/Task/TaskPopup/component/TaskItem/index.wxss +362 -1
  30. package/src/Task/TaskPopup/component/TaskList/index.js +8 -2
  31. package/src/Task/TaskPopup/component/TaskList/index.json +7 -7
  32. package/src/Task/TaskPopup/component/TaskList/index.scss +62 -46
  33. package/src/Task/TaskPopup/component/TaskList/index.wxml +6 -0
  34. package/src/Task/TaskPopup/component/TaskList/index.wxss +1 -1
  35. package/src/Task/TaskPopup/component/TaskType/index.json +9 -9
  36. package/src/Task/TaskPopup/component/TaskType/index.scss +59 -59
  37. package/src/Task/TaskPopup/component/TaskType/index.wxss +98 -1
  38. package/src/Task/TaskPopup/index.js +1 -0
  39. package/src/Task/TaskPopup/index.wxss +250 -1
  40. package/src/Task/taskReceivePopup/index.wxss +1 -1
@@ -14,5 +14,9 @@ Component({
14
14
  /**
15
15
  * 组件的方法列表
16
16
  */
17
- methods: {},
17
+ methods: {
18
+ iconClick(){
19
+ this.triggerEvent("iconClick")
20
+ }
21
+ },
18
22
  })
@@ -1,5 +1,4 @@
1
- <view class="taskIcon {{alive_mode === 1? 'verticalStyle' : ''}}">
1
+ <view class="taskIcon {{alive_mode === 1? 'verticalStyle' : ''}}" catch:tap="iconClick">
2
2
  <view class="task-icon" />
3
3
  <view class="task-text">得奖励</view>
4
4
  </view>
5
-
@@ -1,27 +1,27 @@
1
- const computedBehavior = require('miniprogram-computed').behavior
2
- Component({
3
- behaviors: [computedBehavior],
4
- properties: {
5
- rewardList:{
6
- type:Array,
7
- value:()=>{
8
- return []
9
- }
10
- },
11
- },
12
- data: {
13
- activeNames:["1"],
14
- },
15
- lifetimes: {
16
- // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
17
- attached: function () {
18
-
19
- },
20
- moved: function () { },
21
- detached: function () { },
22
- },
23
- methods: {
24
- onChange(){}
25
- },
26
- observers: {},
27
- })
1
+ const computedBehavior = require('miniprogram-computed').behavior
2
+ Component({
3
+ behaviors: [computedBehavior],
4
+ properties: {
5
+ rewardList:{
6
+ type:Array,
7
+ value:()=>{
8
+ return []
9
+ }
10
+ },
11
+ },
12
+ data: {
13
+ activeNames:["1"],
14
+ },
15
+ lifetimes: {
16
+ // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
17
+ attached: function () {
18
+
19
+ },
20
+ moved: function () { },
21
+ detached: function () { },
22
+ },
23
+ methods: {
24
+ onChange(){}
25
+ },
26
+ observers: {},
27
+ })
@@ -1,6 +1,6 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "task-item":"../TaskItem"
5
- }
6
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "task-item":"../TaskItem"
5
+ }
6
+ }
@@ -1,10 +1,10 @@
1
- <scroll-view class="goods-list" scroll-y="true" bindrefresherrefresh="onLoad" refresher-enabled="{{true}}">
2
- <task-item
3
- wx:for="{{rewardList}}"
4
- wx:for-item="item"
5
- wx:for-index="index"
6
- listType="reward"
7
- isRadius="{{true}}"
8
- taskItem="{{item}}"
9
- />
10
- </scroll-view>
1
+ <scroll-view class="goods-list" scroll-y="true" bindrefresherrefresh="onLoad" refresher-enabled="{{true}}">
2
+ <task-item
3
+ wx:for="{{rewardList}}"
4
+ wx:for-item="item"
5
+ wx:for-index="index"
6
+ listType="reward"
7
+ isRadius="{{true}}"
8
+ taskItem="{{item}}"
9
+ />
10
+ </scroll-view>
@@ -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){
@@ -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.listType === LIST_TYPE.REWARD?data.taskItem.live_task.task_condition:data.taskItem.task_condition
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.listType === LIST_TYPE.REWARD?data.taskItem.live_task:data.taskItem
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
 
@@ -1,5 +1,5 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- }
5
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ }
5
+ }
@@ -1,132 +1,132 @@
1
- $deviceWidth: 750;
2
-
3
- @function vmin($rpx) {
4
- @return #{$rpx * 100 / $deviceWidth}vmin;
5
- }
6
-
7
- @mixin item-box{
8
- display: flex;
9
- align-items: center;
10
- justify-content: space-between;
11
- padding: vmin(32) vmin(24);
12
- background: #FFFFFF;
13
- &.line-class{
14
- position: relative;
15
- &::after{
16
- position: absolute;
17
- box-sizing: border-box;
18
- content: ' ';
19
- pointer-events: none;
20
- right: vmin(32);
21
- bottom: 0;
22
- left: vmin(32);
23
- border-bottom: 1px solid #ebedf0;
24
- -webkit-transform: scaleY(0.5);
25
- transform: scaleY(0.5);
26
- }
27
- }
28
- &.bg-change{
29
- background: linear-gradient(180deg, #FFF3EB 0%, #FFF 100%);
30
- }
31
- &.radius{
32
- border-radius: vmin(16);
33
- }
34
- .left{
35
- max-width: vmin(462);
36
- .first{
37
- line-height: vmin(40);
38
- display: flex;
39
- align-items: center;
40
- .title{
41
- font-size: vmin(28);
42
- font-weight: 500;
43
- color: #333333;
44
- }
45
- .reward{
46
- margin-left: vmin(16);
47
- color: #FF781F;
48
- font-size: vmin(24);
49
- display: flex;
50
- align-items: center;
51
- .reward-img{
52
- width: vmin(24);
53
- height: vmin(24);
54
- }
55
- .reward-text{
56
- margin-left: vmin(8);
57
- }
58
- }
59
- }
60
-
61
- .time{
62
- margin-top: vmin(8);
63
- font-size: vmin(24);
64
- color: #999999;
65
- line-height: vmin(32);
66
- }
67
-
68
- .residue-time{
69
- margin-top: vmin(8);
70
- font-size: vmin(24);
71
- color: #FFA114;
72
- line-height: vmin(32);
73
- }
74
- }
75
-
76
- .btn{
77
- // padding: 0.12rem 0.36rem;
78
- width: vmin(144);
79
- height: vmin(56);
80
- background: linear-gradient(270deg, #FF781F 0%, #FB0 100%);
81
- border-radius: vmin(72);
82
- color: #FFFFFF;
83
- font-weight: 500;
84
- font-size: vmin(24);
85
- display: flex;
86
- justify-content: center;
87
- align-items: center;
88
- line-height: vmin(32);
89
- &.reward-btn{
90
- border: vmin(1) solid #1472FF;
91
- background: #FFF;
92
- color: #1472FF;
93
- }
94
-
95
- &.gray-btn{
96
- background: #F5F5F5;
97
- color: #B2B2B2;
98
- }
99
- }
100
-
101
- }
102
-
103
- .item-box {
104
- @include item-box;
105
- }
106
-
107
- // 竖屏pad
108
- @media screen and (min-width: 768px) and (orientation: portrait) {
109
- $deviceWidth: 1536 !global;
110
-
111
- .item-box {
112
- @include item-box;
113
- }
114
- }
115
-
116
- // PC 放大适配
117
- @media screen and (min-height: 630px) and (orientation: landscape) {
118
- $deviceWidth: 1260 !global;
119
-
120
- .item-box {
121
- @include item-box;
122
- }
123
- }
124
-
125
- // 横屏pad
126
- @media screen and (min-height: 768px) and (orientation: landscape) {
127
- $deviceWidth: 1536 !global;
128
-
129
- .item-box {
130
- @include item-box;
131
- }
1
+ $deviceWidth: 750;
2
+
3
+ @function vmin($rpx) {
4
+ @return #{$rpx * 100 / $deviceWidth}vmin;
5
+ }
6
+
7
+ @mixin item-box{
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ padding: vmin(32) vmin(24);
12
+ background: #FFFFFF;
13
+ &.line-class{
14
+ position: relative;
15
+ &::after{
16
+ position: absolute;
17
+ box-sizing: border-box;
18
+ content: ' ';
19
+ pointer-events: none;
20
+ right: vmin(32);
21
+ bottom: 0;
22
+ left: vmin(32);
23
+ border-bottom: 1px solid #ebedf0;
24
+ -webkit-transform: scaleY(0.5);
25
+ transform: scaleY(0.5);
26
+ }
27
+ }
28
+ &.bg-change{
29
+ background: linear-gradient(180deg, #FFF3EB 0%, #FFF 100%);
30
+ }
31
+ &.radius{
32
+ border-radius: vmin(16);
33
+ }
34
+ .left{
35
+ max-width: vmin(462);
36
+ .first{
37
+ line-height: vmin(40);
38
+ display: flex;
39
+ align-items: center;
40
+ .title{
41
+ font-size: vmin(28);
42
+ font-weight: 500;
43
+ color: #333333;
44
+ }
45
+ .reward{
46
+ margin-left: vmin(16);
47
+ color: #FF781F;
48
+ font-size: vmin(24);
49
+ display: flex;
50
+ align-items: center;
51
+ .reward-img{
52
+ width: vmin(24);
53
+ height: vmin(24);
54
+ }
55
+ .reward-text{
56
+ margin-left: vmin(8);
57
+ }
58
+ }
59
+ }
60
+
61
+ .time{
62
+ margin-top: vmin(8);
63
+ font-size: vmin(24);
64
+ color: #999999;
65
+ line-height: vmin(32);
66
+ }
67
+
68
+ .residue-time{
69
+ margin-top: vmin(8);
70
+ font-size: vmin(24);
71
+ color: #FFA114;
72
+ line-height: vmin(32);
73
+ }
74
+ }
75
+
76
+ .btn{
77
+ // padding: 0.12rem 0.36rem;
78
+ width: vmin(144);
79
+ height: vmin(56);
80
+ background: linear-gradient(270deg, #FF781F 0%, #FB0 100%);
81
+ border-radius: vmin(72);
82
+ color: #FFFFFF;
83
+ font-weight: 500;
84
+ font-size: vmin(24);
85
+ display: flex;
86
+ justify-content: center;
87
+ align-items: center;
88
+ line-height: vmin(32);
89
+ &.reward-btn{
90
+ border: vmin(1) solid #1472FF;
91
+ background: #FFF;
92
+ color: #1472FF;
93
+ }
94
+
95
+ &.gray-btn{
96
+ background: #F5F5F5;
97
+ color: #B2B2B2;
98
+ }
99
+ }
100
+
101
+ }
102
+
103
+ .item-box {
104
+ @include item-box;
105
+ }
106
+
107
+ // 竖屏pad
108
+ @media screen and (min-width: 768px) and (orientation: portrait) {
109
+ $deviceWidth: 1536 !global;
110
+
111
+ .item-box {
112
+ @include item-box;
113
+ }
114
+ }
115
+
116
+ // PC 放大适配
117
+ @media screen and (min-height: 630px) and (orientation: landscape) {
118
+ $deviceWidth: 1260 !global;
119
+
120
+ .item-box {
121
+ @include item-box;
122
+ }
123
+ }
124
+
125
+ // 横屏pad
126
+ @media screen and (min-height: 768px) and (orientation: landscape) {
127
+ $deviceWidth: 1536 !global;
128
+
129
+ .item-box {
130
+ @include item-box;
131
+ }
132
132
  }
@@ -31,8 +31,8 @@
31
31
  <!-- 观看剩余时间 -->
32
32
  <view
33
33
  class="residue-time"
34
- wx:if="{{taskBelongType === 1 && listType === 'task' && taskItem.residue_time}}"
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;
@@ -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
  })
@@ -1,7 +1,7 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "task-type": "../TaskType",
5
- "task-item": "../TaskItem"
6
- }
7
- }
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "task-type": "../TaskType",
5
+ "task-item": "../TaskItem"
6
+ }
7
+ }
@@ -1,47 +1,63 @@
1
- $deviceWidth: 750;
2
-
3
- @function vmin($rpx) {
4
- @return #{$rpx * 100 / $deviceWidth}vmin;
5
- }
6
-
7
- @mixin task-list{
8
- .error-box{
9
- background: #fff;
10
- padding: vmin(2) vmin(2) 0 vmin(2);
11
- position: relative;
12
- margin-bottom: vmin(24);
13
- border-radius: vmin(16);
14
- overflow: hidden;
15
- }
16
- }
17
-
18
- .task-list {
19
- @include task-list;
20
- }
21
-
22
- // 竖屏pad
23
- @media screen and (min-width: 768px) and (orientation: portrait) {
24
- $deviceWidth: 1536 !global;
25
-
26
- .task-list {
27
- @include task-list;
28
- }
29
- }
30
-
31
- // PC 放大适配
32
- @media screen and (min-height: 630px) and (orientation: landscape) {
33
- $deviceWidth: 1260 !global;
34
-
35
- .task-list {
36
- @include task-list;
37
- }
38
- }
39
-
40
- // 横屏pad
41
- @media screen and (min-height: 768px) and (orientation: landscape) {
42
- $deviceWidth: 1536 !global;
43
-
44
- .task-list {
45
- @include task-list;
46
- }
1
+ $deviceWidth: 750;
2
+
3
+ @function vmin($rpx) {
4
+ @return #{$rpx * 100 / $deviceWidth}vmin;
5
+ }
6
+
7
+ @mixin task-list{
8
+ .error-box{
9
+ background: #fff;
10
+ padding: vmin(2) vmin(2) 0 vmin(2);
11
+ position: relative;
12
+ margin-bottom: vmin(24);
13
+ border-radius: vmin(16);
14
+ overflow: hidden;
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
+ }
32
+ }
33
+
34
+ .task-list {
35
+ @include task-list;
36
+ }
37
+
38
+ // 竖屏pad
39
+ @media screen and (min-width: 768px) and (orientation: portrait) {
40
+ $deviceWidth: 1536 !global;
41
+
42
+ .task-list {
43
+ @include task-list;
44
+ }
45
+ }
46
+
47
+ // PC 放大适配
48
+ @media screen and (min-height: 630px) and (orientation: landscape) {
49
+ $deviceWidth: 1260 !global;
50
+
51
+ .task-list {
52
+ @include task-list;
53
+ }
54
+ }
55
+
56
+ // 横屏pad
57
+ @media screen and (min-height: 768px) and (orientation: landscape) {
58
+ $deviceWidth: 1536 !global;
59
+
60
+ .task-list {
61
+ @include task-list;
62
+ }
47
63
  }
@@ -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>