https://gongyi3act.tencent-cloud.net/football/index.html

手中的足球场 --> Array.prototype.contains = function (needle) { for (i in this) { if (this[i].indexOf(needle) > 0) return i; } return -1; } var device_type = navigator.userAgent;// var md = new MobileDetect(device_type);// var os = md.os();// var model = ""; if (os == "iOS") {// os = md.os() + md.version("iPhone"); model = MobileDevice.getModels().join(' or ') } else if (os == "AndroidOS") {// os = md.os() + md.version("Android"); var sss = device_type.split(";"); var i = sss.contains("Build/"); if (i > -1) { model = sss[i].substring(0, sss[i].indexOf("Build/")); } } StaticVar.os = md.os(); StaticVar.tel = model; StaticVar.fbl = Math.max(screen.width, screen.height) * (window.devicePixelRatio || 1); var _mtac = {}; (function () { var mta = document.createElement("script"); mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.2"; mta.setAttribute("name", "MTAH5"); mta.setAttribute("sid", "500620514"); var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(mta, s); })();

var video1 = document.getElementById("video1"), flag; video1.addEventListener("ended", function () { $("#video1").fadeOut(200); setTimeout(function () { video1.currentTime = 0; }, 199); egret.MainContext.instance.stage.dispatchEventWith("over", false); }, false); <!-- video1.addEventListener("pause", function () { --> <!-- clearTimeout(videTimer); --> <!-- $("#video1").fadeOut(200); --> <!-- setTimeout(function () { --> <!-- video1.currentTime = 0; --> <!-- }, 199); --> <!-- egret.MainContext.instance.stage.dispatchEventWith("over", false); --> <!-- }, false); --> function getvideoprogress1() { videTimer = setTimeout(function () { var currentTime = video1.currentTime.toFixed(2); console.log(currentTime); if (currentTime >= 0.01) { video1.style.display = "block"; clearTimeout(videTimer); egret.MainContext.instance.stage.dispatchEventWith("playIng", false); } else { getvideoprogress1(); } }, 50); } var cWidth = $(window).width(), cHeight = $(window).height(); if (cHeight - cWidth > 340) { console.log("X") $(".video").css("object-fit", "fill"); } function videoPlay() { video1.play(); getvideoprogress1(); } function videoPause() { video1.pause(); } function is_weixin() { var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") { return true; } else { return false; } } var gameUrl = window.location.protocol + '//gongyi3act.tencent-cloud.net/football/'; var gameVersion = "0.1.0"; var sharedata = { title: '手中的足球场', desc: '你的屏幕可以成为山区孩子的足球场', link: gameUrl + 'weixin.php', imgUrl: gameUrl + 'icon.jpg' }; var timelinedata = { title: sharedata.title, link: sharedata.link, imgUrl: sharedata.imgUrl } setTimeout(function () { egret.runEgret({ "renderMode": "" }); }, 50); var _video = document.getElementById("video1"); _video.load(); function jwxOnload() { wx.config({ jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'hideMenuItems', 'showMenuItems', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem', 'translateVoice', 'startRecord', 'stopRecord', 'onVoiceRecordEnd', 'playVoice', 'onVoicePlayEnd', 'pauseVoice', 'stopVoice', 'uploadVoice', 'downloadVoice', 'chooseImage', 'previewImage', 'uploadImage', 'downloadImage', 'getNetworkType', 'openLocation', 'getLocation', 'hideOptionMenu', 'showOptionMenu', 'closeWindow', 'scanQRCode', 'chooseWXPay', 'openProductSpecificView', 'addCard', 'chooseCard', 'openCard'], debug: false, appId: wx_config['appId'], timestamp: wx_config['timestamp'], nonceStr: wx_config['nonceStr'], signature: wx_config['signature'] }); sharedata.trigger = function (res) { }; sharedata.cancel = function (res) { }; sharedata.fail = function (res) { }; sharedata.success = function (res) { egret.MainContext.instance.stage.dispatchEventWith("yifenxiang", false);/*分享朋友成功*/ }; timelinedata.trigger = function (res) { }; timelinedata.cancel = function (res) { }; timelinedata.fail = function (res) { }; timelinedata.success = function (res) { egret.MainContext.instance.stage.dispatchEventWith("yifenxiang", false);/*分享朋友圈成功*/ }; wx.ready(function () { wx.onMenuShareAppMessage(sharedata); wx.onMenuShareTimeline(timelinedata); }); wx.error(function (res) { /* config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。*/ }); } var wxConfig = { debug: false, jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'] } $.ajax({ type: 'GET', url: 'https://gongyi3act.tencent-cloud.net/cgi-bin/wx_privilege', dataType: 'json', data: { spid: 'SZ00000012', //SZ00000012 cmd: 'page', url: location.href }, timeout: 300, success: function (data) { wxConfig.appId = data.appid; wxConfig.timestamp = data.timestamp; wxConfig.nonceStr = data.noncestr; wxConfig.signature = data.signature; wx.config(wxConfig); wx.ready(function () { var title = '手中的足球场' var desc = '你的屏幕可以成为山区孩子的足球场' var link = 'https://gongyi3act.tencent-cloud.net/football/weixin.php' var imgUrl = 'https://gongyi3act.tencent-cloud.net/football/icon.jpg' egret.log("初始化wx分享成功!"); wx.onMenuShareTimeline({ title: title, link: link, imgUrl: imgUrl, success: function () { }, cancel: function () { } }) wx.onMenuShareAppMessage({ title: title, desc: desc, link: link, imgUrl: imgUrl, type: '', // 分享类型,music、video或link,不填默认为link dataUrl: '', // 如果type是music或video,则要提供数据链接,默认 success: function () { }, cancel: function () { } }) }) wx.error(function (res) { console.log(res) }); }, error: function (xhr, type) { console.log('jssdk error!') } });


分享到:


相關文章: