index.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Access-Control-Allow-Origin" content="*">
  6. <title> </title>
  7. <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="full-screen" content="true" />
  10. <meta name="screen-orientation" content="portrait" />
  11. <meta name="x5-fullscreen" content="true" />
  12. <meta name="360-fullscreen" content="true" />
  13. <style>
  14. html, body {
  15. -ms-touch-action: none;
  16. background:transparent;
  17. padding: 0;
  18. border: 0;
  19. margin: 0;
  20. }
  21. input,button,select,textarea{outline:none;background-color: transparent; border: 0;}
  22. *{
  23. -webkit-tap-highlight-color: rgba(0,0,0,0);
  24. -webkit-tap-highlight-color:transparent;
  25. }
  26. img,div{
  27. -webkit-tap-highlight-color: rgba(0,0,0,0);
  28. -webkit-tap-highlight-color:transparent;
  29. -webkit-user-select:none; /*webkit浏览器*/
  30. -moz-user-select:none;/*火狐*/
  31. -ms-user-select:none; /*IE10*/
  32. user-select:none;
  33. }
  34. input{
  35. -webkit-appearance: none;
  36. -webkit-tap-highlight-color: rgba(0,0,0,0);
  37. }
  38. .box{
  39. width: 100%;
  40. height: 100%;
  41. text-align:center;
  42. }
  43. .doScale{
  44. -webkit-animation:zscale 1.2s linear infinite ;
  45. }
  46. @-webkit-keyframes zscale
  47. {
  48. 0%{ transform: scale(1) }
  49. 50%{ transform: scale(1.1) }
  50. 100%{ transform: scale(1) }
  51. }
  52. </style>
  53. </head>
  54. <script src="js/jquery.min.js"></script>
  55. <!--<script src="js/createjs.min.js"></script>-->
  56. <script src="layer/layer.js"></script>
  57. <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
  58. <body>
  59. <div id="bgDIV" class="box" style="position:fixed; top: 0;left: 0;width: 100%; ">
  60. <img src="img/aloadingBg.jpg" style=" position: relative; width: 100%; top: 50%; left: 50%; transform: translate(-50%,-50%);">
  61. </div>
  62. <div id="bgDIV2" style="position:fixed; top: 0;left: 0;width: 100%; text-align: center; display: none; ">
  63. <div >
  64. <img src="img/aloading.gif" style=" position: relative; width: 30%; ">
  65. </div>
  66. <div style="margin-top: 4em;">
  67. <img src="img/aloadingTxt.png" style=" position: relative; width: 30%; ">
  68. </div>
  69. </div>
  70. <audio preload="preload" id="wx_call" src="wx.mp3" loop></audio>
  71. <audio preload="preload" id="wx_sound" src="" ></audio>
  72. <div style="margin: auto;width: 100%;height: 100%;" class="egret-player"
  73. data-entry-class="Main"
  74. data-orientation="portrait"
  75. data-scale-mode="fixedWidth"
  76. data-frame-rate="60"
  77. data-content-width="750"
  78. data-content-height="1600"
  79. data-multi-fingered="2"
  80. data-show-fps="false" data-show-log="false"
  81. data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
  82. </div>
  83. <div id="tipDIV" class="box" style="position:fixed; top: 0;left: 0;width: 100%; display: none; ">
  84. <img id="tipImg" src="" style=" position: relative; width: 100%; top: 50%; left: 50%; transform: translate(-50%,-50%);">
  85. <img id="sendWeiboBtn" src="img/shareBtn.gif" style="position: absolute; top:50%; left: 25%; width: 50%; display: none" >
  86. </div>
  87. <div id="canvasDIV" style=" vertical-align: middle; text-align: center; position: absolute; width: 100%; height: 100%; top:0px;left:0px; display: none; ">
  88. <canvas id="canvas" style=" margin-top: 30% " width="750" height="1465" ></canvas>
  89. </div>
  90. <div id="imgDIV" style=" opacity: 0.01; background-color: #FFFFFF; text-align: center; vertical-align: middle; position: absolute; width: 100%; height: 70%; top:0px; left:0px; display: none">
  91. <img id="theImg" style="margin-top: 0% ; width:100%; " >
  92. </div>
  93. <div id="btnsDIV" style="position: absolute; width: 100%; text-align: center; display:none ; ">
  94. <div id="shareBtn" style=" width: 40%; margin-right: 0.5em; display: inline-block">
  95. <img src="img/shareBtn.gif" style="width: 100%">
  96. </div>
  97. <div id="linkBtn" style="width: 33%; margin-left: 0.5em; display: inline-block;">
  98. <img src="img/linkBtn.png" style="width: 100%">
  99. </div>
  100. </div>
  101. <div style="position: fixed; left: 0px; top: 0px; width: 10% ; margin-top: 15px ;margin-left: 90% ; z-index: 999 ; display: block; ">
  102. <img id="soundBtn" src="bm_1.gif" style="width: 70%">
  103. </div>
  104. <script src="js/eruda.min.js"></script>
  105. <script> eruda.init(); </script>
  106. <script>
  107. var loadScript = function (list, callback) {
  108. var loaded = 0;
  109. var loadNext = function () {
  110. loadSingleScript(list[loaded], function () {
  111. loaded++;
  112. if (loaded >= list.length) {
  113. callback();
  114. }
  115. else {
  116. loadNext();
  117. }
  118. })
  119. };
  120. loadNext();
  121. };
  122. var loadSingleScript = function (src, callback) {
  123. var s = document.createElement('script');
  124. s.async = false;
  125. s.src = src;
  126. s.addEventListener('load', function () {
  127. s.parentNode.removeChild(s);
  128. s.removeEventListener('load', arguments.callee, false);
  129. callback();
  130. }, false);
  131. document.body.appendChild(s);
  132. };
  133. var data = `{ "initial": [ "js/all.min.js" ],
  134. "game": [ "js/default.thm.js?v=6" , "js/main.min.js?v=6" ]
  135. }`;
  136. var manifest = JSON.parse(data);
  137. var list = manifest.initial.concat(manifest.game);
  138. loadScript(list, function () {
  139. var theRenderMode = "webgl";
  140. egret.runEgret({ renderMode: theRenderMode , audioType: 0, calculateCanvasScaleFactor:function(context) {
  141. var backingStore = context.backingStorePixelRatio ||
  142. context.webkitBackingStorePixelRatio ||
  143. context.mozBackingStorePixelRatio ||
  144. context.msBackingStorePixelRatio ||
  145. context.oBackingStorePixelRatio ||
  146. context.backingStorePixelRatio || 1;
  147. return (window.devicePixelRatio || 1) / backingStore;
  148. }});
  149. egret.ImageLoader.crossOrigin = "anonymous";
  150. });
  151. </script>
  152. <script>
  153. // 获取参数
  154. function getPara(_key) {
  155. var reg = new RegExp("(^|&)" + _key + "=([^&]*)(&|$)");
  156. var r = window.location.search.substr(1).match(reg);
  157. if (r != null) return unescape(r[2]);
  158. return null;
  159. }
  160. //获取cookie
  161. function getCookie(cname) {
  162. var name = cname + "=";
  163. var ca = document.cookie.split(';');
  164. for (var i = 0; i < ca.length; i++) {
  165. var c = ca[i].trim();
  166. if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
  167. }
  168. return "";
  169. }
  170. // 微博端判断
  171. isWeibo = '<?php echo $isWeibo; ?>';
  172. sub = '<?php echo $sub; ?>';
  173. mock = '<?php echo $mock; ?>';
  174. console.log(isWeibo);
  175. console.log(sub);
  176. console.log(mock);
  177. if (mock == '0') {
  178. if (isWeibo != '1') {
  179. showMessage('请使用微博客户端打开');
  180. onOpen();
  181. }
  182. }
  183. console.log("isWeibo = " + isWeibo)
  184. console.log('sub = ' + sub)
  185. // uid
  186. if (sub=='' && isWeibo) {
  187. console.log('noLogin.....')
  188. noLogin();
  189. }
  190. //未登录状态下跳转 scheme:
  191. function noLogin() {
  192. window.location.href = `sinaweibo://login?redirect_scheme=${(encodeURIComponent(location.href))} `;
  193. }
  194. function onOpen(url) {
  195. let scheme;
  196. if (!url) {
  197. url = location.href; // 要打开的 H5 页面的地址
  198. scheme = `sinaweibo://browser?url=${encodeURIComponent(url)}`;
  199. } else {
  200. if (url.search('http') != -1) {
  201. scheme = `sinaweibo://browser?url=${encodeURIComponent(url)}`;
  202. } else {
  203. scheme = url;
  204. }
  205. }
  206. console.log('打开链接:', scheme);
  207. if (isWeibo) {
  208. window.location.href = scheme;
  209. } else {
  210. window.location.href = `https://m.weibo.cn/feature/openapp?scheme=${encodeURIComponent(scheme)}`;
  211. }
  212. }
  213. // 关于微博 ======== END
  214. function getQueryString(name) {
  215. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  216. var r = window.location.search.substr(1).match(reg);
  217. if (r != null) {
  218. return (r[2]);
  219. } else {
  220. return null;
  221. }
  222. }
  223. var openid = getQueryString('openid');
  224. // 定义变量
  225. var secNum = 120;
  226. var totalNum = 120;
  227. var stayTime = 1500;
  228. var version = 6;
  229. var isShare = 0;
  230. var theTokenData = '';
  231. var YUMING = '/';
  232. // 登录接口
  233. function checkLogin(backFun){
  234. console.log("sub = " + sub)
  235. var u = YUMING + 'index/index/checkLogin'
  236. var obj = {cookie:sub};
  237. $.post(u,obj,function(data){
  238. console.log(data)
  239. if(data.code == 0){
  240. // 调用成功
  241. theTokenData = data.data.token;
  242. playCount = data.data.count;
  243. isShare = data.data.isShare;
  244. isBeginActivity = data.data.isBeginActivity; //活动是否开始
  245. Main.userInfo = data.data.user;
  246. if(data.data.task.length == 0){
  247. TestPage.getDanNum = 0;
  248. }else{
  249. TestPage.getDanNum = data.data.task.num;
  250. }
  251. console.log("Main.userInfo = " )
  252. console.log( Main.userInfo )
  253. // playCount = 1; // Test...........
  254. if(playCount == 1){
  255. // 玩过一次
  256. if( isShare == 0 ){
  257. // 未分享
  258. $('#sendWeiboBtn').show();
  259. $('#tipDIV').show();
  260. $('#tipImg').attr('src' , 'img/tip01.jpg');
  261. }else{
  262. // 已分享
  263. $('#shareBtn').hide();
  264. }
  265. }else if(playCount == 2){
  266. $('#sendWeiboBtn').hide();
  267. $('#tipDIV').show();
  268. $('#tipImg').attr('src' , 'img/tip02.jpg');
  269. }else{
  270. console.log("playCount = " + playCount )
  271. }
  272. backFun();
  273. }else{
  274. console.log('------ checkLogin' + data.message)
  275. }
  276. })
  277. }
  278. // 校验是否可以参加游戏接口
  279. function checkRole(backFun){
  280. var u = YUMING + 'index/index/checkRole'
  281. var obj = {token:theTokenData};
  282. $.post(u,obj,function(data){
  283. console.log(data)
  284. if(data.code == 0){
  285. // 调用成功
  286. Main.canPlay = data.data.first;
  287. backFun();
  288. }else{
  289. console.log('------ checkRole' + data.message)
  290. }
  291. })
  292. }
  293. // 提交任务接口
  294. function submitTask(timeNum, danNum , backFun){
  295. var u = YUMING + 'index/index/submitTask'
  296. var obj = {token:theTokenData , duration:timeNum , number:danNum };
  297. $.post(u,obj,function(data){
  298. if(window.location.host == 'local.sina.com'){
  299. }
  300. console.log(data)
  301. if(data.code == 0){
  302. // 提交成功
  303. // showMessage("提交成功")
  304. backFun();
  305. }else{
  306. console.log('------ submitTask error' + data.message)
  307. }
  308. })
  309. }
  310. // 提交发送微博接口
  311. function submitShare( ){
  312. var u = YUMING + 'index/index/submitShare'
  313. var obj = { token:theTokenData };
  314. $.post(u,obj,function(data){
  315. if(window.location.host == 'local.sina.com'){
  316. }
  317. console.log(data)
  318. if(data.code == 0){
  319. // 提交成功
  320. showMessage("提交成功")
  321. }else{
  322. console.log('------ submitShare error : ' + data.message)
  323. }
  324. })
  325. }
  326. // 排行分数
  327. function getRankTop( backFun ){
  328. var u = YUMING + 'index/index/topRanking'
  329. var obj = { token:theTokenData };
  330. $.post(u,obj,function(data){
  331. if(data.code == 0){
  332. console.log(data.data)
  333. backFun(data.data); //self ranking
  334. }else{
  335. console.log('------ ranking error :' + data.message)
  336. }
  337. })
  338. }
  339. // 排行最新
  340. function getRankNew( backFun ){
  341. var u = YUMING + 'index/index/newRanking'
  342. var obj = { token:theTokenData };
  343. $.post(u,obj,function(data){
  344. if(data.code == 0){
  345. backFun(data.data); //self ranking
  346. }else{
  347. console.log('------ newRanking error' + data.message)
  348. }
  349. })
  350. }
  351. // 提交领取信息接口
  352. function submitReceive( uName , uTel , uAdd , giftId , typeId , backFun ){
  353. // token 登录凭证 name 姓名、mobile 手机号、address 地址、 giftId 奖品ID、 type 类型:1 中奖 2 排名
  354. var u = YUMING + 'index/index/submitReceive'
  355. var obj = { token:theTokenData , name:uName , mobile:uTel, address:uAdd , giftId:giftId , type:typeId };
  356. $.post(u,obj,function(data){
  357. if(data.code == 0){
  358. backFun(data.data); //self ranking
  359. }else{
  360. console.log('------ submitReceive error' + data.message)
  361. }
  362. })
  363. }
  364. //获取轮播中奖接口
  365. function getRotationAward( backFun ){
  366. var u = YUMING + 'index/index/getRotationAward'
  367. var obj = { token:theTokenData };
  368. $.post(u,obj,function(data){
  369. if(data.code == 0){
  370. backFun(data.data);
  371. // "nickname": "用户7771259896",
  372. // "portrait": "https://tvax1.sinaimg.cn/default/images/default_avatar_female_180.gif?KID=imgbed,tva&Expires=1657047644&ssig=rLOkyZc0Iy",
  373. // "uid": 7771259896,
  374. // "giftName": "奖品A"
  375. }else{
  376. console.log('------ getRotationAward error' + data.message)
  377. }
  378. })
  379. }
  380. // 用户点击查看奖品, 排名中奖接口,前 50
  381. function getRankingWinAward( backFun ){
  382. var u = YUMING + 'index/index/getRankingWinAward'
  383. var obj = { token:theTokenData };
  384. $.post(u,obj,function(data){
  385. if(data.code == 0){
  386. backFun(data.data);
  387. }else{
  388. console.log('------ getRankingWinAward error' + data.message)
  389. }
  390. })
  391. }
  392. // 抽奖接口
  393. function getLuckDraw( backFun ){
  394. var u = YUMING + 'index/index/getLuckDraw'
  395. var obj = { token:theTokenData };
  396. $.post(u,obj,function(data){
  397. if(data.code == 0){
  398. backFun(data.data);
  399. // "isWinAward": 0, // 是否中奖 0 末中奖 1 中奖
  400. // "giftId": 0 // 奖品ID
  401. }else{
  402. console.log('------ newRanking error ' + data.message)
  403. }
  404. })
  405. }
  406. // 中奖记录接口
  407. function getAwardLog( backFun ){
  408. var u = YUMING + 'index/index/getAwardLog'
  409. var obj = { token:theTokenData };
  410. $.post(u,obj,function(data){
  411. if(data.code == 0){
  412. backFun(data.data);
  413. // "giftId": 1,
  414. // "giftName": "投影仪",
  415. // "typeLabel": "抽奖",
  416. // "type": 2,
  417. // "createAt": "22-08-30 01:39:45"
  418. }else{
  419. console.log('------ getAwardLog error ' + data.message)
  420. }
  421. })
  422. }
  423. function showHaibao(){
  424. $('#haibaoDIV').show();
  425. }
  426. function isWeiXin() {
  427. var ua = window.navigator.userAgent.toLowerCase();
  428. if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  429. return true;
  430. } else {
  431. return false;
  432. }
  433. }
  434. var isInWx = isWeiXin();
  435. console.log('isInWx = ' + isInWx)
  436. function setDivY(div, n) {
  437. var yy = n / 750 * window.innerWidth;
  438. document.getElementById(div).style.top = yy + "px";
  439. }
  440. function showMessage(str){
  441. layer.msg( str ,{ time: 1500 }, function(){
  442. });
  443. }
  444. function hideImgDIV(){
  445. $('#btnsDIV').hide();
  446. document.getElementById("imgDIV").style.display = "none";
  447. document.getElementById('theImg').src = '';
  448. }
  449. function showBtnDIV(){
  450. setDivY('btnsDIV' , 1330 + Main.hh)
  451. $('#btnsDIV').show();
  452. }
  453. function hideBtnDIV(){
  454. $('#imgDIV').hide();
  455. $('#btnsDIV').hide();
  456. }
  457. function showBtnAndImg(){
  458. $('#imgDIV').show();
  459. $('#btnsDIV').show();
  460. }
  461. function makeWeiboSend(){
  462. var sendArr = ['sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490hqn5gpj60ku0w878u02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490hqn5gpj60ku0w878u02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490hqn5gpj60ku0w878u02%22%7D%5D',
  463. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490ig5jijj60ku0w842y02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490ig5jijj60ku0w842y02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490ig5jijj60ku0w842y02%22%7D%5D',
  464. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490iuexffj60ku0w8djr02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490iuexffj60ku0w8djr02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490iuexffj60ku0w8djr02%22%7D%5D',
  465. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490jb0dtzj60ku0w8q7a02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490jb0dtzj60ku0w8q7a02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490jb0dtzj60ku0w8q7a02%22%7D%5D',
  466. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490jsnv74j60ku0w842o02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490jsnv74j60ku0w842o02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490jsnv74j60ku0w842o02%22%7D%5D',
  467. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490k40kijj60ku0w8q7d02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490k40kijj60ku0w8q7d02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490k40kijj60ku0w8q7d02%22%7D%5D',
  468. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490keoeotj60ku0w8n1d02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490keoeotj60ku0w8n1d02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490keoeotj60ku0w8n1d02%22%7D%5D',
  469. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490kwod1tj60ku0w8wj502.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490kwod1tj60ku0w8wj502.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490kwod1tj60ku0w8wj502%22%7D%5D',
  470. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490l9c612j60ku0w8n1d02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2Fa002ckVKbly8h490l9c612j60ku0w8n1d02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490l9c612j60ku0w8n1d02%22%7D%5D',
  471. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2F002ckVKbly8h490lp4gzxj60ku0w8ae902.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490lp4gzxj60ku0w8ae902.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490lp4gzxj60ku0w8ae902%22%7D%5D',
  472. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge002ckVKbly8h490lzpghhj60ku0w8dk302.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490lzpghhj60ku0w8dk302.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490lzpghhj60ku0w8dk302%22%7D%5D',
  473. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490mb9hjxj60ku0w8jvi02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490mb9hjxj60ku0w8jvi02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490mb9hjxj60ku0w8jvi02%22%7D%5D',
  474. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490mmy6m2j60ku0w8aei02.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490mmy6m2j60ku0w8aei02.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490mmy6m2j60ku0w8aei02%22%7D%5D',
  475. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490mwyi2ej60ku0w8wj102.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490mwyi2ej60ku0w8wj102.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490mwyi2ej60ku0w8wj102%22%7D%5D',
  476. 'sinaweibo://sendweibo?content=&pics=%5B%7B%22thumbnail%22%3A%22https%3A%2F%2Fwx1.sinaimg.cn%2Flarge%2F002ckVKbly8h490nmi4cxj60ku0w8gq202.jpg%22%2C%22original%22%3A%22https%3A%2F%2Fwx4.sinaimg.cn%2Flarge%2F002ckVKbly8h490nmi4cxj60ku0w8gq202.jpg%22%2C%22pid%22%3A%22002ckVKbly8h490nmi4cxj60ku0w8gq202%22%7D%5D'];
  477. var u = sendArr[TestPage.getDanNum - 1]
  478. // window.location.href = encodeURIComponent(u);
  479. console.log(u);
  480. window.location.href = u;
  481. }
  482. $('#sendWeiboBtn').click(function(){
  483. submitShare();
  484. setTimeout(function(){
  485. makeWeiboSend()
  486. $('#tipDIV').hide();
  487. } , 200)
  488. })
  489. $('#shareBtn').click(function(){
  490. submitShare();
  491. if(window.location.host == 'local.sina.com'){
  492. }else{
  493. setTimeout(function(){
  494. makeWeiboSend()
  495. } , 200)
  496. }
  497. if(isShare == 0){
  498. isShare = 1;
  499. hideImgDIV();
  500. MainGame.self.createTestPage();
  501. MainGame.self.goBigMap();
  502. setTimeout(function(){
  503. MainGame.self.doRemoveEndPage();
  504. } , 500)
  505. }
  506. })
  507. $('#linkBtn').click(function(){
  508. hideBtnDIV();
  509. MainGame.self.showRankPage();
  510. })
  511. function showGIF(){
  512. setDivY('bgDIV2' , 590 + Main.hh)
  513. $('#bgDIV').show();
  514. $('#bgDIV2').show();
  515. }
  516. function hideGIF(){
  517. $('#bgDIV').hide();
  518. $('#bgDIV2').hide();
  519. }
  520. $("input,select").blur(function(){
  521. setTimeout(function(){
  522. var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
  523. window.scrollTo(0, Math.max(scrollHeight - 1, 0));
  524. },100);
  525. });
  526. </script>
  527. <!--音频控制-->
  528. <script>
  529. document.addEventListener("WeixinJSBridgeReady", function () {
  530. document.getElementById("wx_call").play();
  531. }, false);
  532. function playBgMusic(){
  533. document.getElementById("wx_call").play();
  534. }
  535. function playSound(str){
  536. document.getElementById(str).play();
  537. }
  538. function pauseSound(str){
  539. document.getElementById(str).pause();
  540. }
  541. //--------处理音频
  542. window.play_sound = 1;
  543. function auPlay(){
  544. console.log(" auPlay ");
  545. document.getElementById('wx_call').play();
  546. }
  547. function auPause(){
  548. console.log(" auPause ");
  549. document.getElementById('wx_call').pause();
  550. }
  551. var angle = 0;
  552. var canZhuan = true;
  553. // setInterval(function(){
  554. // if(canZhuan){
  555. // angle +=3;
  556. // $('#soundBtn').rotate(angle);
  557. // }
  558. // }, 30);
  559. $("#soundBtn").click(function(){
  560. if(play_sound == 0){play_sound = 1;auPlay();}
  561. else{play_sound = 0; auPause();}
  562. canZhuan = !canZhuan;
  563. });
  564. </script>
  565. <!--生成海报-->
  566. <script>
  567. function makeDivImg(base64){
  568. // console.log(base64);
  569. //------------------------ Canvas
  570. var canvas = document.getElementById('canvas');
  571. var context = canvas.getContext('2d');
  572. context.fillStyle="#ffffff";
  573. context.fillRect(0,0,canvas.width, canvas.height);
  574. var img = new Image();
  575. img.onload = function() {
  576. context.drawImage(this, 0, 0, canvas.width*1, canvas.height*1);
  577. // setDivY('btnsDIV', 1200+Main.hh);
  578. // document.getElementById("btnsDIV").style.display = "";
  579. document.getElementById("imgDIV").style.display = "";
  580. document.getElementById('theImg').src = base64;
  581. showBtnDIV();
  582. EndPage.self.makeImgComplete();
  583. // EndPage.endQr.visible = false;
  584. };
  585. img.src = ""+base64;
  586. }
  587. </script>
  588. </body>
  589. </html>