"use strict"; cc._RF.push(module, 'a61d57TENZIULlk4bQyWy8q', 'head_circle_tips'); // Scripts/mod/tips/view/head_circle_tips.js "use strict"; // -------------------------------------------------------------------- // @author: shiraho@syg.com(必填, 创建模块的人员) // @description: // 普通物品的tips,区分背包中和其他 //
Create: new Date().toISOString() // -------------------------------------------------------------------- var PathTool = require("pathtool"); var TipsConst = require("tips_const"); var StringUtil = require("string_util"); var TimeTool = require("timetool"); var HeadCircleTips = cc.Class({ "extends": BaseView, ctor: function ctor() { this.prefabPath = PathTool.getPrefabPath("tips", "headcircle_tips"); this.viewTag = SCENE_TAG.dialogue; this.win_type = WinType.Tips; }, initConfig: function initConfig() { this.tips_controller = require("tips_controller").getInstance(); }, openCallBack: function openCallBack() { this.background = this.seekChild("background"); this.main_panel = this.seekChild("main_panel"); this.time_label = this.seekChild(this.main_panel, "time_label", cc.Label); this.desc = this.seekChild(this.main_panel, "desc", cc.RichText); this.name = this.seekChild(this.main_panel, "name", cc.Label); this.icon = this.seekChild(this.main_panel, "icon", cc.Sprite); }, registerEvent: function registerEvent() { this.background.on(cc.Node.EventType.TOUCH_START, function (event) { this.tips_controller.closeTIpsByType(TipsConst.type.HEAD_CIRCLE); }.bind(this)); }, openRootWnd: function openRootWnd(data) { var config = Config.avatar_data.data_avatar[data.bid]; this.loadRes(PathTool.getHeadcircle(config.res_id), function (resObject) { this.icon.spriteFrame = resObject; }.bind(this)); this.name.string = config.name; this.desc.string = Utils.TI18N("激活条件:") + config.desc; if (config.expire_time > 0) { this.time_label.string = Utils.TI18N("使用期限:") + TimeTool.getTimeFormatDay(config.expire_time * 60); } else { this.time_label.string = Utils.TI18N("使用期限:永久"); } }, closeCallBack: function closeCallBack() { this.tips_controller.closeTIpsByType(TipsConst.type.HEAD_CIRCLE); } }); cc._RF.pop();