Parcourir la Source

Merge branch 'master' of http://10.1.235.20:3000/ipu/ipu-guide

WillFang 6 ans auparavant
Parent
commit
26b6058ca5

BIN
ipu-mobile-common/libs/ipu-plugin-extend.jar


BIN
ipu-mobile-common/res/drawable/fingerprinticon.jpg


+ 1 - 0
show-client/AndroidManifest.xml

@ -48,6 +48,7 @@
48 48
    
49 49
    
50 50
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
51
    <uses-permission android:name="android.permission.USE_FINGERPRINT"/>
51 52
52 53
    <!-- 极光推送 start -->
53 54
    <permission

+ 15 - 2
show-client/assets/mobile-action.xml

@ -143,10 +143,15 @@
143 143
	<action name="openNative" class="com.ai.ipu.func.MobileOpenApp" method="openNative"></action>
144 144
	
145 145
	<!--ScanQR -->
146
	<action name="scanQrCode" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
146
<!-- 	<action name="scanQrCode" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
147 147
	<action name="scanSingle" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
148 148
	<action name="scanMultiple" class="com.ai.ipu.scan.func.IpuScan" method="scanMultiple"></action>
149
	<action name="createQrCode" class="com.ai.ipu.scan.func.IpuScan" method="createQrCode"></action>
149
	<action name="createQrCode" class="com.ai.ipu.scan.func.IpuScan" method="createQrCode"></action> -->
150
	
151
	<action name="scanQrCode" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
152
	<action name="scanSingle" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle" localFilePath="dynapk/ipuscan/ipu-scan.apk"></action>
153
	<action name="scanMultiple" class="com.ai.ipu.scan.func.IpuScan" method="scanMultiple" localFilePath="dynapk/ipuscan/ipu-scan.apk"></action>
154
	<action name="createQrCode" class="com.ai.ipu.scan.func.IpuScan" method="createQrCode" localFilePath="dynapk/ipuscan/ipu-scan.apk"></action>
150 155
	
151 156
	<!-- Voice -->
152 157
	<action name="startListen" class="com.ai.ipu.voice.IpuVoicePlugin" method="startListen"></action>
@ -207,4 +212,12 @@
207 212
	<action name="saveImageToAlbum" class="com.ai.ipu.mobile.plugin.ImageCache" method="saveImageToAlbum"></action>
208 213
	
209 214
	<action name="getIdentifyPhoto" class="com.ai.ipu.ipucustomcamera.IpuCustomCamera" method="getIdentifyPhoto"/>
215
	
216
	<!-- 打开外部app -->
217
	<action name="openOuterApp" class="com.ai.ipu.func.MobileOpenOuterApp" method="openOuterApp"/>
218
	
219
	<action name="getIdentifyPhoto" class="com.ai.ipu.ipucustomcamera.IpuCustomCamera" method="getIdentifyPhoto"/>
220
	<!-- 指纹解锁 -->
221
	<action name="isSupportFingerprintAuthentication" class="com.ai.ipu.mobile.common.fingerprint.FingerPrint" method="isSupportFingerprintAuthentication"/>
222
	<action name="fingerprintAuthentication" class="com.ai.ipu.mobile.common.fingerprint.FingerPrint" method="fingerprintAuthentication"/>
210 223
</actions>

+ 41 - 0
show-client/src/com/ai/ipu/func/MobileOpenOuterApp.java

@ -0,0 +1,41 @@
1
package com.ai.ipu.func;
2
3
import org.json.JSONArray;
4
5
import com.ai.ipu.func.OuterAppWaker.NoAppHandler;
6
import com.ai.ipu.mobile.frame.IIpuMobile;
7
import com.ai.ipu.mobile.frame.plugin.Plugin;
8
9
import android.text.TextUtils;
10
11
public class MobileOpenOuterApp extends Plugin{
12
	OuterAppWaker outerAppWaker;
13
14
	public MobileOpenOuterApp(IIpuMobile ipumobile) {
15
		super(ipumobile);
16
		outerAppWaker = new OuterAppWaker(context);
17
	}
18
19
	public void openOuterApp(JSONArray params){
20
		String pkgName = params.getString(0);
21
		String clsName = params.getString(1);
22
		String downloadUrl = params.getString(3);
23
		openOuterApp(pkgName,clsName,downloadUrl,null);
24
	}
25
	
26
	private void openOuterApp(String pkgName,String clsName,final String downloadUrl,JSONArray params){
27
		if(TextUtils.isEmpty(clsName)){			
28
			outerAppWaker.openOuterLanchPage(pkgName, new NoAppHandler() {
29
				
30
				@Override
31
				public void handleNoApp() {
32
					if(!TextUtils.isEmpty(downloadUrl)){						
33
						outerAppWaker.downloadApk(downloadUrl, null);
34
					}
35
				}
36
			});
37
		}
38
	}
39
	
40
	
41
}

