off_code.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>核销活动</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="format-detection" content="telephone=no">
  12. <link rel="stylesheet" type="text/css" href="../script/lib/layui/css/layui.css" />
  13. <script src="../script/lib/jquery/jquery.min.js"></script>
  14. <script src="../script/lib/layui/layui.js"></script>
  15. <script src="../script/lib/echarts/echarts.common.min.js"></script>
  16. <script><{Dever::script()}></script>
  17. <script src="../script/dever/core.js?1"></script>
  18. <style>
  19. .dever-upload-pic
  20. {
  21. width:100px;
  22. }
  23. h5 {
  24. margin-bottom: 10px;
  25. }
  26. td {
  27. color: black;
  28. }
  29. .layui-card-body {
  30. /*position: relative;*/
  31. /*padding: 50px 15px;*/
  32. line-height: 20px;
  33. margin-left: -20px;
  34. }
  35. .layui-input {
  36. /*position: relative;*/
  37. /*padding: 30px;*/
  38. margin-top: 20px;
  39. /*line-height: 24px;*/
  40. }
  41. .container{
  42. max-width: 1024px;
  43. margin: auto;
  44. }
  45. .layui-span{
  46. color: blue;
  47. margin-left: 80px;
  48. }
  49. .layui-col-xs4{
  50. font-size: 18px;
  51. }
  52. .layui-col-xs6{
  53. margin-top: 15px;
  54. font-size: 15px;
  55. }
  56. </style>
  57. </head>
  58. <body>
  59. <div class="layui-card">
  60. <div class="layui-container">
  61. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;"> </fieldset>
  62. <div class="layui-row">
  63. <div class="layui-col-xs4">
  64. <div class="grid-demo grid-demo-bg1"><{$active_name}></div>
  65. </div>
  66. <div class="layui-col-xs4">
  67. <div class="grid-demo"><span class = 'layui-span'><{$status}></span></div>
  68. </div>
  69. </div>
  70. <div class="layui-row">
  71. <div class="layui-col-xs6">
  72. <div class="grid-demo">活动时间:<{$act_time}></div>
  73. </div>
  74. </div>
  75. <input type="text" value="" autocomplete="off" id="content" autofocus="autofocus" class="layui-input" style="width: auto;display: inline;" placeholder="输入核销码">
  76. <div class="layui-card-body">
  77. <{if(isset($write_code)):}>
  78. <table class="table layui-table layui-table-body" id="table">
  79. <col width="100">
  80. <col width="100">
  81. <thead>
  82. <tr>
  83. <th>参会人</th>
  84. <th>邀请人</th>
  85. </tr>
  86. </thead>
  87. <tbody>
  88. <tr>
  89. <td>姓名:<{$join_name}></td>
  90. <td><{$buy_name}></td>
  91. </tr>
  92. <tr>
  93. <td>电话:<{$join_mobile}></td>
  94. <td><{$buy_mobile}></td>
  95. </tr>
  96. <tr>
  97. <td>核销码:<{$write_code}><br/>座位号:<{$seat_num}></td>
  98. <td><{$role_name}><br/><{$title_name}></td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. <div><a href="javascript:;" class="layui-btn" id="hexiao" onclick="hexiao();">确认核销</a></div>
  103. <{endif}>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- <button data-method="offset" data-type="auto" type='hidden' class="layui-btn layui-btn-normal">居中弹出</button> -->
  109. <input id="id" name="id" value="<{$id}>" type='hidden'/>
  110. </div>
  111. <script>
  112. var layer;
  113. layui.use('layer', function(){
  114. layer = layui.layer;
  115. });
  116. // function search()
  117. // {
  118. // var date = $('#date').val();
  119. // location.href = config.host + 'lib/manage.code&code=' + date +'&id=<{$active_id}>';
  120. // }
  121. // $('#search').click(function() {
  122. // search();
  123. // })
  124. $('#content').focus();
  125. var id = '<{$active_id}>';
  126. $('#content').bind('keydown',function(event){
  127. if(event.keyCode == "13")
  128. {
  129. $.ajax({
  130. type:"GET",
  131. url:config.host + 'lib/manage.code',
  132. data: {
  133. id : id,
  134. code : $('#content').val(),
  135. },
  136. dataType: "json",
  137. success: function (data) {
  138. if (data.msg == 'success'){
  139. location.href = config.host + 'lib/manage.code&type=1&code=' + $('#content').val() +'&id=<{$active_id}>';
  140. } else {
  141. layer.alert('填写错误');
  142. }
  143. },
  144. error: function(data){
  145. $('#content').val('');
  146. alert('核销码不存在或已核销');
  147. }
  148. });
  149. }
  150. });
  151. var code_id = $('#id').val();
  152. function hexiao() {
  153. $.ajax({
  154. type: "GET",
  155. url: config.host + "home.confirm",
  156. data: {
  157. code_id: code_id,
  158. // json : 1
  159. },
  160. dataType: "json",
  161. success: function (data) {
  162. location.href = config.host + "lib/manage.code&id=<{$active_id}>";
  163. /*
  164. layer.alert(data.data.msg, function(){
  165. location.href = config.host + "lib/manage.code&id=<{$active_id}>";
  166. layer.close();
  167. */
  168. },
  169. error: function(data){
  170. alert('核销失败');
  171. }
  172. });
  173. }
  174. </script>
  175. </body>
  176. </html>