@jetthai/cuora 1.1.439-dev.3 → 1.1.439-dev.6

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 CHANGED
@@ -2,6 +2,12 @@
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.439-dev.6](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.5...v1.1.439-dev.6) (2026-06-01)
6
+
7
+ ### [1.1.439-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.4...v1.1.439-dev.5) (2026-05-29)
8
+
9
+ ### [1.1.439-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.3...v1.1.439-dev.4) (2026-05-29)
10
+
5
11
  ### [1.1.439-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.2...v1.1.439-dev.3) (2026-05-29)
6
12
 
7
13
  ### [1.1.439-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.439-dev.1...v1.1.439-dev.2) (2026-05-27)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.439-dev.3",
3
+ "version": "1.1.439-dev.6",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -125,4 +125,14 @@ export default {
125
125
  method: 'get',
126
126
  params: { activityNo, appSecret },
127
127
  }),
128
+ getProgressSummary: ({ appSecret }) => ({
129
+ url: 'activities/progress-summary',
130
+ method: 'get',
131
+ params: { appSecret },
132
+ }),
133
+ getProgressDetail: ({ appSecret }) => ({
134
+ url: 'activities/progress-details',
135
+ method: 'get',
136
+ params: { appSecret },
137
+ }),
128
138
  }
@@ -11,6 +11,7 @@ export default function (request) {
11
11
  context: {
12
12
  tick: 2000,
13
13
  activityList: [],
14
+ progressSummary: {},
14
15
  tournamentList: [],
15
16
  promotionList: [],
16
17
  uidSite: '',
@@ -24,7 +25,7 @@ export default function (request) {
24
25
  src: 'fetchList',
25
26
  onDone: {
26
27
  target: 'checking',
27
- actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
28
+ actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setProgressSummary'],
28
29
  },
29
30
  onError: {
30
31
  target: 'pending',
@@ -96,6 +97,12 @@ export default function (request) {
96
97
  activityList: list,
97
98
  }
98
99
  }),
100
+ setProgressSummary: assign((context, event) => {
101
+ const { progressSummary } = event.data
102
+ return {
103
+ progressSummary: progressSummary || null,
104
+ }
105
+ }),
99
106
  setPromotionList: assign((context, event) => {
100
107
  const { promotionList } = event.data
101
108
  return {
@@ -154,12 +161,20 @@ export default function (request) {
154
161
  services: {
155
162
  fetchList: async (context, event) => {
156
163
  const hasToken = request.getToken()
157
- const [{ data }, promotionList] = await Promise.all([
164
+ const siteConfig = window?.$nuxt?.$store?.state?.siteConfig
165
+ const isProgressEnable = siteConfig?.frontendActivityProgressEnable
166
+
167
+ const [{ data }, promotionList, progressSummaryRes] = await Promise.all([
158
168
  hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
159
169
  hasToken ? request.send(payment.getPromotionsList()) : [],
170
+ hasToken && isProgressEnable ? request.send(activity.getProgressSummary({ appSecret })).catch(() => null) : null,
160
171
  ])
161
172
 
162
- return { activityList: data, promotionList }
173
+ return {
174
+ activityList: data,
175
+ promotionList,
176
+ progressSummary: progressSummaryRes?.data || null,
177
+ }
163
178
  },
164
179
  fetchActivityDetailList: async (context, event) => {
165
180
  await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
@@ -5,7 +5,7 @@ import api from '../api/common.js'
5
5
  import storage from '../util/storage.js'
6
6
 
7
7
  export default function (request) {
8
- const { appSecret, defaultChannel, defaultSubchannel } = request.config
8
+ const { appSecret } = request.config
9
9
  return createMachine(
10
10
  {
11
11
  id: 'common',
@@ -35,8 +35,6 @@ export default function (request) {
35
35
  promotions: [],
36
36
  normalBroadcast: null,
37
37
  sentNormalBroadcastList: [],
38
- channel: null,
39
- subchannel: null,
40
38
  affiliateCode: null,
41
39
  defaultAffiliateCode: null,
42
40
  friendCode: null,
@@ -284,19 +282,9 @@ export default function (request) {
284
282
  return
285
283
  } else {
286
284
  let urlParams = new URLSearchParams(window.location.search)
287
- const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
288
- const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
289
285
  const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
290
286
  const friendCode = urlParams.get('fc') || urlParams.get('affiliate') || storage.get('fc') || storage.get('affiliate')
291
287
 
292
- storage.set('channel', channel, {
293
- path: '/',
294
- maxAge: 60 * 60 * 24 * 7,
295
- })
296
- storage.set('subchannel', subchannel, {
297
- path: '/',
298
- maxAge: 60 * 60 * 24 * 7,
299
- })
300
288
  storage.set('ac', affiliateCode, {
301
289
  path: '/',
302
290
  maxAge: 60 * 60 * 24 * 7,
@@ -307,8 +295,6 @@ export default function (request) {
307
295
  })
308
296
 
309
297
  return {
310
- channel,
311
- subchannel,
312
298
  affiliateCode,
313
299
  friendCode,
314
300
  }
@@ -9,7 +9,8 @@ const ONE_DAY_MS = 24 * 60 * 60 * 1000
9
9
  function expandPeriodOption(option, cycle) {
10
10
  if (!option) return []
11
11
  const { round, beginDate, endDate } = option
12
- const step = endDate - beginDate + ONE_DAY_MS
12
+ // 回合長度取整到整數天,避免後端 endDate 帶當日 23:59:59 等時間造成歷史回合逐期偏移
13
+ const step = Math.floor((endDate - beginDate) / ONE_DAY_MS + 1) * ONE_DAY_MS
13
14
  const count = Math.min(ROUND_LIMIT[cycle] || round, round)
14
15
  // 降冪排列,當前回合在最前
15
16
  return Array.from({ length: count }, (_, i) => ({