+ 355 - 0
show-client/src/com/ai/ipu/func/OuterAppWaker.java

@ -0,0 +1,355 @@
1
package com.ai.ipu.func;
2
3
import java.io.File;
4
5
import android.app.Activity;
6
import android.app.DownloadManager;
7
import android.app.ProgressDialog;
8
import android.content.ActivityNotFoundException;
9
import android.content.BroadcastReceiver;
10
import android.content.Context;
11
import android.content.Intent;
12
import android.content.IntentFilter;
13
import android.content.pm.PackageInfo;
14
import android.content.pm.PackageManager;
15
import android.content.pm.PackageManager.NameNotFoundException;
16
import android.database.Cursor;
17
import android.net.Uri;
18
import android.os.AsyncTask;
19
import android.os.Build;
20
import android.os.Bundle;
21
import android.os.Environment;
22
import android.os.Handler;
23
import android.os.Message;
24
import android.support.v4.content.FileProvider;
25
import android.util.Log;
26
import android.widget.Toast;
27
28
/**
29
 * @author larryjay
30
 * 打开外部app
31
 */
32
public class OuterAppWaker {
33
	private Activity context;
34
	private ProgressDialog dialog;//默认的下载显示进度条
35
	private Handler handler;
36
	
37
	private static final String TOTAL_SIZE = "totalsize";
38
	private static final String SOFAR_SIZE = "sofarSize";
39
	
40
	private DownloadManager downloadMgr;
41
	private long downloadId;//下载管理器下载id
42
	private BroadcastReceiver receiver;//系统下载完成的广播
43
	
44
	public OuterAppWaker(Activity context){
45
		this.context = context;
46
		handler = new Handler(){
47
			@Override
48
			public void handleMessage(Message msg) {
49
				Bundle data = msg.getData();
50
				switch (msg.what) {
51
				case 0:	//弹出加载框
52
					break;
53
				case 1://更新进度框
54
					if(dialog == null || !dialog.isShowing()){
55
						createCustomProgress();
56
					}
57
					int sofarSize = data.getInt(SOFAR_SIZE);
58
					dialog.setMax(data.getInt(TOTAL_SIZE)/(1024 * 1024));
59
					dialog.setProgress(sofarSize/(1024 * 1024));
60
					Log.i("DownloadMgr", "sofarSizeProgress" +  sofarSize);
61
					break;
62
				}
63
			}
64
		};
65
	}
66
	
67
	public void openOuterApp(String pkgName,String clsName){
68
		checkOuterAppInfo(pkgName, null);
69
		Intent intent = new Intent();
70
		intent.setClassName(pkgName, clsName);
71
		context.startActivity(intent);
72
	}
73
	
74
	public void openOuterLanchPage(String pkgName,NoAppHandler noAppHandler){
75
		if(null != checkOuterAppInfo(pkgName, noAppHandler)){
76
			Intent intent = context.getPackageManager().getLaunchIntentForPackage(pkgName);
77
			context.startActivity(intent);
78
		}
79
	}
80
	
81
	/**
82
	 * 检查包信息是否存在
83
	 */
84
	public PackageInfo checkOuterAppInfo(String pkgName,NoAppHandler noAppHandler){
85
		PackageInfo pkgInfo = null;
86
		PackageManager pkgMgr = context.getPackageManager();
87
		try {
88
			pkgInfo = pkgMgr.getPackageInfo(pkgName, PackageManager.GET_ACTIVITIES);
89
		} catch (NameNotFoundException e) {
90
			if(null != noAppHandler){				
91
				noAppHandler.handleNoApp();
92
			}
93
			Toast.makeText(context, "未安装此app", Toast.LENGTH_LONG).show();
94
		}
95
		return pkgInfo;
96
	}
97
	
98
	/**
99
	 * 使用系统下载管理器下载apk
100
	 * @param url 下载apk的url
101
	 * @param filePath 存放apk的路径
102
	 */
103
	public void downloadApk(String url,String filePath){
104
		if(null == downloadMgr){			
105
			downloadMgr = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
106
		}
107
		DownloadManager.Request downloadReq = new DownloadManager.Request(Uri.parse(url));
108
		downloadReq.setVisibleInDownloadsUi(true);
109
		downloadReq.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
110
		String apkName = url.substring(url.lastIndexOf("/") + 1);
111
		downloadReq.setTitle(apkName);
112
		String apkPath = null;
113
		/*允许使用的网络类型*/
114
		downloadReq.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_MOBILE|DownloadManager.Request.NETWORK_WIFI);
115
		int state = context.getPackageManager().getApplicationEnabledSetting(
116
				"com.android.providers.downloads");
117
		if(state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED||
118
				state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER
119
				||state==PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED){
120
			//下载未开启,打开下载管理器页面
121
			try {
122
				Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
123
				intent.setData(Uri.parse("package:" + "com.android.providers.downloads"));
124
				context.startActivity(intent);
125
			} catch (ActivityNotFoundException e ) {
126
				Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
127
				context.startActivity(intent);
128
				Toast.makeText(context, "未找到下载管理器", Toast.LENGTH_SHORT).show();;
129
			}
130
		}else {
131
			/*下载管理开启:判断存储下载文件路径是否存在*/
132
			if(null == filePath || filePath.isEmpty()){//使用默认路径
133
				if (Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
134
					if (null != context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)) {
135
						apkPath = context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).toString()+ "/" + apkName;
136
					}
137
				}
138
			}else {
139
				apkPath = filePath + "/" + apkName;
140
				File fileDir = new File(filePath);
141
				if(!fileDir.exists()){
142
					fileDir.mkdirs();
143
				}
144
			}
