• 分享至微信、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方式
    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);
    });
  • 相关阅读:
    图书馆管理系统

    有理数类的设计
    题目4-多关键字排序(基于自定义比较函数)
    图总结
    树、二叉树、查找算法总结
    数据结构小结
    C语言文件
    第二次博客作业
    第一次博客作业
  • 原文地址:https://www.cnblogs.com/wangqiao170/p/6825261.html
Copyright © 2020-2023  润新知