No Description

ceshi_couplet.html 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>联调</title>
  6. <script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1275865236'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s96.cnzz.com/z_stat.php%3Fid%3D1275865236' type='text/javascript'%3E%3C/script%3E"));</script>
  7. <style type="text/css">
  8. button{
  9. width: 300px;
  10. height: 80px;
  11. font-size: 30px;
  12. display: block;
  13. margin: 50px;
  14. }
  15. </style>
  16. <script>
  17. document.getElementById("cnzz_stat_icon_1275865236").style.display="none"; // 隐藏统计小图标
  18. //声明_czc对象:
  19. var _czc = _czc || [];
  20. //绑定siteid,请用您的siteid替换下方"XXXXXXXX"部分
  21. _czc.push(["_setAccount", "1275865236"]);
  22. </script>
  23. </head>
  24. <body>
  25. <button onclick="getToken()">获取token</button>
  26. <div class="token"></div>
  27. <button onclick="shareWechatVideo()">分享到微信video</button>
  28. <button onclick="sharePengyouquanVideo()">分享到朋友圈video</button>
  29. <button onclick="shareWechatImage()">分享到微信图片</button>
  30. <button onclick="sharePengyouquanImage()">分享到朋友圈图片</button>
  31. <button onclick="shareWechatUrl()">分享到微信url</button>
  32. <button onclick="sharePengyouquanUrl()">分享到朋友圈url</button>
  33. <button onclick="shareXiaochengxu()">分享到小程序</button>
  34. <button onclick="openTaobao()">打开淘宝</button>
  35. </body>
  36. </html>
  37. <script type="text/javascript">
  38. //获取token
  39. function getToken () {
  40. var param = '{"js_callback" : "callBackMethodName"}';
  41. try{
  42. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  43. window.webkit.messageHandlers.app_h5_login.postMessage(param);
  44. }
  45. if(navigator.userAgent.match(/android/i)){
  46. obj4H5.app_h5_login(param);
  47. }
  48. }catch(e){
  49. //TODO handle the exception
  50. _czc.push(['_trackEvent', '小说', '打分', '达芬奇密码','5','dafen']);
  51. _czc.push(["_trackEvent",'测试','获取token']);
  52. console.log("兼容")
  53. }
  54. }
  55. function callBackMethodName (data) {//app token 回调
  56. var data = JSON.parse(data)
  57. alert(data)
  58. document.getElementsByClassName('token')[0].innerHTML = data.token;
  59. }
  60. // 分享到微信视屏
  61. function shareWechatVideo () {
  62. var param = {
  63. "shareVideoUrl" : location.href,//视频链接
  64. "shareType":"1", //1:微信好友 2:朋友圈
  65. "shareTitle" : "我是标题",//视频标题
  66. "shareThumb" : "https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg",//视频缩略图
  67. "shareDescription" : "我是描述"//视频描述
  68. }
  69. param = JSON.stringify(param)
  70. try {
  71. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  72. window.webkit.messageHandlers.app_h5_wx_share_video.postMessage(param);
  73. }
  74. if(navigator.userAgent.match(/android/i)){
  75. obj4H5.app_h5_wx_share_video(param);
  76. }
  77. } catch (error) {
  78. _czc.push(["_trackEvent",'测试','分享到微信视频']);
  79. }
  80. }
  81. // 分享到朋友圈视屏
  82. function sharePengyouquanVideo () {
  83. var param = {
  84. "shareVideoUrl" : location.href,//视频链接
  85. "shareType":"2", //1:微信好友 2:朋友圈
  86. "shareTitle" : "我是标题",//视频标题
  87. "shareThumb" : "http://",//视频缩略图
  88. "shareDescription" : "我是描述"//视频描述
  89. }
  90. param = JSON.stringify(param)
  91. try {
  92. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  93. window.webkit.messageHandlers.app_h5_wx_share_video.postMessage(param);
  94. }
  95. if(navigator.userAgent.match(/android/i)){
  96. obj4H5.app_h5_wx_share_video(param);
  97. }
  98. } catch (error) {
  99. _czc.push(["_trackEvent",'分享到朋友圈视频']);
  100. }
  101. }
  102. //分享到微信图片
  103. function shareWechatImage () {
  104. var param = {
  105. "shareImageUrl" : "https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg",//图片链接
  106. "shareType":"1" //1:微信好友 2:朋友圈
  107. }
  108. param = JSON.stringify(param)
  109. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  110. window.webkit.messageHandlers.app_h5_wx_share_image.postMessage(param);
  111. }
  112. if(navigator.userAgent.match(/android/i)){
  113. obj4H5.app_h5_wx_share_image(param);
  114. }
  115. }
  116. //分享到朋友圈图片
  117. function sharePengyouquanImage () {
  118. var param = {
  119. "shareImageUrl" : "https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg",//图片链接
  120. "shareType":"2" //1:微信好友 2:朋友圈
  121. }
  122. param = JSON.stringify(param)
  123. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  124. window.webkit.messageHandlers.app_h5_wx_share_image.postMessage(param);
  125. }
  126. if(navigator.userAgent.match(/android/i)){
  127. obj4H5.app_h5_wx_share_image(param);
  128. }
  129. }
  130. //分享到微信url
  131. function shareWechatUrl () {
  132. var param = {
  133. "shareImageUrl" : "https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg",
  134. "shareTitle" : "分享的标题",
  135. "shareDescirpt":"描述",
  136. "shareUrl":"https://tbk.726p.com/newh5/guide.html",//详情链接
  137. "shareType":"1" //1:微信好友 2:朋友圈
  138. }
  139. param = JSON.stringify(param)
  140. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  141. window.webkit.messageHandlers.app_h5_wx_share_url.postMessage(param);
  142. }
  143. if(navigator.userAgent.match(/android/i)){
  144. obj4H5.app_h5_wx_share_url(param);
  145. }
  146. }
  147. //分享到朋友圈url
  148. function sharePengyouquanUrl () {
  149. var param = {
  150. "shareImageUrl" : "https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg",
  151. "shareTitle" : "分享的标题",
  152. "shareDescirpt":"描述",
  153. "shareUrl":"https://tbk.726p.com/newh5/guide.html",//详情链接
  154. "shareType":"2" //1:微信好友 2:朋友圈
  155. }
  156. param = JSON.stringify(param)
  157. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  158. window.webkit.messageHandlers.app_h5_wx_share_url.postMessage(param);
  159. }
  160. if(navigator.userAgent.match(/android/i)){
  161. obj4H5.app_h5_wx_share_url(param);
  162. }
  163. }
  164. // 分享到小程序
  165. function shareXiaochengxu () {
  166. var param = {
  167. "shareUrl" : "https://tbk.726p.com/newh5/guide.html",//兼容低版本的网页链接
  168. "shareThumb":"https://small-app.oss-cn-beijing.aliyuncs.com/youhuiquan/shareImg.jpg", //小程序消息封面图片
  169. "shareTitle" : "小程序标题",//小程序标题
  170. "shareDescription" : "小程序描述",//小程序描述
  171. "sharePath" : "pages/startPage/startPage",//小程序页面路径
  172. "shareID" : "gh_90d12769d02d",// 小程序原始id,在微信平台查询
  173. }
  174. param = JSON.stringify(param)
  175. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  176. window.webkit.messageHandlers.app_h5_wx_share_min.postMessage(param);
  177. }
  178. if(navigator.userAgent.match(/android/i)){
  179. obj4H5.app_h5_wx_share_min(param);
  180. }
  181. }
  182. // 刷新页面
  183. function refresh_h5(){
  184. location.reload();
  185. }
  186. // 打开淘宝
  187. function openTaobao () {
  188. var param = {"taobaoUrl" : "http://s.click.taobao.com/t?e=m%3D2%26s%3DwQohPv7xCpBw4vFB6t2Z2ueEDrYVVa64K7Vc7tFgwiHjf2vlNIV67nBGGV1GX0sjc4zWPc6e823SWPP%2BQd1B8Ip5RFGP7nMHQJN6CCi9LyyN1OQhcy96f3L1qrEoIuEDuPAZ9DJauYfNEPXytV9ALtCLThlbPuuZoWxvgQAAl6huShzkDg9djgibaxIfjjYxojrslWDXPcnGJe8N%2FwNpGw%3D%3D&pvid=23238182&union_lens=lensId:0b0b4315_0dfc_16613cfdc09_cc13"}
  189. param = JSON.stringify(param)
  190. if(navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)){
  191. window.webkit.messageHandlers.app_h5_open_taobao_url.postMessage(param);
  192. }
  193. if(navigator.userAgent.match(/android/i)){
  194. obj4H5.app_h5_open_taobao_url(param);
  195. }
  196. }
  197. </script>