index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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="https://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_https.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=13"></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", "networkTypeChanged", "getBrowserInfo", "checkAvailability", "setBrowserTitle", "openMenu", "setMenuItems", "menuItemSelected", "setSharingContent", "openImage", "scanQRCode", "pickImage", "openVideoCamera", "uploadVideo", "getWM", "getLocation", "pickContact", "apiFromTheFuture", "menuItemAvailable", "invokeMenuItem", "audioMetersChange"
  232. ]
  233. }, function(ret){
  234. $("#cover").show();
  235. var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
  236. var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
  237. WeiboJS.invoke("setSharingContent", {
  238. title: shareTitle,
  239. desc: msg,
  240. icon: shareImg
  241. }, function(e) {
  242. // alert("设置分享内容成功:" + JSON.stringify(e));
  243. });
  244. WeiboJS.invoke("setMenuItems", {
  245. menus: ["shareToWeibo", "shareToMessage", "shareToWeixin", "shareToPYQ", "shareToQQ", "shareToQzone"],
  246. content: shareTitle,
  247. title: msg,
  248. icon: shareImg
  249. }, function(e) {
  250. // alert("setMenuItems 返回数据:" + JSON.stringify(e))
  251. });
  252. WeiboJS.on("menuItemSelected", function(params){
  253. if (!params.hasOwnProperty("error")) {
  254. if (params.selected_code == 1001) {
  255. WeiboJS.invoke("invokeMenuItem", {code:1001}, function(params){});
  256. }
  257. window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
  258. }
  259. });
  260. // WeiboJS.invoke("openMenu", {}, function(params){
  261. // alert("openMenu 返回数据:" + JSON.stringify(params));
  262. // });
  263. });
  264. }
  265. });
  266. }
  267. $(function () {
  268. var shareTitle = "一秒变大厨,为远方的朋友做道菜吧!";
  269. var shareImg = "https://wx.ttkuaiban.com/minigame/images/share_picture.png";
  270. var shareLink = "https://wx.ttkuaiban.com/minigame/index.html";
  271. var ua = navigator.userAgent.toLowerCase();
  272. if (ua.match(/microMessenger/i) == 'micromessenger') {
  273. $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/index.html", {}, function(resp) {
  274. if (resp.code == 'error') {
  275. console.log(resp.code);
  276. }else{
  277. wx.config({
  278. debug: false,
  279. appId: 'wx749c84daac654e1e',
  280. timestamp: resp.data.timestamp,
  281. nonceStr: resp.data.noncestr,
  282. signature: resp.data.sign,
  283. jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
  284. });
  285. wx.ready(function(){
  286. const share = {
  287. title: shareTitle,
  288. desc: "",
  289. imgUrl: shareImg,
  290. link: shareLink,
  291. success: function(res) {
  292. console.log(res)
  293. },
  294. cancel: function() {}
  295. };
  296. wx.onMenuShareAppMessage(share);
  297. wx.onMenuShareTimeline(share);
  298. wx.onMenuShareQQ(share);
  299. wx.onMenuShareQZone(share);
  300. wx.onMenuShareWeibo(share);
  301. });
  302. wx.error(function(res){
  303. console.log(res);
  304. });
  305. };
  306. });
  307. } else if (ua.match(/weibo/i) == 'weibo') {
  308. //weibo
  309. var url = escape(location.href);
  310. $.post("./user/getWeiboConfigParam?url=" + url, {}, function(resp) {
  311. if (resp.code == 'error') {
  312. console.log(resp.code);
  313. }else{
  314. window.WeiboJS.init({
  315. 'appkey' : resp.data.appkey,
  316. 'debug': false,
  317. 'timestamp': parseInt(resp.data.timestamp),
  318. 'noncestr': resp.data.noncestr,
  319. 'signature': resp.data.sign,
  320. 'scope': [
  321. "getNetworkType", "networkTypeChanged", "getBrowserInfo", "checkAvailability", "setBrowserTitle", "openMenu", "setMenuItems", "menuItemSelected", "setSharingContent", "openImage", "scanQRCode", "pickImage", "openVideoCamera", "uploadVideo", "getWM", "getLocation", "pickContact", "apiFromTheFuture", "menuItemAvailable", "invokeMenuItem", "audioMetersChange"
  322. ]
  323. }, function(ret){
  324. WeiboJS.invoke("setSharingContent", {
  325. title: "",
  326. desc: shareTitle,
  327. icon: shareImg
  328. }, function(e) {
  329. // alert("1-设置分享内容成功:" + JSON.stringify(e));
  330. });
  331. WeiboJS.invoke("setMenuItems", {
  332. menus: ["shareToWeibo", "shareToMessage", "shareToWeixin", "shareToPYQ", "shareToQQ", "shareToQzone"],
  333. content: shareTitle,
  334. title: "",
  335. icon: shareImg
  336. }, function(e) {
  337. // alert("setMenuItems 返回数据:" + JSON.stringify(e))
  338. });
  339. });
  340. }
  341. });
  342. } else {
  343. // alert('noooooo');
  344. }
  345. })
  346. </script>
  347. </body>
  348. </html>