voucher.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html lang=zh-cn>
  3. <head>
  4. <meta charset=utf-8>
  5. <title>个人信息纵横通行帐号</title>
  6. <meta name=description content=一个帐号通用纵横旗下所有网络产品。>
  7. <meta name=copyright content=smartcost.com.cn>
  8. <link rel=stylesheet href={{rootUrl_CSS}}global.css>
  9. <script src={{rootUrl_JS}}jquery-1.7.1.min.js></script>
  10. <script src={{rootUrl_JS}}global.js></script>
  11. </head>
  12. <body>
  13. <!-- include '_header' -->
  14. <!-- include '_body_top' -->
  15. <div class="globalContent width950">
  16. <div class="formContent clearfix">
  17. <!-- include '_left_profile' -->
  18. <div class="mainContent formItem userProfile">
  19. <div class="voucher">
  20. <div class="voucher-input">
  21. <form action="/voucher" method="post">
  22. <div class="clearfix"><input type="text" name="code" placeholder="输入领取码"><button type="submit" class="button btn-red">领取代金券</button>
  23. </div>
  24. </form>
  25. <br>
  26. <!-- if isset({{pnote}}) --><p class="colRed">{{pnote}}</p><!-- endif -->
  27. </div>
  28. <div class="voucher-list">
  29. <legend>领取历史</legend>
  30. <table class="table table-hover table-bordered">
  31. <thead>
  32. <th>活动名称</th>
  33. <th>代金券金额</th>
  34. <th>领取日期</th>
  35. </thead>
  36. <tbody id="voulist">
  37. <!-- if isset({{uvoulist}}) -->
  38. <!-- loop uvoulist -->
  39. <tr>
  40. <td>{{uvoulist' value.vname}}</td>
  41. <td>¥{{uvoulist' value.vmoney}}</td>
  42. <td>{{formatDate(uvoulist' value.addtime)}}</td>
  43. </tr>
  44. <!-- endloop -->
  45. <!-- endif -->
  46. </tbody>
  47. </table>
  48. <!-- if {{uvounum}} > 20 -->
  49. <a page="1">查看更多</a>
  50. <!-- endif -->
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- include '_footer' -->
  57. <!-- if {{uvounum}} > 20 -->
  58. <script>
  59. $(function(){
  60. $('.voucher-list a').click(function(){
  61. $.ajax({
  62. type: 'get',
  63. url: '/getvoucher/'+$(this).attr('page'),
  64. dataType: 'json',
  65. success: function(result){
  66. console.log(result);
  67. if(result.code == 200){
  68. var html = '';
  69. $.each(result.uvoulist,function(k,v){
  70. html += '<tr><td>'+v.vname+'</td><td>¥'+v.vmoney+'</td><td>'+v.addtime+'</td></tr>'
  71. });
  72. if(result.num == 0){
  73. $('.voucher-list a').remove();
  74. }else{
  75. $('.voucher-list a').attr('page',result.num);
  76. }
  77. $('#voulist').append(html);
  78. }
  79. }
  80. })
  81. })
  82. })
  83. </script>
  84. <!-- endif -->
  85. </body>