index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. <link rel="stylesheet" type="text/css" href="./css/animate.min.css?v=1">
  19. <link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
  20. <link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
  21. <script src="https://cdn.bootcss.com/SoundJS/1.0.2/soundjs.min.js"></script>
  22. <!--<script src="https://www.w3cways.com/demo/vconsole/vconsole.min.js?v=2.2.0"></script>-->
  23. <script>
  24. window.ifDebug = false;
  25. if (location.href.startsWith('http://')) {
  26. location.href = location.href.replace('http','https');
  27. }
  28. </script>
  29. </head>
  30. <body onload="getInfo()">
  31. <!-- loading -->
  32. <div class="loading">
  33. <div class="curtain-box">
  34. <div class="txt rubberBand time6 iteration">
  35. <img src="./img/loading/loading_txt.png">
  36. </div>
  37. <div class="loading-bar">
  38. <p class="load-txt">远方快递正在为您准备美食<span id="loadingTxt">0</span>%</p>
  39. <div class="bar">
  40. <span id="loadingBar">
  41. <i class="icon-load"></i>
  42. </span>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="loading2">
  48. <div class="curtain-box2">
  49. <div class="txt rubberBand time6">
  50. </div>
  51. </div>
  52. </div>
  53. <!-- 主内容 -->
  54. <div class="warp">
  55. <!-- 选择菜 -->
  56. <div class="select-dish-box">
  57. <img src="./img/menu_tt.png" class="tt fadeIn time4 animated js-an">
  58. <div class="list">
  59. <div class="item bounceIn time3 animated js-an delay3">
  60. <img src="./img/menu1.png" class="animated js-an pulse time4 delay11">
  61. </div>
  62. <div class="item bounceIn time3 animated js-an delay4">
  63. <img src="./img/menu2.png" class="animated js-an pulse time4 delay12">
  64. </div>
  65. <div class="item bounceIn time3 animated js-an delay5">
  66. <img src="./img/menu3.png" class="animated js-an pulse time4 delay13">
  67. </div>
  68. <div class="item bounceIn time3 animated js-an delay6">
  69. <img src="./img/menu4.png" class="animated js-an pulse time4 delay14">
  70. </div>
  71. </div>
  72. <div class="confirm anim-btn"></div>
  73. </div>
  74. <!-- 游戏 -->
  75. <div class="game-box">
  76. <canvas id="canvas" width="640" height="1040"></canvas>
  77. </div>
  78. </div>
  79. <!-- 海报 -->
  80. <div class="poster-mode">
  81. <img src="./img/logo.png" class="logo">
  82. <img src="./img/poster/hsr.png" class="poster-img" id="poster">
  83. <div class="leads-box">
  84. <img src="./img/poster/headOil.png" class="pro">
  85. <div class="form-group" style="position:relative;">
  86. <img id='edit' src="./img/edit.gif" style='height: 0.35rem;position: absolute;left: -13px;top: 8px;display: none;'>
  87. <input id="nameInput" type="text" placeholder="我想把这道菜送给TA">
  88. <div id="nameText" class='msg' style='display:none;'></div>
  89. </div>
  90. <div class="form-group">
  91. <input id="textInput" type="text" placeholder="我想对TA说">
  92. <div id="text" class='msg' style='display:none;'></div>
  93. </div>
  94. <div class="user-info">
  95. <div class="headimg-box">
  96. <img src="./img/headimg.png">
  97. </div>
  98. <p>微信昵称</p>
  99. </div>
  100. </div>
  101. <div class="qrcode-box">
  102. <img src="./img/poster/ewm.png">
  103. <p>扫码为他做菜</p>
  104. </div>
  105. <div class="replay-btn">
  106. <img src="./img/replay_btn.png">
  107. </div>
  108. <div class="secret-btn" onclick='saveText()'>
  109. <img src="./img/share_btn.png">
  110. </div>
  111. </div>
  112. <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()">
  113. <img style="width: 100%" src="./img/cover.png">
  114. </div>
  115. <div class="secret-box">
  116. <img src="./img/poster/secret1.png" id="secret">
  117. </div>
  118. <span id="musicControl">
  119. <a id="mc_play" class="on" onclick="play_music();">
  120. <audio id="music" loop="loop" autoplay="autoplay">
  121. <source src="sound/background_music.mp3" type="audio/mpeg">
  122. </audio>
  123. </a>
  124. </span>
  125. <!-- 切菜提示 -->
  126. <div class="cut-mode2">
  127. <img src="./img/wait_cut.png">
  128. </div>
  129. <!-- 移菜提示 -->
  130. <div class="move-mode2">
  131. <img src="./img/wait_move.png">
  132. </div>
  133. <!-- 摇一摇提示 -->
  134. <div class="shake-mode2">
  135. <img src="./img/wait_shake.png">
  136. </div>
  137. <div class="shake-mode">
  138. <div class="shake-dialog">
  139. <!-- <img src="./img/shake_fire.png"> -->
  140. <div class="fire anim-fire js-an" id="fire"></div>
  141. <img src="./img/shake_icon.png" class="icon">
  142. <img src="./img/shake_txt.png" class="txt">
  143. </div>
  144. </div>
  145. <script src="./js/jquery.min.js"></script>
  146. <script src="./js/create.js"></script>
  147. <script src="./js/tweenmax.js"></script>
  148. <script src="./js/wechat.js"></script>
  149. <script src="./assets.js?v=2"></script>
  150. <script src="./js/music.js?v=1"></script>
  151. <script src="./js/main.js?v=8"></script>
  152. <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
  153. <!-- 必须加在微信api资源 -->
  154. <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  155. <script>
  156. //解决IOS下分享签名失败问题
  157. if (navigator.userAgent.indexOf('iPhone') !== -1) {
  158. window.wechaturl = window.location + '';
  159. }
  160. //一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以
  161. var music = document.getElementById('music').play();
  162. music.volume = 0.1;
  163. //必须在微信Weixin JSAPI的WeixinJSBridgeReady才能生效
  164. document.addEventListener("WeixinJSBridgeReady", function () {
  165. var music = document.getElementById('music').play();
  166. music.volume = 0.1;
  167. }, false);
  168. function shareWeixin(msg) {
  169. let wechaturl = window.location.href.split('#')[0];
  170. var shareUrl = wechaturl;
  171. if (window.wechaturl !== undefined) {
  172. wechaturl = window.wechaturl;
  173. }
  174. var url = escape(wechaturl);
  175. $.post("./user/getWxConfigParam?url="+url, {}, function(resp) {
  176. if (resp.code == 'error') {
  177. console.log(resp.code);
  178. }else{
  179. wx.config({
  180. debug: false,
  181. appId: 'wx749c84daac654e1e',
  182. timestamp: resp.data.timestamp,
  183. nonceStr: resp.data.noncestr,
  184. signature: resp.data.sign,
  185. jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
  186. });
  187. wx.ready(function(){
  188. $("#cover").show();
  189. const share = {
  190. title: "我为你精心准备的美味,快享用吧!",
  191. desc: msg,
  192. imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
  193. link: shareUrl,
  194. success: function() {
  195. // alert("分享成功")
  196. window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
  197. },
  198. cancel: function() {
  199. // alert("分享失败")
  200. }
  201. };
  202. wx.onMenuShareAppMessage(share);
  203. wx.onMenuShareTimeline(share);
  204. wx.onMenuShareQQ(share);
  205. wx.onMenuShareQZone(share);
  206. wx.onMenuShareWeibo(share);
  207. });
  208. wx.error(function(res){
  209. alert("分享失败")
  210. console.log(res);
  211. });
  212. };
  213. });
  214. }
  215. $(function () {
  216. $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/index.html", {}, function(resp) {
  217. if (resp.code == 'error') {
  218. console.log(resp.code);
  219. }else{
  220. wx.config({
  221. debug: false,
  222. appId: 'wx749c84daac654e1e',
  223. timestamp: resp.data.timestamp,
  224. nonceStr: resp.data.noncestr,
  225. signature: resp.data.sign,
  226. jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
  227. });
  228. wx.ready(function(){
  229. const share = {
  230. title: "一秒变大厨,为远方的朋友做道菜吧!",
  231. desc: "",
  232. imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
  233. link: "https://wx.ttkuaiban.com/minigame/index.html",
  234. success: function(res) {
  235. console.log(res)
  236. },
  237. cancel: function() {}
  238. };
  239. wx.onMenuShareAppMessage(share);
  240. wx.onMenuShareTimeline(share);
  241. wx.onMenuShareQQ(share);
  242. wx.onMenuShareQZone(share);
  243. wx.onMenuShareWeibo(share);
  244. });
  245. wx.error(function(res){
  246. console.log(res);
  247. });
  248. };
  249. });
  250. //weibo
  251. $.post("./user/getWeiboConfigParam?url=https://wx.ttkuaiban.com/minigame/lottery.html", {}, function(resp) {
  252. if (resp.code == 'error') {
  253. console.log(resp.code);
  254. }else{
  255. window.WeiboJS.init({
  256. 'appkey' : resp.data.appkey,
  257. 'debug': true,
  258. 'timestamp': resp.data.timestamp,
  259. 'noncestr': resp.data.noncestr,
  260. 'signature': resp.data.sign,
  261. 'scope': [
  262. 'getNetworkType',
  263. 'networkTypeChanged',
  264. 'getBrowserInfo',
  265. 'checkAvailability',
  266. 'setBrowserTitle',
  267. 'openMenu',
  268. 'setMenuItems',
  269. 'menuItemSelected',
  270. 'setSharingContent',
  271. 'openImage',
  272. 'scanQRCode',
  273. 'pickImage',
  274. 'getLocation',
  275. 'pickContact',
  276. 'apiFromTheFuture'
  277. ]
  278. }, function(ret){
  279. alert('init done\n' + JSON.stringify(ret));/*DEBUG*/
  280. });
  281. WeiboJS.invoke("setSharingContent", {
  282. title: "抽奖页面测试标题",
  283. desc: "抽奖页面测试描述",
  284. icon: "https://wx.ttkuaiban.com/minigame/images/share_picture.png"
  285. }, function(e) {
  286. alert("设置分享内容成功:" + JSON.stringify(e));
  287. });
  288. }
  289. });
  290. })
  291. </script>
  292. </body>
  293. </html>