Browse Source

Merge branch 'master' of http://114.215.100.48:3000/ipu/android-share.git

wangyj18 9 years ago
parent
commit
ebdb5bedd1
90 changed files with 314 additions and 715 deletions
  1. BIN
      .DS_Store
  2. 0 14
      .classpath
  3. 0 0
      README.md
  4. 9 9
      display-client/.classpath
  5. 2 0
      display-client/.gitignore
  6. 1 1
      display-client/AndroidManifest.xml
  7. 2 2
      display-client/lint.xml
  8. 4 3
      display-client/project.properties
  9. 0 4
      display-client/src/com/ai/mobile/display/测试.txt
  10. 8 0
      display-client/工程依赖说明.txt
  11. 33 1
      display-server/src/com/ai/server/bean/FileUpDownload.java
  12. 6 1
      display-server/web/biz/js/plugin/fileupload.js
  13. 0 50
      ipu-server/.classpath
  14. 2 1
      ipu-server/.gitignore
  15. 0 4
      ipu-server/.settings/org.eclipse.core.resources.prefs
  16. BIN
      ipu-server/web/WEB-INF/lib/bcprov-jdk16-140.jar
  17. BIN
      ipu-server/web/WEB-INF/lib/beetl-core-2.2.3.jar
  18. BIN
      ipu-server/web/WEB-INF/lib/commons-beanutils-1.7.0.jar
  19. BIN
      ipu-server/web/WEB-INF/lib/commons-codec-1.3.jar
  20. BIN
      ipu-server/web/WEB-INF/lib/commons-collections-3.2.jar
  21. BIN
      ipu-server/web/WEB-INF/lib/commons-dbcp-1.4.jar
  22. BIN
      ipu-server/web/WEB-INF/lib/commons-digester1.6.jar
  23. BIN
      ipu-server/web/WEB-INF/lib/commons-fileupload-1.2.2.jar
  24. BIN
      ipu-server/web/WEB-INF/lib/commons-httpclient-3.0.jar
  25. BIN
      ipu-server/web/WEB-INF/lib/commons-lang-2.4.jar
  26. BIN
      ipu-server/web/WEB-INF/lib/commons-logging-1.1.1.jar
  27. BIN
      ipu-server/web/WEB-INF/lib/commons-net-2.0.jar
  28. BIN
      ipu-server/web/WEB-INF/lib/commons-pool-1.6.jar
  29. BIN
      ipu-server/web/WEB-INF/lib/dom4j-1.6.1.jar
  30. BIN
      ipu-server/web/WEB-INF/lib/httpclient-4.0.jar
  31. BIN
      ipu-server/web/WEB-INF/lib/httpcore-4.0.jar
  32. BIN
      ipu-server/web/WEB-INF/lib/java_memcached-release_2.5.3.jar
  33. BIN
      ipu-server/web/WEB-INF/lib/jaxen-1.1.1.jar
  34. BIN
      ipu-server/web/WEB-INF/lib/jedis-2.0.0.jar
  35. BIN
      ipu-server/web/WEB-INF/lib/jta.jar
  36. BIN
      ipu-server/web/WEB-INF/lib/log4j-1.2.8.jar
  37. 0 9
      ipu-server/web/WEB-INF/lib/lua64/defineTagConfig.lua
  38. BIN
      ipu-server/web/WEB-INF/lib/lua64/engine/Tag.lua
  39. BIN
      ipu-server/web/WEB-INF/lib/lua64/engine/TagEngine.lua
  40. BIN
      ipu-server/web/WEB-INF/lib/lua64/engine/tagConfig.lua
  41. BIN
      ipu-server/web/WEB-INF/lib/lua64/htmlparser/ElementNode.lua
  42. BIN
      ipu-server/web/WEB-INF/lib/lua64/htmlparser/htmlparser.lua
  43. BIN
      ipu-server/web/WEB-INF/lib/lua64/htmlparser/voidelements.lua
  44. BIN
      ipu-server/web/WEB-INF/lib/lua64/index.lua
  45. 0 107
      ipu-server/web/WEB-INF/lib/lua64/tag/WmSlider.lua
  46. 0 22
      ipu-server/web/WEB-INF/lib/lua64/tag/WmSliderItem.lua
  47. 0 101
      ipu-server/web/WEB-INF/lib/lua64/tag/WmSwitch.lua
  48. 0 66
      ipu-server/web/WEB-INF/lib/lua64/tag/WmTab.lua
  49. 0 18
      ipu-server/web/WEB-INF/lib/lua64/tag/WmTabItem.lua
  50. 0 80
      ipu-server/web/WEB-INF/lib/lua64/tag/WmTabbar.lua
  51. 0 18
      ipu-server/web/WEB-INF/lib/lua64/tag/WmTabbarItem.lua
  52. 0 59
      ipu-server/web/WEB-INF/lib/lua64/tag/WmTest.lua
  53. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/Class.lua
  54. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/FileUtil.lua
  55. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/Set/init.lua
  56. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/StringBuilder.lua
  57. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/System.lua
  58. BIN
      ipu-server/web/WEB-INF/lib/lua64/util/TableUtil.lua
  59. BIN
      ipu-server/web/WEB-INF/lib/mysql-connector-java-5.1.6-bin.jar
  60. BIN
      ipu-server/web/WEB-INF/lib/ojdbc14.jar
  61. BIN
      ipu-server/web/WEB-INF/lib/pinyin4j-2.5.0.jar
  62. BIN
      ipu-server/web/WEB-INF/lib/poi-3.8.jar
  63. BIN
      ipu-server/web/WEB-INF/lib/poi-ooxml-3.8.jar
  64. BIN
      ipu-server/web/WEB-INF/lib/poi-ooxml-schemas-3.8.jar
  65. BIN
      ipu-server/web/WEB-INF/lib/sqlite-jdbc-3.8.7.jar
  66. BIN
      ipu-server/web/WEB-INF/lib/velocity-1.7.jar
  67. BIN
      ipu-server/web/WEB-INF/lib/wade-apache.jar
  68. BIN
      ipu-server/web/WEB-INF/lib/wade-common.jar
  69. BIN
      ipu-server/web/WEB-INF/lib/wade-database.jar
  70. BIN
      ipu-server/web/WEB-INF/lib/wade-mobile-data.jar
  71. BIN
      ipu-server/web/WEB-INF/lib/wade-mobile-server.jar
  72. BIN
      ipu-server/web/WEB-INF/lib/wade-sqlite-jdbc.jar
  73. 0 15
      multiple-client/project.properties
  74. BIN
      wade-mobile-common/.DS_Store
  75. 0 0
      wade-mobile-common/.classpath
  76. 4 4
      wade-mobile-common/.gitignore
  77. BIN
      wade-mobile-common/libs/wade-mobile-com.jar
  78. BIN
      wade-mobile-common/libs/wade-mobile-func.jar
  79. BIN
      wade-mobile-common/res/drawable-mdpi/map_mark.png
  80. 17 0
      wade-mobile-common/res/drawable/activity_dialog_bg.xml
  81. 16 0
      wade-mobile-common/res/drawable/activity_dialog_bg2.xml
  82. 38 38
      wade-mobile-common/res/layout/scan_zxing_capture.xml
  83. BIN
      wade-mobile-common/res/raw/beep.ogg
  84. 32 32
      wade-mobile-common/res/values/scan_zxing_colors.xml
  85. 31 31
      wade-mobile-common/res/values/scan_zxing_ids.xml
  86. 105 21
      wade-mobile-func/src/com/wade/mobile/func/MobileNetWork.java
  87. 0 0
      wade-mobile-lib/.classpath
  88. 4 4
      wade-mobile-lib/.gitignore
  89. BIN
      wade-mobile-lib/libs/pinyin4j-2.5.0.jar
  90. BIN
      wade-mobile-lib/libs/unirest-java-1.3.2-SNAPSHOT-withDependency-ShadedForAndroid.jar

