You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

  1. //$(function() {
  2. /**
  3. * 获取config信息
  4. * @returns
  5. */
  6. function getJssdk() {
  7. console.log(location.href.split('#')[0])
  8. $.ajax({
  9. url: "http://h5.qishichuangke.cn/api/v2/animate/get-jssdk",
  10. type: "POST",
  11. data: {
  12. url:location.href.split('#')[0]
  13. },
  14. success: function(data) {
  15. var result = data.data;
  16. console.log(data);
  17. wx.config({
  18. debug: false, // 开启调试模式
  19. appId: result['appId'], // 必填,公众号的唯一标识
  20. timestamp: result['timestamp'], // 必填,生成签名的时间戳
  21. nonceStr: result['nonceStr'], // 必填,生成签名的随机串
  22. signature: result['signature'], // 必填,签名,
  23. jsApiList: result['jsApiList'] // 必填,需要使用的JS接口列表,
  24. });
  25. },
  26. });
  27. }
  28. /**
  29. * 执行ready接口
  30. * @returns
  31. */
  32. function getReady() {
  33. wx.hideMenuItems({ // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
  34. menuList: ['menuItem:share:qq', 'menuItem:share:weiboApp', 'menuItem:share:QZone', ]
  35. });
  36. //wx.hideAllNonBaseMenuItem();
  37. //自定义“分享给朋友”及“分享到QQ”按钮的分享内容
  38. wx.updateAppMessageShareData({
  39. title: '“云游故宫”知识大闯关', // 分享标题
  40. desc: '赢价值3000元“故宫游学”大奖,得“KFC葡式蛋挞(经典)”优惠券!', // 分享描述
  41. link: 'http://cfpyx.childrenfun.com.cn/', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  42. imgUrl: 'http://gugongh5.qishichuangke.cn/image/default/92FCE13AA7B546CAAF428BBA7CCDC802-6-2.png', // 分享图标
  43. success: function() {
  44. // 设置成功
  45. }
  46. })
  47. wx.updateTimelineShareData({
  48. title: '“云游故宫”知识大闯关', // 分享标题
  49. link: 'http://cfpyx.childrenfun.com.cn/', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  50. imgUrl: 'http://gugongh5.qishichuangke.cn/image/default/92FCE13AA7B546CAAF428BBA7CCDC802-6-2.png', // 分享图标
  51. success: function() {
  52. // 设置成功
  53. }
  54. })
  55. }
  56. //})