60a667fe-42b3-4ddf-8491-56086417c2b9.js 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. "use strict";
  2. cc._RF.push(module, '60a66f+QrNN34SRVghkF8K5', 'SharePanel');
  3. // Script/view/sharePanel/SharePanel.ts
  4. "use strict";
  5. // Learn TypeScript:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  7. // Learn Attribute:
  8. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  9. // Learn life-cycle callbacks:
  10. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  11. var __extends = (this && this.__extends) || (function () {
  12. var extendStatics = function (d, b) {
  13. extendStatics = Object.setPrototypeOf ||
  14. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  16. return extendStatics(d, b);
  17. };
  18. return function (d, b) {
  19. extendStatics(d, b);
  20. function __() { this.constructor = d; }
  21. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  22. };
  23. })();
  24. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  25. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  27. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  28. return c > 3 && r && Object.defineProperty(target, key, r), r;
  29. };
  30. Object.defineProperty(exports, "__esModule", { value: true });
  31. var BaseView_1 = require("../../../lightMVC/core/base/BaseView");
  32. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  33. var SharePanel = /** @class */ (function (_super) {
  34. __extends(SharePanel, _super);
  35. function SharePanel() {
  36. var _this = _super !== null && _super.apply(this, arguments) || this;
  37. _this.money = 20;
  38. return _this;
  39. }
  40. SharePanel.prototype.drawView = function () {
  41. var _this = this;
  42. // 关闭按钮
  43. var closeBtn = this.ui.getNode("closeBtn");
  44. closeBtn.on(cc.Node.EventType.TOUCH_END, function () {
  45. _this.closeView();
  46. }, this);
  47. // 观看按钮
  48. var watchBtn = this.ui.getNode("watchBtn");
  49. // let watchLabel = watchBtn.getChildByName("label").getComponent(cc.Label);
  50. // watchLabel.string = App.DataManager.getFreeWatchTimes() + '/' + App.DataManager.FREE_WATCH_TIMES;
  51. watchBtn.on(cc.Node.EventType.TOUCH_END, function () {
  52. _this.addCoin();
  53. // if (App.DataManager.getFreeWatchTimes() > 0) {
  54. // App.DataManager.subWatchTimes()
  55. // this.addCoin(watchLabel);
  56. // } else {
  57. // App.TipsManager.showmid("今天可观看广告次数已用完,请明天再看");
  58. // }
  59. }, this);
  60. };
  61. //增加金币
  62. SharePanel.prototype.addCoin = function () {
  63. var data = { "1": this.money };
  64. // label.string = App.DataManager.getFreeWatchTimes() + '/' + App.DataManager.FREE_WATCH_TIMES;
  65. };
  66. SharePanel.path = function () {
  67. return "prefabs/SharePanel";
  68. };
  69. SharePanel = __decorate([
  70. ccclass
  71. ], SharePanel);
  72. return SharePanel;
  73. }(BaseView_1.BaseView));
  74. exports.default = SharePanel;
  75. cc._RF.pop();