BIN
.DS_Store


+ 0 - 14
.classpath

@ -1,14 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="gen"/>
5
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
7
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
8
	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wade-mobile"/>
9
	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wade-mobile-ui"/>
10
	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wade-mobile-func"/>
11
	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wade-mobile-data"/>
12
	<classpathentry combineaccessrules="false" exported="true" kind="src" path="/wade-mobile-im"/>
13
	<classpathentry kind="output" path="bin/classes"/>
14
</classpath>

+ 0 - 0
README.md


+ 9 - 9
display-client/.classpath

@ -1,9 +1,9 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="gen"/>
4
	<classpathentry kind="src" path="src"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
6
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
7
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
6
	<classpathentry kind="src" path="gen"/>
7
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
8
	<classpathentry kind="output" path="bin/classes"/>
9
</classpath>

+ 2 - 0
display-client/.gitignore

@ -2,3 +2,5 @@
2 2
/bin
3 3
/gen
4 4
/proguard
5
/.classpath
6
/project.properties

+ 1 - 1
display-client/AndroidManifest.xml

@ -118,4 +118,4 @@
118 118
        </activity>
119 119
    </application>
120 120

121
</manifest>
121
</manifest>

+ 2 - 2
display-client/lint.xml

@ -1,3 +1,3 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<lint>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<lint>
3 3
</lint>

+ 4 - 3
display-client/project.properties

@ -1,3 +1,4 @@
1
<<<<<<< HEAD
1 2
# This file is automatically generated by Android Tools.
2 3
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 4
#
@ -10,8 +11,8 @@
10 11
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 12
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 13
13
android.library.reference.1=../wade-mobile-lib
14
android.library.reference.2=../wade-mobile-common
15
proguard.config=proguard-project.txt
16 14
# Project target.
17 15
target=android-15
16
android.library=false
17
android.library.reference.1=../wade-mobile-common
18
android.library.reference.2=../wade-mobile-lib

+ 0 - 4
display-client/src/com/ai/mobile/display/测试.txt

@ -1,4 +0,0 @@
1
测试,测试……001fasdfadsfaxiaowang
2
程文斌提交dfadfa
3
能都成功?
4
测试成功01--阳彪

+ 8 - 0
display-client/工程依赖说明.txt

@ -0,0 +1,8 @@
1
为减少代码提交产生的冲突问题,该工程忽略了.classpath和project.properties两个配置文件
2
.classpath生成方式:
3
选中工程->Properties->Java Build Path->Source标签页->Add Folder按钮
4
增加src和gen目录,Defaul output folder为bin/classes目录
5

6
project.properties生成方式:
7
选中工程->Properties->Android
8
选中Android SDK版本号,同时增加Android Library工程wade-mobile-lib和wade-mobile-common

+ 33 - 1
display-server/src/com/ai/server/bean/FileUpDownload.java

@ -1,12 +1,14 @@
1 1
package com.ai.server.bean;
2 2

3 3
import java.io.File;
4
import java.io.FileInputStream;
4 5
import java.io.FileOutputStream;
5 6
import java.io.InputStream;
6 7
import java.io.OutputStream;
7 8
import java.util.List;
8 9

9 10
import javax.servlet.http.HttpServletRequest;
11
import javax.servlet.http.HttpServletResponse;
10 12

11 13
import org.apache.commons.fileupload.FileItem;
12 14
import org.apache.commons.fileupload.FileUploadException;
@ -122,7 +124,37 @@ public class FileUpDownload extends DisplayBean {
122 124
	 * @throws Exception
123 125
	 */
124 126
	public IData download(IData param) throws Exception{
127
		HttpServletRequest request = ServletManager.getRequest();
128
		HttpServletResponse response = ServletManager.getResponse();
129
		//获取文件需要上传到的路径
130
		String fileName = request.getParameter("FILE_PATH");
131
		String mineType = request.getParameter("MINE_TYPE");
132
		log.debug("MINE类型为:[" + mineType + "]");
133
//		log.debug(request.getParameter("USER_NAME"));
134
//		log.debug(request.getParameter("SESSION_ID"));
135
		//获取文件地址
136
		String filePath = ApplicationPath.getFilePath(request) + "upload" + File.separator + fileName;
137
		File file = new File(filePath);
138
		if(! file.isFile())
139
			throw new RuntimeException("上传的文件不存在,请检查文件路径!");
140

141
		response.reset();
142
		response.setContentType(mineType);
143
		InputStream in = new FileInputStream(file);
144
        
145
        int length = 0;
146
        byte[] buf = new byte[1024];
147
        //写出到文件中
148
        OutputStream out = response.getOutputStream();
149
        while((length = in.read(buf) ) != -1) {
150
            //在BUF数组中取出数据写到(输出流)磁盘上
151
        	out.write(buf, 0, length);
152
        }
153
        out.flush();
154
        in.close();
155
        out.close();
156
        response.flushBuffer();
125 157
		
126
       return null;
158
		return null;
127 159
	}
128 160
}

+ 6 - 1
display-server/web/biz/js/plugin/fileupload.js

