WXS01Mediator.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { GUIManager } from "../../../engines/gui/GUIManager";
  2. import GUIMediator from "../../../engines/gui/GUIMediator";
  3. import { PlatformManager } from "../../../platforms/PlatformManager";
  4. import UI_WX_S_01 from "../../../ui/WXSExport/UI_WX_S_01";
  5. import Main from "../../Main";
  6. import UIKeys from "../../UIKeys";
  7. import ExportList from "./ExportList";
  8. export default class WXS01Mediator extends GUIMediator
  9. {
  10. private __showTime:number;
  11. private exportList:ExportList;
  12. constructor(){
  13. super();
  14. }
  15. protected OnShow():void{
  16. PlatformManager.hideBanner();
  17. this.__showTime=cc.sys.now();
  18. if(!Main.TEST){
  19. this.view.m_btnCll.visible=false;
  20. }
  21. if(this.exportList==null){
  22. this.exportList=new ExportList(this.view.m_listIcon,1);
  23. }
  24. this.exportList.Refresh();
  25. }
  26. protected OnHide():void{
  27. }
  28. protected AddEvents():void{
  29. this.view.m_btnCll.onClick(this.CloseButtonClick,this);
  30. }
  31. protected RemoveEvents():void{
  32. this.view.m_btnCll.offClick(this.CloseButtonClick,this);
  33. }
  34. private CloseButtonClick():void{
  35. //1.广告
  36. //2.cpa
  37. this.VideoCallBack();
  38. }
  39. private VideoCallBack():void{
  40. this.HideSelf();
  41. GUIManager.single.Show(UIKeys.WXS02);
  42. }
  43. Tick(dt:number):void{
  44. if(this.view.m_btnCll.visible==false){
  45. let curTime:number=cc.sys.now();
  46. if(curTime-this.__showTime>2000){
  47. this.view.m_btnCll.visible=true;
  48. }
  49. }
  50. this.exportList.Tick(dt);
  51. }
  52. private get view():UI_WX_S_01{
  53. return this._view as UI_WX_S_01;
  54. }
  55. /**
  56. * 所在层次
  57. */
  58. get LayerIndex(){
  59. return 4;
  60. }
  61. }