pricing.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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="stylesheet" href="../../css/admin.css">
  8. </head>
  9. <body>
  10. <div class="page-content active">
  11. <!-- 定价资源网格 -->
  12. <div class="pricing-grid" id="pricingGrid">
  13. <div class="loading-text">加载中...</div>
  14. </div>
  15. </div>
  16. <script src="../../js/pricing/pricing.js"></script>
  17. <script>
  18. // 初始化定价管理器
  19. (function() {
  20. let apiBaseUrl = 'http://localhost:3000';
  21. // 尝试从父窗口获取 API 地址(file:// 协议下会失败,使用默认值)
  22. try {
  23. if (window.parent && window.parent.getApiBaseUrl) {
  24. apiBaseUrl = window.parent.getApiBaseUrl();
  25. }
  26. } catch (e) {
  27. console.log('[PricingManager] 使用默认 API 地址:', apiBaseUrl);
  28. }
  29. if (!window.pricingManager) {
  30. window.pricingManager = new PricingManager({
  31. apiBaseUrl: apiBaseUrl,
  32. grid: document.getElementById('pricingGrid')
  33. });
  34. window.pricingManagerInstance = window.pricingManager;
  35. }
  36. })();
  37. </script>
  38. </body>
  39. </html>