調(diào)用打電話接口
var phone =$('#phonecall').val();
window.location.href = "tel:" + phone;
調(diào)用發(fā)短信接口
//用戶的電話號碼
var phone =$('#messagecall').val();
//發(fā)送短信的內(nèi)容
var name=$('.message_content').html();
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1
|| u.indexOf('Linux') > -1; //android終端或者uc瀏覽器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
|| u.indexOf('iPhone') > -1; //ios終端
if (isAndroid) {
var sendcontent = 'sms:' + phone + '?body='+name;//android ///
window.location.href = sendcontent;
} else if (isiOS) {
var sendcontent = 'sms:' + phone + '&body='+name;//ios ///
window.location.href = sendcontent;
} else {
var sendcontent = 'sms:' + phone + '?body='+name;//android ///
window.location.href = sendcontent;
}
}