wechatxc.min.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. !function() {
  2. var e = {
  3. title : "新年头条系10GB流量优惠来袭!",
  4. desc : "免流看视频刷图文 还有9元话费相赠哟!",
  5. link : window.location.href,
  6. imgUrl : "http://800.wo.cn/orderchannel/tt/images/ttxc.png"
  7. };
  8. $.ajax({
  9. url : getRootPath() + "-s1api" + '/jssdk/init',
  10. data : "url=" + encodeURIComponent(window.location.href),
  11. type : "get",
  12. dataType : "json",
  13. success : function(n) {
  14. wx.config({
  15. debug : !1,
  16. appId : n.appId,
  17. timestamp : n.timestamp,
  18. nonceStr : n.nonceStr,
  19. signature : n.signature,
  20. jsApiList : [ "checkJsApi", "onMenuShareTimeline",
  21. "onMenuShareAppMessage" ]
  22. }), wx.ready(function() {
  23. wx.checkJsApi({
  24. jsApiList : [ "onMenuShareTimeline",
  25. "onMenuShareAppMessage" ],
  26. success : function(e) {
  27. }
  28. }), wx.onMenuShareTimeline({
  29. title : e.title,
  30. link : e.link,
  31. imgUrl : e.imgUrl,
  32. success : function() {
  33. },
  34. cancel : function() {
  35. }
  36. }), wx.onMenuShareAppMessage({
  37. title : e.title,
  38. desc : e.desc,
  39. link : e.link,
  40. imgUrl : e.imgUrl,
  41. type : "link",
  42. dataUrl : "",
  43. success : function() {
  44. },
  45. cancel : function() {
  46. }
  47. }), wx.hideMenuItems({
  48. menuList : [ "menuItem:copyUrl" ]
  49. })
  50. })
  51. }
  52. })
  53. }();