@jetthai/cuora 1.1.77-cash-3 → 1.1.77-cash-5
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/machine/activity/fafafa_activity.js +23 -11
- package/src/machine/activity/ranking_activity.js +31 -2
- package/src/machine/activity/specify_bets_activity.js +44 -3
- package/src/machine/activity/specify_turnover_activity.js +30 -2
- package/src/machine/game_v2_1.js +0 -1
- package/src/machine/index.js +2 -0
- package/src/machine/reward_cash.js +220 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.77-cash-5](https://github.com/jetthai/cuora-module/compare/v1.1.77-cash-4...v1.1.77-cash-5) (2023-04-20)
|
|
6
|
+
|
|
7
|
+
### [1.1.77-cash-4](https://github.com/jetthai/cuora-module/compare/v1.1.77-cash-3...v1.1.77-cash-4) (2023-04-20)
|
|
8
|
+
|
|
5
9
|
### [1.1.77-cash-3](https://github.com/jetthai/cuora-module/compare/v1.1.77-cash-2...v1.1.77-cash-3) (2023-04-19)
|
|
6
10
|
|
|
7
11
|
### [1.1.77-cash-2](https://github.com/jetthai/cuora-module/compare/v1.1.77-cash-1...v1.1.77-cash-2) (2023-04-18)
|
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@ import { assign, createMachine } from 'xstate'
|
|
|
2
2
|
import isEqual from 'lodash/isEqual.js'
|
|
3
3
|
import api from '../../api/activity.js'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default function (request) {
|
|
5
|
+
export default function (request, context) {
|
|
8
6
|
const { appSecret } = request.config
|
|
7
|
+
const { activityNo, isAutoReceiving = true, isLogin = true } = context || {}
|
|
9
8
|
return createMachine(
|
|
10
9
|
{
|
|
11
10
|
id: 'fafafa_activity',
|
|
12
11
|
context: {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
isLogin,
|
|
13
|
+
isAutoReceiving,
|
|
14
|
+
activityNo,
|
|
15
15
|
activityDetail: null,
|
|
16
16
|
duration: 0,
|
|
17
17
|
|
|
@@ -27,7 +27,8 @@ export default function (request) {
|
|
|
27
27
|
initial: 'idle',
|
|
28
28
|
states: {
|
|
29
29
|
idle: {
|
|
30
|
-
|
|
30
|
+
entry: 'reset',
|
|
31
|
+
always: [{ target: 'loading', cond: 'isLoadable' }],
|
|
31
32
|
},
|
|
32
33
|
loading: {
|
|
33
34
|
invoke: {
|
|
@@ -36,9 +37,6 @@ export default function (request) {
|
|
|
36
37
|
target: 'loaded',
|
|
37
38
|
actions: 'setActivityDetail',
|
|
38
39
|
},
|
|
39
|
-
onError: {
|
|
40
|
-
target: 'idle',
|
|
41
|
-
},
|
|
42
40
|
},
|
|
43
41
|
},
|
|
44
42
|
loaded: {
|
|
@@ -97,6 +95,14 @@ export default function (request) {
|
|
|
97
95
|
actions: 'setActivityNo',
|
|
98
96
|
cond: 'isActivityChanged',
|
|
99
97
|
},
|
|
98
|
+
START: {
|
|
99
|
+
target: '.idle',
|
|
100
|
+
actions: assign((context, event) => ({ isLogin: true })),
|
|
101
|
+
},
|
|
102
|
+
STOP: {
|
|
103
|
+
target: '.idle',
|
|
104
|
+
actions: assign((context, event) => ({ isLogin: false })),
|
|
105
|
+
},
|
|
100
106
|
},
|
|
101
107
|
},
|
|
102
108
|
{
|
|
@@ -134,13 +140,19 @@ export default function (request) {
|
|
|
134
140
|
duration: Math.max(context?.activityDetail?.periodEndTime - new Date().getTime() / 1000, 0),
|
|
135
141
|
}
|
|
136
142
|
}),
|
|
143
|
+
reset: assign((context, event) => {
|
|
144
|
+
return {
|
|
145
|
+
activityDetail: null,
|
|
146
|
+
duration: 0,
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
137
149
|
},
|
|
138
150
|
guards: {
|
|
139
151
|
isActivityChanged: (context, event) => {
|
|
140
152
|
return !isEqual(context.activityNo, event.data)
|
|
141
153
|
},
|
|
142
|
-
|
|
143
|
-
return context.activityNo
|
|
154
|
+
isLoadable: (context, event) => {
|
|
155
|
+
return context.isLogin && context.activityNo
|
|
144
156
|
},
|
|
145
157
|
isAwardable: (context, event) => {
|
|
146
158
|
return context.activityDetail?.receiveStatus === 2
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request) {
|
|
4
|
+
export default function (request, context) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
+
const { activityNo, isLogin = true } = context || {}
|
|
6
7
|
return createMachine(
|
|
7
8
|
{
|
|
8
9
|
id: 'ranking_activity',
|
|
9
10
|
context: {
|
|
10
|
-
|
|
11
|
+
isLogin,
|
|
12
|
+
activityNo,
|
|
11
13
|
activityDetail: null,
|
|
12
14
|
duration: null,
|
|
13
15
|
status: 'not-started', // "not-started" | "started" | "finished"
|
|
@@ -15,6 +17,13 @@ export default function (request) {
|
|
|
15
17
|
initial: 'idle',
|
|
16
18
|
states: {
|
|
17
19
|
idle: {
|
|
20
|
+
entry: 'reset',
|
|
21
|
+
always: [
|
|
22
|
+
{
|
|
23
|
+
target: 'loading',
|
|
24
|
+
cond: 'isLoadable',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
18
27
|
on: {
|
|
19
28
|
SET_ACTIVITY_NO: {
|
|
20
29
|
target: 'loading',
|
|
@@ -45,6 +54,16 @@ export default function (request) {
|
|
|
45
54
|
},
|
|
46
55
|
expired: {},
|
|
47
56
|
},
|
|
57
|
+
on: {
|
|
58
|
+
START: {
|
|
59
|
+
target: '.idle',
|
|
60
|
+
actions: assign((context, event) => ({ isLogin: true })),
|
|
61
|
+
},
|
|
62
|
+
STOP: {
|
|
63
|
+
target: '.idle',
|
|
64
|
+
actions: assign((context, event) => ({ isLogin: false })),
|
|
65
|
+
},
|
|
66
|
+
},
|
|
48
67
|
},
|
|
49
68
|
{
|
|
50
69
|
actions: {
|
|
@@ -78,8 +97,18 @@ export default function (request) {
|
|
|
78
97
|
}
|
|
79
98
|
}
|
|
80
99
|
}),
|
|
100
|
+
reset: assign((context, event) => {
|
|
101
|
+
return {
|
|
102
|
+
activityDetail: null,
|
|
103
|
+
duration: 0,
|
|
104
|
+
status: 'not-started',
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
81
107
|
},
|
|
82
108
|
guards: {
|
|
109
|
+
isLoadable: (context, event) => {
|
|
110
|
+
return context.isLogin && context.activityNo
|
|
111
|
+
},
|
|
83
112
|
isExpired: (context, event) => {
|
|
84
113
|
return context.duration <= 0
|
|
85
114
|
},
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request) {
|
|
4
|
+
export default function (request, context) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
+
const { activityNo, isLogin = true } = context || {}
|
|
6
7
|
return createMachine(
|
|
7
8
|
{
|
|
8
9
|
id: 'specify_bets_activity',
|
|
9
10
|
context: {
|
|
10
|
-
|
|
11
|
+
isLogin,
|
|
12
|
+
activityNo,
|
|
11
13
|
activityDetail: null,
|
|
12
14
|
callback: () => {},
|
|
15
|
+
duration: 0,
|
|
13
16
|
},
|
|
14
17
|
initial: 'idle',
|
|
15
18
|
states: {
|
|
16
19
|
idle: {
|
|
20
|
+
entry: 'reset',
|
|
21
|
+
always: [
|
|
22
|
+
{
|
|
23
|
+
target: 'loading',
|
|
24
|
+
cond: 'isLoadable',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
17
27
|
on: {
|
|
18
28
|
SET_ACTIVITY_NO: {
|
|
19
29
|
target: 'loading',
|
|
@@ -40,7 +50,14 @@ export default function (request) {
|
|
|
40
50
|
{ target: 'receivable', cond: 'isReceivable' },
|
|
41
51
|
],
|
|
42
52
|
},
|
|
43
|
-
ongoing: {
|
|
53
|
+
ongoing: {
|
|
54
|
+
entry: 'setDuration',
|
|
55
|
+
after: {
|
|
56
|
+
1000: {
|
|
57
|
+
target: 'ongoing',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
44
61
|
received: {},
|
|
45
62
|
receivable: {
|
|
46
63
|
on: {
|
|
@@ -63,6 +80,16 @@ export default function (request) {
|
|
|
63
80
|
},
|
|
64
81
|
},
|
|
65
82
|
},
|
|
83
|
+
on: {
|
|
84
|
+
START: {
|
|
85
|
+
target: '.idle',
|
|
86
|
+
actions: assign((context, event) => ({ isLogin: true })),
|
|
87
|
+
},
|
|
88
|
+
STOP: {
|
|
89
|
+
target: '.idle',
|
|
90
|
+
actions: assign((context, event) => ({ isLogin: false })),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
66
93
|
},
|
|
67
94
|
{
|
|
68
95
|
actions: {
|
|
@@ -84,8 +111,22 @@ export default function (request) {
|
|
|
84
111
|
doCallback: (context, event) => {
|
|
85
112
|
context.callback(event.data.type)
|
|
86
113
|
},
|
|
114
|
+
setDuration: assign((context, event) => {
|
|
115
|
+
return {
|
|
116
|
+
duration: Math.max(context?.activityDetail?.activityEndTime - new Date().getTime() / 1000, 0),
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
reset: assign((context, event) => {
|
|
120
|
+
return {
|
|
121
|
+
activityDetail: null,
|
|
122
|
+
duration: 0,
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
87
125
|
},
|
|
88
126
|
guards: {
|
|
127
|
+
isLoadable: (context, event) => {
|
|
128
|
+
return context.isLogin && context.activityNo
|
|
129
|
+
},
|
|
89
130
|
isReceivable: (context, event) => {
|
|
90
131
|
return context.activityDetail?.receiveStatus === 2
|
|
91
132
|
},
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request) {
|
|
4
|
+
export default function (request, context) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
+
const { activityNo, isLogin = true } = context || {}
|
|
6
7
|
return createMachine(
|
|
7
8
|
{
|
|
8
9
|
id: 'specify_turnover_activity',
|
|
9
10
|
context: {
|
|
10
|
-
|
|
11
|
+
isLogin,
|
|
12
|
+
activityNo,
|
|
11
13
|
activityDetail: null,
|
|
12
14
|
callback: () => {},
|
|
13
15
|
duration: 0,
|
|
@@ -15,6 +17,13 @@ export default function (request) {
|
|
|
15
17
|
initial: 'idle',
|
|
16
18
|
states: {
|
|
17
19
|
idle: {
|
|
20
|
+
entry: 'reset',
|
|
21
|
+
always: [
|
|
22
|
+
{
|
|
23
|
+
target: 'loading',
|
|
24
|
+
cond: 'isLoadable',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
18
27
|
on: {
|
|
19
28
|
SET_ACTIVITY_NO: {
|
|
20
29
|
target: 'loading',
|
|
@@ -71,6 +80,16 @@ export default function (request) {
|
|
|
71
80
|
},
|
|
72
81
|
},
|
|
73
82
|
},
|
|
83
|
+
on: {
|
|
84
|
+
START: {
|
|
85
|
+
target: '.idle',
|
|
86
|
+
actions: assign((context, event) => ({ isLogin: true })),
|
|
87
|
+
},
|
|
88
|
+
STOP: {
|
|
89
|
+
target: '.idle',
|
|
90
|
+
actions: assign((context, event) => ({ isLogin: false })),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
74
93
|
},
|
|
75
94
|
{
|
|
76
95
|
actions: {
|
|
@@ -97,8 +116,17 @@ export default function (request) {
|
|
|
97
116
|
duration: Math.max(context?.activityDetail?.activityEndTime - new Date().getTime() / 1000, 0),
|
|
98
117
|
}
|
|
99
118
|
}),
|
|
119
|
+
reset: assign((context, event) => {
|
|
120
|
+
return {
|
|
121
|
+
activityDetail: null,
|
|
122
|
+
duration: 0,
|
|
123
|
+
}
|
|
124
|
+
}),
|
|
100
125
|
},
|
|
101
126
|
guards: {
|
|
127
|
+
isLoadable: (context, event) => {
|
|
128
|
+
return context.isLogin && context.activityNo
|
|
129
|
+
},
|
|
102
130
|
isReceivable: (context, event) => {
|
|
103
131
|
return context.activityDetail?.receiveStatus === 2
|
|
104
132
|
},
|
package/src/machine/game_v2_1.js
CHANGED
package/src/machine/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import merge from './merge.js'
|
|
|
13
13
|
import payment_data from './payment_data.js'
|
|
14
14
|
import reward_fc from './reward_fc.js'
|
|
15
15
|
import reward from './reward.js'
|
|
16
|
+
import reward_cash from './reward_cash.js'
|
|
16
17
|
import setting from './setting.js'
|
|
17
18
|
import side from './side.js'
|
|
18
19
|
import side_v2 from './side_v2.js'
|
|
@@ -49,6 +50,7 @@ export default {
|
|
|
49
50
|
merge,
|
|
50
51
|
payment_data,
|
|
51
52
|
reward,
|
|
53
|
+
reward_cash,
|
|
52
54
|
reward_fc,
|
|
53
55
|
setting,
|
|
54
56
|
side,
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { createMachine, assign, send } from 'xstate'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
|
+
import payment from '../api/payment.js'
|
|
4
|
+
|
|
5
|
+
export default function (request) {
|
|
6
|
+
const { appSecret } = request.config
|
|
7
|
+
return createMachine(
|
|
8
|
+
{
|
|
9
|
+
id: 'reward_cash',
|
|
10
|
+
type: 'parallel',
|
|
11
|
+
context: {
|
|
12
|
+
hasAuth: false,
|
|
13
|
+
otherRewardList: [],
|
|
14
|
+
pointsRewardList: [],
|
|
15
|
+
rewardList: [],
|
|
16
|
+
activityNo: null,
|
|
17
|
+
receiveNo: null,
|
|
18
|
+
withdrawRule: {},
|
|
19
|
+
callback: () => {},
|
|
20
|
+
},
|
|
21
|
+
states: {
|
|
22
|
+
timer: {
|
|
23
|
+
initial: 'checking',
|
|
24
|
+
states: {
|
|
25
|
+
checking: {
|
|
26
|
+
always: [
|
|
27
|
+
{
|
|
28
|
+
target: 'loading',
|
|
29
|
+
cond: (context, event) => {
|
|
30
|
+
return context.hasAuth
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
loading: {
|
|
36
|
+
invoke: {
|
|
37
|
+
src: 'fetchRewardList',
|
|
38
|
+
onDone: {
|
|
39
|
+
target: 'pending',
|
|
40
|
+
actions: 'setRewardList',
|
|
41
|
+
},
|
|
42
|
+
onError: {
|
|
43
|
+
target: 'pending',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
pending: {
|
|
48
|
+
after: {
|
|
49
|
+
20000: { target: 'loading' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
on: {
|
|
54
|
+
REFRESH: {
|
|
55
|
+
target: '.loading',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
reward: {
|
|
60
|
+
initial: 'idle',
|
|
61
|
+
states: {
|
|
62
|
+
idle: {
|
|
63
|
+
on: {
|
|
64
|
+
FETCH_WITHDRAW_RULE: {
|
|
65
|
+
target: 'fetching',
|
|
66
|
+
actions: 'setRewardData',
|
|
67
|
+
},
|
|
68
|
+
RECEIVE_REWARD: {
|
|
69
|
+
target: 'receiving',
|
|
70
|
+
actions: 'setCallback',
|
|
71
|
+
},
|
|
72
|
+
RECEIVE_ALL_POINTS: {
|
|
73
|
+
target: 'allPointsReceiving',
|
|
74
|
+
actions: 'setCallback',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
fetching: {
|
|
79
|
+
invoke: {
|
|
80
|
+
src: 'fetchWithdrawRulePreview',
|
|
81
|
+
onDone: {
|
|
82
|
+
target: 'pending',
|
|
83
|
+
actions: 'setWithdrawRulePreview',
|
|
84
|
+
},
|
|
85
|
+
onError: {
|
|
86
|
+
target: 'idle',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
pending: {
|
|
91
|
+
on: {
|
|
92
|
+
RECEIVE_REWARD: {
|
|
93
|
+
target: 'receiving',
|
|
94
|
+
actions: 'setCallback',
|
|
95
|
+
},
|
|
96
|
+
BACK: {
|
|
97
|
+
target: 'idle',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
receiving: {
|
|
102
|
+
invoke: {
|
|
103
|
+
src: 'receiveReward',
|
|
104
|
+
onDone: {
|
|
105
|
+
target: 'received',
|
|
106
|
+
actions: [send({ type: 'REFRESH' }), 'doCallback'],
|
|
107
|
+
},
|
|
108
|
+
onError: {
|
|
109
|
+
target: 'idle',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
received: {
|
|
114
|
+
after: {
|
|
115
|
+
0: {
|
|
116
|
+
target: 'idle',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
allPointsReceiving: {
|
|
121
|
+
invoke: {
|
|
122
|
+
src: 'receiveAllPoints',
|
|
123
|
+
onDone: {
|
|
124
|
+
target: 'idle',
|
|
125
|
+
actions: [send({ type: 'REFRESH' }), 'doCallback'],
|
|
126
|
+
},
|
|
127
|
+
onError: {
|
|
128
|
+
target: 'idle',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
on: {
|
|
136
|
+
SET_AUTH: {
|
|
137
|
+
target: '.timer.checking',
|
|
138
|
+
actions: 'setAuth',
|
|
139
|
+
cond: (context, event) => {
|
|
140
|
+
console.log(context.hasAuth, event.data)
|
|
141
|
+
return context.hasAuth !== event.data
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
actions: {
|
|
148
|
+
setAuth: assign((context, event) => {
|
|
149
|
+
return { hasAuth: event.data }
|
|
150
|
+
}),
|
|
151
|
+
setRewardList: assign((context, event) => {
|
|
152
|
+
return {
|
|
153
|
+
otherRewardList: event.data[0]?.data || [],
|
|
154
|
+
pointsRewardList: event.data[1]?.data || [],
|
|
155
|
+
rewardList: event.data[2]?.data || [],
|
|
156
|
+
}
|
|
157
|
+
}),
|
|
158
|
+
setRewardData: assign((context, event) => {
|
|
159
|
+
const { activityNo, receiveNo } = event.data
|
|
160
|
+
return {
|
|
161
|
+
activityNo,
|
|
162
|
+
receiveNo,
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
setCallback: assign((context, event) => {
|
|
166
|
+
return {
|
|
167
|
+
callback: event.data?.callback || (() => {}),
|
|
168
|
+
}
|
|
169
|
+
}),
|
|
170
|
+
doCallback: (context, event) => {
|
|
171
|
+
context.callback()
|
|
172
|
+
},
|
|
173
|
+
setWithdrawRulePreview: assign((context, event) => {
|
|
174
|
+
return {
|
|
175
|
+
withdrawRule: event.data,
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
services: {
|
|
180
|
+
fetchRewardList: async (context, event) => {
|
|
181
|
+
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
182
|
+
const getPointsRewardAPI = request.send(
|
|
183
|
+
activity.getRewardList({
|
|
184
|
+
rewardType: 'POINTS',
|
|
185
|
+
count: 30,
|
|
186
|
+
appSecret,
|
|
187
|
+
})
|
|
188
|
+
)
|
|
189
|
+
const getOtherRewardAPI = request.send(
|
|
190
|
+
activity.getRewardList({
|
|
191
|
+
rewardType: 'CASH,FREE',
|
|
192
|
+
count: 30,
|
|
193
|
+
appSecret,
|
|
194
|
+
})
|
|
195
|
+
)
|
|
196
|
+
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
197
|
+
return [otherRewardList, pointsRewardList, rewardList]
|
|
198
|
+
},
|
|
199
|
+
fetchWithdrawRulePreview: async (context, event) => {
|
|
200
|
+
const { receiveNo } = context
|
|
201
|
+
const data = await request.send(
|
|
202
|
+
payment.getWithdrawRulePreview({
|
|
203
|
+
applyType: 'activity',
|
|
204
|
+
applyNo: receiveNo,
|
|
205
|
+
amount: null,
|
|
206
|
+
})
|
|
207
|
+
)
|
|
208
|
+
return data
|
|
209
|
+
},
|
|
210
|
+
receiveReward: async (context, event) => {
|
|
211
|
+
const { activityNo, receiveNo, attended } = event.data
|
|
212
|
+
return await request.send(activity.getReward({ activityNo, receiveNo, appSecret, attended }))
|
|
213
|
+
},
|
|
214
|
+
receiveAllPoints: async (context, event) => {
|
|
215
|
+
return await request.send(activity.collect({ collectType: 'collectPoints', appSecret }))
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|