正在显示
1 个修改的文件
包含
41 行增加
和
17 行删除
@@ -165,23 +165,6 @@ | @@ -165,23 +165,6 @@ | ||
165 | <script src="__TMPL__/public/assets/js/public.js"></script> | 165 | <script src="__TMPL__/public/assets/js/public.js"></script> |
166 | 166 | ||
167 | <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> | 167 | <script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script> |
168 | - | ||
169 | -<script> | ||
170 | - $(function () { | ||
171 | - // 分享简介 | ||
172 | - wx.config({ | ||
173 | - debug: false, | ||
174 | - appId: '{$data.appId}', | ||
175 | - timestamp: '{$data.timestamp}', | ||
176 | - nonceStr: '{$data.nonceStr}', | ||
177 | - signature: '{$data.signature}', | ||
178 | - jsApiList: [ | ||
179 | - 'onMenuShareAppMessage', | ||
180 | - 'onMenuShareTimeline', | ||
181 | - ] | ||
182 | - }); | ||
183 | - }); | ||
184 | -</script> | ||
185 | <script> | 168 | <script> |
186 | $('.navImg1 img').click(function() { | 169 | $('.navImg1 img').click(function() { |
187 | if ($(this).attr('src') == "__TMPL__/public/assets/images/xx.png") { | 170 | if ($(this).attr('src') == "__TMPL__/public/assets/images/xx.png") { |
@@ -436,4 +419,45 @@ | @@ -436,4 +419,45 @@ | ||
436 | } | 419 | } |
437 | </script> | 420 | </script> |
438 | 421 | ||
422 | +<script> | ||
423 | + $(function () { | ||
424 | + // 分享简介 | ||
425 | + wx.config({ | ||
426 | + debug: false, | ||
427 | + appId: '{$data.appId}', | ||
428 | + timestamp: '{$data.timestamp}', | ||
429 | + nonceStr: '{$data.nonceStr}', | ||
430 | + signature: '{$data.signature}', | ||
431 | + jsApiList: [ | ||
432 | + 'onMenuShareAppMessage', | ||
433 | + 'onMenuShareTimeline', | ||
434 | + ] | ||
435 | + }); | ||
436 | + var title_title = $(document).attr('title'); | ||
437 | + var desc = $('.post_title').text(); | ||
438 | + var link = $('.video_index_url').val(); | ||
439 | + wx.ready(function(){ | ||
440 | + wx.onMenuShareAppMessage({ | ||
441 | + title: '独角星球-'+title_title, // 分享标题朋友 | ||
442 | + desc: desc, // 分享描述 | ||
443 | + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 | ||
444 | + imgUrl: 'http://www.starplanet.cn/themes/simpleboot3_mobile/public/assets/images/cicon_01@2x.png', // 分享图标 | ||
445 | + type: '', // 分享类型,music、video或link,不填默认为link | ||
446 | + dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空 | ||
447 | + success: function () {} | ||
448 | + }); | ||
449 | + wx.onMenuShareTimeline({ | ||
450 | + title: '独角星球-'+title_title, // 分享标题朋友圈 | ||
451 | + desc: desc, | ||
452 | + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 | ||
453 | + imgUrl: 'http://www.starplanet.cn/themes/simpleboot3_mobile/public/assets/images/cicon_01@2x.png', // 分享图标 | ||
454 | + success: function () {} | ||
455 | + }); | ||
456 | + wx.error(function (res) { | ||
457 | + // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 | ||
458 | + }); | ||
459 | + }); | ||
460 | + }); | ||
461 | +</script> | ||
462 | + | ||
439 | </html> | 463 | </html> |
-
请 注册 或 登录 后发表评论