"use strict";
|
cc._RF.push(module, 'cdcc9c2Y+ZPJ7InR6fVqYIY', 'notice_controller');
|
// Scripts/mod/notice/notice_controller.js
|
|
"use strict";
|
|
// --------------------------------------------------------------------
|
// @author: xxx@syg.com(必填, 创建模块的人员)
|
// @description:
|
// 这里填写详细说明,主要填写该模块的功能简要
|
// <br/>Create: 2018-12-28 10:22:08
|
// --------------------------------------------------------------------
|
var NoticeController = cc.Class({
|
"extends": BaseController,
|
ctor: function ctor() {},
|
// 初始化配置数据
|
initConfig: function initConfig() {
|
var NoticeModel = require("notice_model");
|
|
this.model = new NoticeModel();
|
this.model.initConfig();
|
},
|
// 返回当前的model
|
getModel: function getModel() {
|
return this.model;
|
},
|
// 注册监听事件
|
registerEvents: function registerEvents() {},
|
// 注册协议接受事件
|
registerProtocals: function registerProtocals() {
|
this.RegisterProtocal(10810, this.on10810); // 反馈处理
|
},
|
// 发送反馈信息
|
sender10810: function sender10810(issue_type, title, content) {
|
var protocal = {};
|
protocal.issue_type = issue_type;
|
protocal.title = title;
|
protocal.content = content;
|
this.SendProtocal(10810, protocal);
|
},
|
// 反馈结果
|
on10810: function on10810(data) {
|
message(data.msg);
|
},
|
// 打开bug反馈
|
openBugPanel: function openBugPanel(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 openNocticeWindow(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 get_notice_url(days, loginData) {
|
var loginInfo = require("login_controller").getInstance().getModel().getLoginInfo();
|
|
var host = loginInfo && loginInfo.host || loginData.host;
|
var channel = window.CHANNEL; //时间戳
|
|
var 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 setNoticeContent(str) {
|
this.notice_content = str;
|
},
|
getNoticeContent: function getNoticeContent() {
|
return this.notice_content;
|
}
|
});
|
module.exports = NoticeController;
|
|
cc._RF.pop();
|