Browse Source

格式化

zengqiao 5 years ago
parent
commit
8a26811954
1 changed files with 31 additions and 30 deletions
  1. 31 30
      show-server/src/main/webapp/ipu/frame/mobile/expand-mobile.js

+ 31 - 30
show-server/src/main/webapp/ipu/frame/mobile/expand-mobile.js

1
/**
1
/**
2
 * 提供给外围自行扩展和终端交互的js API。 
2
 * 提供给外围自行扩展和终端交互的js API。
3
 */
3
 */
4
define(["require","jcl"],function(require,Wade) {
4
define(["require","jcl"],function(require,Wade) {
5
	
5
6
	var ExpandMobile = (function(){
6
	var ExpandMobile = (function(){
7
		return{
7
		return{
8
			loadingStart:function(message,title,cancelable,err){ //加载进度条
8
			loadingStart:function(message,title,cancelable,err){ //加载进度条
47
			getQrCodePhotoViaCamera: function (callback, param, err) {
47
			getQrCodePhotoViaCamera: function (callback, param, err) {
48
				storageCallback("getQrCodePhotoViaCamera", callback);
48
				storageCallback("getQrCodePhotoViaCamera", callback);
49
				execute("getQrCodePhotoViaCamera", [param], err);
49
				execute("getQrCodePhotoViaCamera", [param], err);
50
			}, 
50
			},
51
			getQrCodePhotoViaLibrary: function (callback, param, err) {
51
			getQrCodePhotoViaLibrary: function (callback, param, err) {
52
				storageCallback("getQrCodePhotoViaLibrary", callback);
52
				storageCallback("getQrCodePhotoViaLibrary", callback);
53
				execute("getQrCodePhotoViaLibrary", [param], err);
53
				execute("getQrCodePhotoViaLibrary", [param], err);
210
				}
210
				}
211
				if(limit == null)
211
				if(limit == null)
212
					limit = "";
212
					limit = "";
213
				else if(!isNaN(limit))	
213
				else if(!isNaN(limit))
214
					limit = "\"" + limit + "\"";
214
					limit = "\"" + limit + "\"";
215
				
216
				if(offset == null)	
215
216
				if(offset == null)
217
					offset = "";
217
					offset = "";
218
				else if(!isNaN(offset))
218
				else if(!isNaN(offset))
219
					offset = "\"" + offset + "\"";
219
					offset = "\"" + offset + "\"";
220
				
220
221
				storageCallback("execSQL",callback);
221
				storageCallback("execSQL",callback);
222
				execute("execSQL",[dbName,sql,bindArgs.toString(),limit,offset],err);
222
				execute("execSQL",[dbName,sql,bindArgs.toString(),limit,offset],err);
223
			},insert:function(dbName,table,datas,callback,err){
223
			},insert:function(dbName,table,datas,callback,err){
250
				}
250
				}
251
				if(limit == null)
251
				if(limit == null)
252
					limit = "";
252
					limit = "";
253
				else if(!isNaN(limit))	
253
				else if(!isNaN(limit))
254
					limit = "\"" + limit + "\"";
254
					limit = "\"" + limit + "\"";
255
				
256
				if(offset == null)	
255
256
				if(offset == null)
257
					offset = "";
257
					offset = "";
258
				else if(!isNaN(offset))
258
				else if(!isNaN(offset))
259
					offset = "\"" + offset + "\"";
259
					offset = "\"" + offset + "\"";
260
				
260
261
				storageCallback("select",callback);
261
				storageCallback("select",callback);
262
				execute("select",[dbName,table,columns,condSQL,conds.toString(),limit,offset],err);
262
				execute("select",[dbName,table,columns,condSQL,conds.toString(),limit,offset],err);
263
			},selectFirst:function(dbName,table,columns,condSQL,conds,callback,err){
263
			},selectFirst:function(dbName,table,columns,condSQL,conds,callback,err){
300
				execute("setJpushTags", [tags], err);
300
				execute("setJpushTags", [tags], err);
301
			},aliPay:function(tradeNo,subject,body,price,callback,err){
301
			},aliPay:function(tradeNo,subject,body,price,callback,err){
302
				storageCallback("aliPay",callback);
302
				storageCallback("aliPay",callback);
303
				execute("aliPay",[tradeNo,subject,body,price],err);	
303
				execute("aliPay",[tradeNo,subject,body,price],err);
304
			},uploadWithServlet:function(filePath,dataAction,param,callback,err){
304
			},uploadWithServlet:function(filePath,dataAction,param,callback,err){
305
				if(typeof(filePath)=="string"){
305
				if(typeof(filePath)=="string"){
306
					filePath = [filePath];
306
					filePath = [filePath];
307
				}
307
				}
308
				storageCallback("uploadWithServlet",callback);
308
				storageCallback("uploadWithServlet",callback);
309
				execute("uploadWithServlet",[filePath,dataAction,param],err);	
309
				execute("uploadWithServlet",[filePath,dataAction,param],err);
310
			},downloadWithServlet:function(savePath,dataAction,param,callback,err){
310
			},downloadWithServlet:function(savePath,dataAction,param,callback,err){
311
				storageCallback("downloadWithServlet",callback);
311
				storageCallback("downloadWithServlet",callback);
312
				execute("downloadWithServlet",[savePath,dataAction,param],err);	
312
				execute("downloadWithServlet",[savePath,dataAction,param],err);
313
			},uploadFile:function(filePath,servletUrl,callback,err){
313
			},uploadFile:function(filePath,servletUrl,callback,err){
314
				storageCallback("uploadFile",callback);
314
				storageCallback("uploadFile",callback);
315
				execute("uploadFile",[filePath,servletUrl],err);	
315
				execute("uploadFile",[filePath,servletUrl],err);
316
			},downloadFile:function(savePath,servletUrl,callback,err){
316
			},downloadFile:function(savePath,servletUrl,callback,err){
317
				storageCallback("downloadFile",callback);
317
				storageCallback("downloadFile",callback);
318
				execute("downloadFile",[savePath,servletUrl],err);	
318
				execute("downloadFile",[savePath,servletUrl],err);
319
			},getContacts:function(callback,err){
319
			},getContacts:function(callback,err){
320
				storageCallback("getContacts",callback);
320
				storageCallback("getContacts",callback);
321
				execute("getContacts",[], err);	
321
				execute("getContacts",[], err);
322
			},openKeyboard:function(value,err){
322
			},openKeyboard:function(value,err){
323
				execute("openKeyboard",[value],err);
323
				execute("openKeyboard",[value],err);
324
			},setScreenLock:function(dataParam,callback,err){
324
			},setScreenLock:function(dataParam,callback,err){
483
                    execute("clearBackStack",[]);
483
                    execute("clearBackStack",[]);
484
                }
484
                }
485
            },loadUrl:function(param){
485
            },loadUrl:function(param){
486
            	execute("loadUrl",[param]);  
487
            },openFileManager:function(filedirectory){ 
486
            	execute("loadUrl",[param]);
487
            },openFileManager:function(filedirectory){
488
				execute("openFileManager",[filedirectory]);
488
				execute("openFileManager",[filedirectory]);
489
			},openResourceBrowser:function(callback,filedirectory,filetype){ 
489
			},openResourceBrowser:function(callback,filedirectory,filetype){
490
				storageCallback("openResourceBrowser",callback);
490
				storageCallback("openResourceBrowser",callback);
491
				execute("openResourceBrowser",[filedirectory,filetype]);
491
				execute("openResourceBrowser",[filedirectory,filetype]);
492
			},photoBrowse:function(photoListMap){
492
			},photoBrowse:function(photoListMap){
504
				storageCallback("recordWithWatermark",callback);
504
				storageCallback("recordWithWatermark",callback);
505
				execute("recordWithWatermark",[img_path, params]);
505
				execute("recordWithWatermark",[img_path, params]);
506
			},playVideo:function(videoPath){
506
			},playVideo:function(videoPath){
507
				execute("playVideo",[videoPath]);	
507
				execute("playVideo",[videoPath]);
508
			},compressorVideo:function(videoPath,callback){
508
			},compressorVideo:function(videoPath,callback){
509
				storageCallback("compressorVideo",callback);
509
				storageCallback("compressorVideo",callback);
510
				execute("compressorVideo",[videoPath]);
510
				execute("compressorVideo",[videoPath]);
597
			},  voiceInput: function(callback, iconPath, iconPathPressed) {
597
			},  voiceInput: function(callback, iconPath, iconPathPressed) {
598
				storageCallback("voiceInput",callback);
598
				storageCallback("voiceInput",callback);
599
				execute("voiceInput",[iconPath, iconPathPressed]);
599
				execute("voiceInput",[iconPath, iconPathPressed]);
600
			},getFloCardInfoBD:function (callback,type,picInfo,needMark,token,acc_type) {
601
				storageCallback("getFloCardInfoBD",callback);
602
				execute("getFloCardInfoBD",[type,picInfo,needMark,token,acc_type])
603
            },getIdCardInfo:function (callback,type,picInfo,needMark,sdk_type,sdk_key) {
604
                storageCallback("getIdCardInfo",callback);
605
                execute("getIdCardInfo",[type,picInfo,needMark,sdk_type,sdk_key])
606
            }
600
      }, getFloCardInfoBD: function (callback, type, picInfo, needMark, token, acc_type) {
601
        storageCallback("getFloCardInfoBD", callback);
602
        execute("getFloCardInfoBD", [type, picInfo, needMark, token, acc_type])
603
      }
604
      , getIdCardInfo: function (callback, type, picInfo, needMark, sdk_type, sdk_key) {
605
        storageCallback("getIdCardInfo", callback);
606
        execute("getIdCardInfo", [type, picInfo, needMark, sdk_type, sdk_key])
607
      }
607
		};
608
		};
608
	})();
609
	})();
609
	
610
610
	var IpuMobile;
611
	var IpuMobile;
611
	function execute(action, args, error, success) {
612
	function execute(action, args, error, success) {
612
		/*循环依赖,懒加载*/
613
		/*循环依赖,懒加载*/
622
		}
623
		}
623
		IpuMobile.callback.storageCallback(action,callback)
624
		IpuMobile.callback.storageCallback(action,callback)
624
	}
625
	}
625
	
626
626
	return ExpandMobile;
627
	return ExpandMobile;
627
});
628
});