265ee38b-8a01-4276-98b6-735da797ee90.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "use strict";
  2. cc._RF.push(module, '265eeOLigFCdpi2c12nl+6Q', 'pushAdBtBtn');
  3. // resources/wbccwx/script/pushAdBtBtn.js
  4. "use strict";
  5. // Learn cc.Class:
  6. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
  7. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
  8. // Learn Attribute:
  9. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
  10. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
  11. // Learn life-cycle callbacks:
  12. // - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
  13. // - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html
  14. var PushAdBtn = require("pushAdBtn");
  15. cc.Class({
  16. "extends": PushAdBtn,
  17. properties: {
  18. nameLabel: {
  19. "default": null,
  20. type: cc.Label
  21. }
  22. },
  23. onDestroy: function onDestroy() {
  24. if (wb.PushAdBtEnableIndex) wb.PushAdBtEnableIndex.push(this.dataIndex);
  25. },
  26. getDataIndex: function getDataIndex() {
  27. var index = wb.getPushAdBtBtnIndex(this);
  28. cc.log("index " + index);
  29. this.dataIndex = index;
  30. return index;
  31. },
  32. flushNameLabel: function flushNameLabel() {
  33. this.nameLabel.string = wb.SysValue.subStr(this.data.gameName, 8);
  34. },
  35. loopNext: function loopNext() {
  36. if (!wb.wxData.pushData) return;
  37. if (!this.isLoop) return;
  38. var newIndex = this.getDataIndex();
  39. if (newIndex == undefined || this.dataIndex == newIndex) return;
  40. this.dataIndex = newIndex;
  41. this.data = this.pushData[this.dataIndex];
  42. this.setData(this.data);
  43. }
  44. });
  45. cc._RF.pop();