Parcourir la Source

general-web-server工程的修正

yangbiao 9 ans auparavant
Parent
commit
cd5e6f0f02
1 fichiers modifiés avec 83 ajouts et 11 suppressions
  1. 83 11
      general-web-server/web/js/expand-mobile.js

+ 83 - 11
general-web-server/web/js/expand-mobile.js

@ -23,6 +23,15 @@ window.ExpandMobile = (function() {
23 23
				}
24 24
				storageCallback("getDate",callback);
25 25
				execute("getDate", [date,format],err);
26
			},getContactsView:function(callback,data,setting,err){
27
				if(data==undefined){
28
					data = new Wade.DataMap();
29
				}
30
				if(setting==undefined){
31
					setting = new Wade.DataMap();
32
				}
33
				storageCallback("getContactsView",callback);
34
				execute("getContactsView", [data.toString(),setting.toString()],err);
26 35
			},getPhoto:function(callback,type,err){//获取照片
27 36
				if(type==undefined){
28 37
					type = 1;//0-Base64编码的字符串 1- 文件路径
@ -53,12 +62,12 @@ window.ExpandMobile = (function() {
53 62
				execute("shock", [time],err);
54 63
			},call:function(sn,autoCall,err){
55 64
				if(autoCall==undefined){
56
					autoCall=1;//0-跳转至拨打界面,1-直接拨打
65
					autoCall = false;// false-跳转至拨打界面,true-直接拨打
57 66
				}
58 67
				execute("call", [sn,autoCall],err);
59 68
			},sms:function(sn,msg,autoSms,err){
60 69
				if(autoSms==undefined){
61
					autoSms=0;//0-跳转至短信界面,1-直接短信
70
					autoSms = false;// false-跳转至短信界面,true-直接短信
62 71
				}
63 72
				execute("sms", [sn,msg,autoSms],err);
64 73
			},openApp:function(appId,urlParams,installUrl,err){
@ -185,23 +194,50 @@ window.ExpandMobile = (function() {
185 194
				//将日志输出至LogCat控制台(异步)
186 195
				execute("logCat",[msg,title],err);
187 196
			},execSQL:function(dbName,sql,bindArgs,callback,err){
197
				if(bindArgs==undefined){
198
					bindArgs = new Array();
199
				}
188 200
				storageCallback("execSQL",callback);
189 201
				execute("execSQL",[dbName,sql,bindArgs],err);
190 202
			},insert:function(dbName,table,datas,callback,err){
203
				if(datas==undefined){
204
					datas = new Wade.DataMap();
205
				}
191 206
				storageCallback("insert",callback);
192
				execute("insert",[dbName,table,datas],err);
207
				execute("insert",[dbName,table,datas.toString()],err);
193 208
			},delete:function(dbName,table,datas,callback,err){
209
				if(datas==undefined){
210
					datas = new Wade.DataMap();
211
				}
194 212
				storageCallback("delete",callback);
195
				execute("delete",[dbName,table,datas],err);
213
				execute("delete",[dbName,table,datas.toString()],err);
196 214
			},update:function(dbName,table,datas,conds,callback,err){
215
				if(datas==undefined){
216
					datas = new Wade.DataMap();
217
				}
218
				if(conds==undefined){
219
					conds = new Wade.DataMap();
220
				}
197 221
				storageCallback("update",callback);
198
				execute("update",[dbName,table,datas,conds],err);
222
				execute("update",[dbName,table,datas.toString(),conds.toString()],err);
199 223
			},select:function(dbName,table,columns,conds,callback,err){
224
				if(columns==undefined){
225
					columns = new Array();
226
				}
227
				if(conds==undefined){
228
					conds = new Wade.DataMap();
229
				}
200 230
				storageCallback("select",callback);
201
				execute("select",[dbName,table,columns,conds],err);
231
				execute("select",[dbName,table,columns,conds.toString()],err);
202 232
			},selectFirst:function(dbName,table,columns,conds,callback,err){
233
				if(columns==undefined){
234
					columns = new Array();
235
				}
236
				if(conds==undefined){
237
					conds = new Wade.DataMap();
238
				}
203 239
				storageCallback("selectFirst",callback);
204
				execute("selectFirst",[dbName,table,columns,conds],err);
240
				execute("selectFirst",[dbName,table,columns,conds.toString()],err);
205 241
			},registerForPush:function(account,callback,err){
206 242
				storageCallback("registerForPush",callback);
207 243
				execute("registerForPush",[account],err);
@ -211,10 +247,46 @@ window.ExpandMobile = (function() {
211 247
			},sendText:function(account,content,callback,err){
212 248
				storageCallback("sendText",callback);
213 249
				execute("sendText", [account,content],err);
214
			},setCallbackForPush:function(callbackName){
215
				execute("setCallbackForPush", [callbackName]);
216
			},openBrowser:function(url,err){
217
				execute("openBrowser",[url],err);
250
			},setCallbackForPush:function(callback){
251
				execute("setCallbackForPush", [callback]);
252
			},registerForPushWithYunba:function(account,callback,err){
253
				storageCallback("registerForPushWithYunba",callback);
254
				execute("registerForPushWithYunba",[account],err);
255
			},unregisterForPushWithYunba:function(callback){
256
				storageCallback("unregisterForPushWithYunba",callback);
257
				execute("unregisterForPushWithYunba", []);
258
			},sendTextWithYunba:function(account,content,callback,err){
259
				storageCallback("sendTextWithYunba",callback);
260
				execute("sendTextWithYunba", [account,content],err);
261
			},setCallbackForPushWithYunba:function(callback){
262
				execute("setCallbackForPushWithYunba", [callback]);
263
			},aliPay:function(tradeNo,subject,body,price,callback,err){
264
				storageCallback("aliPay",callback);
265
				execute("aliPay",[tradeNo,subject,body,price],err);	
266
			},uploadWithServlet:function(filePath,dataAction,param,callback,err){
267
				if(typeof(filePath)=="string"){
268
					filePath = [filePath];
269
				}
270
				storageCallback("uploadWithServlet",callback);
271
				execute("uploadWithServlet",[filePath,dataAction,param],err);	
272
			},downloadWithServlet:function(savePath,dataAction,param,callback,err){
273
				storageCallback("downloadWithServlet",callback);
274
				execute("downloadWithServlet",[savePath,dataAction,param],err);	
275
			},uploadFile:function(filePath,servletUrl,callback,err){
276
				storageCallback("uploadFile",callback);
277
				execute("uploadFile",[filePath,servletUrl],err);	
278
			},downloadFile:function(savePath,servletUrl,callback,err){
279
				storageCallback("downloadFile",callback);
280
				execute("downloadFile",[savePath,servletUrl],err);	
281
			},recordVideo:function(callback,compressRatio,timeLimit,err){
282
				storageCallback("recordVideo",callback);
283
				execute("recordVideo",[compressRatio,timeLimit],err);	
284
			},playVideo:function(videoPath,callback,err){
285
				storageCallback("playVideo",callback);
286
				execute("playVideo",[videoPath],err);	
287
			},getContacts:function(callback,err){
288
				storageCallback("getContacts",callback);
289
				execute("getContacts",[], err);	
218 290
			}
219 291
		};
220 292
	})();