海鲜阿嫂

rightLower.html 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  8. <title>海鲜阿嫂</title>
  9. <link rel="stylesheet" type="text/css" href="../common/reset.css" />
  10. <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
  11. <script type="text/javascript">
  12. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  13. window.onresize = function () {
  14. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth / 375) + "px";
  15. }
  16. </script>
  17. </head>
  18. <style>
  19. body{
  20. width: 100vw;
  21. overflow: hidden;
  22. }
  23. .template_img{
  24. width: 100%;
  25. }
  26. .evm_img {
  27. width: 100%;
  28. position: absolute;
  29. width: 1.15rem;
  30. top: 4.6rem;
  31. right: 0.28rem;
  32. }
  33. .hand_div{
  34. position: absolute;
  35. top: 5.2rem;
  36. right: 0;
  37. width: 0.5rem;
  38. overflow: hidden;
  39. }
  40. .hand{
  41. width: 150%;
  42. animation:mymove 0.6s infinite alternate ease-in-out;
  43. -webkit-animation:mymove 0.6s infinite alternate ease-in-out; /*Safari and Chrome*/
  44. }
  45. @keyframes mymove
  46. {
  47. 0%{
  48. transform: scale(1); /*开始为原始大小*/
  49. }
  50. 25%{
  51. transform: scale(0.9); /*放大1.1倍*/
  52. }
  53. 50%{
  54. transform: scale(1);
  55. }
  56. 75%{
  57. transform: scale(0.9);
  58. }
  59. }
  60. @-webkit-keyframes mymove /*Safari and Chrome*/
  61. {
  62. 0%{
  63. transform: scale(1); /*开始为原始大小*/
  64. }
  65. 25%{
  66. transform: scale(0.9); /*放大1.1倍*/
  67. }
  68. 50%{
  69. transform: scale(1);
  70. }
  71. 75%{
  72. transform: scale(0.9);
  73. }
  74. }
  75. </style>
  76. <body>
  77. <div id="template">
  78. <img class="template_img" src=""/>
  79. <img class="evm_img" src="" />
  80. <div class="hand_div">
  81. <img class="hand" src="https://seafood-h5.oss-cn-beijing.aliyuncs.com/img/hand.png"/>
  82. </div>
  83. </div>
  84. <div class="alert-info" style="display: none;">
  85. <!-- tip提示,3s后消失 -->
  86. <p>请在浏览器中打开</p>
  87. </div>
  88. <!-- loading -->
  89. <div class="loading">
  90. <img src="../common/loading.gif" />
  91. </div>
  92. </body>
  93. </html>
  94. <script>
  95. var qs = parseQueryString(window.location.href);
  96. var qrode_data = '';//接口传过来的数据
  97. $().ready(function () {
  98. getQrcode();
  99. var timeOutEvent = null;
  100. $("body").on({
  101. touchstart: function (e) {
  102. timeOutEvent = setTimeout(function () {
  103. //此处为长按事件
  104. addLongLog()
  105. }, 700);
  106. },
  107. touchmove: function () {
  108. clearTimeout(timeOutEvent);
  109. },
  110. touchend: function (e) {
  111. clearTimeout(timeOutEvent);
  112. return false;
  113. }
  114. });
  115. })
  116. function getQrcode() {
  117. if(!qs.id){
  118. showMsg('模版未找到!')
  119. return false;
  120. }
  121. $(".loading").show()
  122. $.ajax({
  123. url: '/api/template/qrcode',
  124. methods: 'get',
  125. data: {
  126. t_id: qs.id
  127. },
  128. success: function (res) {
  129. $(".loading").hide()
  130. if (res && res.errno == 0) {
  131. qrode_data = res.rst;
  132. $(".template_img").attr('src',res.rst.back_img)
  133. $(".evm_img").attr('src', res.rst.qrcode);
  134. }else{
  135. showMsg(res.err)
  136. }
  137. },
  138. error: function (err) {
  139. $(".loading").hide()
  140. showMsg('服务器错误')
  141. }
  142. })
  143. }
  144. function addLongLog() {
  145. //长按
  146. $.ajax({
  147. url: '/api/template/addLongLog',
  148. methods: 'get',
  149. data: {
  150. t_id: qs.id,
  151. ip: qrode_data.ip,
  152. saler_id: qrode_data.saler_id
  153. },
  154. success: function (res) {
  155. if (res && res.errno == 0) {
  156. console.log('长按统计成功')
  157. }
  158. },
  159. error: function (err) {
  160. }
  161. })
  162. }
  163. // 展示错误提示信息
  164. function showMsg(msg) {
  165. var msgBox = document.getElementsByClassName('alert-info')[0];
  166. msgBox.getElementsByTagName("p")[0].innerHTML = msg;
  167. msgBox.style.display = "block";
  168. setTimeout(function () {
  169. msgBox.style.display = "none";
  170. }, 2000);
  171. }
  172. //获取地址栏参数
  173. function parseQueryString(url) {
  174. var urlObj = {};
  175. var reg = /([^?=&]+)=([^?=&]+)/g;
  176. url.replace(reg, function ($0, $1, $2) {
  177. urlObj[$1] = decodeURIComponent($2);
  178. })
  179. return urlObj;
  180. }
  181. </script>