vue分享到qq,qq空间,微信,微博等

5 篇文章 0 订阅
1 篇文章 0 订阅

1   pc端网页进行分享开发以下是分享的具体方法

     let title="需要分享的标题"    
     let _url = 'https://www.baidu.com/';//自定义网站链接地址
     let url =  window.location.href;//获取当前网页地址
     let content = '自定义内容';//
     let sharesinastring=null; //跳转的url地址;
     //分享微博。qq  qq空间等
     
     toweibo(){
       var sharesinastring ='http://service.weibo.com/share/share.php?title=' +
        encodeURIComponent(content + '「' + title + '」' + ' 点这里' + url);
        window.open(sharesinastring, '_blank');//微博在新页面打开
     },
     toqq(){
      var _shareUrl ='https://connect.qq.com/widget/shareqq/index.html?';
        _shareUrl += 'url=' + encodeURIComponent(_url || url); 
        _shareUrl += '&title=' + encodeURIComponent(title || '自定义'); 
        window.open(_shareUrl, '_blank');//qq

     }
     toqqkj(){
   sharesinastring ='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey? 
       title=' +encodeURIComponent(title) +
          '&desc=' +
          encodeURIComponent(content) +
          '&summary=' +
          encodeURIComponent(content) +
          '&url=' +
          encodeURIComponent(url);
        window.open(sharesinastring, '_blank');//qq空间

}
//下面是一些其他的链接,方法同上
豆瓣: 'http://shuo.douban.com/!service/share?href={{URL}}&name={{TITLE}}&text={{DESCRIPTION}}&image={{IMAGE}}&starid=0&aid=0&style=11',
脸书: 'https://www.facebook.com/sharer/sharer.php?u={{URL}}',
推特: 'https://twitter.com/intent/tweet?text={{TITLE}}&url={{URL}}&via={{ORIGIN}}',

2微信分享需要借助二维码进行分享有两种生成方式qrcode和vue-q-art这里是具体使用方法https://www.cnblogs.com/belongs-to-qinghua/p/12197878.html

 

 


 
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值