首页 / 结账

您的订单

  • 产品
    数量
    价格
  • 修复父子关系:原生家庭疗愈与能量清理-詹唐宁走向父亲营
    清理疗愈营|走向父亲 
    1
    $620.00
拥有代金券? 点击输入券码

账单信息

邮箱和电话将用于登录课程,请填写常用信息。

Email and phone number will be used for course login.

支付方式

  • Pay via PayPal.

支付未成功?请 点此协助处理

您的个人资料将用于处理您的订单、改进您在本网站的使用体验,以及用于在我们的 隐私政策 中描述的其他用途。

(function(){ 'use strict'; // ========== 配置 ========== const FORM_IDS = [3457, 18954, 52897]; const FIELD_ID_SOURCE = 73; const FIELD_ID_CONTENT = 66; const FIELD_ID_TERM = 80; const STORAGE_KEY_SOURCE = 'utm_source'; const STORAGE_KEY_CONTENT = 'utm_content'; const STORAGE_KEY_TERM = 'utm_term'; const STORAGE_KEY_TIME = 'utm_saved_at'; const LOCK_WINDOW_MS = 48 * 60 * 60 * 1000; // =============================================== /* ---------- 1) 保存 utm_source / utm_content / utm_term(URL -> localStorage,48小时锁定) ---------- */ function getSavedAt() { try { return parseInt(localStorage.getItem(STORAGE_KEY_TIME) || '0', 10) || 0; } catch(e) { return 0; } } function isExpired() { const savedAt = getSavedAt(); if (!savedAt) return true; return (Date.now() - savedAt) > LOCK_WINDOW_MS; } function saveUtmFromUrl() { try { const params = new URLSearchParams(window.location.search || ''); const utmSource = params.get('utm_source'); const utmContent = params.get('utm_content'); const utmTerm = params.get('utm_term'); // 新增 if (!utmSource && !utmContent && !utmTerm) return; // 更新判断条件 const expired = isExpired(); let updated = false; if (utmSource && expired) { try { localStorage.setItem(STORAGE_KEY_SOURCE, utmSource.toLowerCase()); } catch(e){} console.log('[UTM] saved utm_source ->', utmSource.toLowerCase()); updated = true; } else if (utmSource) { console.log('[UTM] utm_source locked within 48h, skip overwrite'); } if (utmContent && expired) { try { localStorage.setItem(STORAGE_KEY_CONTENT, utmContent); } catch(e){} console.log('[UTM] saved utm_content ->', utmContent); updated = true; } else if (utmContent) { console.log('[UTM] utm_content locked within 48h, skip overwrite'); } // 新增:utm_term 逻辑 if (utmTerm && expired) { try { localStorage.setItem(STORAGE_KEY_TERM, utmTerm); } catch(e){} console.log('[UTM] saved utm_term ->', utmTerm); updated = true; } else if (utmTerm) { console.log('[UTM] utm_term locked within 48h, skip overwrite'); } if (updated) { try { localStorage.setItem(STORAGE_KEY_TIME, String(Date.now())); } catch(e){} } } catch (e) { console.error('[UTM] saveUtmFromUrl error', e); } } saveUtmFromUrl(); (function(){ const origPush = history.pushState; history.pushState = function() { const ret = origPush.apply(this, arguments); setTimeout(saveUtmFromUrl, 50); return ret; }; const origReplace = history.replaceState; history.replaceState = function() { const ret = origReplace.apply(this, arguments); setTimeout(saveUtmFromUrl, 50); return ret; }; window.addEventListener('popstate', function(){ setTimeout(saveUtmFromUrl, 50); }); })(); /* ---------- 2) 帮助函数:安全读取 localStorage ---------- */ function getSavedUtmSource() { try { return localStorage.getItem(STORAGE_KEY_SOURCE) || ''; } catch(e){ return ''; } } function getSavedUtmContent() { try { return localStorage.getItem(STORAGE_KEY_CONTENT) || ''; } catch(e){ return ''; } } function getSavedUtmTerm() { // 新增 try { return localStorage.getItem(STORAGE_KEY_TERM) || ''; } catch(e){ return ''; } } /* ---------- 3) 在表单中查找/写入字段(或创建 hidden) ---------- */ function findFieldElement(formEl, formId, fieldId) { if (!formEl) return null; const selectors = [ `#wpforms-${formId}-field_${fieldId}`, `input[name="wpforms[fields][${fieldId}]"]`, `textarea[name="wpforms[fields][${fieldId}]"]`, `select[name="wpforms[fields][${fieldId}]"]`, `input#wpforms-${formId}-field_${fieldId}`, `input[name="${fieldId}"]` ]; for (const s of selectors) { try { const el = formEl.querySelector(s); if (el) return el; } catch(e){} } return null; } function setFormFieldValue(formEl, formId, fieldId, value) { if (!formEl) return; const el = findFieldElement(formEl, formId, fieldId); if (el) { try { const tag = el.tagName.toLowerCase(); const type = (el.type || '').toLowerCase(); if (tag === 'select' || tag === 'textarea' || type === 'text' || type === 'hidden' || type === 'email' || type === 'tel' || type === 'search') { el.value = value; } else if (type === 'checkbox' || type === 'radio') { const group = formEl.querySelectorAll(`input[name="${el.name}"]`); if (group && group.length) { let found = false; group.forEach(i => { if (i.value === value) { i.checked = true; found = true; }}); if (!found) group[0].value = value; } } else { try { el.value = value; } catch(e){} } } catch(e){} return; } try { const hidden = document.createElement('input'); hidden.type = 'hidden'; hidden.name = `wpforms[fields][${fieldId}]`; hidden.id = `wpforms-${formId}-field_${fieldId}`; hidden.value = value; formEl.appendChild(hidden); console.log('[UTM] created hidden field', fieldId, '->', value, 'for form', formId); } catch (e) { console.error('[UTM] failed to create hidden field', e); } } /* ---------- 4) 初始化:找到表单并绑定 submit(capture)保证提交前写入 ---------- */ function initForFormIfPresent(formId) { try { const formEl = document.getElementById(`wpforms-form-${formId}`); if (!formEl) return false; const src = getSavedUtmSource(); const content = getSavedUtmContent(); const term = getSavedUtmTerm(); // 新增 if (src) setFormFieldValue(formEl, formId, FIELD_ID_SOURCE, src); if (content) setFormFieldValue(formEl, formId, FIELD_ID_CONTENT, content); if (term) setFormFieldValue(formEl, formId, FIELD_ID_TERM, term); // 新增 if (!formEl.__utm_listener_attached) { formEl.addEventListener('submit', function(e){ try { const curSrc = getSavedUtmSource(); const curContent = getSavedUtmContent(); const curTerm = getSavedUtmTerm(); // 新增 if (curSrc) setFormFieldValue(formEl, formId, FIELD_ID_SOURCE, curSrc); if (curContent) setFormFieldValue(formEl, formId, FIELD_ID_CONTENT, curContent); if (curTerm) setFormFieldValue(formEl, formId, FIELD_ID_TERM, curTerm); // 新增 } catch (err) { console.error('[UTM] submit handler error', err); } }, true); formEl.__utm_listener_attached = true; } document.addEventListener('wpformsAjaxSubmitSuccess', function(){ // noop }); return true; } catch (e) { console.error('[UTM] initForFormIfPresent error for form ' + formId, e); return false; } } (function(){ try { FORM_IDS.forEach(id => initForFormIfPresent(id)); } catch(e){} })(); (function(){ const observer = new MutationObserver(function(mutations){ for (const m of mutations) { if (m.addedNodes && m.addedNodes.length) { for (const node of m.addedNodes) { try { if (!(node instanceof HTMLElement)) continue; for (const id of FORM_IDS) { if (node.id === `wpforms-form-${id}` || (node.querySelector && node.querySelector(`#wpforms-form-${id}`))) { setTimeout(()=>initForFormIfPresent(id), 30); } } } catch(e){} } } } }); observer.observe(document.documentElement || document.body, { childList: true, subtree: true }); setTimeout(()=>observer.disconnect(), 5 * 60 * 1000); })(); /* ---------- 5) 暴露调试接口 ---------- */ window.__utm_utils = { saveUtmFromUrl, getSavedUtmSource, getSavedUtmContent, getSavedUtmTerm, // 新增 setFieldsNow: function(){ try { FORM_IDS.forEach(formId => { const f = document.getElementById(`wpforms-form-${formId}`); if (f) { const src = getSavedUtmSource(); const content = getSavedUtmContent(); const term = getSavedUtmTerm(); // 新增 if (src) setFormFieldValue(f, formId, FIELD_ID_SOURCE, src); if (content) setFormFieldValue(f, formId, FIELD_ID_CONTENT, content); if (term) setFormFieldValue(f, formId, FIELD_ID_TERM, term); // 新增 } }); } catch(e){ console.error(e); } }, clearSaved: function(){ try { localStorage.removeItem(STORAGE_KEY_SOURCE); localStorage.removeItem(STORAGE_KEY_CONTENT); localStorage.removeItem(STORAGE_KEY_TERM); // 新增 localStorage.removeItem(STORAGE_KEY_TIME); console.log('[UTM] 已清空 localStorage 中的 UTM 参数'); } catch(e){} } }; })();
客服 聯繫班班
領福利
客服
聯繫班班,領福利
点击下方按钮联系
WhatsApp
WhatsApp
箭头
LINE
LINE
箭头
客服
正在為你分配客户经理中,请耐心等候...