145
			if(null == apkPath){
146
				apkPath = Environment.getExternalStorageDirectory().toString() + "/" + apkName;
147
			}
148
			/*指定下载保存路径*/
149
			File destinationApk = new File(apkPath);
150
			downloadReq.setDestinationUri(Uri.fromFile(destinationApk));
151
			downloadId = downloadMgr.enqueue(downloadReq);
152
			
153
			new Thread( new Runnable() {
154
				public void run() {
155
					DownloadManager.Query query = new DownloadManager.Query().setFilterById(downloadId);
156
					Cursor cursor = downloadMgr.query(query);
157
					Bundle data = new Bundle();
158
					boolean isDownloading = true;
159
					while(isDownloading){
160
						cursor = downloadMgr.query(query);
161
						//显示下载进度
162
						if(cursor != null && cursor.moveToFirst()){
163
							int status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));
164
							Log.i("columnstatus", status + "");
165
							switch (status) {
166
							case DownloadManager.STATUS_PENDING:
167
								break;
168
							case DownloadManager.STATUS_PAUSED:
169
								
170
								break;
171
							case DownloadManager.STATUS_RUNNING:
172
								int totalSize = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_TOTAL_SIZE_BYTES));
173
								int downloadSize = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR));
174
								Log.i("DownloadMgr", ";downloadsize"+ downloadSize);
175
								Message msgUpdate = new Message();
176
								data.putInt(TOTAL_SIZE, totalSize);
177
								data.putInt(SOFAR_SIZE, downloadSize);
178
								msgUpdate.what = 1;
179
								msgUpdate.setData(data);
180
								handler.sendMessage(msgUpdate);
181
								break;
182
							case DownloadManager.STATUS_SUCCESSFUL:
183
								isDownloading = false;	
184
								context.runOnUiThread(new Runnable() {
185
									@Override
186
									public void run() {
187
										Toast.makeText(context, "下载成功", Toast.LENGTH_LONG).show();
188
									}
189
								});
190
								break;
191
							case DownloadManager.STATUS_FAILED:
192
								isDownloading = false;
193
								context.runOnUiThread(new Runnable() {
194
									@Override
195
									public void run() {
196
										Toast.makeText(context, "下载失败", Toast.LENGTH_LONG).show();
197
									}
198
								});
199
								break;	
200
							}
201
						}
202
						if(cursor != null){				
203
							cursor.close();
204
						}
205
					}
206
				}
207
			}).start();
208
			registerDownloadApkReceiver(destinationApk);
209
		}
210
	}
211
	
