Commit ec38aac8 authored by haiyoucuv's avatar haiyoucuv

init

parent 1046fea4
This diff is collapsed.
...@@ -46,9 +46,9 @@ export class HomeScene extends Scene { ...@@ -46,9 +46,9 @@ export class HomeScene extends Scene {
@property(Prefab) boxItemPrefab: Prefab = null; @property(Prefab) boxItemPrefab: Prefab = null;
@property(SpriteFrame) boxStatus0: SpriteFrame = null;
@property(SpriteFrame) boxStatus1: SpriteFrame = null; @property(SpriteFrame) boxStatus1: SpriteFrame = null;
@property(SpriteFrame) boxStatus2: SpriteFrame = null; @property(SpriteFrame) boxStatus2: SpriteFrame = null;
@property(SpriteFrame) boxStatus3: SpriteFrame = null;
onLoad() { onLoad() {
...@@ -98,11 +98,11 @@ export class HomeScene extends Scene { ...@@ -98,11 +98,11 @@ export class HomeScene extends Scene {
const txt = item.getComponentInChildren(Label); const txt = item.getComponentInChildren(Label);
txt.string = `通过${targetLevel}关`; txt.string = `通过${targetLevel}关`;
if (+status === 2 || +status === 3) { if (+status == 1 || +status == 2) {
sp.spriteFrame = this[`boxStatus${status}`]; sp.spriteFrame = this[`boxStatus${status}`];
maxIndex = Math.max(maxIndex, i); maxIndex = Math.max(maxIndex, i);
} else { } else {
sp.spriteFrame = this.boxStatus1; sp.spriteFrame = this.boxStatus0;
} }
this.boxRoot.addChild(item); this.boxRoot.addChild(item);
...@@ -117,7 +117,7 @@ export class HomeScene extends Scene { ...@@ -117,7 +117,7 @@ export class HomeScene extends Scene {
openBox = _asyncThrottle(async function (item) { openBox = _asyncThrottle(async function (item) {
const { id, status, targetLevel } = item; const { id, status, targetLevel } = item;
if (+status != 2) return; if (+status != 1) return;
const { success, data } = await sendWebNet(WebNetName.openBox, { id }); const { success, data } = await sendWebNet(WebNetName.openBox, { id });
if (!success) return; if (!success) return;
await showPanel(BoxPanel, data); await showPanel(BoxPanel, data);
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
"unparkCreditsNum": 88, "unparkCreditsNum": 88,
"boxConfigs": [ "boxConfigs": [
{ {
id: 1, "id": "1",
targetLevel: 1, "status": "1",
status: 3 "targetLevel": "1"
}, },
{ {
id: 2, "id": "2",
targetLevel: 3, "status": "0",
status: 2 "targetLevel": "3"
}, },
{ {
id: 3, "id": "3",
targetLevel: 5, "status": "0",
status: 1 "targetLevel": "5"
} }
] ]
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment