|
楼主 |
发表于 2017-9-25 14:10:39
|
显示全部楼层
本帖最后由 qweasdzxc 于 2017-9-25 14:19 编辑
- define(function(require) {
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
- require("cordova!cordova-plugin-customurlscheme");
- var url;
- var Model = function() {
- this.callParent();
-
- this.eventName = new Date().getTime() + "";
- $(window).on('handleOpenURL.'+this.eventName,this.handleOpenURL);
-
- var info=window.location.href;
- var b=info.split("$model/UI2");
- url = "x5/UI2/v_"+b[b.length-1];
-
- };
-
- Model.prototype.modelModelConstructDone = function(event){
- if (justep.Browser.isIOS) {
- var ifr = document.createElement('iframe');
- ifr.src = 'x5xxpt://';
- ifr.style.display = 'none';
- document.body.appendChild(ifr);
- window.setTimeout(function() {
- document.body.removeChild(ifr);
- }, 2000);
- }
- if (justep.Browser.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);
- }
- $(window).off("handleOpenURL." + this.eventName);
- };
- // 在此接收URL参数
- Model.prototype.handleOpenURL = function(event, url) {
- alert(url);
- justep.Util.hint("接收到URL参数: " + url);
- // justep.Util.hint("开发者现在可以根据接收到的URL参数进行不同的处理,在此并不在做展示");
- };
- return Model;
- });
复制代码 这样也不执行啊,具体分别放到什么事件中?
|
|