212
	private boolean isDownloading(String url,DownloadManager downloadMgr,long downloadId){
213
		boolean isDownload = false;
214
		DownloadManager.Query query = new DownloadManager.Query();
215
		query.setFilterByStatus(DownloadManager.STATUS_RUNNING | DownloadManager.STATUS_PENDING);
216
		Cursor cursor = downloadMgr.query(query);
217
		if(cursor != null && cursor.moveToFirst()){
218
			if(cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_URI)).equals(url)){
219
				isDownload = true;
220
			}
221
		}
222
		return isDownload;
223
	}
224
	
225
	/**
226
	 * 使用默认样式的进度条
227
	 */
228
	private void createCustomProgress(){
229
		dialog = new ProgressDialog(context);
230
		dialog.setTitle("下载提示");
231
		dialog.setMessage("文件下载中,请稍后...");
232
		dialog.setIndeterminate(false);
233
		dialog.setProgressNumberFormat("%1d M/%2d M");
234
		dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
235
		dialog.setCancelable(false);
236
		dialog.show();
237
	}
238
	
239
	/**
240
	 * 安装apk
241
	 * @param file
242
	 */
243
	public void installApk(File file){
244
		if(file.exists()){
245
			Intent intent = new Intent(Intent.ACTION_VIEW);
246
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
247
			if(Build.VERSION.SDK_INT >= 24){
248
				installApkAfterL(file);
249
			}else {
250
				installApkBeforeL(file);
251
			}
252
		}
253
//		if(null != receiver){			
254
//			context.unregisterReceiver(receiver);
255
//		}
256
	}
257
	
258
	/**
259
	 * 7.0以前打开私有文件 或者公开目录的文件
260
	 * @param file
261
	 */
262
	private void installApkBeforeL(File file){
263
		if(file.exists()){
264
			Intent intent = new Intent(Intent.ACTION_VIEW);
265
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
266
			intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
267
			context.startActivity(intent);
268
		}
269
	}
270
	
271
	/**
272
	 * 7.0(sdk24)以后使用私有文件,安装apk
273
	 * 需要配置
274
	 * @param file
275
	 */
276
	private void installApkAfterL(File file){
277
		if(file.exists()){
278
			Intent intent = new Intent(Intent.ACTION_VIEW);
279
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
280
			Uri fileUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), file);
281
			//添加这一句表示对目标应用临时授权该Uri所代表的文件
282
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
283
            intent.setDataAndType(fileUri, "application/vnd.android.package-archive");
284
            context.startActivity(intent);
285
		}
286
	}
287
	
288
	/**
289
	 * 注册下载完成的广播
290
	 */
291
	private void registerDownloadApkReceiver(final File file){
292
		IntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);
293
		receiver = new BroadcastReceiver() {
294
			
295
			@Override
296
			public void onReceive(Context context, Intent intent) {
297
				//TODO 关闭下载弹出框提示
298
				dialog.dismiss();
299
				long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1);
300
				if(downloadId == id){					
301
					//安装apk
302
					installApk(file);
303
				}
304
			}
305
		};
306
		context.registerReceiver(receiver, filter);
307
	}
308
	
309
	/**
310
	 * @author larryjay
311
	 * 未安装app处理
312
	 */
313
	interface NoAppHandler{
314
		void handleNoApp();
315
	}
316
	
317
	/**
318
	 * 自定义下载进度弹出框
319
	 * @author larryjay
320
	 *
321
	 */
322
	interface CustomProgressShow{
323
		void showCustomProgress();
324
	}
325
	
326
	
327
	///////////////////////2,自定义下载,弹出框显示//////////////////////////
328
	
329
	/**
330
	 * 2,自定义下载下载的任务
331
	 * @author larryjay
332
	 *
333
	 */
334
	private class DownloadApkTask extends AsyncTask<String, Integer, String>{
335
		
336
		
337
		@Override
338
		protected void onPreExecute() {
339
			// TODO Auto-generated method stub
340
			super.onPreExecute();
341
		}
342
343
		@Override
344
		protected String doInBackground(String... params) {
345
			// TODO Auto-generated method stub
346
			return null;
347
		}
348
		
349
		@Override
350
		protected void onPostExecute(String result) {
351
			// TODO Auto-generated method stub
352
			super.onPostExecute(result);
353
		}
354
	}
355
}

+ 1 - 0
show-server/src/main/resources/server-page.xml

@ -35,6 +35,7 @@
35 35
    <action name="LocalStorage" template="template/webapp/plugins/localStorage.html"></action>
