安卓苹果手机不同qq客服在线代码
发布时间:2016-01-16, 12:32:39 分类:HTML | 编辑 off 网址 | 辅助
图集1/1
正文 3645字数 722,195阅读
<!--客服-->
<style>
.zixun1{width:83px; height:85px; position:fixed; right:5px; bottom:10px;}
.zixun2{width:42px; height:42px; position:fixed; right:5px; bottom:10px;}
</style>
<div class="zixun1" style=" z-index: 999;"><img src="http://mresonancecomcn.test.resonance.net.cn//GZphp/Tpl/Home/Default/Public/images/zixun1.png" width="83" height="85" usemap="#Map" border="0">
<map name="Map" id="Map">
<area shape="rect" coords="62,0,83,18" href="javascript:;" onclick="ssqqbxx();">
<area shape="circle" coords="42,43,34" id="aaa1" target="_blank" href="javascript:;">
</map>
</div>
<div class="zixun2" style="margin-right:-44px;z-index: 999;"><a id="aaa2" target="_blank" href="javascript:;"><img src="http://mresonancecomcn.test.resonance.net.cn/GZphp/Tpl/Home/Default/Public/images/zixun2.png" width="42" height="42"></a></div>
<script>
$(function(){
var ua = navigator.userAgent.toLowerCase();
var isWeixin = ua.indexOf('micromessenger') != -1;
var isAndroid = ua.indexOf('android') != -1;
var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
if (isWeixin) {
//alert('微信来源');
//location.href =
var newurl='http://wpa.qq.com/msgrd?v=3&uin={$qq}&site=http://www.resonance.com.cn/&menu=yes';
}else{
//alert('非微信来源');
//location.href = 'http://wpa.qq.com/msgrd?v=3&uin='+qq+'&site=http://www.resonance.com.cn/&menu=yes';
}
if (isAndroid) {
//alert('安卓来源');
var newurl='http://wpa.qq.com/msgrd?v=3&uin={$qq}&site=http://www.resonance.com.cn/&menu=yes';
}else{
//alert('非安卓来源');
//location.href = 'http://wpa.qq.com/msgrd?v=3&uin='+qq+'&site=http://www.resonance.com.cn/&menu=yes';
}
if (isIos) {
//alert('IOS来源');
var newurl='mqq://im/chat?chat_type=wpa&uin={$qq}&version=1&src_type=web';
}else{
//alert('非IOS来源');
//location.href = 'http://wpa.qq.com/msgrd?v=3&uin='+qq+'&site=http://www.resonance.com.cn/&menu=yes';
var newurl='http://wpa.qq.com/msgrd?v=3&uin={$qq}&site=http://www.resonance.com.cn/&menu=yes';
}
$("#aaa1").attr("href",newurl);
$("#aaa2").attr("href",newurl);
});
function ssqqbxx(){
$(".zixun1").animate({marginRight:'-85px'},'slow',sssdfsdfll);
//alert('fdasfdfdsf');
}
function sssdfsdfll(){
$(".zixun2").animate({marginRight:'0px'});
}
</script>
<!--结束-->
Run code
Cut to clipboard
在浏览器中可以通过JS代码打开QQ并弹出聊天界面,一般作为客服QQ使用。而在移动端腾讯貌似没有公布提供类似API,但是却可以使用schema模式来启动手机QQ。
以下为具体代码:
Android:
String url="mqqwpa://im/chat?chat_type=wpa&uin=123456";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
Run code
Cut to clipboard
iOS:
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
NSURL *url = [NSURL URLWithString:@"mqq://im/chat?chat_type=wpa&uin=123456&version=1&src_type=web"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
webView.delegate = self;
[webView loadRequest:request];
[self.view addSubview:webView];
Run code
Cut to clipboard
浏览器:
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=123456&site=qq&menu=yes">click here</a>
Run code
Cut to clipboard
(支付宝)给作者钱财以资鼓励 (微信)→
有过 2 条评论 »
QQ在线客服 qq推广 QQ通讯组件
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2500152288&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:515807823:53" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>
该段代码,即能嵌入到你的页面,实现在线交流的功能。
相关代码:
唤醒QQ:<a href="http://wpa.qq.com/msgrd?v=3&uin=&site=1234567890&menu=yes">
唤醒微信:<a href="weixin://" onclick="PIWI_SUBMIT.Weixin_Open()" >
注:唤醒QQ链接中的1234567890换成对应的QQ号即可,如换了后不能正常使用需要步骤:
1、搜索QQ推广进入官网
2、进入推广工具界面
3、开通免费推广,获取下方的代码,替换上对应的QQ即可。