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
"use strict";
cc._RF.push(module, '5811eBvZb5M6ouY2b/2devZ', 'orderaction_end_warn_window');
// Scripts/mod/orderaction/view/orderaction_end_warn_window.js
 
"use strict";
 
// --------------------------------------------------------------------
// @author: xxx@syg.com(必填, 创建模块的人员)
// @description:
//     活动结束警告
// <br/>Create: 2019-08-10 16:25:54
// --------------------------------------------------------------------
var PathTool = require("pathtool");
 
var Orderaction_end_warnWindow = cc.Class({
  "extends": BaseView,
  ctor: function ctor() {
    this.prefabPath = PathTool.getPrefabPath("orderaction", "orderaction_end_warn_window");
    this.viewTag = SCENE_TAG.dialogue; //该窗体所属ui层级,全屏ui需要在ui层,非全屏ui在dialogue层,这个要注意
 
    this.win_type = WinType.Mini; //是否是全屏窗体  WinType.Full, WinType.Big, WinType.Mini, WinType.Tips
 
    this.ctrl = arguments[0];
    this.model = this.ctrl.getModel();
  },
  // 初始化一些配置数据,可以用于声明一些变量之类的
  initConfig: function initConfig() {},
  // 预制体加载完成之后的回调,可以在这里捕获相关节点或者组件
  openCallBack: function openCallBack() {
    this.background = this.root_wnd.getChildByName("background");
    this.background.scale = FIT_SCALE;
    var main_container = this.root_wnd.getChildByName("main_container");
    var text_15 = main_container.getChildByName("Image_16").getChildByName("Text_15").getComponent(cc.Label);
    text_15.string = Utils.TI18N("活动提醒");
    this.btn_close = main_container.getChildByName("btn_close");
    this.btn_ok = main_container.getChildByName("btn_ok");
    var text_14 = this.btn_ok.getChildByName("Text_14").getComponent(cc.Label);
    text_14.string = Utils.TI18N("我知道了");
    var desc_text = main_container.getChildByName("desc_text").getComponent(cc.Label);
    desc_text.string = Utils.TI18N("              缤纷盛夏活动将于          后结束\n活动结束后,累积等级、任务进度及经验将会清\n除,请及时完成试炼任务,领取相应奖励,以免\n错过奖励哦!");
    this.reamin_day = main_container.getChildByName("reamin_day").getComponent(cc.Label);
  },
  // 注册事件监听的接口,不需要手动调用,如果是使用gcore.GlobalEvent监听,可以直接调用addGlobalEvent
  registerEvent: function registerEvent() {
    Utils.onTouchEnd(this.background, function () {
      this.ctrl.openEndWarnView(false);
    }.bind(this), 2);
    Utils.onTouchEnd(this.btn_close, function () {
      this.ctrl.openEndWarnView(false);
    }.bind(this), 2);
    Utils.onTouchEnd(this.btn_ok, function () {
      this.ctrl.openEndWarnView(false);
    }.bind(this), 1);
  },
  // 预制体加载完成之后,添加到对应主节点之后的回调,也就是一个窗体的正式入口,可以设置一些数据了
  openRootWnd: function openRootWnd(day) {
    day = day || 0;
    var str = "";
    var remain_day = 30 - day;
 
    if (remain_day <= 0) {
      remain_day = 0;
      str = Utils.TI18N("今天");
    } else {
      str = remain_day + Utils.TI18N("天");
    }
 
    this.reamin_day.string = str;
  },
  // 关闭窗体回调,需要在这里调用该窗体所属controller的close方法没用于置空该窗体实例对象
  closeCallBack: function closeCallBack() {
    this.ctrl.openEndWarnView(false);
  }
});
 
cc._RF.pop();