1ec37fc43e791R122">122
});
|
|
123
|
}
|
|
124
|
};
|
|
125
|
|
|
126
|
this.closeApp = function(){
|
|
127
|
if(confirm("确定要退出应用程序吗?")){
|
|
128
|
Mobile.closeApp();
|
|
129
|
}
|
|
130
|
};
|
|
131
|
|
|
132
|
this.logoutAccount = function(){
|
|
133
|
if(confirm("确定要注销该工号吗?")){
|
|
134
|
Common.remove(Constant.SESSION_ID);
|
|
135
|
WadeMobile.clearBackStack();
|
|
136
|
Mobile.openTemplate("Home");
|
|
137
|
}
|
|
138
|
};
|
|
139
|
|
|
140
|
this.put = function(key, value) {
|
|
141
|
if(!checkMapKey(key)){
|
|
142
|
return;
|
|
143
|
}
|
|
144
|
Mobile.setMemoryCache(key, value);
|
|
145
|
};
|
|
146
|
this.get = function(callback, key, value) {
|
|
147
|
if(!checkArrayKey(key)){
|
|
148
|
return;
|
|
149
|
}
|
|
150
|
Mobile.getMemoryCache(callback, key, value);
|
|
151
|
};
|
|
152
|
this.remove = function(key) {
|
|
153
|
if(!checkArrayKey(key)){
|
|
154
|
return;
|
|
155
|
}
|
|
156
|
Mobile.removeMemoryCache(key);
|
|
157
|
};
|
|
158
|
this.clear = function() {
|
|
159
|
Mobile.clearMemoryCache();
|
|
160
|
};
|
|
161
|
this.putLocal = function(key, value) {
|
|
162
|
if(!checkMapKey(key)){
|
|
163
|
return;
|
|
164
|
}
|
|
165
|
Mobile.setOfflineCache(key, value);
|
|
166
|
};
|
|
167
|
this.getLocal = function(callback, key, value) {
|
|
168
|
if(!checkArrayKey(key)){
|
|
169
|
return;
|
|
170
|
}
|
|
171
|
Mobile.getOfflineCache(callback, key,value);
|
|
172
|
};
|
|
173
|
this.removeLocal = function(key) {
|
|
174
|
if(!checkArrayKey(key)){
|
|
175
|
return;
|
|
176
|
}
|
|
177
|
Mobile.removeOfflineCache(key);
|
|
178
|
};
|
|
179
|
this.clearLocal = function() {
|
|
180
|
Mobile.clearOfflineCache();
|
|
181
|
};
|
|
182
|
/*数据库操作*/
|
|
183
|
var dbName = "display";
|
|
184
|
this.execSQL = function(sql,bindArgs,callback,err){
|
|
185
|
Mobile.execSQL(dbName,sql,bindArgs,callback,err);
|
|
186
|
};
|
|
187
|
|
|
188
|
function checkMapKey(key){
|
|
189
|
if (!key || (typeof (key) != "string" && !ClientTool.tool.isDataMap(key))) {
|
|
190
|
alert(key+"参数类型异常");
|
|
191
|
return false;
|
|
192
|
} else {
|
|
193
|
return true;
|
|
194
|
}
|
|
195
|
}
|
|
196
|
|
|
197
|
function checkArrayKey(key){
|
|
198
|
if (!key || (typeof (key) != "string" && !ClientTool.tool.isArray(key))) {
|
|
199
|
alert(key+"参数类型异常");
|
|
200
|
return false;
|
|
201
|
} else {
|
|
202
|
return true;
|
|
203
|
}
|
|
204
|
}
|
|
205
|
}
|
|
206
|
|
|
207
|
window.Constant = {
|
|
208
|
OPEN_PAGE_KEY : "OPEN_PAGE_KEY",
|
|
209
|
STAFF_ID : "STAFF_ID",
|
|
210
|
SESSION_ID : "SESSION_ID",
|
|
211
|
X_RECORDNUM : "X_RECORDNUM",
|
|
212
|
X_RESULTCODE : "X_RESULTCODE",
|
|
213
|
X_RESULTINFO : "X_RESULTINFO",
|
|
214
|
X_RESULTCAUSE : "X_RESULTCAUSE"
|
|
215
|
}
|
|
216
|
|
|
217
|
return Common;
|
218
|
218
|
});
|
|
@ -12,17 +12,34 @@ require(["mobile","util"], function(Mobile) {
|
12
|
12
|
headers.put("Date","09 Step 2018 11:01:31 GMT");
|
13
|
13
|
|
14
|
14
|
// 数据请求
|
15
|
|
Mobile.dataRequest("SceneBean.dataRequestScene", param, function(result){
|
|
15
|
Mobile.dataRequest("SceneBean.dataRequestScene", param, function(resultData){
|
16
|
16
|
// 获取返回的数据
|
17
|
|
var obj = new Wade.DataMap(result);
|
18
|
|
var retName = obj.get("retName");
|
19
|
|
var retMsg = obj.get("retMsg");
|
20
|
|
|
21
|
|
$("#retName").text(retName);
|
22
|
|
$("#retMsg").text(retMsg);
|
23
|
|
$("#mainTestCharacterContent").hide();
|
24
|
|
$("#retTestCharacterContent").show();
|
25
|
|
},null,headers);
|
|
17
|
if (typeof (resultData) == "string") {
|
|
18
|
resultData = new Wade.DataMap(resultData);
|
|
19
|
}
|
|
20
|
alert(resultData);
|
|
21
|
var x_resultcode = resultData.get(Constant.X_RESULTCODE);
|
|
22
|
var x_resultinfo = resultData.get(Constant.X_RESULTINFO);
|
|
23
|
alert(x_resultcode + "," +x_resultinfo);
|
|
24
|
if(x_resultcode<0){
|
|
25
|
alert(x_resultcode + "," +x_resultinfo);
|
|
26
|
}else{
|
|
27
|
var retName = resultData.get("retName");
|
|
28
|
var retMsg = resultData.get("retMsg");
|
|
29
|
|
|
30
|
$("#retName").text(retName);
|
|
31
|
$("#retMsg").text(retMsg);
|
|
32
|
$("#mainTestCharacterContent").hide();
|
|
33
|
$("#retTestCharacterContent").show();
|
|
34
|
}
|
|
35
|
|
|
36
|
},function(errData){
|
|
37
|
//插件异常处理
|
|
38
|
if (typeof (errData) == "string") {
|
|
39
|
errData = new Wade.DataMap(errData);
|
|
40
|
}
|
|
41
|
alert("插件调用异常信息:" + errData);
|
|
42
|
},headers);
|
26
|
43
|
});
|
27
|
44
|
|
28
|
45
|
// 再测一次按钮
|
|
@ -34,4 +51,14 @@ require(["mobile","util"], function(Mobile) {
|
34
|
51
|
$("#mainTestCharacterContent").show();
|
35
|
52
|
});
|
36
|
53
|
|
|
54
|
window.Constant = {
|
|
55
|
OPEN_PAGE_KEY : "OPEN_PAGE_KEY",
|
|
56
|
STAFF_ID : "STAFF_ID",
|
|
57
|
SESSION_ID : "SESSION_ID",
|
|
58
|
X_RECORDNUM : "X_RECORDNUM",
|
|
59
|
X_RESULTCODE : "X_RESULTCODE",
|
|
60
|
X_RESULTINFO : "X_RESULTINFO",
|
|
61
|
X_RESULTCAUSE : "X_RESULTCAUSE"
|
|
62
|
}
|
|
63
|
|
37
|
64
|
});
|
|
@ -378,6 +378,9 @@ define(["require"],function(require) {
|
378
|
378
|
if(WadeMobile.isAndroid()){
|
379
|
379
|
execute("clearBackStack",[]);
|
380
|
380
|
}
|
|
381
|
},downloadFile:function(type,url,relPath,callback){
|
|
382
|
storageCallback("downloadFile",callback);
|
|
383
|
execute("downloadFile",[type,url,relPath]);
|
381
|
384
|
}
|
382
|
385
|
|
383
|
386
|
|