分享至微信、QQ、微博、复制链接
var share = {
"tit": '您的朋友分享了文章',
"desc": '分享来自百度文库,包含。。。',
"pic": 'https://' + window.location.host + '/web/images/shareLogo.png',
"localhostAdd": 'https://' + window.location.host,
//"pic":'http://www.elitez.cn/c/images/head.jpg',
"url": ''
}
//分享至微信
$('body').on('mouseover', '.wchat', function (event) {
var urlText = $(this).siblings('.urlText').text();
var code = $('.share').text();
//var name = $('#hidden').val();
var questionId = $(this).siblings('.questionId').text();
if ($(this).find(".myQuCode canvas").length == 0) {
$(this).find(".myQuCode").qrcode({
//render: "table", //table方式
width: 110, //宽度
height: 110, //高度
//text: //任意内容
text: window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId
});
}
console.log(window.location.protocol + '//' + window.location.host + "/public/mobile/xinzhiMobile.jsp?questionId=" + questionId)
})
//分享至微博
$('body').on('click', '.share_sina', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
var code = $('.share').text();
//var name = $('#hidden').val();
var url = "http://v.t.sina.com.cn/share/share.php",
_url = targetUrl,
_title = share.desc,
_appkey = '',
_ralateUid = '',
c = '', pic = share.pic;
c = url + "?url=" + encodeURIComponent(_url) + "&appkey=" + _appkey + "&title=" + _title + "&pic=" + pic + "&ralateUid=" + _ralateUid + "&language=";
window.open(c, "shareQQ", "height=480,width=608,top=100,left=200,toolbar=no,menubar=no,resizable=yes,location=yes,status=no");
});
//分享至QQ
$('body').on('click', '.share_qq', function (event) {
var urlText = $(this).parent().siblings('.lastLi').find('.urlText').text();
var targetUrl = window.location.protocol + '//' + window.location.host + '/' + urlText;
//var name = $('#hidden').val();
var a = "http://connect.qq.com/widget/shareqq/index.html",//"http://connect.qq.com/widget/shareqq/index.html",
d = targetUrl,
m = share.tit,
pic = share.pic,
pl = '加点评论吧...',
titsummary = share.desc,
b = "",
x = window.screen.width,
y = window.screen.height;
h = "", k = ""; //g = l.join("||")||"";
k = a + "?url=" + encodeURIComponent(d) + "&showcount=0&desc=" + encodeURIComponent(pl) + "&summary=" + encodeURIComponent(titsummary) + "&title=" + encodeURIComponent(m) + "&pics=" + pic + "&style=203&width=19&height=22";
window.open(k, "", "height = 680, width = 960, top = " + (y - 680) / 2 + ", left = " + (x - 960) / 2 + ", toolbar = no, menubar = no, resizable = yes, location = yes,status = no");
});
//复制
var clipboard = new Clipboard('.btnShareCopy');
clipboard.on('success', function(e) {
alerter("复制成功")
//console.log(e);
});
分享至微信、QQ、微博、复制链接的更多相关文章
- js分享功能(微信,QQ,微博,空间,豆瓣等)
日常编程中,我们可能会碰到项目中的分享功能,各大平台都有分享接口和文档说明,当然也有一些一键分享插件,例如:sosh,iShare.js等等 但有些同学不想引用插件,那么我整理了一些常用的分享至平台功 ...
- 网页分享到微信、微博、QQ空间、百度贴吧等
1.首先说明的是,pc端微信分享只能通过二维码来分享. 2.下面是js代码. //分享到新浪微博 function shareToSinaWB(event){ event.preventDefault ...
- 分享到微信、微博、QQ空间、QQ微博
一:分享到微信 //分享到微信$("#weixin").bind("click", function () { var p = { url: ...
- 如何在自己的代码中实现分享视频文件或者是图片文件到微信 QQ微博 新浪微博等!!!
首先在文档第一句我先自嘲下 , 我是大傻逼, 弄了两天微信是视频分享,一直被说为啥跟系统的相册分享的不一样,尼玛!!! 这里来说正文,我这里不像多少太多,大家都是程序猿,具体的阔以看代码. 搞代码之前 ...
- javascript社交平台分享-新浪微博、QQ微博、QQ好友、QQ空间、人人网
整理的五个社交平台的分享 <!doctype html> <html lang="en"> <head> <meta charset=&q ...
- unity3d应用内分享(微信、微博等)的实现
问题:如何在unity3d的游戏中实现分享功能,如图 思路: 1.分享功能的实现方式有多种,较方便快捷的一种是直接调用android的API来调出系统的分享界面 2.unity3d里面调用androi ...
- 安卓,通过本地应用分享到微信、facebook等
别的不说了,直接上代码. 支持分享到微信.微博.facebook.twitter package com.example.shareSample; import java.util.List; imp ...
- h5怎么做分享到QQ 、朋友圈、微信 、微博等功能
微信已经成为我们日常聊天联系基本的必备工具,所以小菜我首先介绍一下如何调用微信的分享功能.其实除了可以在微信上分享到朋友圈和发送给好友,微信的分享接口还提供了分享到QQ和分享到腾讯微博等,就是在页面的 ...
- apiCloud 三方分享,微信好友分享,微信朋友圈分享,QQ分享,微博分享
首先查看我的这篇有关三方登录的博客,地址是http://www.cnblogs.com/gqx-html/p/8303567.html,配置完三方数据后可以从上一篇文章中的链接跳转到各个登录查看api ...
随机推荐
- Jmeter 问题集
1.配置分布式,调度机(master) 看不到 执行机(slave). 原因: slave是放在一个交换机下面,然后在这个交换机下面又接了个路由器,control连的这个路由器 解决: CONTROL ...
- GC之五--SystemGC完全解读
目录: GC之一--GC 的算法分析.垃圾收集器.内存分配策略介绍 GC之二--GC日志分析(jdk1.8)整理中 GC之三--GC 触发Full GC执行的情况及应对策略 gc之四--Minor G ...
- python-appium520-2初步使用
1.录制自动化脚本 场景:启动雪球,点击我的,登陆雪球,选择手机及其他登陆,输入手机号 2.Appium客户端 客户端介绍:https://github.com/appium/appium/blob/ ...
- echo off
就是说关闭回显 @echo off并不是DOS程序中的,而是DOS批处理中的.当年的DOS,所有操作都用键盘命令来完成,当你每次都要输入相同的命令时,可以把这么多命令存为一个批处理,从此以后,只要运行 ...
- Immunity Debugger学习笔记
图1::Immunity主界面 注意事项:最下方的PyCommands窗格既可以执行调试命令也可以执行python脚步文件. 1.PyCommands学习 在 Immunity 中执行 Python ...
- django从请求到响应的过程深入讲解
django启动 我们在启动一个django项目的时候,无论你是在命令行执行还是在pycharm直接点击运行,其实都是执行'runserver'的操作,而ruserver是使用django自带的的we ...
- REST 风格
- vb shell函数在c#的转换
vb shell: Private Sub AddBarcodeImages(ByVal DTab As DataTable) If Not DTab Is Nothing Then DTab.Col ...
- 简单学习Git
Git是什么? Git是目前世界上最先进的分布式版本控制系统(没有之一). Git有什么特点?简单来说就是:高端大气上档次! Git的发展历史 很多人都知道,Linus在1991年创建了开源的Linu ...
- linux系统安装pycharm环境
1.安装Pycharm环境参考网站: https://www.linuxidc.com/Linux/2018-04/152003.htm 注册:http://idea.lanyus.com/ wind ...