{"id":17,"date":"2026-08-10T22:58:58","date_gmt":"2026-08-10T14:58:58","guid":{"rendered":"https:\/\/www.socklm.top\/?page_id=17"},"modified":"2026-08-11T09:55:31","modified_gmt":"2026-08-11T01:55:31","slug":"%e7%a7%af%e5%88%86%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f","status":"publish","type":"page","link":"https:\/\/www.socklm.top\/?page_id=17","title":{"rendered":"\u79ef\u5206\u7ba1\u7406"},"content":{"rendered":"<style>\n.pm-wrap { width: calc(100% - 32px); max-width: 1080px; margin: 0 auto; padding: 20px 0; }\n.pm-wrap h2 { text-align: center; color: #1a1a2e; margin-bottom: 8px; }\n.pm-wrap .subtitle { text-align: center; color: #9ca3af; font-size: 14px; margin-bottom: 32px; }\n.pm-search { display: flex; gap: 10px; margin-bottom: 24px; }\n.pm-search input { flex: 1; padding: 14px 18px; border: 2px solid #e5e7eb; border-radius: 14px; font-size: 16px; outline: none; }\n.pm-search input:focus { border-color: #4f46e5; }\n.pm-search button { padding: 14px 28px; background: #4f46e5; color: #fff; border: none; border-radius: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }\n.pm-search button:hover { background: #4338ca; }\n.pm-result { background: #f8f9fa; border-radius: 16px; padding: 28px; display: none; }\n.pm-result.show { display: block; }\n.pm-result h3 { font-size: 18px; color: #1a1a2e; margin-bottom: 16px; }\n.pm-balance { font-size: 48px; font-weight: 800; color: #4f46e5; text-align: center; margin: 12px 0; }\n.pm-balance.negative { color: #ef4444; }\n.pm-balance-label { text-align: center; color: #9ca3af; font-size: 14px; margin-bottom: 20px; }\n.pm-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }\n.pm-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }\n.pm-table th { text-align: left; padding: 10px 8px; font-size: 12px; color: #6b7280; font-weight: 600; border-bottom: 2px solid #e5e7eb; }\n.pm-table td { padding: 12px 8px; font-size: 13px; color: #374151; border-bottom: 1px solid #f3f4f6; vertical-align: top; }\n.pm-table th:nth-child(1), .pm-table td:nth-child(1) { width: 150px; white-space: nowrap; }\n.pm-table th:nth-child(2), .pm-table td:nth-child(2) { width: 72px; white-space: nowrap; }\n.pm-table th:nth-child(4), .pm-table td:nth-child(4) { width: 110px; white-space: nowrap; }\n.pm-type-add { color: #10b981; font-weight: 600; }\n.pm-type-sub { color: #ef4444; font-weight: 600; }\n.pm-amount { font-weight: 700; }\n.pm-reason { color: #6b7280; max-width: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.65; }\n@media (max-width: 720px) {\n  .pm-wrap { width: calc(100% - 20px); }\n  .pm-result { padding: 20px 16px; }\n  .pm-search { flex-direction: column; }\n  .pm-search button { width: 100%; }\n}\n.pm-no-result { text-align: center; padding: 40px; color: #d1d5db; font-size: 14px; display: none; }\n.pm-no-result.show { display: block; }\n.pm-footer a { color: #4f46e5; font-size: 13px; text-decoration: none; }\n.pm-footer a:hover { text-decoration: underline; }\n.pm-debug { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px; padding: 12px; margin-top: 16px; font-size: 12px; color: #92400e; display: none; }\n.pm-matches { display:none; background:#fff; border:1px solid #e5e7eb; border-radius:16px; padding:10px; margin:0 0 24px; box-shadow:0 8px 24px rgba(15,23,42,.06); }\n.pm-matches.show { display:block; }\n.pm-matches-title { padding:8px 10px 10px; color:#6b7280; font-size:13px; }\n.pm-match-item { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; margin:0; border:0; border-radius:10px; background:transparent; color:#1f2937; cursor:pointer; text-align:left; }\n.pm-match-item:hover { background:#eef7ff; color:#008ac7; }\n.pm-match-name { font-weight:700; overflow-wrap:anywhere; }\n.pm-match-action { flex:0 0 auto; color:#008ac7; font-size:12px; font-weight:700; }\n.pm-pagination { display:none; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; margin-top:18px; }\n.pm-pagination.show { display:flex; }\n.pm-page-btn { min-width:36px; height:36px; padding:0 10px; border:1px solid #dbe3ea; border-radius:9px; background:#fff; color:#475569; font-size:13px; cursor:pointer; }\n.pm-page-btn:hover { border-color:#4f46e5; color:#4f46e5; }\n.pm-page-btn.active { background:#4f46e5; border-color:#4f46e5; color:#fff; font-weight:700; }\n.pm-page-btn:disabled { opacity:.4; cursor:not-allowed; }\n.pm-page-info { color:#94a3b8; font-size:12px; margin-left:4px; }\n<\/style>\n\n<div class=\"pm-wrap\">\n  <h2>\u6211\u7684\u79ef\u5206<\/h2>\n  <div class=\"subtitle\">\u5f53\u524d\u767b\u5f55\u98de\u884c\u5458\u7684\u79ef\u5206\u4f59\u989d\u548c\u53d8\u52a8\u660e\u7ec6<\/div>\n<div class=\"pm-result\" id=\"pmResultCard\">\n    <h3 id=\"pmResultName\">\u7528\u6237\u540d<\/h3>\n    <div class=\"pm-balance\" id=\"pmResultBalance\">0.00<\/div>\n    <div class=\"pm-balance-label\">\u5f53\u524d\u5269\u4f59\u79ef\u5206<\/div>\n    <div class=\"pm-table-wrap\">\n    <table class=\"pm-table\" id=\"pmRecordTable\">\n      <thead>\n        <tr><th>\u65f6\u95f4<\/th><th>\u7c7b\u578b<\/th><th>\u539f\u56e0<\/th><th style=\"text-align:right\">\u6570\u91cf<\/th><\/tr>\n      <\/thead>\n      <tbody id=\"pmRecordBody\"><\/tbody>\n    <\/table>\n    <\/div>\n    <div class=\"pm-pagination\" id=\"pmPagination\"><\/div>\n  <\/div>\n\n  <div class=\"pm-no-result\" id=\"pmNoResult\">\u8bf7\u5148\u767b\u5f55\u98de\u884c\u5458\u8d26\u53f7<\/div>\n\n  <div class=\"pm-debug\" id=\"pmDebug\"><\/div>\n  <div style=\"text-align:center;margin-top:22px;font-size:13px;\">\n    <a href=\"https:\/\/www.socklm.top\/?page_id=17&#038;pm_admin=1\" style=\"color:#9ca3af;text-decoration:none;\">\u7ba1\u7406\u5458\u767b\u5f55 \u2192 \u79ef\u5206\u7ba1\u7406\u540e\u53f0<\/a>\n  <\/div>\n<\/div>\n\n<script>\nfunction pmFormatNum(num) {\n  const n = parseFloat(num);\n  return Number.isFinite(n) ? n.toFixed(2) : '0.00';\n}\n\nfunction pmRenderPagination(data) {\n  const box = document.getElementById('pmPagination');\n  box.innerHTML = '';\n  box.classList.remove('show');\n\n  const p = data.pagination || {};\n  const totalPages = parseInt(p.total_pages || 1, 10);\n  const page = parseInt(p.page || 1, 10);\n  const totalRecords = parseInt(p.total_records || 0, 10);\n\n  if (totalPages <= 1) return;\n\n  function addBtn(text, targetPage, active, disabled) {\n    const btn = document.createElement('button');\n    btn.type = 'button';\n    btn.className = 'pm-page-btn' + (active ? ' active' : '');\n    btn.textContent = text;\n    btn.disabled = !!disabled;\n    if (!disabled && !active) {\n      btn.addEventListener('click', function() {\n        pmQueryCurrentUser(targetPage);\n      });\n    }\n    box.appendChild(btn);\n  }\n\n  addBtn('\u4e0a\u4e00\u9875', page - 1, false, page <= 1);\n\n  let start = Math.max(1, page - 2);\n  let end = Math.min(totalPages, start + 4);\n  start = Math.max(1, end - 4);\n\n  for (let i = start; i <= end; i++) addBtn(String(i), i, i === page, false);\n\n  addBtn('\u4e0b\u4e00\u9875', page + 1, false, page >= totalPages);\n\n  const info = document.createElement('span');\n  info.className = 'pm-page-info';\n  info.textContent = '\u7b2c ' + page + ' \/ ' + totalPages + ' \u9875\uff0c\u5171 ' + totalRecords + ' \u6761';\n  box.appendChild(info);\n  box.classList.add('show');\n}\n\nfunction pmRenderUser(data) {\n  document.getElementById('pmNoResult').classList.remove('show');\n  document.getElementById('pmResultCard').classList.add('show');\n  document.getElementById('pmResultName').textContent = data.user.username;\n\n  const balance = parseFloat(data.user.balance);\n  const balEl = document.getElementById('pmResultBalance');\n  balEl.textContent = pmFormatNum(balance);\n  balEl.className = 'pm-balance' + (balance < 0 ? ' negative' : '');\n\n  const tbody = document.getElementById('pmRecordBody');\n  const records = data.records || [];\n  pmRenderPagination(data);\n  if (records.length === 0) {\n    tbody.innerHTML = '<tr><td colspan=\"4\" style=\"text-align:center;color:#d1d5db;padding:24px\">\u6682\u65e0\u8bb0\u5f55<\/td><\/tr>';\n    return;\n  }\n  tbody.innerHTML = records.map(function(r) {\n    const isAdd = r.type === 'add';\n    const reason = r.reason ? r.reason : '\u2014';\n    const time = r.created_at ? r.created_at.substring(0, 16).replace('T', ' ') : '';\n    return '<tr><td>' + time + '<\/td><td class=\"' + (isAdd ? 'pm-type-add' : 'pm-type-sub') + '\">' + (isAdd ? '\u589e\u52a0' : '\u51cf\u5c11') + '<\/td><td class=\"pm-reason\"><\/td><td class=\"pm-amount ' + (isAdd ? 'pm-type-add' : 'pm-type-sub') + '\" style=\"text-align:right\">' + (isAdd ? '+' : '-') + pmFormatNum(r.amount) + '<\/td><\/tr>';\n  }).join('');\n  Array.from(tbody.querySelectorAll('.pm-reason')).forEach(function(cell, i) {\n    const reason = records[i] && records[i].reason ? records[i].reason : '\u2014';\n    cell.textContent = reason;\n    cell.title = reason === '\u2014' ? '' : reason;\n  });\n}\n\nfunction pmQueryCurrentUser(page) {\n  jQuery.ajax({\n    url: 'https:\/\/www.socklm.top\/wp-admin\/admin-ajax.php',\n    type: 'POST',\n    data: {\n      action: 'points_action',\n      points_action: 'query_current_user',\n      page: page || 1,\n      nonce: '497af30bd8'\n    },\n    success: function(res) {\n      if (res.success) {\n        document.getElementById('pmNoResult').classList.remove('show');\n        pmRenderUser(res.data);\n      } else {\n        document.getElementById('pmResultCard').classList.remove('show');\n        document.getElementById('pmPagination').classList.remove('show');\n        const noResult = document.getElementById('pmNoResult');\n        noResult.textContent = (typeof res.data === 'string' ? res.data : '\u8bf7\u5148\u767b\u5f55\u98de\u884c\u5458\u8d26\u53f7');\n        noResult.classList.add('show');\n      }\n    },\n    error: function() {\n      document.getElementById('pmResultCard').classList.remove('show');\n      const noResult = document.getElementById('pmNoResult');\n      noResult.textContent = '\u79ef\u5206\u660e\u7ec6\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5';\n      noResult.classList.add('show');\n    }\n  });\n}\n\ndocument.addEventListener('DOMContentLoaded', function() {\n  pmQueryCurrentUser(1);\n});\n\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-17","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/pages\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.socklm.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":3,"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/pages\/17\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/www.socklm.top\/index.php?rest_route=\/wp\/v2\/pages\/17\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/www.socklm.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}