SharePre.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_BtWX: cc.Node,
  5. m_BtWXLine: cc.Node,
  6. },
  7. OnBtShare(Tag, isLine) {
  8. // var platform = cc.sys.localStorage.getItem(window.Key_LoginPlatform);
  9. // if (platform != window.PLATFORM_WX) {
  10. // if (g_CurScene) g_CurScene.ShowTips('非微信登录无法分享到微信!');
  11. // return;
  12. // }
  13. var ShareInfo = null;
  14. //带文本分享
  15. if (this.m_Hook.GetShareInfo) ShareInfo = this.m_Hook.GetShareInfo();
  16. if (ShareInfo) {
  17. ThirdPartyShareMessage(ShareInfo, isLine);
  18. }
  19. //纯图片分享
  20. else if (this.m_Hook.GetShareTex) {
  21. ShareInfo = this.m_Hook.GetShareTex();
  22. if (ShareInfo) ThirdPartyShareImg(ShareInfo, isLine);
  23. }
  24. this.shareFunc();
  25. this.HideView();
  26. },
  27. OnShowView:function(){
  28. ShowO2I(this.node);
  29. },
  30. OnHideView:function(){
  31. HideI2O(this.node);
  32. },
  33. shareFunc:function(){
  34. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  35. var webUrl = window.PHP_HOME+'/UserFunc.php?&GetMark=10&dwUserID='+pGlobalUserData.dwUserID;
  36. WebCenter.GetData(webUrl, 0, function (data) {
  37. var res = JSON.parse(data);
  38. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  39. if(res.RoomCard != null) pGlobalUserData.llUserIngot=res.RoomCard;
  40. }.bind(this));
  41. },
  42. // update (dt) {},
  43. });