|
@@ -21,27 +21,26 @@ const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass("PageShop")
|
|
|
export class PageShop extends BaseUI implements OnTabClickListener {
|
|
|
-
|
|
|
- switchTab(tab: { index: number; name: string; }) {
|
|
|
+ switchTab(tab: { index: number; name: string }) {
|
|
|
this.onTabClick(tab.index);
|
|
|
}
|
|
|
protected onLoad(): void {
|
|
|
super.onLoad();
|
|
|
this.init();
|
|
|
}
|
|
|
- static readonly TAB_GAME_PASS = {
|
|
|
+ static readonly TAB_GAME_PASS = {
|
|
|
index: 0,
|
|
|
name: "ScrollViewGamePass",
|
|
|
};
|
|
|
- static readonly TAB_POG_BOOSTER = {
|
|
|
+ static readonly TAB_POG_BOOSTER = {
|
|
|
index: 1,
|
|
|
name: "ScrollViewPogBooster",
|
|
|
};
|
|
|
- static readonly TAB_ITEM_BOX = {
|
|
|
+ static readonly TAB_ITEM_BOX = {
|
|
|
index: 2,
|
|
|
name: "ScrollViewItemBox",
|
|
|
};
|
|
|
- static readonly TAB_POG_BOX = { index: 3, name: "ScrollViewPogBox" };
|
|
|
+ static readonly TAB_POG_BOX = { index: 3, name: "ScrollViewPogBox" };
|
|
|
private _tabsTitle: CommonTabsTitle = null;
|
|
|
init() {
|
|
|
this._tabsTitle = this.getComponentInChildren(CommonTabsTitle);
|
|
@@ -54,6 +53,7 @@ export class PageShop extends BaseUI implements OnTabClickListener {
|
|
|
this.FindNode("PogBoosterItem").active = false;
|
|
|
}
|
|
|
onTabClick(index: number) {
|
|
|
+ this._tabsTitle.setSelect(index);
|
|
|
this.FindNode("ShopPageContainer").children.forEach((child) => {
|
|
|
child.active = false;
|
|
|
});
|
|
@@ -141,9 +141,8 @@ export class PageShop extends BaseUI implements OnTabClickListener {
|
|
|
item.active = true;
|
|
|
scrollView.content.addChild(item);
|
|
|
|
|
|
-
|
|
|
- let c= ConfigM.ins.getShopListByStoreId(1)[i];
|
|
|
- item.getComponent(GamePassItem).init(list[i],c)
|
|
|
+ let c = ConfigM.ins.getShopListByStoreId(1)[i];
|
|
|
+ item.getComponent(GamePassItem).init(list[i], c);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -173,8 +172,6 @@ export class PageShop extends BaseUI implements OnTabClickListener {
|
|
|
await UserM.ins.refreshInfo();
|
|
|
}
|
|
|
this.initGamePassShard();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
protected simpleOnBtnClick(name: string): void {
|
|
|
switch (name) {
|