Commit 3a146412 by dabai

cdn

parent 5e963e91
Showing with 65 additions and 0 deletions
$.ajaxSetup({
global: false,
type: 'post',
dataType: "JSON",
data: {
os: 'WEB',
cid: 'web_gw',
lang: 2,
uid: url_get_params().uid,
token: url_get_params().token
}
})
//時間加0
function add0(m) {
return m < 10 ? '0' + m + "" : m + ""
}
//获取url参数
function url_get_params() {
var url = location.href;
var theRequest = new Object();
if(url.indexOf("?") != -1) {
var str = url.substr(url.indexOf("?") + 1);
strs = str.split("&");
for(var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
function close() {
var obj = {
"cid": 14,
"reqCode": new Date().getTime(),
"data": {
"msg": '關閉半屏網頁',
}
}
var obj2 = JSON.stringify(obj);
appCollaboration(obj2);
}
function appCollaboration(msg) {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
if(!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {} else if(bIsAndroid) {
window.yazhai.appCollaboration(msg);
} else if(bIsIphoneOs || bIsIpad) {
window.webkit.messageHandlers.appCollaboration.postMessage(msg);
}
}
//客户端回调结果
function appCallback(msg) {
console.log(msg);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment