push_gift.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('礼物推送')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="role-form">
  11. <div class="select-list">
  12. <div class="form-group">
  13. <label for="ernos" class="col-sm-2 control-label">卿卿号(多个卿卿号回车分隔):</label>
  14. <div class="col-sm-10" style="margin-bottom: 20px;">
  15. <textarea class="form-control" name="ernos" id="ernos" style="height:100px;resize:none;"></textarea>
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label for="num" class="col-sm-2 control-label">赠送数量:</label>
  20. <div class="col-sm-10" style="margin-bottom: 20px;">
  21. <input type="number" class="form-control validate[required]" name="num" id="num" min="1" value="1">
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label for="giftId" class="col-sm-2 control-label">礼物:</label>
  26. <div class="col-sm-10" style="margin-bottom: 20px;">
  27. <select name="giftId" id="giftId" th:with="type=${gifts}">
  28. <option th:each="gift : ${type}" th:text="${gift.giftName}" th:value="${gift.giftId}"></option>
  29. </select>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="col-sm-2 control-label"></label>
  34. <div class="col-sm-10">
  35. <a class="btn btn-primary btn-rounded btn-sm" onclick="querySearch()"><i class="fa fa-search"></i>&nbsp;查询</a>
  36. <a class="btn btn-warning btn-rounded btn-sm" onclick="confirmGif()"><i class="fa fa-check"></i>&nbsp;确认</a>
  37. </div>
  38. </div>
  39. </div>
  40. </form>
  41. </div>
  42. <div class="col-sm-12 select-table table-striped">
  43. <table class="table table-bordered">
  44. <thead><tr>
  45. <th style="width: 50px">头像</th>
  46. <th style="width:200px;">卿卿号</th>
  47. <th style="width:300px;">昵称</th>
  48. <th>金币</th>
  49. </tr></thead>
  50. <tbody id="tbody">
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. <th:block th:include="include :: footer" />
  57. <script th:inline="javascript">
  58. var prefix = ctx + "mall/push/gift";
  59. function querySearch() {
  60. if(!$('#ernos').val()){
  61. $.modal.alertError("请输入卿卿号");
  62. return;
  63. }
  64. $.operate.get(prefix + "/getUserInfo?erNos=" + $('#ernos').val(),function (result) {
  65. if(result.code == 0){
  66. var str = '';
  67. for(var i=0; i < result.data.length; i++) {
  68. var bean = result.data[i];
  69. str += "<tr>\n" +
  70. " <th style=\"width: 100px\"><img src='"+bean.avatar+"' width='50'/></th>\n" +
  71. " <th style='width:200px;'>" + bean.erbanNo + "</th>\n" +
  72. " <th style='width:300px;'>" + bean.nick + "</th>\n" +
  73. " <th>" + bean.goldNum + "</th>\n" +
  74. " </tr>";
  75. }
  76. $('#tbody').html(str);
  77. }
  78. })
  79. }
  80. function confirmGif(){
  81. var ernos = $('#ernos').val();
  82. var giftId = $('#giftId').val();
  83. var num = $('#num').val();
  84. if(!$('#ernos').val()){
  85. $.modal.alertError("请输入卿卿号!");
  86. return;
  87. }
  88. $.operate.post(prefix + "/give",{"noList":ernos,"giftId":giftId,"giftNum":num})
  89. }
  90. </script>
  91. </body>
  92. </html>