difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//      这里填写详细说明,主要填写该模块的功能简要
// <br/>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;