async function emsFetch(url , param){ try { var _param = ''; if(param){ _param = param; } var response = await fetch(url + '?' + _param); const resText = await response.text(); return resText; } catch (error) { console.log('Ems Fetch Error:' + url); } } (async function(){ if(typeof $ems === 'undefined'){ const jQueryTemp = await emsFetch('https://www41.easy-myshop.jp/ems/js/jquery-2.2.4.min.js'); eval(jQueryTemp); $ems = $.noConflict(true); } (function($){ if($('#ems_js_add').length == 0){ $('body').append(''); } var subCls = '.mapping_detail'; var notEle = ':not(.js)'; if(typeof $('#ems_js_add').data('detail') === "undefined"){ $('#ems_js_add').data('detail', 'true'); const itemDetailJs = emsFetch('https://straightplayingcards.easy-myshop.jp/c-cart-detail.js' , 'member_id='); itemDetailJs.then(res => { eval(res); }).catch(err => { $('#ems_js_add').removeData('detail'); }); } subCls = '.mapping_js'; notEle = ''; //ems-dialog.jsを読み込み if(typeof $('#ems_js_add').data('dialog') === "undefined"){ $('#ems_js_add').data('dialog', 'true'); const dlgJs = emsFetch('https://www41.easy-myshop.jp/ems/js/jquery.ems-dialog.js'); dlgJs.then(res => { eval(res); }).catch(err => { $('#ems_js_add').removeData('dialog'); }); } //ems-spinner.jsを読み込み if(typeof $('#ems_js_add').data('spinner') === "undefined"){ if(typeof spinnerFormFlg === "undefined"){ $('#ems_js_add').data('spinner', 'true'); const spinnerJs = emsFetch('https://www41.easy-myshop.jp/ems/js/ems-spinner.js'); spinnerJs.then(res => { eval(res); }).catch(err => { $('#ems_js_add').removeData('spinner'); }); } } if(typeof favoriteFormFlg === "undefined"){ const favoriteJs = emsFetch('https://www41.easy-myshop.jp/ems/js/favorite.js'); favoriteJs.then(res => { eval(res); this.favoChange = favoChange; }); } if(typeof regularFormFlg === "undefined"){ const regularJs = emsFetch('https://www41.easy-myshop.jp/ems/js/regularForm.js?v=2024r01.2404251030'); regularJs.then(res => { eval(res); // 別名定義 this.date_count_ani = date_count_ani; this.changeInterval = changeInterval; this.dispRegularPeriodArea = dispRegularPeriodArea; this.changeFirstSendDate = changeFirstSendDate; this.changeFirstSendDateSync = changeFirstSendDateSync; this.changeNextSend = changeNextSend; this.changeNextSendSync = changeNextSendSync this.changeRegularPeriod = changeRegularPeriod; this.setRegularCookie = setRegularCookie; this.changeRegularPeriodSync = changeRegularPeriodSync; }); } $('.ems_jscart' + subCls).each(function(i){ var itemCode = $(this).attr('data-item-code'); var setUse = $(this).attr('data-set'); var paramStr = ''; var emsJsCart = $(this); var cnt = 0; if($(emsJsCart).attr('data-uk')){ return true; // 多重起動防止 } var uk = 'b3708eae8b5f4d96b5a1906b5376cdef' + i; $(emsJsCart).find('.ems_tag' + notEle).each(function(j){ if($(emsJsCart).find('.ems_tag' + notEle).attr('data-contents') != ''){ if(paramStr != ''){ paramStr += ','; } var dataContents = $(emsJsCart).find('.ems_tag' + notEle).eq(j).attr('data-contents'); $(emsJsCart).find('.ems_tag' + notEle).eq(j).addClass(dataContents); paramStr += dataContents; cnt++; } }); if(setUse){ paramStr = "set"; } let param = 'ic=' + itemCode + '&p=' + paramStr + '&uk=' + uk + '&a_key=5f4d4723e7fb7e4764a0b4a713be8fb9242d37db56cc8b433556de773027b7bd&detail_page_flg=0&member_id=&apply_id=&apply_key=&pm='; $.ajax({ cache: false, url: 'https://straightplayingcards.easy-myshop.jp/c-cart-mapping.js/itemHtmlJson?' + param ,method: 'post' ,success: function(_res){ var itemJson = $.parseJSON(_res); if(setUse){ $(emsJsCart).append(itemJson['set']); } var noneItem = false; for(key in itemJson){ if(key == 'none_item'){ noneItem = true; } if(!$(emsJsCart).attr('data-uk')){ $(emsJsCart).find('.ems_tag.' + key + notEle).after(itemJson[key]).remove(); } } if(!noneItem && !$(emsJsCart).attr('data-uk')){ $(emsJsCart).addClass(uk).attr('data-uk' , uk); // 販売時間 if($(emsJsCart).find('.before_handling_sec').length > 0){ setInterval(function(){ if(typeof handlingCountdown == 'function'){ handlingCountdown(uk); } },1000); } // 抽選応募時間 if($(emsJsCart).find('.before_lottery_sec').length > 0){ setInterval(function(){ if(typeof lotteryCountdown == 'function'){ lotteryCountdown(uk); } },1000); } // 定期 if($(emsJsCart).find('.regular_form_area').length > 0){ // data-ukの追記 $(emsJsCart).find('.regular_form_area').attr('data-uk' , uk); // 定期FormStart var reguInterval = setInterval(function(){ if(typeof regularFormStart == 'function' ){ clearInterval(reguInterval); regularFormStart(uk); } },100); } // lastUrl var lastUrl = location.href; if($('.js_last_url').length > 0){ $('.js_last_url').val(lastUrl); } // 二次元種類 // オーダーメイド(JSカート) if($(emsJsCart).find('.js_cart_ordermade').length > 0){ $(emsJsCart).find('.js_cart_ordermade').attr('id' , 'span_' + uk); $(emsJsCart).append(''); }else{ $('#ordermade_dialog_' + itemCode).addClass(uk); var ordermadeArea = $('.' + uk +' .ordermade_area.in.detail:not(.comp)').length; if(ordermadeArea > 0){ var ordermadeDetailUrl = './c-ordermade-detail?ic=' + itemCode +'&detail_flg=1&omcid=&pre=0&uk=' + uk + '&select=&apply_id=&apply_key='; $.ajax({ cache: false, url: ordermadeDetailUrl ,method: 'post' ,success: function(_res){ $('.ordermade_area:not(.comp)').html(_res).addClass('comp'); $('.ordermade_contents').stop(true,true); setConfScroll('.ordermade_variable_area' , -100); setTimeout(function(){ $('.iframe_wait.detail').remove(); $('.ordermade_area').slideDown(); if($(emsJsCart).find('.regular_form_area').length > 0){ if(typeof regularFormStart == 'function'){ regularFormStart(uk); } } }, 1000); } ,error: function(_res){ } ,async: false }); } } $(emsJsCart).append(''); } } ,error: function(_res){ } ,async: true }); }); }($ems)); })();