(function () { var isWap = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent); var doc = document; var css = location.protocol + '//j.gamersky.com/static/api/css/share.css?v='+dateFtt({f:10}); $("").attr({rel: "stylesheet",href: css}).appendTo("head"); $.cachedScript('//j.gamersky.com/g/lib/qrcode/jquery.qrcode.min.js'); var openCss = "height=540,width=720,top=" + (window.screen.height - 600) / 2 + ",left=" + (window.screen.width - 800) / 2 + ",toolbar=no,menubar=no,resizable=yes,location=yes,status=no"; var ymxkShare = { //获取地址传参数 getQueryString: function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); return r != null ? unescape(r[2]) : null; }, config: function (callback) { var shareTit = '',shareDesc = '',sharePic = '',shareUrl = ''; if ($(".shareConfig").length > 0) { shareTit = $(".shareConfig h3").text(); shareDesc = $(".shareConfig p").text(); sharePic = $(".shareConfig img").attr("src"); shareUrl = $(".shareConfig a").attr("href"); } else if (window._bd_share_config) { shareTit = window._bd_share_config.common.bdText; shareDesc = window._bd_share_config.common.bdDesc; sharePic = window._bd_share_config.common.bdPic; shareUrl = window._bd_share_config.common.bdUrl; } shareTit = shareTit || $("title").text() || ''; shareDesc = shareDesc || $("meta[name='description']").attr("content") || ''; sharePic = sharePic || $("meta[itemprop='image']").attr("content") || $("body").find("img").attr("src") || ''; shareUrl = shareUrl || location.href; sharePic = /https:|http:/.test(sharePic)?sharePic:location.protocol+sharePic; var title = encodeURIComponent(shareTit), bdDesc = encodeURIComponent(shareDesc), bdPic = encodeURIComponent(sharePic), bdUrl = encodeURIComponent(shareUrl); callback(title, bdDesc, bdPic, bdUrl); }, shareHtm: function (shareName) { var that = this; var shareLogo = "https://image.gamersky.com/webimg15/wap/2019/logo2019.png"; var appVersion = ymxkShare.getQueryString('appVersion'); if (appVersion == null || appVersion.length < 1) { appVersion = ymxkShare.getQueryString('InGSApp'); } if (appVersion != null) { var gsAppFun = new GSApp(),shareInfo = {}; that.config(function (title, bdDesc, bdPic, bdUrl) { shareInfo.platform = shareName; // “qq”,“qqKongJian”,“weiXin”,“pengYouQuan”,“weiBo” 等, shareInfo.type = "url"; //可选值有:url,分享页面链接;screenshot,页面截图。 shareInfo.title = title; // 分享标题 shareInfo.description = bdDesc; // 分享描述 shareInfo.url = bdUrl; // 分享链接 shareInfo.thumbnailURL = bdPic || shareLogo; // 分享图标 shareInfo.lotteryId = 0; gsAppFun.share(shareInfo); }); } else { $("body").append('
'); $(".shareMask").unbind().click(function () { $(this).remove(); }); } }, //统计 GetHits: function (cid) { var url = '//click.gamersky.com/Common/' + (isWap ? 'GetWapHits' : 'GetHits') + '.aspx'; $.ajax({type: "GET",dataType: "jsonp",url: url,data: {id: cid,script: 3},success: function () {}}); }, //微信扫码 weixin: function () { //分享弹窗 var that = this; that.GetHits(1287129); //统计 that.config(function (title, bdDesc, bdPic, bdUrl) { if (isWap) { that.shareHtm('weiXin'); } else { var htm = ''; htm += '