修改黄金矿工活动面板的倒计时规则
This commit is contained in:
parent
85daacefe1
commit
1f3c329eb3
|
|
@ -601,7 +601,7 @@
|
|||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "CountdownDigits",
|
||||
"_name": "CountdownLabel",
|
||||
"_objFlags": 0,
|
||||
"_parent": {
|
||||
"__id__": 5
|
||||
|
|
@ -648,6 +648,9 @@
|
|||
"_components": [
|
||||
{
|
||||
"__id__": 82
|
||||
},
|
||||
{
|
||||
"__id__": 1079
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
|
|
@ -663,8 +666,8 @@
|
|||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 300,
|
||||
"height": 31
|
||||
"width": 208,
|
||||
"height": 48
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
|
|
@ -675,8 +678,8 @@
|
|||
"__type__": "TypedArray",
|
||||
"ctor": "Float64Array",
|
||||
"array": [
|
||||
-216.877,
|
||||
612.993,
|
||||
-215.404,
|
||||
614.993,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
|
@ -712,7 +715,7 @@
|
|||
"__id__": 17
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 20
|
||||
|
|
@ -894,7 +897,7 @@
|
|||
"__id__": 22
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 25
|
||||
|
|
@ -1079,7 +1082,7 @@
|
|||
"__id__": 30
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 33
|
||||
|
|
@ -1369,7 +1372,7 @@
|
|||
"__id__": 35
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 38
|
||||
|
|
@ -1551,7 +1554,7 @@
|
|||
"__id__": 40
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 43
|
||||
|
|
@ -1736,7 +1739,7 @@
|
|||
"__id__": 48
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 51
|
||||
|
|
@ -2026,7 +2029,7 @@
|
|||
"__id__": 53
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 56
|
||||
|
|
@ -2208,7 +2211,7 @@
|
|||
"__id__": 58
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 61
|
||||
|
|
@ -3095,49 +3098,36 @@
|
|||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "bef06RsP29LE5VJ6q2m1Y1j",
|
||||
"__type__": "cc.Label",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_enabled": true,
|
||||
"frames": [
|
||||
"_materials": [
|
||||
{
|
||||
"__uuid__": "0be8cba5-0878-4aae-8176-b5e9cc996810"
|
||||
},
|
||||
{
|
||||
"__uuid__": "f4a29cd3-e764-4d78-aac0-39274314ea36"
|
||||
},
|
||||
{
|
||||
"__uuid__": "cb06d1e2-76bc-4e4c-ae55-247d96cf2f71"
|
||||
},
|
||||
{
|
||||
"__uuid__": "fa45f996-7b1c-4afd-8145-5fb98c5096da"
|
||||
},
|
||||
{
|
||||
"__uuid__": "c7cb4d0d-998d-4b63-8e2f-3f330f57af36"
|
||||
},
|
||||
{
|
||||
"__uuid__": "43574e26-80c6-4dac-a400-9e2f05fe6bc1"
|
||||
},
|
||||
{
|
||||
"__uuid__": "cbba1cd8-b585-4c38-be4e-54555a60f3d2"
|
||||
},
|
||||
{
|
||||
"__uuid__": "125d20d0-dc73-45fb-bc78-5394045eea26"
|
||||
},
|
||||
{
|
||||
"__uuid__": "db2928c6-3b77-443f-b50f-aea2d0034510"
|
||||
},
|
||||
{
|
||||
"__uuid__": "87521681-ee1a-4a1d-bbe6-818818cfc284"
|
||||
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
|
||||
}
|
||||
],
|
||||
"slashFrame": null,
|
||||
"height": 31,
|
||||
"gap": -2.48,
|
||||
"colonWidth": 0.48,
|
||||
"_srcBlendFactor": 770,
|
||||
"_dstBlendFactor": 771,
|
||||
"_string": "6天10时",
|
||||
"_N$string": "6天10时",
|
||||
"_fontSize": 34,
|
||||
"_lineHeight": 42,
|
||||
"_enableWrapText": false,
|
||||
"_N$file": null,
|
||||
"_isSystemFontUsed": true,
|
||||
"_spacingX": 0,
|
||||
"_batchAsBitmap": false,
|
||||
"_styleFlags": 1,
|
||||
"_underlineHeight": 0,
|
||||
"_N$horizontalAlign": 1,
|
||||
"_N$verticalAlign": 1,
|
||||
"_N$fontFamily": "Arial",
|
||||
"_N$overflow": 2,
|
||||
"_N$cacheMode": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
|
@ -39711,5 +39701,23 @@
|
|||
},
|
||||
"fileId": "",
|
||||
"sync": false
|
||||
},
|
||||
{
|
||||
"__type__": "cc.LabelOutline",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"node": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_enabled": true,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_width": 2,
|
||||
"_id": ""
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const { ccclass, property } = cc._decorator;
|
|||
export default class CoinMadnessPanel extends cc.Component {
|
||||
@property(cc.Node) card: cc.Node = null;
|
||||
@property(cc.Node) dim: cc.Node = null;
|
||||
@property(CoinMadnessDigits) countdown: CoinMadnessDigits = null;
|
||||
@property(cc.Label) countdown: cc.Label = null;
|
||||
@property(cc.SpriteFrame) flyingCoin: cc.SpriteFrame = null;
|
||||
@property(CoinMadnessDigits) totalDigits: CoinMadnessDigits = null;
|
||||
@property(cc.Node) lockedOffer: cc.Node = null;
|
||||
|
|
@ -451,7 +451,10 @@ export default class CoinMadnessPanel extends cc.Component {
|
|||
if (!this.data) return;
|
||||
const remaining = Math.max(0, Math.ceil(((this.data.state.config.endsAt || 0) - Date.now() - this.offset) / 1000));
|
||||
const pad = (value: number) => value < 10 ? '0' + value : String(value);
|
||||
this.countdown.setText(pad(Math.floor(remaining / 3600)) + ':' + pad(Math.floor(remaining / 60) % 60) + ':' + pad(remaining % 60));
|
||||
// Match the home entry: omit minutes (without rounding up) while at least one day remains.
|
||||
this.countdown.string = remaining >= 86400
|
||||
? Math.floor(remaining / 86400) + '天' + Math.floor(remaining % 86400 / 3600) + '时'
|
||||
: pad(Math.floor(remaining / 3600)) + ':' + pad(Math.floor(remaining / 60) % 60) + ':' + pad(remaining % 60);
|
||||
if (this.api.request && !remaining) { this.finishExpired(); return; }
|
||||
}
|
||||
private async run(action: string, body: any) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user