增加浏览器判断提示升级猎豹

This commit is contained in:
luolei 2014-09-05 19:22:13 +08:00
parent 63472c2d22
commit da76812684
2 changed files with 35 additions and 16 deletions

View File

@ -12,11 +12,11 @@
target.encode = function(data) {
var buf = [];
var map = base64Map;
var n = data.length; //总字节数
var val; //中间值
var n = data.length; //总字节数
var val; //中间值
var i = 0;
/*
/*
* 3字节 ==> val ==> 4字符
*/
while (i < n) {
@ -31,9 +31,9 @@
i += 3;
}
if (n % 3 == 1) //凑两个"="
if (n % 3 == 1) //凑两个"="
buf.pop(), buf.pop(), buf.push('=', '=');
else //凑一个"="
else //凑一个"="
buf.pop(), buf.push('=');
return buf.join('');
@ -42,17 +42,17 @@
var buf = [];
var arr = str.split('');
var map = base64DeMap;
var n = arr.length; //总字符数
var val; //中间值
var n = arr.length; //总字符数
var val; //中间值
var i = 0;
/*
/*
* 长度异常
*/
if (n % 4)
return null;
/*
/*
* 4字符 ==> val ==> 3字节
*/
while (i < n) {
@ -67,7 +67,7 @@
i += 4;
}
/*
/*
* 凑字字符"="个数
*/
while (arr[--n] == '=')
@ -94,7 +94,7 @@
})();
var bootStrap = (function() {
var def = $.Deferred();
// alert(typeof __TicketJavaScriptObject__);
var isAndroid = typeof(__TicketJavaScriptObject__) !== 'undefined';
@ -160,7 +160,7 @@ var bootStrap = (function() {
try{
deviceObject.toast('刷票成功,请尽快订票');
}catch(e){
}
} else if (window.liebaoExtentions && window.liebaoExtentions.vibrate) {
window.liebaoExtentions.vibrate(5000);
@ -684,4 +684,14 @@ bootStrap.done(function() {
MyRemind.init();
Remind.init();
OrderList.init();
if(isIos){
Public.confirm('升级到手机猎豹极速版,更轻、更快、更安全!',Public.updateIos,'立刻升级');
}
if(window.navigator.userAgent.indexOf('Android') > -1){
if(window.navigator.userAgent.indexOf('LieBaoFast') == -1 ){
Public.confirm('升级到手机猎豹极速版,更轻、更快、更安全!',Public.updateAndroid,'立刻升级');
}
}
});

View File

@ -90,16 +90,16 @@ var Public = {
return false;
}
});
//全局外部链接跳转
if(bootStrap.isAndroid || bootStrap.isIos){
$(".jump_link").live('click', function(){
$(".jump_link").live('click', function(){
bootStrap.open_url($(this).attr('rel'));
});
});
}else{
$(".jump_link").hide();
}
},
user: '',
isLogin: false,
@ -455,5 +455,14 @@ var Public = {
$('#date_tip').attr('class', 'tip_small');
}
}
},
updateIos : function(url){
window.location.href = url || 'https://itunes.apple.com/cn/app/id641522896' ;
},
updateAndroid : function(url){
window.location.href = url || 'http://dl.liebao.cn/android/fast/cheetah_2.11.0.apk';
}
}