index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>管理后台</title>
  7. <link rel="icon" type="image/png" href="static/favicon.png">
  8. <link rel="stylesheet" href="css/admin.css">
  9. </head>
  10. <body>
  11. <!-- 登录页面 -->
  12. <div id="loginPage" class="login-page">
  13. <div class="login-container">
  14. <div class="login-header">
  15. <h1>管理后台</h1>
  16. <p>管理员登录</p>
  17. </div>
  18. <form id="loginForm" class="login-form">
  19. <div class="form-group">
  20. <label>用户名</label>
  21. <input type="text" id="adminUsername" placeholder="请输入管理员用户名" required>
  22. </div>
  23. <div class="form-group">
  24. <label>密码</label>
  25. <input type="password" id="adminPassword" placeholder="请输入密码" required>
  26. </div>
  27. <button type="submit" class="login-btn">登录</button>
  28. <div id="loginError" class="error-message" style="display: none;"></div>
  29. </form>
  30. </div>
  31. </div>
  32. <!-- 主界面 -->
  33. <div id="mainPage" class="main-page" style="display: none;">
  34. <!-- 侧边栏 -->
  35. <aside class="sidebar">
  36. <div class="sidebar-header">
  37. <h2>管理后台</h2>
  38. </div>
  39. <nav class="sidebar-nav">
  40. <a href="#" class="nav-item active" data-page="users">
  41. <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
  42. <path d="M10 10C12.7614 10 15 7.76142 15 5C15 2.23858 12.7614 0 10 0C7.23858 0 5 2.23858 5 5C5 7.76142 7.23858 10 10 10Z" fill="currentColor"/>
  43. <path d="M10 12C5.58172 12 2 13.7909 2 16V20H18V16C18 13.7909 14.4183 12 10 12Z" fill="currentColor"/>
  44. </svg>
  45. <span>用户管理</span>
  46. </a>
  47. <a href="#" class="nav-item" data-page="resource-manager">
  48. <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
  49. <path d="M18 4H2L0 8L2 12H18L20 8L18 4Z" fill="currentColor"/>
  50. <path d="M2 12L4 20H16L18 12" fill="currentColor"/>
  51. </svg>
  52. <span>素材管理</span>
  53. </a>
  54. <a href="#" class="nav-item" data-page="pricing">
  55. <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
  56. <path d="M10 2L3 7V18H17V7L10 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  57. <path d="M10 10V18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  58. <path d="M6 10H14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  59. </svg>
  60. <span>素材定价</span>
  61. </a>
  62. <a href="#" class="nav-item" data-page="product-pricing">
  63. <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
  64. <path d="M10 2L3 7V18H17V7L10 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  65. <path d="M10 10V18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  66. <path d="M6 10H14" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  67. </svg>
  68. <span>商品定价</span>
  69. </a>
  70. <a href="#" class="nav-item" data-page="currency">
  71. <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
  72. <circle cx="10" cy="10" r="8" stroke="currentColor" stroke-width="2"/>
  73. <path d="M10 5V15M7 8H13M7 12H13" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  74. </svg>
  75. <span>充值与货币</span>
  76. </a>
  77. </nav>
  78. <div class="sidebar-footer">
  79. <button id="logoutBtn" class="logout-btn">
  80. <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
  81. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/>
  82. <polyline points="16 17 21 12 16 7"/>
  83. <line x1="21" y1="12" x2="9" y2="12"/>
  84. </svg>
  85. <span>退出登录</span>
  86. </button>
  87. </div>
  88. </aside>
  89. <!-- 主内容区 -->
  90. <main class="main-content">
  91. <header class="main-header">
  92. <h1 id="pageTitle">用户管理</h1>
  93. <div class="header-actions">
  94. <span class="admin-name" id="adminName">管理员</span>
  95. </div>
  96. </header>
  97. <div class="content-area" id="contentArea">
  98. <!-- 页面容器 - 使用 iframe 加载各个页面 -->
  99. <iframe id="pageFrame" src="page/users/users.html" frameborder="0" style="width: 100%; height: 100%; border: none;"></iframe>
  100. </div>
  101. </main>
  102. </div>
  103. <!-- 编辑用户弹窗 -->
  104. <div id="editUserModal" class="modal" style="display: none;">
  105. <div class="modal-content">
  106. <div class="modal-header">
  107. <h3>编辑用户</h3>
  108. <button class="modal-close" id="closeEditUserModal">&times;</button>
  109. </div>
  110. <form id="editUserForm" class="modal-form">
  111. <input type="hidden" id="editUserId">
  112. <div class="form-group">
  113. <label>用户名</label>
  114. <input type="text" id="editUsername" required>
  115. </div>
  116. <div class="form-group">
  117. <label>手机号</label>
  118. <input type="text" id="editPhone" required>
  119. </div>
  120. <div class="form-group">
  121. <label>Ani币</label>
  122. <input type="number" id="editPoints" min="0" required>
  123. </div>
  124. <div class="modal-actions">
  125. <button type="button" class="btn-secondary" id="cancelEditUser">取消</button>
  126. <button type="submit" class="btn-primary">保存</button>
  127. </div>
  128. </form>
  129. </div>
  130. </div>
  131. <!-- 上传素材弹窗 -->
  132. <div id="uploadStoreModal" class="modal" style="display: none;">
  133. <div class="modal-content">
  134. <div class="modal-header">
  135. <h3>上传素材</h3>
  136. <button class="modal-close" id="closeUploadModal">&times;</button>
  137. </div>
  138. <form id="uploadStoreForm" class="modal-form">
  139. <div class="form-group">
  140. <label>上传到分类目录</label>
  141. <select id="uploadCategory" required>
  142. <option value="">请选择分类目录</option>
  143. <!-- 分类选项将通过 JavaScript 动态加载 -->
  144. </select>
  145. <small class="form-hint">选择素材要上传到的分类目录,文件夹名称将作为资源名称</small>
  146. </div>
  147. <div class="form-group">
  148. <label>资源名称(文件夹名称)</label>
  149. <input type="text" id="uploadName" placeholder="例如: player_0001" required>
  150. <small class="form-hint">上传的文件夹名称将作为资源名称显示</small>
  151. </div>
  152. <div class="form-group">
  153. <label>上传文件夹</label>
  154. <div class="file-upload-area" id="fileUploadArea">
  155. <input type="file" id="uploadFiles" webkitdirectory directory multiple required style="display: none;">
  156. <div class="file-upload-content">
  157. <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
  158. <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
  159. <polyline points="17 8 12 3 7 8"></polyline>
  160. <line x1="12" y1="3" x2="12" y2="15"></line>
  161. </svg>
  162. <p class="file-upload-text" id="fileUploadText">点击选择文件夹或拖拽文件夹到此处</p>
  163. <p class="file-upload-hint" id="fileUploadHint">未选择任何文件</p>
  164. </div>
  165. </div>
  166. <small class="form-hint">请选择包含PNG序列帧的文件夹</small>
  167. </div>
  168. <!-- 上传进度 -->
  169. <div id="uploadProgressContainer" class="upload-progress-container" style="display: none;">
  170. <div class="upload-progress-header">
  171. <span>上传进度</span>
  172. <span id="uploadProgressPercent">0%</span>
  173. </div>
  174. <div class="upload-progress-bar">
  175. <div class="upload-progress-fill" id="uploadProgressFill"></div>
  176. </div>
  177. <div class="upload-progress-text" id="uploadProgressText">准备上传...</div>
  178. </div>
  179. <!-- 上传成功预览 -->
  180. <div id="uploadSuccessPreview" class="upload-success-preview" style="display: none;">
  181. <div class="preview-header">
  182. <svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
  183. <path d="M16 4h2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path>
  184. <rect x="8" y="2" width="4" height="4" rx="1" ry="1"></rect>
  185. </svg>
  186. <span>上传成功!预览图:</span>
  187. </div>
  188. <div class="preview-image-container">
  189. <img id="previewImage" src="" alt="预览图" class="preview-image">
  190. <div class="preview-loading" id="previewLoading">加载预览图...</div>
  191. </div>
  192. </div>
  193. <div class="modal-actions">
  194. <button type="button" class="btn-secondary" id="cancelUpload">取消</button>
  195. <button type="submit" class="btn-primary" id="uploadSubmitBtn">上传</button>
  196. </div>
  197. </form>
  198. </div>
  199. </div>
  200. <!-- 自定义确认对话框 -->
  201. <div id="customConfirmModal" class="modal" style="display: none;">
  202. <div class="modal-content confirm-modal-content">
  203. <div class="modal-header">
  204. <h3 id="confirmTitle">确认操作</h3>
  205. </div>
  206. <div class="modal-body">
  207. <p id="confirmMessage"></p>
  208. <div id="confirmFileList" class="file-list" style="display: none;">
  209. <div class="file-list-header">
  210. <span>文件列表 (<span id="fileCount">0</span> 个文件)</span>
  211. </div>
  212. <div class="file-list-content" id="fileListContent"></div>
  213. </div>
  214. </div>
  215. <div class="modal-actions">
  216. <button type="button" class="btn-secondary" id="confirmCancel">取消</button>
  217. <button type="button" class="btn-primary" id="confirmOk">确认</button>
  218. </div>
  219. </div>
  220. </div>
  221. <!-- 自定义提示对话框 -->
  222. <div id="customAlertModal" class="modal" style="display: none;">
  223. <div class="modal-content alert-modal-content">
  224. <div class="modal-header">
  225. <h3 id="alertTitle">提示</h3>
  226. <button class="modal-close" id="closeAlertModal">&times;</button>
  227. </div>
  228. <div class="modal-body">
  229. <p id="alertMessage"></p>
  230. </div>
  231. <div class="modal-actions">
  232. <button type="button" class="btn-primary" id="alertOk">确定</button>
  233. </div>
  234. </div>
  235. </div>
  236. <!-- 主脚本 -->
  237. <script src="js/admin.js"></script>
  238. </body>
  239. </html>