|
- define(function(require){
- require("cordova!cordova-plugin-customurlscheme");
- var Model = function(){
- this.callParent();
- this.eventName = new Date().getTime() + "";
- $(window).on('handleOpenURL.'+this.eventName,this.handleOpenURL);
-
- var u = navigator.userAgent, app = navigator.appVersion;
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; // android终端或者uc浏览器
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
- if (isIOS) {
- // var ifr = document.createElement('iframe');
- // ifr.src = 'x5xxpt://';
- // ifr.style.display = 'none';
- // document.body.appendChild(ifr);
- // window.setTimeout(function() {
- // document.body.removeChild(ifr);
- // //window.location.href = "http://192.168.100.13:8080/x5/UI2/v_/IntegratedApp/mobile/xfj/download.html";
- // }, 2000);
- }
- if (isAndroid) {
- var ifr = document.createElement('iframe');
- ifr.src = 'x5xxpt://';
- ifr.style.display = 'none';
- document.body.appendChild(ifr);
- window.setTimeout(function() {
- document.body.removeChild(ifr);
- },2000);
- }
- };
-
- Model.prototype.modelUnLoad = function(event) {
- if (this._updateDateTimeHandle)
- window.clearInterval(this._updateDateTimeHandle);
- $(window).off("handleOpenURL." + this.eventName);
- };
- // 在此接收URL参数
- Model.prototype.handleOpenURL = function(event, url) {
- justep.Util.hint("接收到URL参数: " + url);
- // justep.Util.hint("开发者现在可以根据接收到的URL参数进行不同的处理,在此并不在做展示");
- };
- return Model;
- });
复制代码 我在index.w页面写的,用浏览器扫二维码以前是在网页上运行网页版APP,现在能打开APP了,但是没有传参没弹出justep.Util.hint("接收到URL参数: " + url);
|
|