MailItemPre.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. InitPre:function(){
  4. this._Title = this.$('Title@Label');
  5. this._status0 = this.$('status0');
  6. this._status1 = this.$('status1');
  7. this._btLook = this.$('Layout/BtLook');
  8. this._btDel = this.$('Layout/BtDel');
  9. this._Title.string = '';
  10. this._status0.active = false;
  11. this._status1.active = false;
  12. //this._btLook.active = false;
  13. this._btDel.active = false;
  14. },
  15. SetPreInfo:function(Info){
  16. this._dwID = Info[0];
  17. this._Msg = Info[2];
  18. this._Title.string = Info[1];
  19. this._status0.active = Info[4] == 0;
  20. this._status1.active = Info[4] == 1;
  21. //this._btLook.active = Info[4] == 0;
  22. this._btDel.active = Info[4] == 1;
  23. },
  24. OnBtLookClick:function(){
  25. this.m_Hook.ShowPrefabDLG('MailDetails',null,function(Js){
  26. Js.OnSetInfo(this._Title.string,this._Msg,this);
  27. }.bind(this));
  28. this.onSendRead();
  29. },
  30. OnBtDelClick:function(){
  31. g_CurScene.ShowAlert('確定刪除此郵件?',Alert_YesNo,function(Res){
  32. if(Res){
  33. this.onSendDel();
  34. }
  35. }.bind(this));
  36. },
  37. onSendDel:function(){
  38. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  39. var webUrl = window.PHP_HOME+'/Mail.php?&GetMark=1&dwID='+this._dwID;
  40. webUrl += '&dwUserID='+pGlobalUserData.dwUserID;
  41. webUrl += '&Operate=2'
  42. WebCenter.GetData(webUrl, 0, function (data) {
  43. this.m_Hook._Update = true;
  44. }.bind(this));
  45. },
  46. onSendRead:function(){
  47. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  48. var webUrl = window.PHP_HOME+'/Mail.php?&GetMark=1&dwID='+this._dwID;
  49. webUrl += '&dwUserID='+pGlobalUserData.dwUserID;
  50. webUrl += '&Operate=1'
  51. WebCenter.GetData(webUrl, 0, function (data) {
  52. this.m_Hook._Update = true;
  53. g_CurScene&&g_CurScene.OnCheckLobbyShow&&g_CurScene.OnCheckLobbyShow();
  54. }.bind(this));
  55. }
  56. });