36 36
    <action name="WDFImageCache" template="template/webapp/plugins/WDFImageCache.html"></action>
37 37
    <action name="ImageSave" template="template/webapp/plugins/image.html"></action>
38
    <action name="FingerprintUnlock" template="template/webapp/plugins/fingerprintUnlock.html"></action>
38 39
    
39 40
    <!-- JS组件 -->
40 41
    <action name="Carousel" template="template/webapp/jsComponent/carousel.html"></action>

+ 27 - 0
show-server/src/main/webapp/biz/js/plugins/fingerprintUnlock.js

@ -0,0 +1,27 @@
1
require(["wadeMobile","jcl","ipuUI"], function(WadeMobile,$, ipuUI) {
2
	$(function(){
3
4
		$("#isSuport").click(function() {
5
			WadeMobile.isSupportFingerprintAuthentication(function(msg) {
6
				if(msg==0){
7
					ipuUI.toast('支持指纹解锁');
8
				}else{
9
					ipuUI.toast('当前设备不支持指纹解锁');
10
				}
11
			});
12
		});
13
		
14
		$("#fingerprint").click(function() {
15
			WadeMobile.fingerprintAuthentication(function(msg) {
16
				if(msg==0){//指纹解锁验证成功
17
					ipuUI.toast('指纹解锁验证成功');
18
				}else if(msg==1){//系统取消授权、用户取消授权
19
					ipuUI.toast('系统取消授权、用户取消授权');
20
				}else{//解锁失败
21
					ipuUI.toast('指纹解锁验证失败');
22
				}
23
			});
24
		});
25
		
26
	});
27
});

+ 14 - 8
show-server/src/main/webapp/biz/js/plugins/image.js

