lines-num-old"> 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 {

+ 48 - 1
wade-mobile-func/src/com/wade/mobile/func/MobileUI.java

@ -23,7 +23,6 @@ import android.widget.LinearLayout;
23 23

24 24
import com.ailk.common.data.IData;
25 25
import com.ailk.common.data.impl.DataMap;
26
import com.litesuits.android.log.Log;
27 26
import com.wade.mobile.common.MobileLog;
28 27
import com.wade.mobile.common.contacts.activity.ContactsActivity;
29 28
import com.wade.mobile.common.contacts.helper.ContactsData;
@ -182,6 +181,54 @@ public class MobileUI extends Plugin{
182 181
		return ((TemplateWebView)getWebView()).getTemplate(templatePath, data);
183 182
	}
184 183
	
184
	public void getPage(JSONArray param) throws Exception {
185
        String pageAction = param.getString(0);
186
        String data = param.getString(1);
187
        boolean isEscape = "true".equals(param.getString(2)) ? true : false;
188
        String html = getPage(pageAction, isNull(data)?null:new DataMap(data));
189
        if (isEscape) {
190
            html = EscapeUnescape.escape(html);
191
        }
192
        callback(html);
193
    }
194
	
195
    public String getPage(String pageAction,DataMap param) throws Exception{
196
        /*获取模板相对路径*/
197
        String templatePath = ServerPageConfig.getTemplate(pageAction);
198
        if(templatePath==null||"".equals(templatePath)){
199
            Utility.error(Messages.NO_TEMPLATE + ",Action:" + pageAction);
200
        }
201
        
202
        IData data = null;
203
        /*载入业务数据*/
204
        String dataAction = ServerPageConfig.getData(pageAction);
205
        if(dataAction!=null){
206
            MobileNetWork MobileNetWork = wademobile.getPluginManager().getPlugin(MobileNetWork.class);
207
            String result = MobileNetWork.dataRequest(dataAction, param);// 打开页面时请求业务数据
208
            data = new DataMap(result);
209
            if(data.getInt("X_RESULTCODE")<0){
210
                error(data.toString());
211
                return null;
212
            }
213
        }
214
        /*String serverDataAction = ServerPageConfig.getData(pageAction);
215
        String className = ServerDataConfig.getActionClass(serverDataAction);
216
        String methodName = ServerDataConfig.getActionMethod(serverDataAction);
217
        // new一个className 调用里面的method 得到resule的dataMap
218
        Class clz = Class.forName(className);
219
        Object obj = clz.newInstance();
220
        //获取方法  
221
        Method m = obj.getClass().getDeclaredMethod(methodName, String.class);
222
        //调用方法  
223
        String result = (String) m.invoke(obj, data);
224
        JSONObject  jasonObject = (JSONObject) JSONObject.stringToValue(result);
225
        Map map = (Map)jasonObject;
226
        if(templatePath==null||"".equals(templatePath)){
227
            Utility.error(Messages.NO_TEMPLATE);
228
        }*/
229
        return ((TemplateWebView)getWebView()).getTemplate(templatePath, data);
230
    }
231
	
185 232
	/************************多WebView 开始*****************************/
186 233
	private TemplateWebView initFlipperPage(String pageAction, boolean isAnimation) {
187 234
		// TODO Auto-generated method stub

+ 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


BIN
wade-mobile-library/common/wade-mobile-server.jar


更新应用图标 · ad235c5888 - Nuosi Git Service
瀏覽代碼

更新应用图标

liuyf23 2 年之前
父節點
當前提交
ad235c5888

二進制
superapp-client/app/src/main/res/drawable-hdpi/ic_launcher.png


二進制
superapp-client/app/src/main/res/drawable-xhdpi/ic_launcher.png


二進制
superapp-client/app/src/main/res/drawable-xxhdpi/ic_launcher.png