大きいサイズのメンズ専門店ビッグエムワン【SB0322】大きいサイズ メンズ LINKATION リンケーション ハンズフリー シューズ 靴 アスレジャー スポーツウェア lksn-249001通販サイト

link

【SB0322】大きいサイズ メンズ LINKATION リンケーション ハンズフリー シューズ 靴 アスレジャー スポーツウェア lksn-249001

定価 ¥5,489(税込)
¥4,660(税込)
品番
lksn-249001
29.030.031.032.0
915.チャコールグレー × × × ×
990.ブラック × × × ×
個数

ユーザーレビュー

この商品に寄せられたレビューはまだありません。

/* ========================================================================== 閲覧履歴(最近チェックしたアイテム)表示スクリプト - 本番実装版 対象: big-m-one.com 商品詳細ページ(/shop/g/...) ========================================================================== */ (function () { 'use strict'; // -- 設定 ------------------------------------------------------------- var CONFIG = { API_ENDPOINT: 'https://big-m-one-recsys-api-gcsmount-846450369028.asia-northeast1.run.app/api/products/bulk', GA4_MEASUREMENT_ID: 'G-VKBPBBY6FH', HISTORY_KEY: 'browsing_history', MAX_SAVED: 50, // localStorageに保持する最大件数 MAX_DISPLAY_PC: 6, // PC: 表示件数(横1列) MAX_DISPLAY_SP: 12, // SP: 表示件数(2列) EXPIRE_MS: 365 * 24 * 60 * 60 * 1000, // 保持期限: 1年 API_TIMEOUT_MS: 5000, GTAG_TIMEOUT_MS: 1500, ANCHOR_TIMEOUT_MS: 10000, // 挿入先の出現待ち上限 TITLE: '最近チェックしたアイテム', ROOT_CLASS: 'browsing-history-from-console', ANCHOR_SELECTORS: { pc: 'div.pane-goods-footer > div.recommended-items-from-console', sp: 'body > div.wrapper > main > div.recommended-items-from-console' }, PC_DETECT_SELECTOR: 'div.pane-goods-footer', NATIVE_HISTORY_SELECTOR: '#block_of_history, .block_of_history', PRODUCT_PATH_RE: /^\/shop\/g\/g([^/]+)\/?/ }; // 商品詳細ページ以外では何もしない var pathMatch = location.pathname.match(CONFIG.PRODUCT_PATH_RE); if (!pathMatch) return; // 二重実行防止 if (window.__bmBrowsingHistoryLoaded) return; window.__bmBrowsingHistoryLoaded = true; // -- ユーティリティ --------------------------------------------------- function log() { if (window.__bmBrowsingHistoryDebug && window.console) { console.log.apply(console, ['[browsing-history]'].concat([].slice.call(arguments))); } } function withTimeout(promise, ms, fallback) { return new Promise(function (resolve) { var done = false; var timer = setTimeout(function () { if (!done) { done = true; resolve(fallback); } }, ms); promise.then(function (v) { if (!done) { done = true; clearTimeout(timer); resolve(v); } }, function () { if (!done) { done = true; clearTimeout(timer); resolve(fallback); } }); }); } function waitForElement(selector, timeout) { return new Promise(function (resolve) { var found = document.querySelector(selector); if (found) return resolve(found); var observer = new MutationObserver(function () { var el = document.querySelector(selector); if (el) { observer.disconnect(); clearTimeout(timer); resolve(el); } }); observer.observe(document.body, { childList: true, subtree: true }); var timer = setTimeout(function () { observer.disconnect(); resolve(null); }, timeout); }); } function safeUrl(url) { try { var u = new URL(url, location.origin); return (u.protocol === 'https:' || u.protocol === 'http:') ? u.href : ''; } catch (e) { return ''; } } function sendGaEvent(name, params) { if (typeof window.gtag === 'function') window.gtag('event', name, params || {}); } // -- localStorage ---------------------------------------------------- function readHistory() { try { var parsed = JSON.parse(localStorage.getItem(CONFIG.HISTORY_KEY) || '[]'); if (!Array.isArray(parsed)) return []; return parsed.filter(function (h) { return h && typeof h.id === 'string' && h.id && typeof h.savedAt === 'number'; }); } catch (e) { return []; } } function writeHistory(history) { try { localStorage.setItem(CONFIG.HISTORY_KEY, JSON.stringify(history)); } catch (e) { /* 容量超過・プライベートモード等は無視 */ } } function getCurrentProductId() { var el = document.querySelector('#spec_item_code'); var fromDom = el ? String(el.textContent || el.value || '').trim() : ''; return fromDom || decodeURIComponent(pathMatch[1] || ''); } function saveAndGetHistoryIds(currentId) { var now = Date.now(); var history = readHistory().filter(function (h) { return h.id !== currentId && now - h.savedAt < CONFIG.EXPIRE_MS; }); var others = history.map(function (h) { return h.id; }); if (currentId) history.unshift({ id: currentId, savedAt: now }); writeHistory(history.slice(0, CONFIG.MAX_SAVED)); return others; } // -- GA4 ID取得(タイムアウト付き)------------------------------------ function gtagGet(field) { return withTimeout(new Promise(function (resolve) { if (typeof window.gtag !== 'function') return resolve(''); window.gtag('get', CONFIG.GA4_MEASUREMENT_ID, field, function (v) { resolve(v || ''); }); }), CONFIG.GTAG_TIMEOUT_MS, ''); } // -- API(タイムアウト付き)------------------------------------------ function fetchItems(ids, userId, sessionId) { var controller = typeof AbortController === 'function' ? new AbortController() : null; var timer = controller ? setTimeout(function () { controller.abort(); }, CONFIG.API_TIMEOUT_MS) : null; return fetch(CONFIG.API_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ids: ids, ga4_user_id: userId, ga4_session_id: sessionId }), signal: controller ? controller.signal : undefined }).then(function (res) { if (!res.ok) throw new Error('HTTP ' + res.status); return res.json(); }).then(function (data) { return (data && Array.isArray(data.recommended_item_info)) ? data.recommended_item_info : []; }).finally(function () { if (timer) clearTimeout(timer); }); } // -- スタイル --------------------------------------------------------- var STYLE_ID = 'bm-browsing-history-style'; var HIDE_NATIVE_ID = 'bm-browsing-history-hide-native'; function injectStyle() { if (document.getElementById(STYLE_ID)) return; var r = '.' + CONFIG.ROOT_CLASS; var css = r + '{margin:24px 0}' + r + ' .bmh-title{font-weight:bold;font-size:1.15em;margin:0 0 .75em;padding:0 0 .4em;border-bottom:1px solid #ddd;color:#333;background:none}' + r + ' .bmh-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0;padding:0;list-style:none}' + r + ' .bmh-item{text-align:center;min-width:0}' + r + ' .bmh-link{display:block;text-decoration:none;color:inherit}' + r + ' .bmh-link:focus-visible{outline:2px solid #444;outline-offset:2px}' + r + ' .bmh-img{display:block;width:100%;max-width:160px;aspect-ratio:1/1;height:auto;object-fit:contain;margin:0 auto}' + r + ' .bmh-name{margin:.4em 0 .2em;font-size:.85em;line-height:1.4;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}' + r + ' .bmh-price{margin:0;font-size:.9em;color:#d00}' + // PC: 横1列に6商品 r + '.bmh--pc .bmh-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}'; var style = document.createElement('style'); style.id = STYLE_ID; style.textContent = css; document.head.appendChild(style); } function hideNativeHistory() { if (document.getElementById(HIDE_NATIVE_ID)) return; var style = document.createElement('style'); style.id = HIDE_NATIVE_ID; style.textContent = CONFIG.NATIVE_HISTORY_SELECTOR + '{display:none!important}'; document.head.appendChild(style); } // -- DOM生成(テキストはtextContentで設定)-------------------------- function buildSection(items, isPc) { var section = document.createElement('section'); section.className = CONFIG.ROOT_CLASS + (isPc ? ' bmh--pc' : ' bmh--sp'); section.setAttribute('aria-label', CONFIG.TITLE); var h2 = document.createElement('h2'); h2.className = 'bmh-title'; h2.textContent = CONFIG.TITLE; section.appendChild(h2); var list = document.createElement('ul'); list.className = 'bmh-grid'; items.forEach(function (item, index) { var name = String(item.product_name_short || item.product_name || ''); var li = document.createElement('li'); li.className = 'bmh-item'; var a = document.createElement('a'); a.className = 'bmh-link'; a.href = item.__url; a.addEventListener('click', function () { sendGaEvent('browsing_history_click', { item_id: String(item.id || item.product_id || ''), item_name: name, index: index + 1 }); }); var imgUrl = safeUrl(item.thumbnail_image); if (imgUrl) { var img = document.createElement('img'); img.className = 'bmh-img'; img.src = imgUrl; img.alt = name; img.loading = 'lazy'; img.decoding = 'async'; img.width = 360; img.height = 360; a.appendChild(img); } var pName = document.createElement('p'); pName.className = 'bmh-name'; pName.textContent = name; a.appendChild(pName); var price = Number(item.selling_price_with_tax); if (isFinite(price) && price > 0) { var pPrice = document.createElement('p'); pPrice.className = 'bmh-price'; pPrice.textContent = '\u00A5' + price.toLocaleString('ja-JP'); a.appendChild(pPrice); } li.appendChild(a); list.appendChild(li); }); section.appendChild(list); return section; } // -- 挿入先の決定 ----------------------------------------------------- // 第1候補: レコメンド枠の直後 / 第2候補: 標準閲覧履歴ブロックの位置 function resolveAnchor() { var isPc = !!document.querySelector(CONFIG.PC_DETECT_SELECTOR); var selector = isPc ? CONFIG.ANCHOR_SELECTORS.pc : CONFIG.ANCHOR_SELECTORS.sp; return waitForElement(selector, CONFIG.ANCHOR_TIMEOUT_MS).then(function (el) { if (el) return { el: el, position: 'afterend', type: isPc ? 'pc_recommend' : 'sp_recommend', isPc: isPc }; var native = document.querySelector(CONFIG.NATIVE_HISTORY_SELECTOR); if (native) return { el: native, position: 'beforebegin', type: 'native_history', isPc: isPc }; return null; }); } // -- メイン ----------------------------------------------------------- function main() { var currentId = getCurrentProductId(); var historyIds = saveAndGetHistoryIds(currentId); if (!historyIds.length) { log('no history'); return; } Promise.all([gtagGet('client_id'), gtagGet('session_id')]) .then(function (ga) { return fetchItems(historyIds, ga[0], ga[1]); }) .then(function (items) { var valid = items .map(function (i) { i.__url = safeUrl(i.shop_url); return i; }) .filter(function (i) { return i.__url && (i.product_name_short || i.product_name); }); if (!valid.length) { log('no items returned'); return; } return resolveAnchor().then(function (anchor) { if (!anchor) { log('anchor not found; keep native history'); return; } if (document.querySelector('.' + CONFIG.ROOT_CLASS)) return; var shown = valid.slice(0, anchor.isPc ? CONFIG.MAX_DISPLAY_PC : CONFIG.MAX_DISPLAY_SP); injectStyle(); anchor.el.insertAdjacentElement(anchor.position, buildSection(shown, anchor.isPc)); hideNativeHistory(); // 独自表示に成功したときだけ標準ブロックを隠す sendGaEvent('browsing_history_impression', { item_count: shown.length, placement: anchor.type }); log('rendered', shown.length, 'items at', anchor.type); }); }) .catch(function (e) { // 失敗時は標準の閲覧履歴がそのまま表示される log('error', e); }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', main); } else { main(); } })();