@ -1,4 +1,4 @@
1
require(["wadeMobile","jcl"], function(WadeMobile,$) {
1
require(["wadeMobile","jcl","ipuUI"], function(WadeMobile,$,ipuUI) {
2 2
	/*
3 3
	WadeMobile.saveImageToAlbum(url,callback);
4 4
	url: 图片的url地址,支持file://开头的本地文件地址。
@ -7,16 +7,22 @@ require(["wadeMobile","jcl"], function(WadeMobile,$) {
7 7
	
8 8
	*/
9 9
	$(function(){
10
		$("#save0").click(function(){
11
			WadeMobile.saveImageToAlbum($("#pic0").attr("src"), function(msg) {
12
				WadeMobile.tip(msg);
10
		$("#save1").click(function(){
11
			WadeMobile.saveImageToAlbum($("#pic1").attr("src"), function(msg) {
12
//				WadeMobile.tip(msg);
13
				if(msg==0){
14
					ipuUI.toast('成功保存远程图片到相册!!!');
15
				}
13 16
			});
14 17
		});
15 18
		
16
		$("#save").click(function(){
17
			var url = location.href + $("#pic").attr("src"); // 获取绝对路径
18
			WadeMobile.saveImageToAlbum(url, function(msg) {
19
				WadeMobile.tip(msg);
19
		$("#save2").click(function(){
20
			var url = location.href + $("#pic2").attr("src"); // 获取绝对路径
21
			WadeMobile.saveImageToAlbum(url,function(msg) {
22
//				WadeMobile.tip(msg);
23
				if(msg==0){
24
					ipuUI.toast('成功保存本地图片到相册!!!');
25
				}
20 26
			});
21 27
22 28
		});

+ 12 - 0
show-server/src/main/webapp/biz/js/plugins/pageHandler/pageHandler.js

@ -59,6 +59,18 @@ require([ "wadeMobile", "mobile", "jcl" ], function(WadeMobile, Mobile, $) {
59 59
		$("#menu").click(function() {
60 60
			Mobile.openPage("KeyDownListen");
61 61
		});
62
		//打开外部app
63
		$("#openOuterApp").click(function(){
64
			//超级客户端包名
65
			var androdiPkg = "com.ai.ipu.superapp";
66
			var clsName = "";
67
			var iosUri = "";
68
			//本地测试apk文件的地址
69
			var androidUrl = "http://10.13.10.56:8083/superapp-client.apk";
70
			var iosUrl = "";
71
			var params;
72
			WadeMobile.openOuterApp(androdiPkg,clsName,iosUri,androidUrl,iosUrl);
73
		});
62 74
63 75
		Mobile.setBackCallListener(function(e) {
64 76
			alert(e);

+ 11 - 1
show-server/src/main/webapp/ipu/frame/mobile/expand-mobile.js

@ -450,7 +450,17 @@ define(["require","jcl"],function(require,Wade) {
450 450
			},saveImageToAlbum:function(url,callback) {
451 451
				storageCallback("saveImageToAlbum",callback);
452 452
				execute("saveImageToAlbum",[url]);
453
			}			
453
			},openOuterApp:function(androidPkg,clsName,iosUri,androidUrl,iosUrl,params,callback){
454
				storageCallback("openOuterApp",callback);
455
				execute("openOuterApp",[androidPkg,clsName,iosUri,androidUrl,iosUrl,params]);
456
			},isSupportFingerprintAuthentication:function(callback){
457
				storageCallback("isSupportFingerprintAuthentication",callback);
458
				execute("isSupportFingerprintAuthentication",[]);
459
			},fingerprintAuthentication:function(callback){
460
				storageCallback("fingerprintAuthentication",callback);
461
				execute("fingerprintAuthentication",[]);
462
			}
463
			
454 464
		};
455 465
	})();
456 466
	

+ 8 - 53
show-server/src/main/webapp/template/webapp/plugins/customCameraOrientation.html

@ -2,8 +2,13 @@
2 2
<html>
3 3
<head>
4 4
	<title>图片/自定义相机带图片旋转</title>
5
	{%>template/common/Head.html%}
6
	<script type="text/javascript" src="biz/js/plugins/customCameraOrientation.js"></script>
5
	<script type="text/javascript">
6
		var x = 10;
7
		document.write("ni hao,age is:"+x);
8
	
9
	
10
	
11
	</script>
7 12
</head>
8 13
<body>
9 14
@ -17,57 +22,7 @@
17 22
			</header>
18 23
		</div>
19 24
		
20
		<div id="scroll-container" class="ipu-col">
21
22
			<div>
23
				<div class="demo-desc">拍照</div>
24
				<div class="ipu-card ">
25
					<div class="ipu-content ipu-border-b">
26
						<div class="label">人脸拍照</div>
27
						<div class="fn" id="face_picture"><span class="fa fa-camera"></span></div>
28
					</div>
29
					<div class="ipu-content ipu-content-vertical">
30
						<div class="label">返回结果</div>
31
						<div class="value">
32
							<span class="fa fa-image ipu-image-holder" id="pic" ></span>
33
						</div>
34
						<div class="info" id="path">路径:</div>
35
					</div>
36
					
37
				</div>
38
				
39
				<div class="ipu-card ">
40
					<div class="ipu-content ipu-border-b">
41
						<div class="label">身份证正面拍照</div>
42
						<div class="fn" id="take_id_picture_front"><span class="fa fa-camera"></span></div>
43
					</div>
44
					<div class="ipu-content ipu-content-vertical">
45
						<div class="label">返回结果</div>
46
						<div class="value">
47
							<span class="fa fa-image ipu-image-holder" id="pic_id_front" ></span>
48
						</div>
49
						<div class="info" id="path_front">路径:</div>
50
					</div>
51
					
52
				</div>
53
				
54
				<div class="ipu-card ">
55
					<div class="ipu-content ipu-border-b">
56
						<div class="label">身份证反面拍照</div>
57
						<div class="fn" id="take_id_picture_back"><span class="fa fa-camera"></span></div>
58
					</div>
59
					<div class="ipu-content ipu-content-vertical">
60
						<div class="label">返回结果</div>
61
						<div class="value">
62
							<span class="fa fa-image ipu-image-holder" id="pic_id_back" ></span>
63
						</div>
64
						<div class="info" id="path_back">路径:</div>
65
					</div>
66
					
67
				</div>
68
			</div>
69
70
		</div>
25
		
71 26
</div>
72 27
73 28
</body>

+ 30 - 0
show-server/src/main/webapp/template/webapp/plugins/fingerprintUnlock.html

@ -0,0 +1,30 @@
1
<!DOCTYPE HTML>
2
<html>
3
<head>
4
	<title>指纹解锁</title>
5
	{%>template/common/Head.html%}
6
	<script type="text/javascript" src="biz/js/plugins/fingerprintUnlock.js"></script>
7
</head>
8
<body>
9
10
<div class="ipu-flex-row ipu-flex-vertical">
11
		<div class="ipu-flex-col">
12
			<header class="ipu-toolbar">
13
				<h1 class="ipu-toolbar-title">指纹解锁</h1>
14
				<a class="ipu-fn-left page-back" href="javascript:;"> <i
15
					class="ipu-icon mdi mdi-chevron-left"></i>
16
				</a>
17
			</header>
18
		</div>
19
		
20
		<div class="ipu-flex-col-auto" id='content'>
21
			<div class="ipu-fn-p">
22
				<div class="ipu-btn" id="isSuport">点击验证是否支持指纹解锁</div>
23
				<div class="ipu-btn" id="fingerprint">指纹解锁验证</div>
24
			</div>
25
		</div>
26
		
27
</div>
28
29
</body>
30
</html>

+ 8 - 8
show-server/src/main/webapp/template/webapp/plugins/image.html

@ -1,7 +1,7 @@
1 1
<!DOCTYPE HTML>
2 2
<html>
3 3
<head>
4
<title>保存图片</title> {%>template/common/Head.html%}
4
<title>保存图片到相册</title> {%>template/common/Head.html%}
5 5
<script type="text/javascript" src="biz/js/plugins/image.js"></script>
6 6
</head>
7 7
<body>
@ -12,29 +12,29 @@
12 12
				<a class="ipu-fn-left page-back" href="javascript:;"> <i
13 13
					class="ipu-icon mdi mdi-chevron-left"></i>
14 14
				</a>
15
				<h1 class="ipu-toolbar-title">保存图片</h1>
15
				<h1 class="ipu-toolbar-title">保存图片到相册</h1>
16 16
			</header>
17 17
		</div>
18 18
19 19
		<div class="ipu-content ipu-content-vertical">
20 20
21 21
			<div class="value">
22
				<img class="fa fa-image ipu-image-holder" id="pic0"
22
				<img class="fa fa-image ipu-image-holder" id="pic1"
23 23
					src='http://cafe.smallpay.com/xd/media/goods/m_1003/g_940/20151112202854_844.png' />
24 24
			</div>
25 25
26
			<div id="buttons" class="ipu-fn-hide value">
27
				<div class="ipu-btn" id="save0">保存图片</div>
26
			<div class="ipu-fn-p">
27
				<div class="ipu-btn" id="save1">保存远程图片到相册</div>
28 28
			</div>
29 29
30 30
31 31
			<div class="value ipu-center">
32
				<img class="fa fa-image ipu-image-holder" id="pic"
32
				<img class="fa fa-image ipu-image-holder" id="pic2"
33 33
					src='biz/img/opensource/lvse.jpg' />
34 34
			</div>
35 35
36
			<div id="buttons" class="ipu-fn-hide value">
37
				<div class="ipu-btn" id="save">保存图片</div>
36
			<div class="ipu-fn-p">
37
				<div class="ipu-btn" id="save2">保存本地图片到相册</div>
38 38
			</div>
39 39
40 40

+ 6 - 1
show-server/src/main/webapp/template/webapp/plugins/index-list.html

@ -122,7 +122,12 @@
122 122
		
123 123
	    <li data-action="ImageSave">
124 124
	        <div class="ipu-icon mdi mdi-image-area-close"></div>
125
	        <p>保存图片</p>
125
	        <p>保存图片到相册</p>
126
	    </li>
127
	    
128
	    <li data-action="FingerprintUnlock">
129
	        <div class="ipu-icon mdi mdi-image-area-close"></div>
130
	        <p>指纹解锁</p>
126 131
	    </li>
127 132
	    
128 133
	</ul>

+ 19 - 0
show-server/src/main/webapp/template/webapp/plugins/pageHandler/pageHandler.html

@ -113,6 +113,25 @@
113 113
					</div>
114 114
	
115 115
				</div>
116
				
117
				<div class="demo-item">
118
					<div class="demo-title">打开外部App</div>
119
					<div class="ipu-list">
120
						<ul>
121
							<li class="ipu-list-item">
122
								<div class="ipu-list-item-inner">
123
									<div class="ipu-list-item-title">打开外部App</div>
124
									<div class="ipu-list-item-after">
125
										<button class="ipu-btn ipu-btn-s" id="openOuterApp">点击</button>
126
									</div>
127
								</div>
128
							</li>
129
						</ul>
130
					</div>
131
	
132
				</div>
133
				
134
				
116 135
			</div>	
117 136
		</div>
118 137
	</div>