give_headwear.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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="erBanNo" class="col-sm-2 control-label">卿卿号:</label>
  14. <div class="col-sm-10" style="margin-bottom: 20px;">
  15. <input name="erBanNo" id="erBanNo" class="form-control" type="text" placeholder="请输入卿卿号"/>
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label for="headWearId" class="col-sm-2 control-label">头饰:</label>
  20. <div class="col-sm-10" style="margin-bottom: 20px;">
  21. <select name="headWearId" id="headWearId" th:with="type=${headWears}">
  22. <option th:each="headWear : ${type}" th:text="${headWear.headwearName}" th:value="${headWear.headwearId}"></option>
  23. </select>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-2 control-label">赠送天数:</label>
  28. <div class="col-sm-10">
  29. <select name="days" id="days" class="form-control m-b" th:with="type=${@dict.getType('give_days_type')}">
  30. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  31. </select>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="col-sm-2 control-label"></label>
  36. <div class="col-sm-10">
  37. <a class="btn btn-primary btn-rounded btn-sm" shiro:hasPermission="mall:give:headwear:query" onclick="querySearch()"><i class="fa fa-search"></i>&nbsp;查询</a>
  38. <a class="btn btn-warning btn-rounded btn-sm" shiro:hasPermission="mall:give:headwear:confirm" onclick="confirmGift()"><i class="fa fa-check"></i>&nbsp;确认</a>
  39. </div>
  40. </div>
  41. </div>
  42. </form>
  43. </div>
  44. <div class="col-sm-12 select-table table-striped">
  45. <table class="table table-bordered">
  46. <thead><tr>
  47. <th style="width: 80px;text-align: center">头像</th>
  48. <th style="width:60px;text-align: center">uid</th>
  49. <th style="width:100px;text-align: center">卿卿号</th>
  50. <th style="width:100px;text-align: center">昵称</th>
  51. <th style="width:150px;text-align: center">卿卿号OR头饰ID</th>
  52. <th style="width:100px;text-align: center">头饰名称</th>
  53. <th style="width:80px;text-align: center">价格</th>
  54. <th style="text-align: center">剩余时间(天)</th>
  55. </tr></thead>
  56. <tbody id="tbody">
  57. </tbody>
  58. </table>
  59. </div>
  60. </div>
  61. </div>
  62. <th:block th:include="include :: footer" />
  63. <script th:inline="javascript">
  64. var prefix = ctx + "mall/give/headwear";
  65. function querySearch() {
  66. if(!$('#erBanNo').val()){
  67. $.modal.alertError("请输入卿卿号");
  68. return;
  69. }
  70. $.operate.get(prefix + "/getGiveHeadwearUsersInfo?erBanNo=" + $('#erBanNo').val() + "&headWearId=" + $("#headWearId").val(),function (result) {
  71. if(result.code == 0){
  72. var str = '';
  73. var bean = result.data;
  74. str += "<tr>\n" +
  75. " <th style=\"width: 80px;text-align: center\"><img src='"+bean.avatar+"' width='50'/></th>\n" +
  76. " <th style='width: 60px;text-align: center'>" + bean.uid + "</th>\n" +
  77. " <th style='width:100px;text-align: center'>" + bean.erBanNo + "</th>\n" +
  78. " <th style='width:100px;text-align: center'>" + bean.nick + "</th>\n" +
  79. " <th style='width:150px;text-align: center'>" + bean.erBanNoOrHeadWearId + "</th>\n" +
  80. " <th style='width:100px;text-align: center'>" + bean.headWearName + "</th>\n" +
  81. " <th style='width:100px;text-align: center'>" + bean.goldPrice + "</th>\n" +
  82. " <th style='text-align: center'>" + bean.headWearDate + "</th>\n" +
  83. " </tr>";
  84. $('#tbody').html(str);
  85. }
  86. })
  87. }
  88. function confirmGift(){
  89. if(!$('#erBanNo').val()){
  90. $.modal.alertError("请输入卿卿号!");
  91. return;
  92. }
  93. var erBanNo = $('#erBanNo').val();
  94. var itemId = $('#headWearId').val();
  95. var days = $("#days").val();
  96. $.operate.post(prefix + "/give",{"erBanNo":erBanNo,"itemId":itemId,"days":days})
  97. }
  98. </script>
  99. </body>
  100. </html>