coins.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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="text" class="form-control validate[required]" name="num" id="num" value="1">
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label for="type" class="col-sm-2 control-label">赠送类型:</label>
  26. <div class="col-sm-10" style="margin-bottom: 20px;">
  27. <select name="type" id="type" th:with="type=${@dict.getType('gold_type')}">
  28. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  29. </select>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label for="num" class="col-sm-2 control-label">赠送用途:</label>
  34. <div class="col-sm-10" style="margin-bottom: 20px;">
  35. <input type="text" class="form-control validate[required]" name="remark" id="remark" value="" required>
  36. </div>
  37. </div>
  38. <div class="form-group"><div style="color:red;">(每个用户赠送次数以及被赠送用户的金币余额限制请查看字典管理)</div></div>
  39. <div class="form-group">
  40. <label class="col-sm-2 control-label"></label>
  41. <div class="col-sm-10">
  42. <a class="btn btn-primary btn-rounded btn-sm" onclick="querySearch()"><i class="fa fa-search"></i>&nbsp;查询</a>
  43. <a class="btn btn-warning btn-rounded btn-sm" onclick="confirmGif()"><i class="fa fa-check"></i>&nbsp;确认</a>
  44. </div>
  45. </div>
  46. </div>
  47. </form>
  48. </div>
  49. <div class="col-sm-12 select-table table-striped">
  50. <table class="table table-bordered">
  51. <thead><tr>
  52. <th style="width: 50px">头像</th>
  53. <th style="width:200px;">卿卿号</th>
  54. <th style="width:300px;">昵称</th>
  55. <th>金币</th>
  56. </tr></thead>
  57. <tbody id="tbody">
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. </div>
  63. <th:block th:include="include :: footer" />
  64. <script th:inline="javascript">
  65. var prefix = ctx + "users/coins";
  66. function querySearch() {
  67. if(!$('#ernos').val()){
  68. $.modal.alertError("请输入卿卿号");
  69. return;
  70. }
  71. $.operate.get(prefix + "/getUserInfo?erNos=" + $('#ernos').val(),function (result) {
  72. if(result.code == 0){
  73. var str = '';
  74. for(var i=0; i < result.data.length; i++) {
  75. var bean = result.data[i];
  76. str += "<tr>\n" +
  77. " <th style=\"width: 100px\"><img src='"+bean.avatar+"' width='50'/></th>\n" +
  78. " <th style='width:200px;'>" + bean.erbanNo + "</th>\n" +
  79. " <th style='width:300px;'>" + bean.nick + "</th>\n" +
  80. " <th>" + bean.goldNum + "</th>\n" +
  81. " </tr>";
  82. }
  83. $('#tbody').html(str);
  84. }
  85. })
  86. }
  87. function confirmGif(){
  88. var ernos = $('#ernos').val();
  89. var type = $('#type').val();
  90. var num = $('#num').val();
  91. var remark = $('#remark').val();
  92. if(!$('#ernos').val()){
  93. $.modal.alertError("请输入卿卿号!");
  94. return;
  95. }
  96. if(!remark){
  97. $.modal.alertError("请输入赠送用途!");
  98. return;
  99. }
  100. $.operate.post(prefix + "/give",{"erNos":ernos,"type":type,"num":num,"remark":remark})
  101. }
  102. </script>
  103. </body>
  104. </html>