-
Notifications
You must be signed in to change notification settings - Fork 1
/
callapp.js
167 lines (160 loc) · 14.2 KB
/
callapp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
* @模块功能 App 唤醒
* @调用 lib.callapp(o);
* @功能描述 调用后 先唤醒app 如果用户手机没装app 则跳到下载地址 如果是在微信 则弹出提示 引导用户用浏览器打开
*
* @参数说明:
* @o [传入一个对象o 对象可接受 schemeUrl dowmloadUrl scheme package 四个参数]
* @o.schemeUrl app打开协议
* @o.dowmloadUrl app下载地址
* @o.scheme app的scheme【app开发人员提供】【https://developer.chrome.com/multidevice/android/intents】
* @o.package app 安卓包名【app开发人员提供】【https://developer.chrome.com/multidevice/android/intents】
* @author 庄焕滨
*
* @备注 安卓和ios的协议必须保持一致
* @备注 太平洋汽车网客户端APP scheme=pcautobrowser package=cn.com.pcauto.android.browser
* @备注 有问题联系 [email protected]
*/
;(function(win, lib) {
if (lib.callapp) return;
var ua = navigator.userAgent;
var browser = {
isSafari: /Version\/[\d\.]+.*Safari/.test(ua),
// isChrome: /Chrome/i.test(ua),
chromeV: ua.match(/Chrome\/(\d+)/),
isAndroid: /Android/i.test(ua),
isIOS: /iPhone|iPad|iPod/i.test(ua),
isWechat: /MicroMessenger/i.test(ua),
iosVersion: function () {
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
}
return null;
}
};
function customClickEvent() {
var clickEvt;
if (win.CustomEvent) {
clickEvt = new win.CustomEvent("click", {
canBubble: true,
cancelable: true
});
} else {
clickEvt = document.createEvent("Event");
clickEvt.initEvent("click", true, true);
}
return clickEvt;
}
/**
* 插入微信提示
*/
function writeWechatTip() {
var JwechatTip = document.getElementById("JwechatTip");
if (!JwechatTip) {
var styleInner = [
".wechat-tip{overflow:hidden;width:100%;height:100%;position:fixed;left:0px;top:0px;background-color:#efeff4;z-index:99999;}",
".wechat-tip-inner{position:relative;margin:0 auto;width:260px;height:210px;top:10%;overflow:hidden;text-align:center;}",
".wechat-tip-tit{margin:0;font-size:18px;font-weight:700;color:#333;margin-bottom:20px;line-height:30px;}",
".wechat-tip-step{overflow:hidden;position:relative;}",
".wechat-tip-step-l{float:left;width:120px;}",
".wechat-tip-step-r{float:right;width:120px;}",
".wechat-tip-step-m{width:10px;height:10px;position:absolute;top:30px;left:50%;margin-left:-6px;border-top:3px solid #63B5F6;border-right:3px solid #63B5F6;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);}",
".wechat-tip-step-more-android,.wechat-tip-step-more-ios,.wechat-tip-step-web-android,.wechat-tip-step-web-ios{width:40px;height:40px;margin:0px auto 10px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAABgFBMVEUAAAD///////////////+VlqstLTD///+Yma3+/v////////8uLjGWl6z///8wMDMuLjGVlqsuLjGVlqv///+VlquVlqsvLzL///+VlqsuLjH+/v7///+VlqsuLjH////+/v4uLjH///////8vLzKVlqwsLC+VlqsvLzKXmKz////f4OaVlqsuLjH///8xMTT9/f0xMTQuLjEhJin6+vkamPf///8FCQwSFhkAivYMkvfw8fSXmK3p6eqJiqHh4uSPkKdMUFJWV1k/Q0WDhJ3Y2dvCw8Q3OTx4wfeRlJWIiozQ0tObnZ+rr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mp79tpozXn1IlyxHdkeXgy3g5D6twrRKYm4K04h9Wfp+6WPrUTT+ael8WpRX/1JXSfIhzxezywuYj33yQ0g7S3IAYx9tH1XLQdhBk7SApDbr4WlBm5l4SXIPOe8sUaMs0Gd6YWXU5Dq5lKqOJHdfu5PIgUdXEljFWmIXfSr1yI4bKsYKIQY+eOyt4JmlF9jk76NF8msaCjN6waPRGdjnFsfkMZ9zozf8wFHPD0DVdDlq16zUsHYYKGU/H5AcuzBSbjqfBGk97JwzAQYQB/YeUMIAWYcA7hQMPo3BoJA6FAywKR/tINf5pTnAkzQltmlMbiWfeqYB4HBUQbCpgO8mZp6PLRrvTZSOHSIgJXVYAgRlqITALoJQj6NibUo4ZDkMpbzPJ35/sQh0ku3AjkV2IEsLA7kIYhJwQpu3SJMFisTiIWEyUfI9isQJUkWQ0le/JElSi+eYCzZcrqJQoca1Eg4BU4hpcnInomKhf86JjuTJwZ3HcRaIycLnCfEbTnhPmS7ZKcDAwVgnnZV5hB9rmFeLtRFwZu/2jYydyNgYvaJ+7xODlf1vutMgEqUW2VJlRWAyGgqjZKEyD0WiyeDQgtFFYvc5tvc5kNB30r3T0B9PRpNO7vK3bua17PR5q67YgCG60ddtwfN3d2bvtD9hMskHz6d2NAAAAAElFTkSuQmCC);-webkit-background-size:80px;background-size:80px;}",
".wechat-tip-step-more-android{background-position:0px 0px;}",
".wechat-tip-step-web-android{background-position:-40px 0px;}",
".wechat-tip-step-more-ios{background-position:0px -40px;}",
".wechat-tip-step-web-ios{background-position:-40px -40px;}",
".wechat-tip-step-tit{margin:0;font-size:16px;font-weight:bold;line-height:30px;color:#666;}",
".wechat-tip-step-des{margin:0;font-size:12px;color:#666;line-height:20px;}"
].join("");
var styleEle = document.createElement("style");
styleEle.type = "text/css";
styleEle.appendChild(document.createTextNode(styleInner));
document.getElementsByTagName("head")[0].appendChild(styleEle);
var divEle = document.createElement("div");
divEle.className = "wechat-tip";
divEle.id = "JwechatTip";
if (browser.isIOS) {
var wechatMoreClass = "wechat-tip-step-more-ios";
var wechatWebClass = "wechat-tip-step-web-ios";
var wechatTip = "选择在Safari中打开";
} else {
var wechatMoreClass = "wechat-tip-step-more-android";
var wechatWebClass = "wechat-tip-step-web-android";
var wechatTip = "选择在浏览器中打开";
};
var html= '<div class="wechat-tip-inner">'
+ '<p class="wechat-tip-tit">请按照下面的示意图操作打开<br>葫芦里 App</p>'
+ '<div class="wechat-tip-step">'
+ '<div class="wechat-tip-step-l">'
+ '<div class="'+wechatMoreClass+'"></div>'
+ '<p class="wechat-tip-step-tit">第 1 步</p><p class="wechat-tip-step-des">点击右上角「更多」</p>'
+ '</div>'
+ '<div class="wechat-tip-step-m"></div>'
+ '<div class="wechat-tip-step-r">'
+ '<div class="'+wechatWebClass+'"></div>'
+ '<p class="wechat-tip-step-tit">第 2 步</p><p class="wechat-tip-step-des">'+wechatTip+'</p>'
+ '</div>'
+ '</div>'
+ '</div>'
divEle.innerHTML = html;
document.body.appendChild(divEle);
divEle.addEventListener("click",function(){
divEle.style.display = "none";
},false);
}else {
JwechatTip.style.display = "block";
};
}
var p = (browser.chromeV && browser.chromeV[1]) >= 25 && browser.isAndroid;
var q = browser.isAndroid && !!ua.match(/samsung/i);
var r = browser.isSafari && ua.indexOf("OS 9_") > -1;
lib.callapp = function(o) {
if (!o || typeof(o) != "object") return;
// 如果是微信 显示微信提示
// if (browser.isWechat) {
// writeWechatTip();
// return false;
// }
if (typeof(o.dowmloadUrl) != "undefined" && o.dowmloadUrl != "") {
var time = r ? 2500 : 1000;//如果是ios9,则停留时间长一点,让用户有时间选择打开。
var d = Date.now();
var timeload = setTimeout(function() {
var c = Date.now();
if (c - d < time + 200) {
win.location.href = o.dowmloadUrl;
}
}, time);
};
if (typeof(o.scheme) == "undefined" || o.scheme == "") return;
if (typeof(o.package) == "undefined" || o.package == "") return;
if (typeof(o.schemeUrl) != "undefined" && o.schemeUrl != "") {
if (r) {
// iOS 9 do not support custom protocal in iframe src
// http://stackoverflow.com/questions/31891777/ios-9-safari-iframe-src-with-custom-url-scheme-not-working
setTimeout(function() {
var JopenScheme = document.getElementById("JopenScheme");
if (!JopenScheme) {
JopenScheme = document.createElement("a");
JopenScheme.id = "JopenScheme";
JopenScheme.style.display = "none";
document.body.appendChild(JopenScheme);
}
JopenScheme.href = o.schemeUrl;
JopenScheme.dispatchEvent(customClickEvent());
}, 100);
} else if (p || q) {
o.schemeUrl = o.schemeUrl.replace(/pcautobrowser:/,"intent:") + "#Intent;scheme=" + o.scheme + ";package=" + o.package + ";end";
setTimeout(function() {
win.location.href = o.schemeUrl;
}, 100);
} else {
var ifr = document.createElement("iframe");
ifr.src = o.schemeUrl;
ifr.style.display = "none";
document.body.appendChild(ifr);
};
};
}
})(window, window.lib || (window.lib = {}));