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CAAC;oBAC5B,cAAc,EAAE,GAAG,EAAE,GAAG,CAAC;oBACzB,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC;iBAC7B,CAAC;gBACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,CAAC;aAC9D;QACL,CAAC;QAyBD,gCAAgC;YAC5B,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,uCAA6B,CAAC,WAAW,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QACtI,CAAC;KACJ,CAAA;IA5IU,kCAAI,GAAG,+BAA+B,CAAC;IAF7B,6BAA6B;QADjD,qCAAY,CAAC,+CAAwB,CAAC;OAClB,6BAA6B,CA8IjD;IAAD,oCAAC;KAAA;kBA9IoB,6BAA6B","file":"","sourceRoot":"/","sourcesContent":["import { ResUtils } from \"simba-cc-resutils\";\nimport { ConfigManager } from \"simba-config-manager\";\nimport { SDK } from \"simba-sdk\";\nimport { DeepReadonlyObject } from \"simba-utils\";\nimport { createPresenter, Presenter } from \"../../../common/classbase/PresenterBase\";\nimport { GameConstData } from \"../../../common/gameplay/gamedata/GameConstData\";\nimport { UIManager } from \"../../../common/gameplay/managers/UIManager\";\nimport { IItemTbl, itemTbl } from \"../../../config/ItemTbl\";\nimport GameCenter from \"../../../cooperation/script/GameCenter\";\nimport { channel, GameConfig } from \"../../../GameConfig\";\nimport GameDotMgr from \"../../GameDotMgr\";\nimport { GameModelManager } from \"../../model/GameModelManager\";\nimport { UnlockItemModelManager } from \"../../model/UnlockItemModelManager\";\nimport UnlockSpecialPlotEventManager from \"../../model/UnlockSpecialPlotEventManager\";\nimport { UnlockSpecialPlotModelManager } from \"../../model/UnlockSpecialPlotModelManager\";\nimport { RegPresenter } from \"../PresenterCCViewFactory\";\nimport { ItemIntroductionView, ItemIntroductionViewProps, ItemIntroductionViewType } from \"../view/type/ItemIntroductionView\";\nimport { SpecialPlotViewProps } from \"../view/type/SpecialPlotView\";\nimport SpecialPlotViewPresenter from \"./SpecialPlotViewPresenter\";\n\n@RegPresenter(ItemIntroductionViewType)\nexport default class ItemIntroductionViewPresenter extends Presenter<ItemIntroductionViewProps, ItemIntroductionView>\n{\n static uuid = \"ItemIntroductionViewPresenter\";\n\n private _viewProps: ItemIntroductionViewProps;\n private specialPresenter: SpecialPlotViewPresenter | undefined = undefined;\n\n constructor() {\n super();\n }\n\n onOpen(props: ItemIntroductionViewProps) {\n super.onOpen(props);\n this._viewProps = props;\n this._viewProps.showItemSpr = this.showItemSpr;\n this._viewProps.onSpecialPlotBtnClick = this.onSpecialPlotClickCallBack;\n this._viewProps.onShopBtnClick = this.onShopBtnClickCallBack;\n this.view.setProps(this._viewProps);\n this.onShow();\n createPresenter(SpecialPlotViewPresenter).then((presenter) => {\n this.specialPresenter = presenter;\n });\n }\n\n onShow() {\n super.onShow();\n this.showItemSpr(this._viewProps.itemId);\n }\n\n onEnterBackground() {\n super.onEnterBackground();\n }\n\n onEnterForeground() {\n super.onEnterForeground();\n }\n\n onClose() {\n super.onClose();\n }\n\n showItemSpr = async (itemId: number) => {\n try {\n let cfg: DeepReadonlyObject<IItemTbl> | undefined = undefined;\n if (itemId) {\n cfg = ConfigManager.getConfig(itemTbl, itemId);\n if (cfg) {\n //如果没有模糊图,那么直接展示简介图\n if (cfg.foggy === 0) {\n UnlockItemModelManager.saveUnlockedIntroductionItemIdToGameRecord(itemId);\n let path: string = GameConstData.GAME_CONST_ITEM_BIG_SPR_DIR + cfg.type;\n let itemSpriteFrame = await ResUtils.loadRes(path, cc.SpriteFrame);\n this.view.getItemSpriteNode().spriteFrame = itemSpriteFrame;\n }\n //如果有模糊图,那么就判断是否已经解锁了清晰的简介图\n else {\n let unlockedIntroduction = false;\n let unlockedIntroductionItems = UnlockItemModelManager.unlockedIntroductionItems;\n for (let i = 0; i < unlockedIntroductionItems.length; i++) {\n if (itemId == unlockedIntroductionItems[i]) {\n unlockedIntroduction = true;\n }\n }\n if (!unlockedIntroduction) {\n let path: string = GameConstData.GAME_CONST_ITEM_BIG_SPR_DIR + cfg.foggyPicture;\n let itemSpriteFrame = await ResUtils.loadRes(path, cc.SpriteFrame);\n this.view.getItemSpriteNode().spriteFrame = itemSpriteFrame;\n } else {\n UnlockItemModelManager.saveUnlockedIntroductionItemIdToGameRecord(itemId);\n let path: string = GameConstData.GAME_CONST_ITEM_BIG_SPR_DIR + cfg.type;\n let itemSpriteFrame = await ResUtils.loadRes(path, cc.SpriteFrame);\n this.view.getItemSpriteNode().spriteFrame = itemSpriteFrame;\n }\n }\n }\n }\n this.updateSpecialPlotBtnRedDotStatus();\n } catch (error) {\n console.error(error);\n }\n }\n\n onSpecialPlotClickCallBack = () => {\n let itemCfg: DeepReadonlyObject<IItemTbl> | undefined = undefined;\n itemCfg = ConfigManager.getConfig(itemTbl, this._viewProps.itemId);\n let unlockedSpecialPlots = UnlockSpecialPlotModelManager.unlockedSpecialPlotIdByItemId(this._viewProps.itemId);\n if (itemCfg) {\n let unlockedSpecialPlot = false;\n if (unlockedSpecialPlots.length > 0) {\n unlockedSpecialPlot = true;\n }\n if (unlockedSpecialPlot) {\n this.openSpecialPlotView(this._viewProps.itemId, unlockedSpecialPlots);\n } else {\n UIManager.showToast(itemCfg.toastMsg);\n return;\n }\n }\n this.view.close();\n }\n\n openSpecialPlotView(itemId: number, specialPlotIds: number[]) {\n if (this.specialPresenter) {\n let temp: SpecialPlotViewProps = {\n itemId: itemId,\n specialPlotIds: specialPlotIds,\n onLeftBtnClick: () => { },\n onRightBtnClick: () => { },\n createGameClubBtn: () => { },\n onShopBtnClick: () => { },\n onCloseBtnClick: () => { }\n };\n this.specialPresenter.open(this.view.getContainer(), temp);\n }\n }\n\n onShopBtnClickCallBack = () => {\n GameDotMgr.getInstance().dotClickUI(\"shop_btn_introduction\");\n let type = GameModelManager.getTypeByBedroomItemId(this._viewProps.itemId);\n if (channel == \"wechat\") {\n // GameCenter.getInstance().openSubProgram(GameConfig.youZanShopAppId);\n if (type) {\n let link = GameModelManager.getYouZanShopUrlByType(type);\n if (link) {\n SDK.openProgramV2(GameConfig.youZanShopAppId, link);\n }\n }\n } else if (channel == \"android\") {\n if (type) {\n let link = GameModelManager.getTaoBaoShopUrlByType(type);\n if (link) {\n GameModelManager.jumpToTaobaoShop(link);\n }\n }\n } else {\n UIManager.showToast(\"该功能在当前平台不可使用\");\n }\n }\n\n updateSpecialPlotBtnRedDotStatus() {\n this.view.showSpecialPlotBtnRedDot(UnlockSpecialPlotEventManager.getInstance().isShowBedRoomRedDotStatus(this._viewProps.itemId));\n }\n}\n"]}