Catalog.cshtml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @page "{id:int}"
  2. @model Admin.Pages.Store.Game.CatalogModel
  3. @{
  4. ViewData["Title"] = "SKU 정가 카탈로그";
  5. }
  6. <div class="container-fluid">
  7. <h3>@ViewData["Title"] @(Model.Data != null ? $"— {Model.Data.GameName}" : "")</h3>
  8. <hr />
  9. <partial name="_StatusMessage" />
  10. @if (Model.Data == null)
  11. {
  12. <div class="alert alert-warning">게임 정보를 불러올 수 없습니다.</div>
  13. }
  14. else
  15. {
  16. <div class="alert alert-light border">
  17. <div>게임 코드: <code>@(Model.Data.GameCode ?? "-")</code> / API 수수료율: <strong>@Model.Data.ApiCommissionRate%</strong></div>
  18. <small class="text-muted">
  19. 파트너가 결제 보고(/v1/purchases) 시 보낸 productID(SKU)가 이 카탈로그에 있으면 보고 금액을 정가와 대조합니다.
  20. 불일치 건은 등록은 되지만 <span class="badge bg-danger">불일치</span> 표시되어 결제 보고 내역에서 검토할 수 있습니다.
  21. 카탈로그에 없는 SKU 는 검증 없이 통과합니다.
  22. </small>
  23. </div>
  24. <form method="post" asp-page-handler="Add">
  25. <input type="hidden" asp-for="Add.GameID" />
  26. <div class="row g-2 align-items-end mb-3">
  27. <div class="col-12 col-sm-auto">
  28. <label asp-for="Add.ProductID" class="form-label">SKU(상품 ID)</label>
  29. <input asp-for="Add.ProductID" class="form-control" maxlength="100" placeholder="예) diamond_100" />
  30. </div>
  31. <div class="col-6 col-sm-auto">
  32. <label asp-for="Add.Price" class="form-label">정가(원)</label>
  33. <input asp-for="Add.Price" class="form-control" type="number" min="1" />
  34. </div>
  35. <div class="col-auto">
  36. <button type="submit" class="btn btn-primary">추가</button>
  37. </div>
  38. </div>
  39. </form>
  40. <div class="table-responsive">
  41. <table class="table table-bordered table-hover align-middle">
  42. <thead>
  43. <tr>
  44. <th>ID</th>
  45. <th>SKU</th>
  46. <th style="width:180px">정가(원)</th>
  47. <th style="width:100px">사용</th>
  48. <th>등록/수정일</th>
  49. <th style="width:160px">관리</th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. @if (Model.Data.List.Count <= 0)
  54. {
  55. <tr>
  56. <td colspan="6" class="text-center text-muted py-4">등록된 SKU 가 없습니다.</td>
  57. </tr>
  58. }
  59. else
  60. {
  61. @foreach (var row in Model.Data.List)
  62. {
  63. <tr>
  64. <td>@row.ID</td>
  65. <td><code>@row.ProductID</code></td>
  66. <td>
  67. <input type="number" name="price" value="@row.Price" min="1" class="form-control form-control-sm" form="fUpdate-@row.ID" />
  68. </td>
  69. <td>
  70. <input type="checkbox" name="isActive" value="true" class="form-check-input" checked="@row.IsActive" form="fUpdate-@row.ID" />
  71. </td>
  72. <td>
  73. @row.CreatedAt.ToString("yyyy-MM-dd")
  74. @if (row.UpdatedAt != null)
  75. {
  76. <small class="text-muted">(수정 @row.UpdatedAt.Value.ToString("yyyy-MM-dd"))</small>
  77. }
  78. </td>
  79. <td>
  80. <form id="fUpdate-@row.ID" method="post" asp-page-handler="Update" class="d-inline">
  81. <input type="hidden" name="gameID" value="@Model.Data.GameID" />
  82. <input type="hidden" name="id" value="@row.ID" />
  83. <button type="submit" class="btn btn-sm btn-outline-primary">저장</button>
  84. </form>
  85. <form method="post" asp-page-handler="Delete" class="d-inline" onsubmit="return confirm('SKU @row.ProductID 를 삭제할까요?');">
  86. <input type="hidden" name="gameID" value="@Model.Data.GameID" />
  87. <input type="hidden" name="id" value="@row.ID" />
  88. <button type="submit" class="btn btn-sm btn-outline-danger">삭제</button>
  89. </form>
  90. </td>
  91. </tr>
  92. }
  93. }
  94. </tbody>
  95. </table>
  96. </div>
  97. <hr />
  98. <div class="d-flex justify-content-center">
  99. <a href="/Store/Game/Edit/@Model.Data.GameID" class="btn btn-secondary">게임 수정으로</a>
  100. </div>
  101. }
  102. </div>