currency.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  15. background: #f9fafb;
  16. min-height: 100vh;
  17. }
  18. .page-content {
  19. padding: 24px;
  20. }
  21. .section {
  22. background: #fff;
  23. border-radius: 12px;
  24. padding: 20px;
  25. margin-bottom: 20px;
  26. box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  27. }
  28. .section-title {
  29. font-size: 15px;
  30. font-weight: 600;
  31. color: #111;
  32. margin-bottom: 16px;
  33. }
  34. .package-list {
  35. display: flex;
  36. flex-direction: column;
  37. gap: 12px;
  38. }
  39. .package-item {
  40. display: flex;
  41. align-items: center;
  42. gap: 16px;
  43. padding: 14px 16px;
  44. background: #fafafa;
  45. border-radius: 8px;
  46. border: 1px solid #eee;
  47. }
  48. .package-index {
  49. width: 26px;
  50. height: 26px;
  51. background: linear-gradient(135deg, #667eea, #764ba2);
  52. color: #fff;
  53. border-radius: 50%;
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. font-size: 12px;
  58. font-weight: 600;
  59. flex-shrink: 0;
  60. }
  61. .package-fields {
  62. display: flex;
  63. align-items: center;
  64. gap: 20px;
  65. flex: 1;
  66. }
  67. .package-field {
  68. display: flex;
  69. align-items: center;
  70. gap: 6px;
  71. }
  72. .package-field label {
  73. font-size: 12px;
  74. color: #666;
  75. white-space: nowrap;
  76. }
  77. .package-field input {
  78. width: 80px;
  79. padding: 6px 10px;
  80. border: 1px solid #ddd;
  81. border-radius: 5px;
  82. font-size: 13px;
  83. outline: none;
  84. transition: border-color 0.2s;
  85. }
  86. .package-field input:focus {
  87. border-color: #667eea;
  88. }
  89. .package-field .unit {
  90. font-size: 12px;
  91. color: #999;
  92. }
  93. .package-total {
  94. padding: 6px 12px;
  95. background: #f0fdf4;
  96. border-radius: 5px;
  97. font-size: 13px;
  98. color: #16a34a;
  99. font-weight: 500;
  100. white-space: nowrap;
  101. }
  102. .package-actions {
  103. display: flex;
  104. align-items: center;
  105. gap: 8px;
  106. flex-shrink: 0;
  107. }
  108. .btn-confirm {
  109. display: none;
  110. width: 28px;
  111. height: 28px;
  112. background: #10b981;
  113. color: #fff;
  114. border: none;
  115. border-radius: 50%;
  116. cursor: pointer;
  117. font-size: 14px;
  118. align-items: center;
  119. justify-content: center;
  120. transition: all 0.2s;
  121. }
  122. .btn-confirm:hover {
  123. background: #059669;
  124. transform: scale(1.1);
  125. }
  126. .btn-confirm.show {
  127. display: flex;
  128. }
  129. .btn-remove {
  130. width: 28px;
  131. height: 28px;
  132. background: #fee2e2;
  133. color: #ef4444;
  134. border: none;
  135. border-radius: 50%;
  136. cursor: pointer;
  137. font-size: 16px;
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. transition: all 0.2s;
  142. }
  143. .btn-remove:hover {
  144. background: #fecaca;
  145. }
  146. .btn-add {
  147. display: inline-flex;
  148. align-items: center;
  149. gap: 6px;
  150. padding: 8px 14px;
  151. background: #f0fdf4;
  152. color: #16a34a;
  153. border: 1px solid #86efac;
  154. border-radius: 6px;
  155. cursor: pointer;
  156. font-size: 13px;
  157. transition: all 0.2s;
  158. margin-top: 12px;
  159. }
  160. .btn-add:hover {
  161. background: #dcfce7;
  162. }
  163. .preview-section {
  164. margin-top: 24px;
  165. padding: 24px;
  166. background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  167. border-radius: 16px;
  168. border: 1px solid rgba(102, 126, 234, 0.1);
  169. }
  170. .preview-title {
  171. font-size: 14px;
  172. font-weight: 600;
  173. color: #374151;
  174. margin-bottom: 20px;
  175. display: flex;
  176. align-items: center;
  177. gap: 8px;
  178. }
  179. .preview-title::before {
  180. content: '';
  181. width: 4px;
  182. height: 16px;
  183. background: linear-gradient(135deg, #667eea, #764ba2);
  184. border-radius: 2px;
  185. }
  186. .preview-packages {
  187. display: grid;
  188. grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  189. gap: 20px;
  190. }
  191. .preview-card {
  192. padding: 28px 24px;
  193. background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #9333ea 100%);
  194. color: #fff;
  195. border-radius: 20px;
  196. text-align: center;
  197. box-shadow:
  198. 0 10px 30px rgba(102, 126, 234, 0.3),
  199. 0 4px 12px rgba(0, 0, 0, 0.1);
  200. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  201. position: relative;
  202. overflow: hidden;
  203. display: flex;
  204. flex-direction: column;
  205. align-items: center;
  206. justify-content: center;
  207. min-height: 140px;
  208. }
  209. .preview-card::before {
  210. content: '';
  211. position: absolute;
  212. top: -50%;
  213. left: -50%;
  214. width: 200%;
  215. height: 200%;
  216. background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  217. opacity: 0;
  218. transition: opacity 0.3s;
  219. }
  220. .preview-card:hover {
  221. transform: translateY(-6px) scale(1.02);
  222. box-shadow:
  223. 0 20px 40px rgba(102, 126, 234, 0.4),
  224. 0 8px 20px rgba(0, 0, 0, 0.15);
  225. }
  226. .preview-card:hover::before {
  227. opacity: 1;
  228. }
  229. .preview-card .points {
  230. font-size: 28px;
  231. font-weight: 700;
  232. letter-spacing: -0.5px;
  233. text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  234. margin-bottom: 16px;
  235. }
  236. .preview-card .card-bottom {
  237. display: flex;
  238. align-items: center;
  239. gap: 10px;
  240. margin-top: auto;
  241. }
  242. .preview-card .bonus {
  243. font-size: 12px;
  244. opacity: 0.95;
  245. padding: 6px 14px;
  246. background: rgba(255, 255, 255, 0.15);
  247. border-radius: 20px;
  248. white-space: nowrap;
  249. }
  250. .preview-card .price {
  251. font-size: 15px;
  252. font-weight: 600;
  253. background: rgba(255, 255, 255, 0.25);
  254. padding: 6px 16px;
  255. border-radius: 20px;
  256. backdrop-filter: blur(4px);
  257. box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  258. white-space: nowrap;
  259. }
  260. .msg {
  261. padding: 10px 14px;
  262. border-radius: 6px;
  263. margin-bottom: 12px;
  264. font-size: 13px;
  265. display: none;
  266. }
  267. .msg.success {
  268. background: #f0fdf4;
  269. color: #16a34a;
  270. }
  271. .msg.error {
  272. background: #fef2f2;
  273. color: #ef4444;
  274. }
  275. </style>
  276. </head>
  277. <body>
  278. <div class="page-content">
  279. <div id="msgBox" class="msg"></div>
  280. <div class="section">
  281. <h3 class="section-title">充值套餐配置</h3>
  282. <div class="package-list" id="packageList"></div>
  283. <button class="btn-add" id="addBtn">+ 添加套餐</button>
  284. <div class="preview-section">
  285. <div class="preview-title">客户端预览</div>
  286. <div class="preview-packages" id="preview"></div>
  287. </div>
  288. </div>
  289. </div>
  290. <script src="../../js/currency/currency.js"></script>
  291. <script>
  292. (function() {
  293. let apiBaseUrl = 'http://localhost:3000';
  294. try {
  295. if (window.parent && window.parent.getApiBaseUrl) {
  296. apiBaseUrl = window.parent.getApiBaseUrl();
  297. }
  298. } catch (e) {}
  299. window.currencyManager = new CurrencyManager({ apiBaseUrl });
  300. })();
  301. </script>
  302. </body>
  303. </html>