yangbiao 9 years ago
parent
commit
e132920115

+ 2 - 0
ipu-client/assets/mobile-action.xml

@ -100,4 +100,6 @@
100 100
	<action name="unregisterForPush" class="com.ai.mobile.im.func.MobilePush" method="unregisterForPush"></action>
101 101
	<action name="sendText" class="com.ai.mobile.im.func.MobilePush" method="sendText"></action>
102 102
	<action name="setCallbackForPush" class="com.ai.mobile.im.func.MobilePush" method="setCallbackForPush"></action>
103
	
104
	<action name="openBrowser" class="com.ipu.func.Util" method="openBrowser" ></action>
103 105
</actions>

+ 22 - 0
ipu-client/src/com/ipu/func/Util.java

@ -0,0 +1,22 @@
1
package com.ipu.func;
2
3
import org.json.JSONArray;
4
5
import android.content.Intent;
6
import android.net.Uri;
7
8
import com.wade.mobile.frame.IWadeMobile;
9
import com.wade.mobile.frame.plugin.Plugin;
10
11
public class Util extends Plugin {
12
	public Util(IWadeMobile wademobile) {
13
		super(wademobile);
14
	}
15
16
	public void openBrowser(JSONArray param) throws Exception {
17
		String url = param.getString(0);
18
		Uri uri = Uri.parse(url);
19
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
20
		context.startActivity(intent);
21
	}
22
}

+ 6 - 1
ipu-server/web/biz/js/Index.js

@ -43,7 +43,12 @@ require([ "mobile", "jquery", "common","jcl","wadeMobile" ], function(Mobile, $,
43 43
				});
44 44
			} else {
45 45
				obj.click(function() {
46
					Common.openPage(action);
46
					//Common.openPage(action);
47
					alert("即将打开网页");
48
					WadeMobile.openBrowser("http:www.baidu.com",function(msg){
49
						alert("打开异常:" + msg);
50
					});
51
					alert("打开成功");
47 52
				});
48 53
			}
49 54
		}

+ 2 - 0
ipu-server/web/res/js/mobile/expand-mobile.js

@ -213,6 +213,8 @@ define(["require"],function(require) {
213 213
				execute("sendText", [account,content],err);
214 214
			},setCallbackForPush:function(callbackName){
215 215
				execute("setCallbackForPush", [callbackName]);
216
			},openBrowser:function(url,err){
217
				execute("openBrowser",[url],err);
216 218
			}
217 219
		};
218 220
	})();