周星
This commit is contained in:
parent
ff755b449e
commit
ab884ed9da
BIN
activity/weekly-star/assets/coin.png
Normal file
BIN
activity/weekly-star/assets/coin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
@ -7,7 +7,7 @@
|
|||||||
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"
|
||||||
/>
|
/>
|
||||||
<title>Weekly Star</title>
|
<title>Weekly Star</title>
|
||||||
<link rel="stylesheet" href="./style.css?v=20260605" />
|
<link rel="stylesheet" href="./style.css?v=20260609" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app-viewport" id="appViewport">
|
<div class="app-viewport" id="appViewport">
|
||||||
@ -111,6 +111,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="../../common/api.js?v=20260606"></script>
|
<script src="../../common/api.js?v=20260606"></script>
|
||||||
<script src="../../common/params.js?v=20260606"></script>
|
<script src="../../common/params.js?v=20260606"></script>
|
||||||
<script src="./script.js?v=20260606"></script>
|
<script src="./script.js?v=20260609"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
var dateText = document.querySelector('.date-text');
|
var dateText = document.querySelector('.date-text');
|
||||||
var note = document.querySelector('.note');
|
var note = document.querySelector('.note');
|
||||||
var historyDate = document.querySelector('.history-date');
|
var historyDate = document.querySelector('.history-date');
|
||||||
|
var COIN_IMAGE = './assets/coin.png';
|
||||||
|
|
||||||
var mockRanks = [
|
var mockRanks = [
|
||||||
{ rank: 1, name: 'hanneem', score: '337700', avatar: './assets/avatar-top.png' },
|
{ rank: 1, name: 'hanneem', score: '337700', avatar: './assets/avatar-top.png' },
|
||||||
@ -73,6 +74,7 @@
|
|||||||
return [
|
return [
|
||||||
'<div class="reward-item',
|
'<div class="reward-item',
|
||||||
item.single ? ' is-single' : '',
|
item.single ? ' is-single' : '',
|
||||||
|
item.coin ? ' is-coin' : '',
|
||||||
'">',
|
'">',
|
||||||
'<div class="gift-card">',
|
'<div class="gift-card">',
|
||||||
'<img class="gift-frame" src="./assets/gift-card.png" alt="" />',
|
'<img class="gift-frame" src="./assets/gift-card.png" alt="" />',
|
||||||
@ -151,16 +153,19 @@
|
|||||||
return {
|
return {
|
||||||
label: name + suffix,
|
label: name + suffix,
|
||||||
resource_group_id: reward.resource_group_id || reward.resourceGroupId || group.group_id || group.groupId,
|
resource_group_id: reward.resource_group_id || reward.resourceGroupId || group.group_id || group.groupId,
|
||||||
|
coin: walletType === 'COIN',
|
||||||
image:
|
image:
|
||||||
item.image ||
|
walletType === 'COIN'
|
||||||
item.image_url ||
|
? COIN_IMAGE
|
||||||
item.imageUrl ||
|
: item.image ||
|
||||||
resource.asset_url ||
|
item.image_url ||
|
||||||
resource.assetUrl ||
|
item.imageUrl ||
|
||||||
resource.preview_url ||
|
resource.preview_url ||
|
||||||
resource.previewUrl ||
|
resource.previewUrl ||
|
||||||
resource.animation_url ||
|
resource.asset_url ||
|
||||||
resource.animationUrl,
|
resource.assetUrl ||
|
||||||
|
resource.animation_url ||
|
||||||
|
resource.animationUrl,
|
||||||
single: false,
|
single: false,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -170,7 +175,22 @@
|
|||||||
var cards = Array.prototype.slice.call(document.querySelectorAll('.gift-strip .gift-card'));
|
var cards = Array.prototype.slice.call(document.querySelectorAll('.gift-strip .gift-card'));
|
||||||
cards.forEach(function (card, index) {
|
cards.forEach(function (card, index) {
|
||||||
var gift = (gifts || [])[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 label = gift.name || gift.display_name || gift.displayName || gift.gift_id || gift.giftId || '';
|
||||||
var image = card.querySelector('.gift-img');
|
var image = card.querySelector('.gift-img');
|
||||||
if (image && img) image.src = img;
|
if (image && img) image.src = img;
|
||||||
|
|||||||
@ -426,6 +426,13 @@ button {
|
|||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reward-item.is-coin .gift-img {
|
||||||
|
left: 66px;
|
||||||
|
top: 70px;
|
||||||
|
width: 126px;
|
||||||
|
height: 126px;
|
||||||
|
}
|
||||||
|
|
||||||
.reward-label {
|
.reward-label {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -18px;
|
left: -18px;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
(function () {
|
(function () {
|
||||||
var remoteBridgeVersion = '20260608.1';
|
var remoteBridgeVersion = '20260609.1';
|
||||||
|
|
||||||
function safeCall(fn, args) {
|
function safeCall(fn, args) {
|
||||||
try {
|
try {
|
||||||
@ -27,6 +27,33 @@
|
|||||||
return String(value).trim();
|
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) {
|
function post(action, body) {
|
||||||
var message = JSON.stringify({ action: action, payload: body || {} });
|
var message = JSON.stringify({ action: action, payload: body || {} });
|
||||||
if (postToChannel('GameBridgeChannel', message)) {
|
if (postToChannel('GameBridgeChannel', message)) {
|
||||||
@ -153,6 +180,7 @@
|
|||||||
var config = launchConfig();
|
var config = launchConfig();
|
||||||
var payload = launchPayload();
|
var payload = launchPayload();
|
||||||
var adapter = detectAdapter(config, payload);
|
var adapter = detectAdapter(config, payload);
|
||||||
|
config = normalizeAdapterConfig(config, adapter);
|
||||||
var normalized = readString(action);
|
var normalized = readString(action);
|
||||||
if (normalized === 'getConfig') {
|
if (normalized === 'getConfig') {
|
||||||
post('getConfig', body || {});
|
post('getConfig', body || {});
|
||||||
@ -177,6 +205,7 @@
|
|||||||
var payload = launchPayload();
|
var payload = launchPayload();
|
||||||
var entry = launchEntry();
|
var entry = launchEntry();
|
||||||
var adapter = detectAdapter(config, payload);
|
var adapter = detectAdapter(config, payload);
|
||||||
|
config = normalizeAdapterConfig(config, adapter);
|
||||||
var nativeBridge = window.NativeBridge || {};
|
var nativeBridge = window.NativeBridge || {};
|
||||||
var oldPostMessage =
|
var oldPostMessage =
|
||||||
typeof nativeBridge.postMessage === 'function'
|
typeof nativeBridge.postMessage === 'function'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user