[菜鸟]下载的微信小游戏源码,分享朋友圈功能没有

s2432971 2014-10-27 11:35:52
不知道哪儿出了问题。。。我刚刚开始学,希望大家指教一下



<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>监狱风云</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>

<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<style>
body {
text-align: center;
margin: 0;
padding: 0;
border: 0;
background-color: #000000;
height: 100%;
}
</style>
</head>
<body>
<script src="js/pixi.js"></script>
<script src="js/game.js"></script>
<script language=javascript>
var mebtnopenurl = 'http://game.id87.com/';
window.shareData = {
"imgUrl": "http://game.id87.com/Public/jyfy/icon.png",
"timeLineLink": "http://game.id87.com/games/jyfy/
/jyfy/",
"tTitle": "监狱风云",
"tContent": "日本右翼势力正试图为侵略历史翻案,每一个有良知的中国人都不会答应,立即阻击日本鬼子篡改历史?
};

function goHome(){
window.location=mebtnopenurl;
}
function clickMore(){
if((window.location+"").indexOf("f=zf",1)>0){
window.location = "game.id87.com/";
}
else{
goHome();
}
}
function dp_share(){
document.title =shareData.sDesc;
document.getElementById("share").style.display="";
window.shareData.tTitle = document.title;
}
function dp_Ranking(){
window.location=mebtnopenurl;
}

function showAd(){
}
function hideAd(){
}
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {

WeixinJSBridge.on('menu:share:appmessage', function(argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"img_url": window.shareData.imgUrl,
"link": window.shareData.timeLineLink,
"desc": window.shareData.tContent,
"title": window.shareData.tTitle
}, onShareComplete);
});

WeixinJSBridge.on('menu:share:timeline', function(argv) {
WeixinJSBridge.invoke('shareTimeline', {
"img_url": window.shareData.imgUrl,
"img_width": "640",
"img_height": "640",
"link": window.shareData.timeLineLink,
"desc": window.shareData.tContent,
"title": window.shareData.tTitle
}, onShareComplete);
});
}, false);
</script>
<div id=share style="display: none">
<img width=100% src="share.png"
style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
ontouchstart="document.getElementById('share').style.display='none';" />
</div>
<div style="display: none;">
<script type="text/javascript">
var myData = { gameid: "jyfy" };
//var domain = ["oixm.cn", "hiemma.cn", "peagame.net"][parseInt(Math.random() * 3)];
//window.shareData.timeLineLink = "http://"+ parseInt(Math.random()*100000) +"."+ myData.gameid +"."+domain+"/gc.html?gameid=" + myData.gameid + (localStorage.myuid ? "&uid=" + localStorage.myuid : "");
function dp_submitScore(score){
myData.score =parseInt(score);
myData.scoreName = "消灭?+score+"只鬼?;
if(score>0){
if (confirm("你竟然在分分钟钟间就消灭?+score+"只鬼子,让伙伴们一起来消灭鬼子吧!")){
dp_share();
}
}
}
function onShareComplete(res) {
if (localStorage.myuid && myData.score != undefined) {
setTimeout(function(){
if (confirm("要将成绩提交?G游戏排行榜吗?)) {
// window.location = "http://wx.9g.com/rank/submit2.jsp?gameid=" + myData.gameid + "&uid=" + localStorage.myuid + "&score=" + myData.score + "&scorename=" + encodeURIComponent(myData.scoreName);
}
else {
document.location.href = mebtnopenurl;
}
}, 500);
}
else {
document.location.href = mebtnopenurl;
}
}
</script>

</body>
</html>
...全文
1115 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
业余草 2014-11-26
  • 打赏
  • 举报
回复
结贴吧,你!!!!!!
jy02409187 2014-11-24
  • 打赏
  • 举报
回复
分享的功能早就被微信给禁用了,现在只能点右上角的菜单进行分享

39,087

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