码迷,mamicode.com
首页 > 移动开发 > 详细

App内嵌H5页面联调接口

时间:2017-12-27 12:00:39      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:==   share   etl   func   安卓   else   navig   window   each   

//分享接口
function ShareLp(query,pkid){
	
	var shareUrl="";
	var shareImg="";
	var shareTll="";
	var shareInfo="";


	var u = navigator.userAgent;
	var isAndroid = u.indexOf(‘Android‘) > -1 || u.indexOf(‘Adr‘) > -1; //android终端
	var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
	
	if(isAndroid==true){
		shareAndroid(shareUrl,shareImg,shareTll,shareInfo);
	}else if(isIOS==true){
		ShareIOS(shareUrl,shareImg,shareTll,shareInfo);
	}
	
}

function shareAndroid(shareUrl,shareImg,shareTll,shareInfo){
	 window.schoolhealth.callAppFunc("",shareUrl,shareImg,shareTll,shareInfo);//安卓要求五个参数,多传了个空值
	
}

function ShareIOS(shareUrl,shareImg,shareTll,shareInfo){
	window.location.href = url + "?method=teachIndex@@@ShareCanvas@@@"+shareUrl+"@@@"+shareImg+"@@@"+shareTll+"@@@"+shareInfo+"";
	
}

  

App内嵌H5页面联调接口

标签:==   share   etl   func   安卓   else   navig   window   each   

原文地址:https://www.cnblogs.com/vinn7/p/8124534.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!