diff --git a/activity/weekly-star/assets/coin.png b/activity/weekly-star/assets/coin.png new file mode 100644 index 0000000..4cbeb39 Binary files /dev/null and b/activity/weekly-star/assets/coin.png differ diff --git a/activity/weekly-star/index.html b/activity/weekly-star/index.html index 8ce8cc1..0914a8a 100644 --- a/activity/weekly-star/index.html +++ b/activity/weekly-star/index.html @@ -7,7 +7,7 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" /> Weekly Star - +
@@ -111,6 +111,6 @@
- + diff --git a/activity/weekly-star/script.js b/activity/weekly-star/script.js index 394c0f2..d35d31c 100644 --- a/activity/weekly-star/script.js +++ b/activity/weekly-star/script.js @@ -6,6 +6,7 @@ var dateText = document.querySelector('.date-text'); var note = document.querySelector('.note'); var historyDate = document.querySelector('.history-date'); + var COIN_IMAGE = './assets/coin.png'; var mockRanks = [ { rank: 1, name: 'hanneem', score: '337700', avatar: './assets/avatar-top.png' }, @@ -73,6 +74,7 @@ return [ '
', '
', '', @@ -151,16 +153,19 @@ return { label: name + suffix, resource_group_id: reward.resource_group_id || reward.resourceGroupId || group.group_id || group.groupId, + coin: walletType === 'COIN', image: - item.image || - item.image_url || - item.imageUrl || - resource.asset_url || - resource.assetUrl || - resource.preview_url || - resource.previewUrl || - resource.animation_url || - resource.animationUrl, + walletType === 'COIN' + ? COIN_IMAGE + : item.image || + item.image_url || + item.imageUrl || + resource.preview_url || + resource.previewUrl || + resource.asset_url || + resource.assetUrl || + resource.animation_url || + resource.animationUrl, single: false, }; }); @@ -170,7 +175,22 @@ var cards = Array.prototype.slice.call(document.querySelectorAll('.gift-strip .gift-card')); cards.forEach(function (card, index) { var gift = (gifts || [])[index] || {}; - var img = gift.image_url || gift.imageUrl || gift.icon_url || gift.iconUrl || gift.asset_url || gift.assetUrl; + var resource = gift.resource || {}; + var img = + gift.image_url || + gift.imageUrl || + gift.cover_url || + gift.coverUrl || + gift.preview_url || + gift.previewUrl || + gift.icon_url || + gift.iconUrl || + resource.preview_url || + resource.previewUrl || + gift.asset_url || + gift.assetUrl || + resource.asset_url || + resource.assetUrl; var label = gift.name || gift.display_name || gift.displayName || gift.gift_id || gift.giftId || ''; var image = card.querySelector('.gift-img'); if (image && img) image.src = img; diff --git a/activity/weekly-star/style.css b/activity/weekly-star/style.css index 4b9f751..07b585c 100644 --- a/activity/weekly-star/style.css +++ b/activity/weekly-star/style.css @@ -426,6 +426,13 @@ button { top: 0; } +.reward-item.is-coin .gift-img { + left: 66px; + top: 70px; + width: 126px; + height: 126px; +} + .reward-label { position: absolute; left: -18px; diff --git a/game-bridge/voice-room-game-bridge.v1.js b/game-bridge/voice-room-game-bridge.v1.js index 3640c1d..39cf69f 100644 --- a/game-bridge/voice-room-game-bridge.v1.js +++ b/game-bridge/voice-room-game-bridge.v1.js @@ -1,5 +1,5 @@ (function () { - var remoteBridgeVersion = '20260608.1'; + var remoteBridgeVersion = '20260609.1'; function safeCall(fn, args) { try { @@ -27,6 +27,33 @@ return String(value).trim(); } + function readPositiveInteger(value) { + if (typeof value === 'number' && isFinite(value)) { + return value > 0 ? Math.floor(value) : 0; + } + var text = readString(value); + if (!/^[0-9]+$/.test(text)) { + return 0; + } + var parsed = Number(text); + return isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : 0; + } + + function normalizeAdapterConfig(config, adapter) { + if (adapter !== 'vivagames_v1') { + return config; + } + var appId = readPositiveInteger(config.app_id); + if (appId <= 0) { + appId = readPositiveInteger(config.appId); + } + if (appId > 0) { + config.app_id = appId; + config.appId = appId; + } + return config; + } + function post(action, body) { var message = JSON.stringify({ action: action, payload: body || {} }); if (postToChannel('GameBridgeChannel', message)) { @@ -153,6 +180,7 @@ var config = launchConfig(); var payload = launchPayload(); var adapter = detectAdapter(config, payload); + config = normalizeAdapterConfig(config, adapter); var normalized = readString(action); if (normalized === 'getConfig') { post('getConfig', body || {}); @@ -177,6 +205,7 @@ var payload = launchPayload(); var entry = launchEntry(); var adapter = detectAdapter(config, payload); + config = normalizeAdapterConfig(config, adapter); var nativeBridge = window.NativeBridge || {}; var oldPostMessage = typeof nativeBridge.postMessage === 'function'