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AE,WAAW,EAAE,qBAAqB,EAAE,CAAC;4DACvB;IAElD;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;2DACvB;IAGjD;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;qDACnC;IAGxC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;kDACY;IAE9B;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;kDACY;IAE9B;QADC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC;sDACiB;IAtB3B,YAAY;QAFxB,OAAO;QACP,gCAAO,CAAC,uBAAY,EAAE,oBAAoB,CAAC;OAC/B,YAAY,CA6IxB;IAAD,mBAAC;KAAA;AA7IY,oCAAY","file":"","sourceRoot":"/","sourcesContent":["import { DummyLabel, DummyNode, DummySprite } from \"../../../../common/CCDummyObjects\";\nimport { CCPureView, CCView } from \"../../../../common/classbase/CCViewBase\";\nimport { View } from \"../../../../common/classbase/ViewBase\";\nimport { channel, GameConfig } from \"../../../../GameConfig\";\nimport { DirectionType, MainTabs } from \"../../../Enums\";\nimport { GuideViewParamModel } from \"../../presenter/GuideViewPresenter\";\nimport { RegView } from \"../../PresenterCCViewFactory\";\nimport { MainView, MainViewProps, MainViewType } from \"../type/MainView\";\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\n@RegView(MainViewType, \"prefab/ui/MainView\")\nexport class MainViewImpl extends CCPureView<MainViewProps> implements MainView {\n\n @property({ type: cc.Node })\n private contentParent: cc.Node = DummyNode;\n @property({ type: cc.Sprite })\n private titleSprite: cc.Sprite = DummySprite;\n\n @property({ type: [cc.Button], displayName: \"Tabbar Buttons\" })\n private tabbarButtons: cc.Button[] = [];\n @property({ type: [cc.SpriteFrame], displayName: \"Tabbar Spriteframes\" })\n private tabbarSpriteFrames: cc.SpriteFrame[] = [];\n @property({ type: [cc.SpriteFrame], displayName: \"Title Spriteframes\" })\n private titleSpriteFrames: cc.SpriteFrame[] = [];\n\n @property({ type: [sp.Skeleton], displayName: \"Click skeleton ani array\" })\n private clickAniArr: sp.Skeleton[] = [];\n\n @property(cc.Node)\n debugbtn: cc.Node = DummyNode;\n @property(cc.Node)\n waitNode: cc.Node = DummyNode;\n @property(cc.Label)\n loadingLabel: cc.Label = DummyLabel;\n\n onTabButtonClick(event, index: string) {\n this._props.onTabClick(parseInt(index), () => {});\n this.hideClickAniByIndex(parseInt(index));\n }\n\n private _tabContentContainer: View;\n private _dotNumber = 1;\n\n\n onLoad() {\n this.changeLoadingLabel();\n this._tabContentContainer = this.contentParent.addComponent(CCView);\n\n this.bindProp(\"messageRedDot\", (value) => {\n this.tabbarButtons[MainTabs.messageTab].node.getChildByName(\"RedDot\").active = value;\n if (this._props.selectedTab !== 0 && value) {\n this.clickAniArr[MainTabs.messageTab].node.active = true;\n } else {\n this.clickAniArr[MainTabs.messageTab].node.active = false;\n }\n });\n this.bindProp(\"datingEventRedDot\", (value) => {\n this.tabbarButtons[MainTabs.datingEventTab].node.getChildByName(\"RedDot\").active = value;\n if (this._props.selectedTab !== MainTabs.datingEventTab && value) {\n this.clickAniArr[MainTabs.datingEventTab].node.active = true;\n } else {\n this.clickAniArr[MainTabs.datingEventTab].node.active = false;\n }\n });\n\n //修改主界面发现按钮为永久显示红点\n this.bindProp(\"discoverRedDot\", (value) => {\n this.tabbarButtons[MainTabs.discoverTab].node.getChildByName(\"RedDot\").active = true;\n });\n\n this.debugbtn.active = GameConfig.debug;\n }\n\n getTabContentContainer(): View {\n return this._tabContentContainer;\n }\n\n onPropsLoad(props: Readonly<MainViewProps>) {\n super.onPropsLoad(props);\n let currTab = this._props.selectedTab;\n this.tabbarButtons[currTab].normalSprite = this.tabbarSpriteFrames[currTab * 2 + 1];\n this.titleSprite.spriteFrame = this.titleSpriteFrames[currTab];\n }\n\n onPropChange(key: Extract<keyof MainViewProps, string>) {\n super.onPropChange(key);\n if (key === \"selectedTab\") {\n let prevTab = this._prevProps.selectedTab;\n this.tabbarButtons[prevTab].normalSprite = this.tabbarSpriteFrames[prevTab * 2];\n let currTab = this._props.selectedTab;\n this.tabbarButtons[currTab].normalSprite = this.tabbarSpriteFrames[currTab * 2 + 1];\n this.titleSprite.spriteFrame = this.titleSpriteFrames[currTab];\n }\n }\n\n\n onDebugClickCallback(event) {\n this._props.onDebugClick();\n }\n\n getGuideTabParam(index: number): GuideViewParamModel | undefined {\n if (index < 0 || this._props.selectedTab === index) {\n return undefined;\n }\n let node = this.tabbarButtons[index].node;\n let wp = node.convertToWorldSpaceAR(cc.v2(0, 0));\n let m: GuideViewParamModel = {\n x: wp.x,\n y: wp.y,\n w: node.width,\n h: node.height,\n d: DirectionType.DOWM,\n }\n return m;\n }\n\n hideClickAniByIndex = (index: number) => {\n if (index < 0 || index > this.clickAniArr.length) {\n return;\n }\n let limitArr: MainTabs[] = [MainTabs.messageTab, MainTabs.datingEventTab];\n let contrlArr: boolean[] = [this._props.messageRedDot, this._props.datingEventRedDot];\n let exist = limitArr.findIndex((v) => v === index) !== (-1);\n if (exist) {\n for (let i = 0; i < limitArr.length; i++) {\n this.clickAniArr[limitArr[i]].node.active = (limitArr[i] !== index) && contrlArr[i];\n }\n } else {\n for (let i = 0; i < limitArr.length; i++) {\n this.clickAniArr[limitArr[i]].node.active = contrlArr[i];\n }\n }\n }\n\n showWaitingView(isShow: boolean) {\n this.waitNode.active = isShow;\n }\n\n changeLoadingLabel() {\n this.loadingLabel.schedule(() => {\n if (this._dotNumber >= 3) {\n this._dotNumber = 1;\n } else {\n this._dotNumber++;\n }\n let dot = \"\";\n for (let i = 0; i < this._dotNumber; i++) {\n dot += \".\"\n }\n this.loadingLabel.string = \"正在努力加载(ง ˙o˙)ว!请耐心等待\" + dot;\n }, 0.5);\n }\n}"]}