index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0,minimal-ui">
  7. <meta name="renderer" content="webkit">
  8. <meta http-equiv="X-UA-Compatible" content="IE=Edge,Chrome=1">
  9. <meta name="screen-orientation" content="portrait" /> <!-- uc强制竖屏 -->
  10. <meta name="x5-orientation" content="portrait" /> <!-- QQ强制竖屏 -->
  11. <meta name="apple-mobile-web-app-capable" content="yes" />
  12. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  13. <meta name="format-detection" content="telphone=no" />
  14. <meta name="format-detection" content="email=no" />
  15. <title>贝蒂斯厨房</title>
  16. <script src="./js/flexiable.js"></script>
  17. <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  18. <script src="https://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
  19. <link rel="stylesheet" type="text/css" href="./css/animate.min.css?v=1">
  20. <link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
  21. <link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
  22. <script src="https://cdn.bootcss.com/SoundJS/1.0.2/soundjs.min.js"></script>
  23. <script src="http://tjs.sjs.sinajs.cn/open/thirdpart/js/jsapi/mobile.js" charset="utf-8"></script>
  24. <!--<script src="https://www.w3cways.com/demo/vconsole/vconsole.min.js?v=2.2.0"></script>-->
  25. <script>
  26. window.ifDebug = false;
  27. if (location.href.startsWith('http://')) {
  28. location.href = location.href.replace('http','https');
  29. }
  30. </script>
  31. </head>
  32. <body onload="getInfo()">
  33. <!-- loading -->
  34. <div class="loading">
  35. <div class="curtain-box">
  36. <div class="txt rubberBand time6 iteration">
  37. <img src="./img/loading/loading_txt.png">
  38. </div>
  39. <div class="loading-bar">
  40. <p class="load-txt">远方快递正在为您准备美食<span id="loadingTxt">0</span>%</p>
  41. <div class="bar">
  42. <span id="loadingBar">
  43. <i class="icon-load"></i>
  44. </span>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="loading2">
  50. <div class="curtain-box2">
  51. <div class="txt rubberBand time6">
  52. </div>
  53. </div>
  54. </div>
  55. <!-- 主内容 -->
  56. <div class="warp">
  57. <!-- 选择菜 -->
  58. <div class="select-dish-box">
  59. <img src="./img/menu_tt.png" class="tt fadeIn time4 animated js-an">
  60. <div class="list">
  61. <div class="item bounceIn time3 animated js-an delay3">
  62. <img src="./img/menu1.png" class="animated js-an pulse time4 delay11">
  63. </div>
  64. <div class="item bounceIn time3 animated js-an delay4">
  65. <img src="./img/menu2.png" class="animated js-an pulse time4 delay12">
  66. </div>
  67. <div class="item bounceIn time3 animated js-an delay5">
  68. <img src="./img/menu3.png" class="animated js-an pulse time4 delay13">
  69. </div>
  70. <div class="item bounceIn time3 animated js-an delay6">
  71. <img src="./img/menu4.png" class="animated js-an pulse time4 delay14">
  72. </div>
  73. </div>
  74. <div class="confirm anim-btn"></div>
  75. </div>
  76. <!-- 游戏 -->
  77. <div class="game-box">
  78. <canvas id="canvas" width="640" height="1040"></canvas>
  79. </div>
  80. </div>
  81. <!-- 海报 -->
  82. <div class="poster-mode">
  83. <img src="./img/logo.png" class="logo">
  84. <img src="./img/poster/hsr.png" class="poster-img" id="poster">
  85. <div class="leads-box">
  86. <img src="./img/poster/headOil.png" class="pro">
  87. <div class="form-group" style="position:relative;">
  88. <img id='edit' src="./img/edit.gif" style='height: 0.35rem;position: absolute;left: -13px;top: 8px;display: none;'>
  89. <input id="nameInput" type="text" placeholder="我想把这道菜送给TA">
  90. <div id="nameText" class='msg' style='display:none;'></div>
  91. </div>
  92. <div class="form-group">
  93. <input id="textInput" type="text" placeholder="我想对TA说">
  94. <div id="text" class='msg' style='display:none;'></div>
  95. </div>
  96. <div class="user-info">
  97. <div class="headimg-box">
  98. <img src="./img/headimg.png">
  99. </div>
  100. <p>微信昵称</p>
  101. </div>
  102. </div>
  103. <div class="qrcode-box">
  104. <img src="./img/poster/ewm.png">
  105. <p>扫码为他做菜</p>
  106. </div>
  107. <div class="replay-btn">
  108. <img src="./img/replay_btn.png">
  109. </div>
  110. <div class="secret-btn" onclick='saveText()'>
  111. <img src="./img/share_btn.png">
  112. </div>
  113. </div>
  114. <div id="cover" style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 99999;display: none;background: rgba(0,0,0,0.8)" onclick="hiddenCover()">
  115. <img style="width: 100%" src="./img/cover.png">
  116. </div>
  117. <div class="secret-box">
  118. <img src="./img/poster/secret1.png" id="secret">
  119. </div>
  120. <span id="musicControl">
  121. <a id="mc_play" class="on" onclick="play_music();">
  122. <audio id="music" loop="loop" autoplay="autoplay">
  123. <source src="sound/background_music.mp3" type="audio/mpeg">
  124. </audio>
  125. </a>
  126. </span>
  127. <!-- 切菜提示 -->
  128. <div class="cut-mode2">
  129. <img src="./img/wait_cut.png">
  130. </div>
  131. <!-- 移菜提示 -->
  132. <div class="move-mode2">
  133. <img src="./img/wait_move.png">
  134. </div>
  135. <!-- 摇一摇提示 -->
  136. <div class="shake-mode2">
  137. <img src="./img/wait_shake.png">
  138. </div>
  139. <div class="shake-mode">
  140. <div class="shake-dialog">
  141. <!-- <img src="./img/shake_fire.png"> -->
  142. <div class="fire anim-fire js-an" id="fire"></div>
  143. <img src="./img/shake_icon.png" class="icon">
  144. <img src="./img/shake_txt.png" class="txt">
  145. </div>
  146. </div>
  147. <script src="./js/jquery.min.js"></script>
  148. <script src="./js/create.js"></script>
  149. <script src="./js/tweenmax.js"></script>
  150. <script src="./js/wechat.js"></script>
  151. <script src="./assets.js?v=2"></script>
  152. <script src="./js/music.js?v=1"></script>
  153. <script src="./js/main.js?v=8"></script>
  154. <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  155. <!-- 必须加在微信api资源 -->
  156. <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  157. <script>
  158. //解决IOS下分享签名失败问题
  159. if (navigator.userAgent.indexOf('iPhone') !== -1) {
  160. window.wechaturl = window.location + '';
  161. }
  162. //一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以
  163. var music = document.getElementById('music').play();
  164. music.volume = 0.1;
  165. //必须在微信Weixin JSAPI的WeixinJSBridgeReady才能生效
  166. document.addEventListener("WeixinJSBridgeReady", function () {
  167. var music = document.getElementById('music').play();
  168. music.volume = 0.1;
  169. }, false);
  170. function shareWeixin(msg) {
  171. let wechaturl = window.location.href.split('#')[0];
  172. var shareUrl = wechaturl;
  173. if (window.wechaturl !== undefined) {
  174. wechaturl = window.wechaturl;
  175. }
  176. var url = escape(wechaturl);
  177. $.post("./user/getWxConfigParam?url="+url, {}, function(resp) {
  178. if (resp.code == 'error') {
  179. console.log(resp.code);
  180. }else{
  181. wx.config({
  182. debug: false,
  183. appId: 'wx749c84daac654e1e',
  184. timestamp: resp.data.timestamp,
  185. nonceStr: resp.data.noncestr,
  186. signature: resp.data.sign,
  187. jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
  188. });
  189. wx.ready(function(){
  190. $("#cover").show();
  191. const share = {
  192. title: "我为你精心准备的美味,快享用吧!",
  193. desc: msg,
  194. imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
  195. link: shareUrl,
  196. success: function() {
  197. // alert("分享成功")
  198. window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
  199. },
  200. cancel: function() {
  201. // alert("分享失败")
  202. }
  203. };
  204. wx.onMenuShareAppMessage(share);
  205. wx.onMenuShareTimeline(share);
  206. wx.onMenuShareQQ(share);
  207. wx.onMenuShareQZone(share);
  208. wx.onMenuShareWeibo(share);
  209. });
  210. wx.error(function(res){
  211. alert("分享失败")
  212. console.log(res);
  213. });
  214. };
  215. });
  216. }
  217. //通过微博进行分享的回调时事件
  218. function shareWeibo(msg) {
  219. var url = escape(window.location.href.split('#')[0]);
  220. $.post("./user/getWeiboConfigParam?url=" + url, {}, function(resp) {
  221. if (resp.code == 'error') {
  222. console.log(resp.code);
  223. }else{
  224. window.WeiboJS.init({
  225. 'appkey' : resp.data.appkey,
  226. 'debug': false,
  227. 'timestamp': parseInt(resp.data.timestamp),
  228. 'noncestr': resp.data.noncestr,
  229. 'signature': resp.data.sign,
  230. 'scope': [
  231. 'getNetworkType',
  232. 'networkTypeChanged',
  233. 'getBrowserInfo',
  234. 'checkAvailability',
  235. 'setBrowserTitle',
  236. 'openMenu',
  237. 'menuItemAvailable',
  238. 'setMenuItems',
  239. 'menuItemSelected',
  240. 'setSharingContent',
  241. 'openImage',
  242. 'scanQRCode',
  243. 'pickImage',
  244. 'getLocation',
  245. 'pickContact',
  246. 'apiFromTheFuture'
  247. ]
  248. }, function(ret){
  249. $("#cover").show();
  250. var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
  251. var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
  252. WeiboJS.invoke("setSharingContent", {
  253. title: shareTitle,
  254. desc: msg,
  255. icon: shareImg
  256. }, function(e) {
  257. // alert("设置分享内容成功:" + JSON.stringify(e));
  258. });
  259. // WeiboJS.invoke("setMenuItems", {
  260. //  menus : ["shareToWeibo", "follow"],
  261. // content : "我是默认文案"
  262. // }, function(params){
  263. // // alert("setMenuItems 返回数据:" + JSON.stringify(params));
  264. // });
  265. WeiboJS.on("menuItemSelected", function(params){
  266. // alert("menuItemSelected:" + JSON.stringify(params));
  267. if (!params.hasOwnProperty("error")) {
  268. window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
  269. }
  270. });
  271. // WeiboJS.invoke("openMenu", {}, function(params){
  272. // alert("openMenu 返回数据:" + JSON.stringify(params));
  273. // });
  274. });
  275. }
  276. });
  277. }
  278. $(function () {
  279. var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
  280. var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
  281. var shareLink = "https://wx.ttkuaiban.com/minigame/index.html";
  282. var ua = navigator.userAgent.toLowerCase();
  283. if (ua.match(/microMessenger/i) == 'micromessenger') {
  284. $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/index.html", {}, function(resp) {
  285. if (resp.code == 'error') {
  286. console.log(resp.code);
  287. }else{
  288. wx.config({
  289. debug: false,
  290. appId: 'wx749c84daac654e1e',
  291. timestamp: resp.data.timestamp,
  292. nonceStr: resp.data.noncestr,
  293. signature: resp.data.sign,
  294. jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
  295. });
  296. wx.ready(function(){
  297. const share = {
  298. title: shareTitle,
  299. desc: "",
  300. imgUrl: shareImg,
  301. link: shareLink,
  302. success: function(res) {
  303. console.log(res)
  304. },
  305. cancel: function() {}
  306. };
  307. wx.onMenuShareAppMessage(share);
  308. wx.onMenuShareTimeline(share);
  309. wx.onMenuShareQQ(share);
  310. wx.onMenuShareQZone(share);
  311. wx.onMenuShareWeibo(share);
  312. });
  313. wx.error(function(res){
  314. console.log(res);
  315. });
  316. };
  317. });
  318. } else if (ua.match(/weibo/i) == 'weibo') {
  319. //weibo
  320. var url = escape(location.href);
  321. $.post("./user/getWeiboConfigParam?url=" + url, {}, function(resp) {
  322. if (resp.code == 'error') {
  323. console.log(resp.code);
  324. }else{
  325. window.WeiboJS.init({
  326. 'appkey' : resp.data.appkey,
  327. 'debug': false,
  328. 'timestamp': parseInt(resp.data.timestamp),
  329. 'noncestr': resp.data.noncestr,
  330. 'signature': resp.data.sign,
  331. 'scope': [
  332. 'getNetworkType',
  333. 'networkTypeChanged',
  334. 'getBrowserInfo',
  335. 'checkAvailability',
  336. 'setBrowserTitle',
  337. 'openMenu',
  338. 'menuItemAvailable',
  339. 'setMenuItems',
  340. 'menuItemSelected',
  341. 'setSharingContent',-
  342. 'openImage',
  343. 'scanQRCode',
  344. 'pickImage',
  345. 'getLocation',
  346. 'pickContact',
  347. 'apiFromTheFuture'
  348. ]
  349. }, function(ret){
  350. WeiboJS.invoke("setSharingContent", {
  351. title: shareTitle,
  352. desc: "",
  353. icon: shareImg
  354. }, function(e) {
  355. // alert("1-设置分享内容成功:" + JSON.stringify(e));
  356. });
  357. // WeiboJS.invoke("setMenuItems", {
  358. // /**微博:1001好友圈:1002
  359. // 私信 :1003
  360. // 微信好友:1004
  361. // 朋友圈:1005
  362. // 来往动态:1009
  363. // QQ:1010
  364. // Qzone:1011
  365. // 短信:1101
  366. // 邮件:1102**/
  367. //  menus : ["1001","1002", "1003", "1004","1005", "1010"],
  368. // content : shareTitle
  369. // }, function(params){
  370. // alert("setMenuItems 返回数据:" + JSON.stringify(params));
  371. // });
  372. //"shareToWeibo", "follow", "shareToMessage", "shareToWeixin", "shareToPYQ", "shareToQQ", "shareToQzone", "openInBrowser", "copyURL"
  373. // WeiboJS.invoke("menuItemAvailable", {}, function(params){
  374. //       alert("获取的菜单项:" + JSON.stringify(params));
  375. // });
  376. });
  377. }
  378. });
  379. } else {
  380. // alert('noooooo');
  381. }
  382. })
  383. </script>
  384. </body>
  385. </html>