WarnTipData.ts 1.0 KB

123456789101112131415161718192021222324252627
  1. const { ccclass } = cc._decorator;
  2. @ccclass
  3. export default class WarnTipData {
  4. //当前状态 0-无处理;1-警告;2-封广告30分钟;3-封广告12小时;4-用户拉黑
  5. curSolution = 0;
  6. tipArr = ['',
  7. '您点击广告太频繁了,请降低点击广告频率以免被封!',
  8. '您点击广告太频繁了,禁止看广告30分钟!',
  9. '您点击广告太频繁了,禁止看广告12小时!',
  10. '系统检测到您的账号存在异常,禁止登陆游戏!']
  11. setSolution(solution) {
  12. if (this.curSolution != solution) {
  13. //除了状态0,其他状态只有级别比当前状态高才会赋值,避免异步导致低级状态覆盖高级状态
  14. if (solution == 0 || this.curSolution < solution) {
  15. this.curSolution = solution;
  16. }
  17. mk.storage.setStorage('solution', this.curSolution);
  18. }
  19. if (this.curSolution >= 1) {
  20. mk.ui.openPanel('module/warnTip/WarnTipPanel');
  21. }
  22. }
  23. }