"use strict"; cc._RF.push(module, 'ddd4a7HhINF5aY2Sto5AiLt', 'bug_panel'); // Scripts/mod/notice/view/bug_panel.js "use strict"; // -------------------------------------------------------------------- // @author: whjing2012@syg.com(必填, 创建模块的人员) // @description: // 用户输入框 //
Create: new Date().toISOString() // -------------------------------------------------------------------- var PathTool = require("pathtool"); var LoaderManager = require("loadermanager"); var RoleController = require("role_controller"); var BugPanel = cc.Class({ "extends": BaseView, ctor: function ctor() { this.prefabPath = PathTool.getPrefabPath("notice", "bug_panel"); this.viewTag = SCENE_TAG.dialogue; this.win_type = WinType.Mini; }, openCallBack: function openCallBack() { this.backpanel = this.root_wnd.getChildByName("backpanel"); this.main_panel = this.root_wnd.getChildByName("main_panel"); this.close_btn = this.main_panel.getChildByName("close_btn"); this.ok_btn = this.main_panel.getChildByName("ok_btn"); this.tab_container = this.main_panel.getChildByName("tab_container"); this.btn_list = []; for (var i = 0; i < 2; i++) { var btn = this.tab_container.getChildByName("tab_btn_" + (i + 1)); btn.label = btn.getChildByName("title"); btn.label.color = new cc.Color(0xcf, 0xb5, 0x93, 0xff); btn.buttom = btn.getComponent(cc.Button); this.btn_list[i] = btn; btn.index = i; } this.changeIndex(0); this.title_input = this.main_panel.getChildByName("title_input").getComponent(cc.EditBox); this.content_input = this.main_panel.getChildByName("content_input").getComponent(cc.EditBox); this.desc = this.main_panel.getChildByName("desc").getComponent(cc.RichText); this.desc.string = cc.js.formatStr(Utils.TI18N("亲爱的冒险者大人:
欢迎您进驻《%s》的冒险世界,如您在游戏中发现BUG或有什么建议,请您填写留言并提交,我们会认真对待你们的建议~如有紧急问题,请点击【浮标】→【客服】进行反馈,我们会第一时间给你回复!"), GAME_NAME); }, registerEvent: function registerEvent() { var _this = this; var NoticeController = require("notice_controller"); this.backpanel.on(cc.Node.EventType.TOUCH_END, function (event) { NoticeController.getInstance().openBugPanel(false); }, this); this.close_btn.on(cc.Node.EventType.TOUCH_END, function (event) { NoticeController.getInstance().openBugPanel(false); }, this); this.ok_btn.on(cc.Node.EventType.TOUCH_END, function (event) { if (this.title_input.string == "") { message(Utils.TI18N("请输入标题")); return; } if (this.content_input.string == "") { message(Utils.TI18N("请输入内容")); return; } NoticeController.getInstance().sender10810(this.index + 2, this.title_input.string, this.content_input.string); this.title_input.string = ""; this.content_input.string = ""; }, this); var _loop = function _loop(i) { btn = _this.btn_list[i]; btn.on(cc.Node.EventType.TOUCH_END, function (event) { this.changeIndex(i); }, _this); }; for (var i = 0; i < 2; i++) { var btn; _loop(i); } }, changeIndex: function changeIndex(index) { if (this.index == index) { return; } if (index < 0 || index > 1) { index = 0; } this.index = index; if (this.cur_tab) { this.cur_tab.buttom.interactable = true; this.cur_tab.label.color = new cc.Color(0xcf, 0xb5, 0x93, 0xff); } this.cur_tab = this.btn_list[index]; if (this.cur_tab) { this.cur_tab.buttom.interactable = false; this.cur_tab.label.color = new cc.Color(0xff, 0xed, 0xd6, 0xff); } }, openRootWnd: function openRootWnd() {}, closeCallBack: function closeCallBack() { if (this.role_update_evt) { this.roleVo.unbind(this.role_update_evt); } } }); module.exports = BugPanel; cc._RF.pop();