DatingEventViewImpl.ts
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { CCPureView } from "../../../../common/classbase/CCViewBase";
import { RegView } from "../../PresenterCCViewFactory";
import { DatingEventViewType, DatingEventViewProps, DatingEventView } from "../type/DatingEventView";
import { View } from "../../../../common/classbase/ViewBase";
import { DatingEventSubviewImpl } from "./dating/DatingEventSubviewImpl";
import { DummyNode } from "../../../../common/CCDummyObjects";
const { ccclass, property } = cc._decorator;
@ccclass
@RegView(DatingEventViewType, "prefab/ui/DatingEventView")
export class DatingEventViewImpl extends CCPureView<DatingEventViewProps> implements DatingEventView {
private _activeIndex = 0;
//#region edntor bindings
@property([DatingEventSubviewImpl])
private subviews: DatingEventSubviewImpl[] = [];
@property(cc.Node)
private mainRedDot0 = DummyNode;
@property(cc.Node)
private mainRedDot1 = DummyNode;
@property(cc.Node)
private extraRedDot0 = DummyNode;
@property(cc.Node)
private extraRedDot1 = DummyNode;
onTabChange(_: any, index: string) {
this.subviews[this._activeIndex].hide();
this._activeIndex = parseInt(index);
this.subviews[this._activeIndex].show();
}
//#endregion
private _tabGiftContentContainer: View;
private _tabClothContentContainer: View;
public getGiftContentContainer(): View {
return this._tabGiftContentContainer;
}
public getClothContentContainer(): View {
return this._tabClothContentContainer;
}
onLoad() {
this.bindProp("mainEventRedDot", this.mainRedDot0, "active");
this.bindProp("mainEventRedDot", this.mainRedDot1, "active");
this.bindProp("extraEventRedDot", this.extraRedDot0, "active");
this.bindProp("extraEventRedDot", this.extraRedDot1, "active");
}
}