Empty Result

购物车
优惠劵
搜索
// 打开弹窗 function openXhsModal(url) { const modal = document.getElementById('xhs-modal'); const body = document.getElementById('xhs-modal-body'); body.innerHTML = '
加载中...
'; modal.classList.add('show'); document.body.style.overflow = 'hidden'; fetch(url) .then(res => res.text()) .then(html => { const doc = new DOMParser().parseFromString(html, 'text/html'); // 精准抓取圈子详情内容 const content = doc.querySelector('.single-circle') || doc.querySelector('.circle-content') || doc.body; body.innerHTML = content.outerHTML; }) .catch(() => { body.innerHTML = '
加载失败,请重试
'; }); } // 关闭弹窗 function closeXhsModal() { const modal = document.getElementById('xhs-modal'); modal.classList.remove('show'); document.body.style.overflow = ''; } // 全局事件委托 兼容Vue异步渲染 jQuery(document).on('click', '.circle-topic-item', function(e) { // 排除内部按钮、点赞、评论、标签,不触发弹窗 if (jQuery(e.target).closest('button,.topic-footer,.comment-box,.circle-child-btn').length) { return; } let link = jQuery(this).find('a').attr('href'); if (!link) return; // PC端才拦截跳转 if (window.innerWidth > 768) { e.preventDefault(); e.stopPropagation(); openXhsModal(link); } });