// PCのポイント訴求実装(右カラム上)
// c-cpnt.gnst.jp/header/js/header-0.1.0.jsによってcookieからセットされるメンバー名とポイント数
// shop.app.jsの方が先に読み込まれるので初期値は空
let loginName = ''
let loginPoint = ''
let tryCount = 100
const tryTime = 100
const cloneValue = () => {
const memberName = document.getElementById('js-sub-member-info-name')
const memberPoint = document.getElementById('js-sub-member-info-point')
if (--tryCount) {
if (loginName === '' && loginPoint === '') {
loginName = document.getElementById('user_name').textContent
loginPoint = document.getElementById('point').textContent
setTimeout(cloneValue, tryTime)
} else {
memberName.textContent = loginName
memberPoint.textContent = `${loginPoint}P`
}
}
}
const subMemberInfo = () => {
const subMemberInfoWrap = document.querySelector('.sub-member-info')
if (subMemberInfoWrap === null) return
// header-0.1.0.jsの読み込み後に発火
window.addEventListener('load', () => {
cloneValue()
})
}
export default subMemberInfo
if($('#motif').length) {
var tryCount = 10;
try_issue();
}
function try_issue() {
if ($('.mod-trip-advisor-review').length) {
SHOP.issue218.init();
} else if (tryCount--) {
setTimeout(function() {
try_issue();
}, 500);
}
}
start: function() {
var that = this;
// 既存のphotolistが走るまで待機
setTimeout(function() {
if (that.checkcount--) {
if ($('#sh-photo-list-wrap .list-unit')[0]) {
that.action();
} else {
that.start();
}
}
}, 100);
}
// 10回tryの10秒待ちコード
var i = 10;
var wait = function() {
if (--i) $('.wewewe').length ? self.start() : setTimeout(wait, 1000);
};
wait();