博客
关于我
h5中分享到QQ,微信好友,朋友圈
阅读量:654 次
发布时间:2019-03-15

本文共 763 字,大约阅读时间需要 2 分钟。

如何在h5中进行分享?

h5中写了工具WxShare,工具通过使用JSJDK实现分享功能,这里只需要使用就行

使用:由于微信没有开放直接调起发送给朋友或者朋友圈等权限,因此只能引导用户点击右上角...再手动分享,我们要做的就是             初始化分享出去的内容。

1 首先声明一个变量以供使用

2 内容参数:一般设置如下几个

   title:分享的标题

   desc:分享的描述

   imgUrl:图片

   url:即用户点击分享出去的文案时,打开的链接(url可以不设置,工具内部会拿浏览器上的当前地址)

declare  var WxShare:any;//在class外声明变量WxShare  ......  ......  ...  //分享  wxShare(){    let shareInfo = [      {title:'砍砍砍,帮我砍到0元,送我一份买球宝典吧!',desc:'天天盈球,专业的赛事推荐平台'},      {title:'帮我砍个价,你也可以免费领取这份竞彩秘籍!',desc:'天天盈球,专业的赛事推荐平台'},      {title:'发现一本独家购彩秘籍,帮我砍个价就告诉你。',desc:'天天盈球,专业的赛事推荐平台'},      {title:'买球之前上盈球,帮我砍个价,送我盈球大会员!',desc:'天天盈球,专业的赛事推荐平台'},    ];    let index = Math.floor(Math.random()*4);    let params = {      title:shareInfo[index].title,      desc:shareInfo[index].desc    };    WxShare.initShare(-1,params);  }

 

转载地址:http://ubolz.baihongyu.com/

你可能感兴趣的文章
NN&DL4.1 Deep L-layer neural network简介
查看>>
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named 'pandads'
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>