// -------------------------------------------------------------------- // @author: xxx@syg.com(必填, 创建模块的人员) // @description: // 这里填写详细说明,主要填写该模块的功能简要 //
Create: 2018-12-28 10:22:08 // -------------------------------------------------------------------- var NoticeController = cc.Class({ extends: BaseController, ctor: function () { }, // 初始化配置数据 initConfig: function () { var NoticeModel = require("notice_model"); this.model = new NoticeModel(); this.model.initConfig(); }, // 返回当前的model getModel: function () { return this.model; }, // 注册监听事件 registerEvents: function () { }, // 注册协议接受事件 registerProtocals: function () { this.RegisterProtocal(10810, this.on10810); // 反馈处理 }, // 发送反馈信息 sender10810: function (issue_type, title, content) { var protocal = {}; protocal.issue_type = issue_type; protocal.title = title; protocal.content = content; this.SendProtocal(10810, protocal); }, // 反馈结果 on10810: function (data) { message(data.msg); }, // 打开bug反馈 openBugPanel: function (status) { if (status) { Log.info("=====aaaaaaa"); if (!this.bug_panel) { var BugPanel = require("bug_panel"); this.bug_panel = new BugPanel(); } this.bug_panel.open(); } else { if (this.bug_panel) { this.bug_panel.close(); this.bug_panel = null; } } }, //打开游戏公告 //默认请url请传nil值,改url为邮件超链接情况传值 openNocticeWindow: function (status, url) { if (status) { if (!this.notice_view) { var notice_view = require("notice_window"); this.notice_view = new notice_view(); } this.notice_view.open(url); } else { if (this.notice_view) { this.notice_view.close(); this.notice_view = null; } } }, get_notice_url: function (days, loginData) { let loginInfo = require("login_controller").getInstance().getModel().getLoginInfo() let host = loginInfo && loginInfo.host || loginData.host; let channel = window.CHANNEL; //时间戳 let date_time = Math.ceil(Date.now() / 1000); // console.log(cc.js.formatStr("host=%s...channel=%s...time=%s"),host,channel,date_time); return cc.js.formatStr("https://%s/api.php/local/local/notice/?channel=%s&time=%s", host, channel, date_time) }, setNoticeContent: function (str) { this.notice_content = str; }, getNoticeContent: function () { return this.notice_content; } }); module.exports = NoticeController;