//分享接口 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 + "[email protected]@@[email protected]@@"+shareUrl+"@@@"+shareImg+"@@@"+shareTll+"@@@"+shareInfo+""; }
原文地址:https://www.cnblogs.com/vinn7/p/8124534.html
时间: 2024-10-01 06:58:42