WXS04Mediator.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { GUIManager } from "../../../engines/gui/GUIManager";
  2. import GUIMediator from "../../../engines/gui/GUIMediator";
  3. import { LiangLiangSDK } from "../../../platforms/libs/liangliangSDK";
  4. import { PlatformManager } from "../../../platforms/PlatformManager";
  5. import UI_WX_S_04 from "../../../ui/WXSExport/UI_WX_S_04";
  6. import UIKeys from "../../UIKeys";
  7. import ExportList from "./ExportList";
  8. export default class WXS04Mediator extends GUIMediator
  9. {
  10. private list:ExportList;
  11. constructor(){
  12. super();
  13. }
  14. protected OnShow():void{
  15. PlatformManager.hideBanner();
  16. if(this.list==null){
  17. this.list=new ExportList(this.view.m_listIcon,1);
  18. }
  19. if(LiangLiangSDK.CanWuChu()){
  20. this.view.m_btnVideo.visible = true;
  21. }else{
  22. this.view.m_btnVideo.visible = false;
  23. }
  24. this.list.Refresh();
  25. }
  26. protected OnHide():void{
  27. }
  28. Tick(dt:number):void{
  29. this.list.Tick(dt);
  30. }
  31. protected AddEvents():void{
  32. this.view.m_btnVideo.onClick(this.VideoButtonClick,this);
  33. this.view.m_btnContine.onClick(this.ContineButtonClick,this);
  34. }
  35. protected RemoveEvents():void{
  36. this.view.m_btnVideo.offClick(this.VideoButtonClick,this);
  37. this.view.m_btnContine.offClick(this.ContineButtonClick,this);
  38. }
  39. private VideoButtonClick():void{
  40. PlatformManager.showRewardedVideo(()=>{
  41. this.GotoWXS02();
  42. }, ()=>{
  43. })
  44. }
  45. private ContineButtonClick():void{
  46. this.GotoWXS02();
  47. }
  48. private GotoWXS02():void{
  49. GUIManager.single.Show(UIKeys.WXS02,this.data);
  50. this.HideSelf();
  51. }
  52. private get view():UI_WX_S_04{
  53. return this._view as UI_WX_S_04;
  54. }
  55. }