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