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;IAGhC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;2DACc;IAGhC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;uDACU;IAG5B;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;2DACc;IAEhC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;4DACe;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;4DACe;IAEjC;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;yDACY;IAE9B;QADC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC;gEACmB;IAtCpB,mBAAmB;QAFvC,OAAO;QACP,gCAAO,CAAC,qCAAmB,EAAE,2BAA2B,CAAC;OACrC,mBAAmB,CAyMvC;IAAD,0BAAC;KAAA;kBAzMoB,mBAAmB","file":"","sourceRoot":"/","sourcesContent":["import { RegView } from \"../../PresenterCCViewFactory\";\r\nimport { AlertDialogViewType, AlertDialogViewProps, AlertDialogView } from \"../type/AlertDialogView\";\r\nimport { CCPureView } from \"../../../../common/classbase/CCViewBase\";\r\nimport { DummyLabel, DummyNode, DummyButton, DummyRichText } from \"../../../../common/CCDummyObjects\";\r\nimport SVButton from \"simba-sdk-ccsvbutton\";\r\nimport { ShowType, ShowLocationType } from \"../../../Enums\";\r\nimport GameDotMgr from \"../../../GameDotMgr\";\r\nimport { SDK } from \"simba-sdk\";\r\nimport { GameConstData } from \"../../../../common/gameplay/gamedata/GameConstData\";\r\nimport { SVPoint } from \"simba-sdk/dist/SDKTypes\";\r\nimport { DeepReadonly } from \"simba-utils\";\r\nimport { GetRewardType } from \"../../../../common/gameplay/gamedata/GameEnumData\";\r\nimport { channel, GameConfig } from \"../../../../GameConfig\";\r\nimport { UIManager } from \"../../../../common/gameplay/managers/UIManager\";\r\nimport { GameModelManager } from \"../../../model/GameModelManager\";\r\n\r\n\r\nconst { ccclass, property } = cc._decorator;\r\n\r\n@ccclass\r\n@RegView(AlertDialogViewType, \"prefab/ui/AlertDialogView\")\r\nexport default class AlertDialogViewImpl extends CCPureView<AlertDialogViewProps> implements AlertDialogView {\r\n //#region \r\n @property(cc.Label)\r\n titlelabel: cc.Label = DummyLabel;\r\n\r\n @property(cc.RichText)\r\n content: cc.RichText = DummyRichText;\r\n\r\n @property(cc.Node)\r\n twobtnmode: cc.Node = DummyNode;\r\n\r\n @property(cc.Button)\r\n okbtn: cc.Button = DummyButton;\r\n\r\n @property(cc.Button)\r\n adokbtn: cc.Button = DummyButton;\r\n\r\n @property(SVButton)\r\n adsvbtn: SVButton = undefined as any;\r\n\r\n @property(cc.Node)\r\n onebtnmode: cc.Node = DummyNode;\r\n\r\n @property(cc.Node)\r\n opacityBtn: cc.Node = DummyNode;\r\n\r\n @property(cc.Node)\r\n banner: cc.Node = DummyNode;\r\n\r\n @property(cc.Node)\r\n cancelNode: cc.Node = DummyNode;\r\n @property(cc.Node)\r\n cancelNode2: cc.Node = DummyNode;\r\n @property(cc.Node)\r\n cancelNode3: cc.Node = DummyNode;\r\n @property(cc.Node)\r\n shopNode: cc.Node = DummyNode;\r\n @property(cc.Node)\r\n shareScreenNode: cc.Node = DummyNode;\r\n\r\n svType: GetRewardType = GetRewardType.Ad;\r\n\r\n onLoad() {\r\n this.adsvbtn.loadSVConfig();\r\n this.bindProp(\"titlecontent\", (value) => {\r\n this.titlelabel.string = value;\r\n });\r\n\r\n this.bindProp(\"content\", (value) => {\r\n this.content.string = value;\r\n });\r\n\r\n this.bindProp(\"ishasad\", (value) => {\r\n if (this._props.istwobtn) {\r\n this.adokbtn.node.active = value;\r\n this.okbtn.node.active = !value;\r\n this.adsvbtn.enabled = true;\r\n }\r\n\r\n });\r\n\r\n this.bindProp(\"istwobtn\", (value) => {\r\n this.twobtnmode.active = value;\r\n let hasad = this._props.ishasad;\r\n this.adokbtn.node.active = hasad;\r\n this.okbtn.node.active = !hasad;\r\n this.onebtnmode.active = !value;\r\n });\r\n\r\n this.bindProp(\"adconfig\", (value) => {\r\n this.adsvbtn.enabled = (value !== \"\");\r\n if (value !== \"\") {\r\n this.adsvbtn.sharePointId = value;\r\n this.adsvbtn.loadSVConfig();\r\n }\r\n });\r\n\r\n this.bindProp(\"isthreebtn\", (value) => {\r\n let three: boolean = value ? true : false;\r\n this.shopNode.active = three;\r\n this.cancelNode2.active = three;\r\n this.cancelNode.active = !three;\r\n });\r\n\r\n this.bindProp(\"isadlimit\", (value) => {\r\n let isadlimit: boolean = value ? true : false;\r\n this.shopNode.active = isadlimit;\r\n this.cancelNode3.active = isadlimit;\r\n this.adokbtn.node.active = !isadlimit;\r\n });\r\n\r\n this.bindProp(\"isShareScreen\", (value) => {\r\n let isShareScreen: boolean = value ? true : false;\r\n this.shareScreenNode.active = isShareScreen;\r\n this.adokbtn.node.active = !isShareScreen;\r\n });\r\n\r\n this.adsvbtn.onResult = ((type, ret) => {\r\n this._props.callback(type, ret, this._props.dataptr);\r\n this.closeView();\r\n });\r\n\r\n this.adsvbtn.onConfigLoaded = (svPoint: DeepReadonly<SVPoint>) => {\r\n if (svPoint.type === \"share\") {\r\n this.svType = GetRewardType.Share;\r\n } else {\r\n this.svType = GetRewardType.Ad;\r\n }\r\n }\r\n\r\n }\r\n\r\n onOkClickCallback(event) {\r\n this._props.callback(\"\", true, this._props.dataptr);\r\n this.closeView();\r\n }\r\n\r\n onCancleClickCallback(event) {\r\n this._props.callback(\"\", false, this._props.dataptr);\r\n this.closeView();\r\n }\r\n\r\n onGoToShopClickCallback(event) {\r\n this._props.callback(\"\", false, this._props.dataptr);\r\n GameDotMgr.getInstance().dotClickUI(\"shop_btn_AlertDialogView\");\r\n if (channel == \"wechat\") {\r\n // GameCenter.getInstance().openSubProgram(GameConfig.youZanShopAppId);\r\n let link = GameModelManager.getYouZanShopUrlByType(2);\r\n if (link) {\r\n SDK.openProgramV2(GameConfig.youZanShopAppId, link);\r\n }\r\n } else if (channel == \"android\") {\r\n let link = GameModelManager.getTaoBaoShopUrlByType(2);\r\n if (link) {\r\n GameModelManager.jumpToTaobaoShop(link);\r\n }\r\n } else {\r\n UIManager.showToast(\"该功能在当前平台不可使用\");\r\n }\r\n }\r\n\r\n onShareScreenClickCallback(event) {\r\n \r\n }\r\n\r\n onADBtnClick() {\r\n this.opacityBtn.active = true;\r\n }\r\n\r\n getSvBtnType = (): string => {\r\n let ret = \"\";\r\n if (this.adsvbtn.svPoint) {\r\n ret = this.adsvbtn.svPoint.type;\r\n }\r\n return ret;\r\n }\r\n\r\n closeView() {\r\n SDK.hideBannerAd();\r\n this.close();\r\n this.opacityBtn.active = false;\r\n }\r\n\r\n switchAdConfig(props: AlertDialogViewProps) {\r\n if (props.istwobtn) {//两个按钮的\r\n if (props.adconfig && \"\" !== props.adconfig.trim()) {\r\n this.adsvbtn.sharePointId = props.adconfig;\r\n this.adsvbtn.loadSVConfig();\r\n }\r\n }\r\n }\r\n\r\n showView = (props: AlertDialogViewProps) => {\r\n this.opacityBtn.active = false;\r\n this.switchAdConfig(props);\r\n if (!props.hasBanner) {\r\n SDK.hideBannerAd();\r\n return;\r\n }\r\n let info = SDK.systemInfo.displayInfo;\r\n let aspect = info.windowSize.height / cc.view.getVisibleSize().height;\r\n this.node.getComponent(cc.Widget).updateAlignment();\r\n\r\n let _width = this.banner.width * aspect;\r\n let _height = this.banner.height * aspect;\r\n let _left = (info.windowSize.width - _width) * 0.5;\r\n let _top = info.windowSize.height - _height;\r\n\r\n let style = {\r\n left: _left,\r\n top: _top,\r\n width: _width,\r\n height: _height,\r\n anchorX: 0.5,\r\n anchorY: 1,\r\n }\r\n SDK.showBannerAd(style, GameConstData.GAME_CONST_BANNER_REFRESH_TIME);\r\n }\r\n\r\n\r\n\r\n}"]}