cardconsume.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {php define(MUI, true);}
  2. {template 'common/header'}
  3. <header class="mui-bar mui-bar-nav">
  4. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  5. <h1 class="mui-title">卡券核销</h1>
  6. </header>
  7. {template 'nav'}
  8. <div class="mui-content">
  9. <form action="" method="post" class="mui-mt15">
  10. <div class="mui-input-group">
  11. <div class="mui-input-row">
  12. <input type="text" name="code" value="{$qrcode}" placeholder="请输入序列号"/>
  13. </div>
  14. </div>
  15. <div class="mui-content-padded">
  16. <button class="mui-btn mui-btn-success mui-btn-block syscard-check">核 销</button>
  17. </div>
  18. </form>
  19. </div>
  20. <script type="text/javascript">
  21. $('.syscard-check').click(function(){
  22. var code = $.trim($('input[name="code"]').val());
  23. if(!code) {
  24. alert('code号错误');
  25. return false;
  26. }
  27. $.post("{php echo $this->createMobileUrl('cardconsume', array('op' => 'consume'));}", {code:code}, function(data) {
  28. var data = $.parseJSON(data);
  29. if(data.message.errno == -1) {
  30. alert(data.message.message);
  31. } else {
  32. alert('核销成功');
  33. location.href = "{php echo $this->createMobileUrl('home')}";
  34. }
  35. });
  36. return false;
  37. });
  38. </script>
  39. {template 'common/footer'}