win.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { _decorator, Component, Label, Node } from 'cc';
  2. import { server_han_zi_zhao_bu_tong_data_item, server_mei_nv_zhao_xi_jie_data_item, server_shuang_tu_zhao_bu_tong_data_item } from '../data/server_play_list_data';
  3. import { Util } from '../framework/util';
  4. import { gameManager } from '../gameManager';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('win')
  7. export class win extends Component {
  8. @property(Node) btn_back:Node;
  9. @property(Node) btn_ordinary:Node;
  10. @property(Node) btn_double:Node;
  11. @property(Node) lab_reward_number:Node;
  12. private m_ordinary_call:any = null;
  13. private m_double_call:any = null;
  14. start() {
  15. let self = this;
  16. this.btn_back.on(Node.EventType.TOUCH_START,()=>{
  17. self.close();
  18. },this);
  19. this.btn_ordinary.on(Node.EventType.TOUCH_START,()=>{
  20. if(this.m_ordinary_call!=null){
  21. this.m_ordinary_call()
  22. }
  23. self.close();
  24. },this);
  25. this.btn_double.on(Node.EventType.TOUCH_START,()=>{
  26. if(this.m_double_call!=null){
  27. this.m_double_call()
  28. }
  29. self.close();
  30. },this);
  31. }
  32. close(){
  33. this.node.removeFromParent();
  34. }
  35. //双图找不同
  36. public showZhaoBuTongView(reward:number,data:server_shuang_tu_zhao_bu_tong_data_item,ordinary_call,double_call){
  37. this.m_double_call = double_call;
  38. this.m_ordinary_call = ordinary_call;
  39. this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";
  40. }
  41. //汉字找不同
  42. public showHanZiView(reward:number,data:server_han_zi_zhao_bu_tong_data_item,ordinary_call,double_call){
  43. this.m_double_call = double_call;
  44. this.m_ordinary_call = ordinary_call;
  45. this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";
  46. }
  47. //美女找不同
  48. public showMeiNvView(reward:number,data:server_mei_nv_zhao_xi_jie_data_item,ordinary_call,double_call){
  49. this.m_double_call = double_call;
  50. this.m_ordinary_call = ordinary_call;
  51. this.lab_reward_number.getComponent(Label).string = "+ " +reward+"";
  52. }
  53. }