Common.js
6.36 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
cc.Class({
extends: cc.Component,
properties: {
},
// use this for initialization
onLoad: function () {
},
statics: {
SCREEN_WIDTH: 1280.0,
SCREEN_HEIGHT: 720.0,
MOVE_DIRECTION_UP: 0,
MOVE_DIRECTION_RIGHT: 1,
MOVE_DIRECTION_DOWN: 2,
MOVE_DIRECTION_LEFT: 3,
FOCUS_FLY_DURATION: 0.3,
FOCUS_BREATH_DURATION: 0.8,
//Action Tag
FEATURE_NODE_TRANSFER: 1,
FOCUS_CELL_TRANSFER: 1,
FOCUS_CONTAINER_TRANSFER: 1,
FOCUS_CONTAINER_BREATH: 2,
FOCUS_CONTAINER_JOGGLE: 3,
OVERLENGTH_MOVING: 4,
SCROLL_BY_FOCUS_CHANGE: 5,
API_SORT_ASC: 'asc',
API_SORT_DESC: 'desc',
FEMALE: 0,
MALE: 1,
BAND: 2,
ANDROID_KEY: {
back: 6,
up: 1003,
right: 1001,
down: 1004,
left: 1000,
enter: 1005
},
BUSINESS_PARAMETER: {
// {:,
},
//天津少儿2.0测试接口
// TOPDRAW_API_SERVER:'http://202.99.114.74:52118/hyperion.chimera/',
// TOPDRAW_API_SERVER2:'http://202.99.114.74:52118/hyperion.archer/',
// TOPDRAW_IMAGE_SERVER:'http://202.99.114.74:52118/hyperion.resource/',
//新部署测试接口
TOPDRAW_API_SERVER: 'http://139.196.192.242:8080/hyperion.chimera/',
TOPDRAW_API_SERVER2: 'http://139.196.192.242:8080/hyperion.archer/',
TOPDRAW_IMAGE_SERVER: 'http://139.196.192.242:8080/hyperion.resource/',
// TOPDRAW_API_SERVER : "http://111.11.189.12:8080/hyperion.chimera/", //暂且取用EPG数据
// TOPDRAW_IMAGE_SERVER : "http://111.11.189.12:8080/hyperion.resource/",
// TOPDRAW_API_SERVER2:'http://111.11.189.12:8080/hyperion.archer/',
TEST_API_TOKEN: 'dd4b1968eb5b417e834c2687e23d2471',
//教育
TOPDRAW_API_SERVER_EDU: 'http://139.196.4.234:38080/hyperion.chimera/',
TOPDRAW_IMAGE_SERVER_EDU: 'http://139.196.4.234:38080/eduHall/pages/index/',
TOPDRAW_IMAGE_SERVER_EDU_RIGHT: 'http://139.196.4.234:38080/hyperion.resource/',
TEST_API_TOKEN_EDU: 'b4863228c5ef4593991ad4cc83f0cabf',
BI_BASE_PATH: 'http://139.196.192.242:82/1.gif',
TV_LINK_ACTION_CLICK: 100,
TV_LINK_ACTION_HOVER: 101,
// TEST_API_TOKEN:'8a56a215e7be4cf6910990d4d7c95e2c',
USER_ID: '1',
AUTH_STATUS: 0,
DEBUG_MODE: 0,//0非调试模式,1调试模式
APP_VERSION_NAME: '1.0.0',
g_strCurrentSceneName: "",
loadRes: function (strResourceURL,/*iResourceIndex,*/onSuccess, onError, oScope) {
cc.loader.loadRes(strResourceURL,
function (error, loadedResource) {
if (error) {
if (null != oScope) {
onError.call(oScope, error);
} else {
onError(error);
}
} else {
if (null != oScope) {
onSuccess.call(oScope, loadedResource/*,iResourceIndex*/);
} else {
onSuccess(loadedResource/*,iResourceIndex*/);
}
}
}
);
},
setTimeout: function (onTimeComplete, iDuration, oScope, argements) {
/*
window.setTimeout(onTimeComplete,iDuration,);
cc.loader.loadRes(strResourceURL,
function(error,loadedResource){
if (error){
if(null!=oScope){
onError.call(oScope,error);
}else{
onError(error);
}
}else{
if(null!=oScope){
onSuccess.call(oScope,loadedResource);
}else{
onSuccess(loadedResource);
}
}
}
);
*/
},
getAbsolutePositionX: function (node) {
},
getAbsolutePositionY: function (node) {
},
promiseAjax: function () {
},
getNodePath: function (node) {
let strPath = "";
while (node.parent && node.parent.parent) {//不算TopCanvas
strPath = "/" + node.name + strPath;
node = node.parent;
}
return strPath.substring(1);
},
getX: function (tempNode) {
let fCenterX = 0;
while (tempNode.parent.parent) {//不算TopCanvas
//cc.log(tempNode.name+" X: "+tempNode.x)
fCenterX += tempNode.x;
tempNode = tempNode.parent;
}
return fCenterX;
},
getY: function (tempNode) {
let fCenterY = 0;
while (tempNode.parent.parent) {//不算TopCanvas
//cc.log(tempNode.name+" Y: "+tempNode.y)
fCenterY += tempNode.y;
tempNode = tempNode.parent;
}
return fCenterY;
},
/**
* 用于合并对象 By Eva
* @param target
* @param firstSource
* @returns {any}
*/
assign: function (target, firstSource) {
if (target === undefined || target === null)
throw new TypeError("Cannot convert first argument to object");
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
var nextSource = arguments[i];
if (nextSource === undefined || nextSource === null) continue;
var keysArray = Object.keys(Object(nextSource));
for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
var nextKey = keysArray[nextIndex];
var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
if (desc !== undefined && desc.enumerable) to[nextKey] = nextSource[nextKey];
}
}
return to;
},
}
// called every frame, uncomment this function to activate update callback
// update: function (dt) {
// },
});