hexiao_times.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <title>到店核销</title>
  6. <style>
  7. .layui-table th{border-color: #e6e6e6;}
  8. </style>
  9. </head>
  10. <body>
  11. <div class="layui-fluid">
  12. <div class="layui-row layui-col-space10">
  13. <div class="layui-col-md12">
  14. <h4 style="text-align:center;font-weight:bold;">到店核销</h4>
  15. </div>
  16. <input type="hidden" id="order_goods_hexiao_id" name="order_goods_hexiao_id" value="{$order_hexiao_info['id']}"/>
  17. <div class="layui-col-md12">
  18. <img src="<?php echo $order_hexiao_info['goods_images']; ?>" width="80px;" height="80px;">
  19. <div style="display:inline-block;vertical-align: top;margin-top:10px;margin-left: 5px;">{$order_hexiao_info['goods_name']}</div>
  20. </div>
  21. <div class="layui-col-md12">
  22. <table class="layui-table" lay-size="lg">
  23. <colgroup>
  24. <col width="200">
  25. <col width="150">
  26. <col width="150">
  27. </colgroup>
  28. <thead>
  29. <tr>
  30. <th colspan="3" style="color:#000000;font-weight:bold;">商品使用次数(<?php echo $order_hexiao_info['hexiao_count']; ?>次):</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. <?php foreach($hx_list as $k=>$v){ ?>
  35. <tr>
  36. <td>{$order_hexiao_info['goods_name']}</td>
  37. <td>已使用(<?php echo $v['hexiao_count']; ?>次)</td>
  38. <td><?php echo date('Y-m-d H:i:s',$v['addtime']); ?></td>
  39. </tr>
  40. <?php } ?>
  41. <?php
  42. $count = $order_hexiao_info['hexiao_count'] - $hx_count;
  43. for($i = 0;$i < $count;$i++){
  44. ?>
  45. <tr>
  46. <td>{$order_hexiao_info['goods_name']}</td>
  47. <td>未使用</td>
  48. <td>
  49. <input type="checkbox" name="is_hexiao" value="1">
  50. </td>
  51. </tr>
  52. <?php } ?>
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  59. <script>
  60. function hexiao_goods(){
  61. var hx_count = 0;
  62. var s_url = "{:U('order/hexiao_goods')}";
  63. var hx_id = $('#order_goods_hexiao_id').val();
  64. $('input[name="is_hexiao"]').each(function(){
  65. if($(this).is(":checked")){
  66. hx_count++;
  67. }
  68. })
  69. if(hx_count == 0){
  70. layer.msg('请选择商品核销次数');
  71. return false;
  72. }
  73. layer.confirm("确认使用商品", function(index){
  74. $.ajax({
  75. url:s_url,
  76. type:'post',
  77. dataType:'json',
  78. data:{hx_id:hx_id,hx_count:hx_count},
  79. success:function(info){
  80. if(info.status == 0)
  81. {
  82. layer.msg(info.result.message,{icon: 1,time: 2000});
  83. }else if(info.status == 1){
  84. layer.msg('操作成功',{time: 1000,
  85. end:function(){
  86. location.href = info.result.url;
  87. }
  88. });
  89. }
  90. }
  91. })
  92. });
  93. }
  94. </script>
  95. </body>
  96. </html>