@ -16,10 +16,15 @@ require(["domReady!","wadeMobile", "util"], function(doc,WadeMobile) {
16 16
	
17 17
	//下载
18 18
	$("#download").tap(function() {
19
		//下载文件保存
19
		//文件保存路径
20 20
		var downloadPath = "/Users/kevin/Downloads";
21 21
		
22 22
		var params = new Wade.DataMap();
23
		//下载文件列表,在服务器获取真实绝对文件路径
24
		params.put("FILE_PATH", ["/temp/download.png"]);
25
		//其他可选参数,可以自行添加,在FileUpDownload.download中进行处理
26
		params.put("USER_NAME", "GUANYU");
27
		params.put("SESSION_ID", "S8234982348jfjekj");
23 28
		
24 29
		WadeMobile.downloadWithServlet(downloadPath, "FileUpDownload.download", params, function(){
25 30
			

+ 0 - 50
ipu-server/.classpath

@ -1,50 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<classpath>
3
	<classpathentry kind="src" path="src"/>
4
	<classpathentry kind="src" path="etc"/>
5
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6
	<classpathentry kind="lib" path="/wade-mobile-library/common/bcprov-jdk16-140.jar"/>
7
	<classpathentry kind="lib" path="/wade-mobile-library/common/beetl-core-2.2.3.jar"/>
8
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-beanutils-1.7.0.jar"/>
9
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-codec-1.3.jar"/>
10
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-collections-3.2.jar"/>
11
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-dbcp-1.4.jar"/>
12
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-digester1.6.jar"/>
13
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-fileupload-1.2.2.jar"/>
14
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-httpclient-3.0.jar"/>
15
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-lang-2.4.jar"/>
16
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-logging-1.1.1.jar"/>
17
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-net-2.0.jar"/>
18
	<classpathentry kind="lib" path="/wade-mobile-library/common/commons-pool-1.6.jar"/>
19
	<classpathentry kind="lib" path="/wade-mobile-library/common/dom4j-1.6.1.jar"/>
20
	<classpathentry kind="lib" path="/wade-mobile-library/common/http-unirest-1.3.8.jar"/>
21
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpasyncclient-4.0.1.jar"/>
22
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpclient-4.3.2.jar"/>
23
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-4.4.3.jar"/>
24
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-ab-4.4.3.jar"/>
25
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpcore-nio-4.4.3.jar"/>
26
	<classpathentry kind="lib" path="/wade-mobile-library/common/httpmime-4.3.2.jar"/>
27
	<classpathentry kind="lib" path="/wade-mobile-library/common/java_memcached-release_2.5.3.jar"/>
28
	<classpathentry kind="lib" path="/wade-mobile-library/common/jaxen-1.1.1.jar"/>
29
	<classpathentry kind="lib" path="/wade-mobile-library/common/jedis-2.0.0.jar"/>
30
	<classpathentry kind="lib" path="/wade-mobile-library/common/json-20131018.jar"/>
31
	<classpathentry kind="lib" path="/wade-mobile-library/common/jta.jar"/>
32
	<classpathentry kind="lib" path="/wade-mobile-library/common/junit-4.8.jar"/>
33
	<classpathentry kind="lib" path="/wade-mobile-library/common/log4j-1.2.8.jar"/>
34
	<classpathentry kind="lib" path="/wade-mobile-library/common/mysql-connector-java-5.1.6-bin.jar"/>
35
	<classpathentry kind="lib" path="/wade-mobile-library/common/ojdbc14.jar"/>
36
	<classpathentry kind="lib" path="/wade-mobile-library/common/pinyin4j-2.5.0.jar"/>
37
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-3.8.jar"/>
38
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-3.8.jar"/>
39
	<classpathentry kind="lib" path="/wade-mobile-library/common/poi-ooxml-schemas-3.8.jar"/>
40
	<classpathentry kind="lib" path="/wade-mobile-library/common/servlet-api2.5.jar"/>
41
	<classpathentry kind="lib" path="/wade-mobile-library/common/sqlite-jdbc-3.8.7.jar"/>
42
	<classpathentry kind="lib" path="/wade-mobile-library/common/velocity-1.7.jar"/>
43
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-apache.jar"/>
44
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-common.jar"/>
45
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-database.jar"/>
46
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-data.jar"/>
47
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-mobile-server.jar"/>
48
	<classpathentry kind="lib" path="/wade-mobile-library/common/wade-sqlite-jdbc.jar"/>
49
	<classpathentry kind="output" path="web/WEB-INF/classes"/>
50
</classpath>

+ 2 - 1
ipu-server/.gitignore

@ -4,4 +4,5 @@
4 4
/web/res.version.properties
5 5
/.DS_Store
6 6
/web/.DS_Store
7
/web/WEB-INF/.DS_Store
7
/web/WEB-INF/.DS_Store
8
/bin/

+ 0 - 4
ipu-server/.settings/org.eclipse.core.resources.prefs

@ -1,4 +0,0 @@
1
eclipse.preferences.version=1
2
encoding//build/build.properties=UTF-8
3
encoding/<project>=UTF-8
4
encoding/build=UTF-8

BIN
ipu-server/web/WEB-INF/lib/bcprov-jdk16-140.jar


BIN
ipu-server/web/WEB-INF/lib/beetl-core-2.2.3.jar


BIN
ipu-server/web/WEB-INF/lib/commons-beanutils-1.7.0.jar


BIN
ipu-server/web/WEB-INF/lib/commons-codec-1.3.jar


BIN
ipu-server/web/WEB-INF/lib/commons-collections-3.2.jar


BIN
ipu-server/web/WEB-INF/lib/commons-dbcp-1.4.jar


BIN
ipu-server/web/WEB-INF/lib/commons-digester1.6.jar


BIN
ipu-server/web/WEB-INF/lib/commons-fileupload-1.2.2.jar


BIN
ipu-server/web/WEB-INF/lib/commons-httpclient-3.0.jar


BIN
ipu-server/web/WEB-INF/lib/commons-lang-2.4.jar


BIN
ipu-server/web/WEB-INF/lib/commons-logging-1.1.1.jar


BIN
ipu-server/web/WEB-INF/lib/commons-net-2.0.jar


BIN
ipu-server/web/WEB-INF/lib/commons-pool-1.6.jar


BIN
ipu-server/web/WEB-INF/lib/dom4j-1.6.1.jar


BIN
ipu-server/web/WEB-INF/lib/httpclient-4.0.jar


BIN
ipu-server/web/WEB-INF/lib/httpcore-4.0.jar


BIN
ipu-server/web/WEB-INF/lib/java_memcached-release_2.5.3.jar


BIN
ipu-server/web/WEB-INF/lib/jaxen-1.1.1.jar


BIN
ipu-server/web/WEB-INF/lib/jedis-2.0.0.jar


BIN
ipu-server/web/WEB-INF/lib/jta.jar


BIN
ipu-server/web/WEB-INF/lib/log4j-1.2.8.jar


+ 0 - 9
ipu-server/web/WEB-INF/lib/lua64/defineTagConfig.lua

@ -1,9 +0,0 @@
1
return{
2
  ["wm-tab"] = "tag.WmTab",
3
  ["wm-tab-item"] = "tag.WmTabItem",
4
  ["wm-tabbar"] = "tag.WmTabbar",
5
  ["wm-tabbar-item"] = "tag.WmTabbarItem",
6
  ["wm-switch"] = "tag.WmSwitch",
7
  ["wm-slider"] = "tag.WmSlider",
8
  ["wm-slider-item"] = "tag.WmSliderItem",
9
}

BIN
ipu-server/web/WEB-INF/lib/lua64/engine/Tag.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/engine/TagEngine.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/engine/tagConfig.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/htmlparser/ElementNode.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/htmlparser/htmlparser.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/htmlparser/voidelements.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/index.lua


+ 0 - 107
ipu-server/web/WEB-INF/lib/lua64/tag/WmSlider.lua

@ -1,107 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmSlider = Class(Tag)
4

5
--htmlbuff
6
function WmSlider:createNew(obj,htmlbuff)
7
  self.htmlbuff=htmlbuff
8
  self.bottoms = {}
9
end
10

11
--attr所有属性
12
function WmSlider:doStartTag(attr)
13
  self.attr=attr
14
  self.htmlbuff:append([[
15
<div class="c_slide c_slide-col-4 l_mt" id="]])
16
  self.htmlbuff:append(attr.id)
17
  self.htmlbuff:append([[">
18
    <div class="frame">
19
      <div class="wrapper">
20
        <ul>]])
21
end
22

23
function WmSlider:doEndTag()
24
  self.htmlbuff:append([[
25
        </ul>
26
      </div>
27
    </div>
28
    <div class="page">
29
    ]])
30
  for k,v in pairs(self.bottoms) do
31
    if k==1 then
32
      self.htmlbuff:append([[
33
      <div class="on"></div>
34
      ]]);
35
    else
36
      self.htmlbuff:append([[
37
      <div></div>
38
      ]]);
39
    end
40
  end
41
  self.htmlbuff:append([[
42
    </div>
43
    </div>
44
  ]])
45
  
46
  
47
  self.htmlbuff:append([[
48
  <script>   
49
    require(["wmSlider","util"],function(WmSlider) {
50
        var wmSlider=new WmSlider("]])
51
  self.htmlbuff:append(self.attr.id);
52
  self.htmlbuff:append([[");
53
        wmSlider.create();]])
54
  if self.attr.duration then
55
    self.htmlbuff:append([[    
56
        wmSlider.setDuration(]])
57
    self.htmlbuff:append(self.attr.duration)
58
    self.htmlbuff:append([[);
59
        wmSlider.play();
60
    ]])
61
  end;
62
  self.htmlbuff:append([[
63
    WmWebUI.store("]])
64
  self.htmlbuff:append(self.attr.id)
65
  self.htmlbuff:append([[",wmSlider);
66
 });
67
    </script>
68
  ]])
69
end
70

71
--[[
72
require(["wmSlider","util"],function(WmSlider) {
73
  var wmSlider=new WmSlider("TestSlider01");
74
  wmSlider.create();
75
  $("#prev").click(function(){
76
    wmSlider.prev();
77
  });
78
  $("#next").click(function(){
79
    wmSlider.next();
80
  });
81
  $("#goFrame").click(function(){
82
    wmSlider.active($("#goFrame").val());
83
  });
84
  wmSlider.setDuration(2000);
85
  wmSlider.play();
86
  var items=wmSlider.getItems();
87
  items[0].setAlt('ABC');
88
  for(var i=0;i<items.length;i++){
89
    console.log(items[i].getUrl());
90
    console.log(items[i].getAlt());
91
    var j=i;
92
    var f=function(){
93
      console.log("index:"+arguments.callee.i); 
94
    };
95
    f.i=i;
96
    items[i].setAction(f);
97
  }
98
  console.log(items[0].setUrl('ABC'))
99
  console.log(items[0].getUrl());
100
});
101
]]
102

103
function WmSlider:addBottom(bottom)
104
  table.insert(self.bottoms, bottom)
105
end
106

107
return WmSlider

+ 0 - 22
ipu-server/web/WEB-INF/lib/lua64/tag/WmSliderItem.lua

@ -1,22 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmSliderItem = Class(Tag)
4

5
function WmSliderItem:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

9
function WmSliderItem:doStartTag(attr)
10
  self.htmlbuff:append([[
11
    <li><img src="]])
12
  self.htmlbuff:append(attr.url)
13
  self.htmlbuff:append([[" alt="]])
14
  self.htmlbuff:append(attr.alt)
15
  self.htmlbuff:append([["></li> ]]);
16
  self.parent:addBottom(attr)
17
end
18

19
function WmSliderItem:doEndTag()
20
end
21

22
return WmSliderItem

+ 0 - 101
ipu-server/web/WEB-INF/lib/lua64/tag/WmSwitch.lua

@ -1,101 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmSwitch = Class(Tag)
4

5
--htmlbuff
6
function WmSwitch:createNew(obj,htmlbuff)
7
  self.htmlbuff=htmlbuff
8
end
9

10
local function split(s, delim)
11
    if type(delim) ~= "string" or string.len(delim) <= 0 then
12
        return
13
    end
14

15
    local start = 1
16
    local t = {}
17
    while true do
18
    local pos = string.find (s, delim, start, true) -- plain find
19
        if not pos then
20
          break
21
        end
22

23
        table.insert (t, string.sub (s, start, pos - 1))
24
        start = pos + string.len (delim)
25
    end
26
    table.insert (t, string.sub (s, start))
27

28
    return t
29
end
30

31
--attr 所有属性
32
function WmSwitch:doStartTag(attr)
33
  --[[for k,v in pairs(attr) do
34
    self.htmlbuff:append(k,v)
35
  end--]]
36
  ---[[属性初始化
37
  attr.value=attr.value or "true"
38
  attr.label=attr.label or "On|Off"
39
  attr.onAction=attr.onAction or "console.log('On')"
40
  attr.offAction=attr.offAction or "console.log('Off')"
41
  attr.changeAction=attr.changeAction or "console.log('onChange')"
42
  attr.isEnable=attr.isEnable or "true"
43
  local stateStyle=""
44
  if attr.value=="false"
45
    then 
46
    stateStyle="transform:translateX(-100%)"
47
  end
48
  self.htmlbuff:append([[
49
    <div class="value">
50
        <span class="e_switch e_switch-on" id="]])
51
  self.htmlbuff:append(attr.id)
52
  self.htmlbuff:append([[">
53
          <span class="e_switchOn">]])
54
  local labelTable=split(attr.label,"|")
55
  self.htmlbuff:append(labelTable[1])
56
  self.htmlbuff:append([[</span>
57
          <span class="e_switchOff">]])
58
  self.htmlbuff:append(labelTable[2])
59
  self.htmlbuff:append([[</span>
60
          <span class="e_switchBar" style="]])
61
  self.htmlbuff:append(stateStyle)
62
  self.htmlbuff:append([["></span>
63
          <input type="hidden" value="]])
64
  self.htmlbuff:append(attr.value)
65
  self.htmlbuff:append([[" >
66
        </span>
67
     </div>
68
  ]]);
69
  
70
  
71
  self.htmlbuff:append([[
72
  <script>
73
  require(["iScroll","wmSwitch","util"],function(iScroll,wmSwitch) {
74
  var obj=new wmSwitch("]])
75
  self.htmlbuff:append(attr.id)
76
  self.htmlbuff:append([[");
77
  obj.setOnAction(function(){]])
78
  self.htmlbuff:append(attr.onAction)
79
  self.htmlbuff:append([[});
80
  obj.setOffAction(function(){]])
81
  self.htmlbuff:append(attr.offAction)
82
  self.htmlbuff:append([[});
83
  obj.setChangeAction(function(){]])
84
  self.htmlbuff:append(attr.changeAction)
85
  self.htmlbuff:append([[});
86
  obj.isEnable(]])
87
  self.htmlbuff:append(attr.isEnable)
88
  self.htmlbuff:append([[);
89
  obj.create();
90
  WmWebUI.store("]])
91
  self.htmlbuff:append(attr.id)
92
  self.htmlbuff:append([[",obj);
93
  });
94
  </script>
95
  ]])
96
end
97
--结束标签
98
function WmSwitch:doEndTag()
99

100
end
101
return WmSwitch

+ 0 - 66
ipu-server/web/WEB-INF/lib/lua64/tag/WmTab.lua

@ -1,66 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmTab = Class(Tag)
4

5
function WmTab:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
  self.childrenAttr = {}
8
  self.index = 0; 
9
end
10

11
function WmTab:doStartTag(attr)
12
  if attr.id then
13
    self.id = attr.id
14
  else
15
    self.id = "tab"..os.time()
16
  end
17
  self.htmlbuff:append('<div id="',self.id,'" class="c_tab">','\n')
18
  self.htmlbuff:append('<div class="title"><ul>','\n')
19
  self.pos = self.htmlbuff:currPos()
20
  self.startPos = self.htmlbuff:length()+1
21
  self.htmlbuff:append([[
22
    </ul>
23
    </div>
24
    <div class="pages">
25
  ]])
26
end
27

28
function WmTab:doEndTag()
29
  self.htmlbuff:append([[
30
    </div>
31
    </div>
32
    <script type="text/javascript">
33
    require(["wmTab","wmWebUI"],function(WmTab,WmWebUI) {
34
  ]])
35
  self.htmlbuff:append('	var wmTab = new WmTab("',self.id,'");','\n')
36
  local StringBuilder = require("util.StringBuilder")
37
  local buff = StringBuilder:new()
38
  for key, value in ipairs(self.childrenAttr) do
39
    if value.active=="true" then
40
      buff:append('<li class="on">',value.title,'</li>','\n')
41
      self.htmlbuff:append('wmTab.active(',value._index,');','\n');
42
    else
43
      buff:append('<li>',value.title,'</li>','\n')
44
    end
45
    
46
    if value.action then
47
      self.htmlbuff:append('wmTab.addListener(',value._index,',function(){',value.action,';});','\n');
48
    end
49
  end
50
  
51
  self.htmlbuff:append([[
52
      wmTab.create();
53
    });
54
    </script>
55
  ]])
56

57
  self.htmlbuff:insertTo(self.pos,buff:toString())
58
end
59

60
function WmTab:addChildrenAttr(childrenAttr)
61
  childrenAttr._index = self.index
62
  self.index = self.index + 1
63
  table.insert(self.childrenAttr, childrenAttr)
64
end
65

66
return WmTab

+ 0 - 18
ipu-server/web/WEB-INF/lib/lua64/tag/WmTabItem.lua

@ -1,18 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmTabItem = Class(Tag)
4

5
function WmTabItem:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

9
function WmTabItem:doStartTag(attr)
10
  self.htmlbuff:append('<div class="page">')
11
  self.parent:addChildrenAttr(attr)
12
end
13

14
function WmTabItem:doEndTag()
15
  self.htmlbuff:append('</div>')
16
end
17

18
return WmTabItem

+ 0 - 80
ipu-server/web/WEB-INF/lib/lua64/tag/WmTabbar.lua

@ -1,80 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmTabbar = Class(Tag)
4

5
function WmTabbar:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
  self.childrenAttr = {}
8
  self.index = 0; 
9
end
10

11
function WmTabbar:doStartTag(attr)
12
  if attr.id then
13
    self.id = attr.id
14
  else
15
    self.id = "tabbar"..os.time()
16
  end
17
  if attr.active then
18
    self.active = tonumber(attr.active)
19
  else
20
    self.active = 0
21
  end
22

23
  self.htmlbuff:append('<div id="',self.id,'">','\n')
24
  self.htmlbuff:append([[
25
  <div class="m_nav">
26
  <div class="wrapper">
27
  ]])
28
end
29

30
function WmTabbar:doEndTag()
31
  self.htmlbuff:append([[
32
  </div>
33
  </div>
34
  <div class="m_footer">
35
  <ul>
36
  ]])
37
  for key, value in ipairs(self.childrenAttr) do
38
    if value.active=="true" or value._index==self.active then
39
      self.htmlbuff:append('<li class="on">','\n')
40
    else
41
      self.htmlbuff:append('<li>','\n')
42
    end
43
    self.htmlbuff:append('<span class="',value.icon,'"></span>','\n')
44
    self.htmlbuff:append('<div class="text">',value.label,'</div>','\n')
45
    self.htmlbuff:append('</li>','\n')
46
  end
47
  self.htmlbuff:append([[
48
  </ul>
49
  </div>
50
  </div>
51
  ]])
52
  
53
  self.htmlbuff:append([[
54
  <script type="text/javascript">
55
    require(["wmTabbar","wmWebUI"],function(WmTabbar,WmWebUI) {
56
  ]])
57
  self.htmlbuff:append('  var wmTabbar = new WmTabbar("',self.id,'");','\n')
58
  self.htmlbuff:append('  wmTabbar.create();','\n')
59
  for key, value in ipairs(self.childrenAttr) do
60
    if value.action then
61
      self.htmlbuff:append('wmTabbar.addListener(',value._index,',function(){',value.action,';});','\n');
62
    end
63
  end
64
  self.htmlbuff:append([[
65
  });
66
   </script>
67
  ]])
68
end
69

70
function WmTabbar:addBottom(bottom)
71
  table.insert(self.bottoms, bottom)
72
end
73

74
function WmTabbar:addChildrenAttr(childrenAttr)
75
  childrenAttr._index = self.index
76
  self.index = self.index + 1
77
  table.insert(self.childrenAttr, childrenAttr)
78
end
79

80
return WmTabbar

+ 0 - 18
ipu-server/web/WEB-INF/lib/lua64/tag/WmTabbarItem.lua

@ -1,18 +0,0 @@
1
local Class = require("util.Class")
2
local Tag = require("engine.Tag")
3
local WmTabbarItem = Class(Tag)
4

5
function WmTabbarItem:createNew(obj,htmlbuff)
6
  self.htmlbuff=htmlbuff
7
end
8

9
function WmTabbarItem:doStartTag(attr)
10
  self.htmlbuff:append('<div class="nav">')
11
  self.parent:addChildrenAttr(attr)
12
end
13

14
function WmTabbarItem:doEndTag()
15
  self.htmlbuff:append('</div>')
16
end
17

18
return WmTabbarItem

+ 0 - 59
ipu-server/web/WEB-INF/lib/lua64/tag/WmTest.lua

@ -1,59 +0,0 @@
1
monitor:debug("------------------------")
2
monitor:debug(tostring("10"+1))
3
monitor:debug(10 ..1)
4
monitor:debug(tostring(#"123456"));-- # 长度操作符
5

6
a={};--所有未初始化的元素的索引都是nil,Lua将nil作为界定数组结尾的标志
7
a["x"] = 123;
8
a[0] = 343;
9
a.y = "yyyy";
10
monitor:debug(tostring(a["x"]))
11
monitor:debug(tostring(a.y))
12
monitor:debug(tostring(a[0]))
13
monitor:debug(tostring(#a))--#用于返回一个数组和线性表的最后一个索引值(key值,不是value值,只考虑索引值为数字格式的值)
14
for i=1,10 do
15
	a[i]=tostring(i*2)
16
	monitor:debug(a[i])
17
end--Lua将全局变量存储在table中
18
monitor:debug(tostring(a[#a]))--打印最后一项值
19
a[#a] = nil --删除最后一个值
20
a[#a+1] = "hahha"--添加到列表末尾
21
monitor:debug(tostring(#a))--
22
monitor:debug(tostring(#a))
23
monitor:debug(tostring(#a))
24
a[100] = "aad"
25
monitor:debug(tostring(table.maxn(a)))--包含“空隙”的数组的最大索引数
26

27
--比较运算符 == ~=(不等于) < > >= <= 不同的类型必定不相等(区分JS)对于table userdata和函数是比较引用是否相等
28
--只能对两个数字或两个字符串进行比较,字符串以字符次序比较 2<15 true  "2"<"15" false
29
--and or not  not只返回true或false
30
monitor:debug(tostring(4 and 5))
31
monitor:debug(tostring(nil and 13))
32
monitor:debug(tostring(false and 13))
33
monitor:debug(tostring(4 or 5))
34
monitor:debug(tostring(false or 5))
35
--短路求值
36
x = x or "eee";
37
monitor:debug(x)
38

39
if type(a)=="table" and a[100] =="aad" then
40
	monitor:debug("----lalalalal---")
41
end
42
h = 5
43
i = 7
44
max = h > i and h or i 
45
monitor:debug(tostring(max))
46
monitor:debug("------------------------")
47
local Class = require("util.Class")
48
local Tag = require("engine.Tag")
49
local WmTest = Class(Tag)
50

51
function WmTest:doStartTag(attr)
52
  return "123456789"
53
end
54

55
function WmTest:doEndTag()
56
  return "987654321"
57
end
58

59
return WmTest

BIN
ipu-server/web/WEB-INF/lib/lua64/util/Class.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/util/FileUtil.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/util/Set/init.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/util/StringBuilder.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/util/System.lua


BIN
ipu-server/web/WEB-INF/lib/lua64/util/TableUtil.lua


BIN
ipu-server/web/WEB-INF/lib/mysql-connector-java-5.1.6-bin.jar


BIN
ipu-server/web/WEB-INF/lib/ojdbc14.jar


BIN
ipu-server/web/WEB-INF/lib/pinyin4j-2.5.0.jar


BIN
ipu-server/web/WEB-INF/lib/poi-3.8.jar


BIN
ipu-server/web/WEB-INF/lib/poi-ooxml-3.8.jar


BIN
ipu-server/web/WEB-INF/lib/poi-ooxml-schemas-3.8.jar


BIN
ipu-server/web/WEB-INF/lib/sqlite-jdbc-3.8.7.jar


BIN
ipu-server/web/WEB-INF/lib/velocity-1.7.jar


BIN
ipu-server/web/WEB-INF/lib/wade-apache.jar


BIN
ipu-server/web/WEB-INF/lib/wade-common.jar


BIN
ipu-server/web/WEB-INF/lib/wade-database.jar


BIN
ipu-server/web/WEB-INF/lib/wade-mobile-data.jar


BIN
ipu-server/web/WEB-INF/lib/wade-mobile-server.jar


BIN
ipu-server/web/WEB-INF/lib/wade-sqlite-jdbc.jar


+ 0 - 15
multiple-client/project.properties

@ -1,15 +0,0 @@
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12

13
# Project target.
14
target=android-15
15
android.library.reference.1=..\\wade-mobile-lib

BIN
wade-mobile-common/.DS_Store


+ 0 - 0
wade-mobile-common/.classpath


+ 4 - 4
wade-mobile-common/.gitignore

@ -1,4 +1,4 @@
1
/.settings
2
/bin
3
/gen
4
/
1
/gen
2
/.DS_Store
3
/.settings
4
/bin

BIN
wade-mobile-common/libs/wade-mobile-com.jar


BIN
wade-mobile-common/libs/wade-mobile-func.jar


BIN
wade-mobile-common/res/drawable-mdpi/map_mark.png


+ 17 - 0
wade-mobile-common/res/drawable/activity_dialog_bg.xml

@ -0,0 +1,17 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:Android="http://schemas.android.com/apk/res/android" >
3

4
    <padding
5
        Android:bottom="5dp"
6
        Android:left="5dp"
7
        Android:right="5dp"
8
        Android:top="5dp" />
9
	<!-- 外边线 -->
10
    <stroke
11
        Android:width="2dip"
12
        Android:color="#544649" />
13
	
14
    <corners Android:radius="5dp" />
15
	<!-- 内线 -->
16
    <solid Android:color="#8A7479" />
17
</shape>

+ 16 - 0
wade-mobile-common/res/drawable/activity_dialog_bg2.xml

@ -0,0 +1,16 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:Android="http://schemas.android.com/apk/res/android" >
3
    <padding
4
        Android:bottom="5dp"
5
        Android:left="5dp"
6
        Android:right="5dp"
7
        Android:top="5dp" />
8
	<!-- 外边线 -->
9
    <stroke
10
        Android:width="1dip"
11
        Android:color="#D2AAAA" />
12
	<!-- 角上半径 -->
13
    <corners Android:radius="5dp" />
14
	<!-- 内线 -->
15
    <solid Android:color="#D2AAAA" />
16
</shape>

+ 38 - 38
wade-mobile-common/res/layout/scan_zxing_capture.xml

@ -1,39 +1,39 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="fill_parent"
4
    android:layout_height="fill_parent" >
5
6
    <SurfaceView
7
        android:id="@+id/preview_view"
8
        android:layout_width="wrap_content"
9
        android:layout_height="wrap_content"
10
        android:layout_gravity="center" />
11
    
12
    <RelativeLayout
13
        android:layout_width="match_parent"
14
        android:layout_height="match_parent"
15
        android:layout_gravity="center">
16
17
        <ImageButton
18
            android:id="@+id/btn_cancel_scan"
19
            android:layout_width="wrap_content"
20
            android:layout_height="wrap_content"
21
            android:layout_alignParentLeft="true"
22
            android:layout_alignParentTop="true"
23
            android:src="@drawable/scan_cancel_normal" />
24
25
        <ImageButton
26
            android:id="@+id/btn_flashlight"
27
            android:layout_width="wrap_content"
28
            android:layout_height="wrap_content"
29
            android:layout_alignParentRight="true"
30
            android:layout_alignParentTop="true"
31
            android:src="@drawable/scan_flashlight_off" />
32
33
        <com.wade.mobile.common.scan.view.ViewfinderView
34
	        android:id="@+id/viewfinder_view"
35
	        android:layout_width="wrap_content"
36
	        android:layout_height="wrap_content"/>
37
38
    </RelativeLayout>
1
<?xml version="1.0" encoding="utf-8"?>
2
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="fill_parent"
4
    android:layout_height="fill_parent" >
5

6
    <SurfaceView
7
        android:id="@+id/preview_view"
8
        android:layout_width="wrap_content"
9
        android:layout_height="wrap_content"
10
        android:layout_gravity="center" />
11
    
12
    <RelativeLayout
13
        android:layout_width="match_parent"
14
        android:layout_height="match_parent"
15
        android:layout_gravity="center">
16

17
        <ImageButton
18
            android:id="@+id/btn_cancel_scan"
19
            android:layout_width="wrap_content"
20
            android:layout_height="wrap_content"
21
            android:layout_alignParentLeft="true"
22
            android:layout_alignParentTop="true"
23
            android:src="@drawable/scan_cancel_normal" />
24

25
        <ImageButton
26
            android:id="@+id/btn_flashlight"
27
            android:layout_width="wrap_content"
28
            android:layout_height="wrap_content"
29
            android:layout_alignParentRight="true"
30
            android:layout_alignParentTop="true"
31
            android:src="@drawable/scan_flashlight_off" />
32

33
        <com.wade.mobile.common.scan.view.ViewfinderView
34
	        android:id="@+id/viewfinder_view"
35
	        android:layout_width="wrap_content"
36
	        android:layout_height="wrap_content"/>
37

38
    </RelativeLayout>
39 39
</FrameLayout>

BIN
wade-mobile-common/res/raw/beep.ogg


+ 32 - 32
wade-mobile-common/res/values/scan_zxing_colors.xml

@ -1,32 +1,32 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<resources>
3
  
4
  <color name="bg_color">#EDEDED</color>
5
  <color name="contents_text">#ff000000</color>
6
  <color name="encode_view">#ffffffff</color>
7
  <color name="help_button_view">#ffcccccc</color>
8
  <color name="help_view">#ff404040</color>
9
  <color name="possible_result_points">#c0ffff00</color>  
10
  <color name="result_image_border">#ffffffff</color>
11
  <color name="result_minor_text">#ffc0c0c0</color>
12
  <color name="result_points">#c000ff00</color>
13
  <color name="result_text">#ffffffff</color>
14
  <color name="result_view">#b0000000</color>
15
  <color name="sbc_header_text">#ff808080</color>
16
  <color name="sbc_header_view">#ffffffff</color>
17
  <color name="sbc_list_item">#fffff0e0</color>
18
  <color name="sbc_layout_view">#ffffffff</color>
19
  <color name="sbc_page_number_text">#ff000000</color>
20
  <color name="sbc_snippet_text">#ff4b4b4b</color>
21
  <color name="share_text">#ff000000</color>
22
  <color name="share_view">#ffffffff</color>
23
  <color name="status_view">#50000000</color>
24
  <color name="status_text">#ffffffff</color>
25
  <color name="transparent">#00000000</color>
26
  <color name="viewfinder_frame">#ff000000</color>
27
  <color name="viewfinder_laser">#ffff0000</color>
28
  <color name="viewfinder_mask">#60000000</color>
29
  <color name="header">#58567D</color>
30
  <color name="grgray">#686868</color>
31
      
32
</resources>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<resources>
3
  
4
  <color name="bg_color">#EDEDED</color>
5
  <color name="contents_text">#ff000000</color>
6
  <color name="encode_view">#ffffffff</color>
7
  <color name="help_button_view">#ffcccccc</color>
8
  <color name="help_view">#ff404040</color>
9
  <color name="possible_result_points">#c0ffff00</color>  
10
  <color name="result_image_border">#ffffffff</color>
11
  <color name="result_minor_text">#ffc0c0c0</color>
12
  <color name="result_points">#c000ff00</color>
13
  <color name="result_text">#ffffffff</color>
14
  <color name="result_view">#b0000000</color>
15
  <color name="sbc_header_text">#ff808080</color>
16
  <color name="sbc_header_view">#ffffffff</color>
17
  <color name="sbc_list_item">#fffff0e0</color>
18
  <color name="sbc_layout_view">#ffffffff</color>
19
  <color name="sbc_page_number_text">#ff000000</color>
20
  <color name="sbc_snippet_text">#ff4b4b4b</color>
21
  <color name="share_text">#ff000000</color>
22
  <color name="share_view">#ffffffff</color>
23
  <color name="status_view">#50000000</color>
24
  <color name="status_text">#ffffffff</color>
25
  <color name="transparent">#00000000</color>
26
  <color name="viewfinder_frame">#ff000000</color>
27
  <color name="viewfinder_laser">#ffff0000</color>
28
  <color name="viewfinder_mask">#60000000</color>
29
  <color name="header">#58567D</color>
30
  <color name="grgray">#686868</color>
31
      
32
</resources>

+ 31 - 31
wade-mobile-common/res/values/scan_zxing_ids.xml

@ -1,31 +1,31 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
 Copyright (C) 2008 ZXing authors
4
5
 Licensed under the Apache License, Version 2.0 (the "License");
6
 you may not use this file except in compliance with the License.
7
 You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
 Unless required by applicable law or agreed to in writing, software
12
 distributed under the License is distributed on an "AS IS" BASIS,
13
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 See the License for the specific language governing permissions and
15
 limitations under the License.
16
 -->
17
<resources>
18
  <!-- Messages IDs -->
19
  <item type="id" name="auto_focus"/>
20
  <item type="id" name="decode"/>
21
  <item type="id" name="decode_failed"/>
22
  <item type="id" name="decode_succeeded"/>
23
  <item type="id" name="encode_failed"/>
24
  <item type="id" name="encode_succeeded"/>
25
  <item type="id" name="launch_product_query"/>
26
  <item type="id" name="quit"/>
27
  <item type="id" name="restart_preview"/>
28
  <item type="id" name="return_scan_result"/>
29
  <item type="id" name="search_book_contents_failed"/>
30
  <item type="id" name="search_book_contents_succeeded"/>
31
</resources>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
 Copyright (C) 2008 ZXing authors
4

5
 Licensed under the Apache License, Version 2.0 (the "License");
6
 you may not use this file except in compliance with the License.
7
 You may obtain a copy of the License at
8

9
      http://www.apache.org/licenses/LICENSE-2.0
10

11
 Unless required by applicable law or agreed to in writing, software
12
 distributed under the License is distributed on an "AS IS" BASIS,
13
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 See the License for the specific language governing permissions and
15
 limitations under the License.
16
 -->
17
<resources>
18
  <!-- Messages IDs -->
19
  <item type="id" name="auto_focus"/>
20
  <item type="id" name="decode"/>
21
  <item type="id" name="decode_failed"/>
22
  <item type="id" name="decode_succeeded"/>
23
  <item type="id" name="encode_failed"/>
24
  <item type="id" name="encode_succeeded"/>
25
  <item type="id" name="launch_product_query"/>
26
  <item type="id" name="quit"/>
27
  <item type="id" name="restart_preview"/>
28
  <item type="id" name="return_scan_result"/>
29
  <item type="id" name="search_book_contents_failed"/>
30
  <item type="id" name="search_book_contents_succeeded"/>
31
</resources>

+ 105 - 21
wade-mobile-func/src/com/wade/mobile/func/MobileNetWork.java

@ -1,5 +1,7 @@
1 1
package com.wade.mobile.func;
2 2

3
import java.io.File;
4
import java.io.InputStream;
3 5
import java.util.HashMap;
4 6
import java.util.HashSet;
5 7
import java.util.Map;
@ -8,6 +10,7 @@ import org.json.JSONArray;
8 10

9 11
import android.bluetooth.BluetoothAdapter;
10 12
import android.content.Intent;
13
import android.os.AsyncTask;
11 14
import android.os.Build;
12 15
import android.widget.Toast;
13 16

@ -31,9 +34,13 @@ import com.wade.mobile.safe.MobileSecurity;
31 34
import com.wade.mobile.util.BusinessCache;
32 35
import com.wade.mobile.util.Constant;
33 36
import com.wade.mobile.util.EscapeUnescape;
37
import com.wade.mobile.util.FileUtil;
34 38
import com.wade.mobile.util.FuncConstant;
39
import com.wade.mobile.util.Messages;
35 40
import com.wade.mobile.util.StringUtil;
41
import com.wade.mobile.util.Utility;
36 42
import com.wade.mobile.util.http.HttpTool;
43
import com.wade.mobile.util.http.UnirestUtil;
37 44

38 45
public class MobileNetWork extends Plugin {
39 46
	private boolean hasSetSmsListener;
@ -192,34 +199,40 @@ public class MobileNetWork extends Plugin {
192 199
		}
193 200
	}
194 201

195
	@SuppressWarnings({ "rawtypes", "static-access" })
202
	@SuppressWarnings({ "static-access" })
196 203
	private String requestBizData(String dataAction, IData param) throws Exception {
197
		Map<String,String> postParam = new HashMap<String,String>();
198
		postParam.put(Constant.Server.ACTION, dataAction);
204
		Map<String,String> postData = transPostData(dataAction, param);
205
		String encode = MobileConfig.getInstance().getEncode();
206
		String dataUrl = HttpTool.toQueryString(postData);
207
		dataUrl = HttpTool.urlEncode(dataUrl, encode);
208
		String result = HttpTool.httpRequest(MobileConfig.getInstance().getRequestUrl(),
209
				dataUrl, Constant.HTTP_POST);
199 210
		if (ServerDataConfig.getInstance().isEncrypt(dataAction)) {
200
			String paramData = param == null ? "{}" : param.toString();
211
			result = MobileSecurity.responseDecrypt(result);
212
		}
213
		return result;
214
	}
215
	
216
	public Map<String, String> transPostData(String dataAction, IData dataParam) throws Exception {
217
		// TODO Auto-generated method stub
218
		Map<String, String> postData = new HashMap<String, String>();
219
		postData.put(Constant.Server.ACTION, dataAction);
220
		if (ServerDataConfig.isEncrypt(dataAction)) {
221
			String paramData = dataParam == null ? "{}" : dataParam.toString();
201 222
			/* 参数加密处理 */
202 223
			String encryptData = MobileSecurity.requestEncrypt(paramData);
203 224
			String key = MobileSecurity.getDesKey(context);
204 225
			/* 将+号全部转换成-号 */
205 226
			encryptData = encryptData.replace("+", "-");
206 227
			key = key.replace("+", "-");
207
			postParam.put(Constant.Server.DATA, encryptData);
208
			postParam.put(Constant.Server.KEY, key);
228
			postData.put(Constant.Server.DATA, encryptData);
229
			postData.put(Constant.Server.KEY, key);
209 230
		} else {
210
			if (param != null) {
211
				postParam.put(Constant.Server.DATA, param.toString());
231
			if (dataParam != null) {
232
				postData.put(Constant.Server.DATA, dataParam.toString());
212 233
			}
213 234
		}
214

215
		String encode = MobileConfig.getInstance().getEncode();
216
		String qs = HttpTool.toQueryString(postParam);
217
		String data = HttpTool.urlEncode(qs, encode);
218
		String result = HttpTool.httpRequest(MobileConfig.getInstance().getRequestUrl(), data, Constant.HTTP_POST);
219
		if (ServerDataConfig.getInstance().isEncrypt(dataAction)) {
220
			result = MobileSecurity.responseDecrypt(result);
221
		}
222
		return result;
235
		return postData;
223 236
	}
224 237

225 238
	public void storageDataByThread(JSONArray param) throws Exception {
@ -292,16 +305,87 @@ public class MobileNetWork extends Plugin {
292 305
	}
293 306
	
294 307
	public void uploadWithServlet(JSONArray param) throws Exception {
295
		
296 308
		JSONArray filePaths = param.getJSONArray(0);
297 309
		String dataAction = param.getString(1);
298
		String dataParam = param.getString(2);
310
		IData dataParam = isNull(param.getString(2))?new DataMap():new DataMap(param.getString(2));
299 311
		uploadWithServlet(filePaths, dataAction, dataParam);
300 312
	}
301 313
	
302
	public void uploadWithServlet(JSONArray filePaths, String dataAction, String dataParam) {
314
	public void uploadWithServlet(final JSONArray filePaths, String dataAction, IData dataParam) throws Exception {
303 315
		// TODO Auto-generated method stub
304
		
316
		final Map<String, String> postData = transPostData(dataAction, dataParam);
317
		final Map<String, Object> filePostData = new HashMap<String, Object>();
318
		filePostData.putAll(postData);//先装载参数
319
		new AsyncTask<String, Integer, String>() {
320
			@Override
321
			protected String doInBackground(String... arg0) {
322
				// TODO Auto-generated method stub
323
				String result = null;
324
				try{
325
					String filePath = null;
326
					File file;
327
					for(int i=0;i<filePaths.length();i++){
328
						filePath = filePaths.getString(i);
329
						file = new File(filePath);
330
						if(!file.exists()){
331
							Utility.error(Messages.FILE_NOT_EXIST+":"+filePath);
332
						}
333
						filePostData.put("FILE"+i, filePath);//再装载文件
334
					}
335
					result = UnirestUtil.uploadByPost(MobileConfig.getInstance().getRequestUrl(), filePostData);
336
				}catch(Exception e){
337
					MobileNetWork.this.error(e.getMessage());// 报错回调
338
				}
339
				return result;
340
			}
341
			
342
			@Override
343
			protected void onPostExecute(String result) {
344
				// TODO Auto-generated method stub
345
				super.onPostExecute(result);
346
				if (result != null) {
347
					MobileNetWork.this.callback(result);// 正常回调
348
				}
349
			}
350
		}.execute();
351
	}
352
	
353
	public void downloadWithServlet(JSONArray param) throws Exception {
354
		String savePath = param.getString(0);
355
		String dataAction = param.getString(1);
356
		IData dataParam = param.getString(2)==null?new DataMap():new DataMap(param.getString(2));
357
		downloadWithServlet(savePath, dataAction, dataParam);
358
	}
359
	
360
	public void downloadWithServlet(final String savePath, String dataAction, IData dataParam) throws Exception {
361
		// TODO Auto-generated method stub
362
		Map<String, String> tempPostData = transPostData(dataAction, dataParam);
363
		final Map<String, Object> postData = new HashMap<String, Object>();
364
		postData.putAll(tempPostData);
365
		new AsyncTask<String, Integer, String>() {
366
			@Override
367
			protected String doInBackground(String... arg0) {
368
				// TODO Auto-generated method stub
369
				String result = null;
370
				try{
371
					InputStream in = UnirestUtil.downloadByPost(MobileConfig.getInstance().getRequestUrl(), postData);
372
					FileUtil.writeFile(in, savePath);
373
					result = "下载成功";
374
				}catch(Exception e){
375
					MobileNetWork.this.error(savePath + "异常:"+e.getMessage());// 报错回调
376
				}
377
				return result;
378
			}
379
			
380
			@Override
381
			protected void onPostExecute(String result) {
382
				// TODO Auto-generated method stub
383
				super.onPostExecute(result);
384
				if (result != null) {
385
					MobileNetWork.this.callback(result);// 正常回调
386
				}
387
			}
388
		}.execute();
305 389
	}
306 390

307 391
	public void uploadFile(JSONArray param) throws Exception {

+ 0 - 0
wade-mobile-lib/.classpath


+ 4 - 4
wade-mobile-lib/.gitignore

@ -1,4 +1,4 @@
1
/.settings
2
/bin
3
/gen
4
/
1
/gen
2
/.DS_Store
3
/.settings
4
/bin

BIN
wade-mobile-lib/libs/pinyin4j-2.5.0.jar


BIN
wade-mobile-lib/libs/unirest-java-1.3.2-SNAPSHOT-withDependency-ShadedForAndroid.jar