신제품 희망 소매 가격에서 할인율 83%OFF ( 448.56 USD )
신제품 희망 소매 가격：539.76 USD
상품코드：2100333721974
'; } else { return ''; } } var vars = [], hash = "", array = "", flg_recommend = true; var query = window.location.search; hash = query.slice(1).split('&'); for (var i = 0; i < hash.length; i++) { array = hash[i].split('='); //keyと値に分割。 if ( array[0] === 'f' && array[1] === 't' ) flg_recommend = false; var obj = {}; obj[array[0]] = array[1] vars.push( obj ); //末尾にクエリ文字列のkeyを挿入。 } if ( flg_recommend ) { var recommendParams = { slickBefore: 0, slickCurrent: 0, slickSwipeCount: 0, slickShowItems: 0, randomString: new Date().getTime().toString(16) + Math.floor(1000 * Math.random()).toString(16), init: function (slickelemnt) { // set params this.slickCurrent = 0; this.slickSwipeCount = 0; this.slickShowItems = slickelemnt.options.slidesToShow; // rewrite $('.js-url_rewite').each(function () { var $this = $(this); var pid = $this.attr('data-pid'); $this.attr('href', 'https://dokodemo.world/ko/es/products/' + pid + '/?recommend=1001&uid=' + recommendParams.randomString + '&cs=' + recommendParams.slickCurrent + '&sc=' + recommendParams.slickSwipeCount + '&si=' + recommendParams.slickShowItems); }); }, rewrite: function (slickelemnt, current) { // set params this.slickCurrent = Math.floor(current / slickelemnt.options.slidesToShow); if (this.slickCurrent != this.slickBefore) { this.slickSwipeCount += 1; } this.slickBefore = this.slickCurrent; this.slickShowItems = slickelemnt.options.slidesToShow; // rewrite $('.js-url_rewite').each(function () { var $this = $(this); var pid = $this.attr('data-pid'); $this.attr('href', 'https://dokodemo.world/ko/es/products/' + pid + '/?recommend=1001&uid=' + recommendParams.randomString + '&cs=' + recommendParams.slickCurrent + '&sc=' + recommendParams.slickSwipeCount + '&si=' + recommendParams.slickShowItems); }); } } $.ajax({ type: 'POST', url: 'https://3gpij0xjo6.execute-api.ap-northeast-1.amazonaws.com/prod/category/salecount', dataType: 'json', headers: { 'x-api-key': 'oJi8ltTxuq6kB5kaFF3we2u8GpVsOefu7VpLndI7', 'x-dkdm-gid': '4', 'x-dkdm-ccd': 'USD', 'x-dkdm-scd': '840', 'Content-Type': 'application/json' }, data: JSON.stringify({ 'cidl': '2654', 'cidm': '2716', 'cids': '2724', 'epid': ['1600071'] }), }) .done(function (data, textStatus, jqXHR) { $('#js-recommend_list').fadeIn(); var html = ''; var langkey = '4'; if (data.errorType) { html += '
'; $('#js-slick_RECOMMEND_CATEGORY').html(html); } else { // データが０件の場合は非表示 if (data.cs.length === 0 && data.cm.length === 0) { html += '데이터를 취득할 수 없습니다.'; $('#js-slick_RECOMMEND_CATEGORY').html(html); // 中カテ、小カテのデータがある場合 } else { html += makeProductblockDom(data.cs); html += makeProductblockDom(data.cm); $('#js-slick_RECOMMEND_CATEGORY').html(html); // スライド detail.slickSlide($('#js-slick_RECOMMEND_CATEGORY')); } } }) .fail(function (jqXHR, textStatus, errorThrown) { console.log('fail', jqXHR.status); var html = '데이터를 취득할 수 없습니다.'; $('#js-slick_RECOMMEND_CATEGORY').html(html); }).always(function () { detail.reviewDisp(); }); var user_id = ''; $.ajax({ type: 'POST', url: 'https://eeqcy0nt31.execute-api.ap-northeast-1.amazonaws.com/prod/v1/orders/products', headers: { 'x-dkdm-gid': '4', 'x-dkdm-ccd': 'USD', 'x-dkdm-scd': '840', 'Content-Type': 'application/json' }, data: JSON.stringify({ 'product_id': Number('1600071'), 'product_group_id': null, 'size': 20, 'user_id': user_id ? user_id : NaN, }), }) .done(function (data, textStatus, jqXHR) { var html = ''; if (data.code !== 1) { $('#js-slick_RECOMMEND_ORDER').fadeIn(); html += '
'; $('#js-slick_RECOMMEND_ORDER ul').html(html); } else { // // // データが4件以下の場合は非表示 if (data.items.length > 4) { var dom = makeProductblockDom(data.items); $("#js-slick_RECOMMEND_ORDER .p-products-slickSlide").html(dom); $('#js-slick_RECOMMEND_ORDER').fadeIn(); detail.slickSlide($('#js-slick_RECOMMEND_ORDER .p-products-slickSlide')); } } }) .fail(function (jqXHR, textStatus, errorThrown) { console.log('fail', jqXHR.status); var html = '데이터를 취득할 수 없습니다.'; $('#js-slick_RECOMMEND_ORDER').html(html); }).always(function () { detail.reviewDisp(); }); } $.ajax({ type: 'POST', url: 'https://dokodemo.world/api/product_history/', dataType: 'json', data: { global_id: '4', country_id: '840', currency_code: 'USD', product_ids: '1600071' }, jsonpCallback: 'callback' }) .done(function(data, textStatus, jqXHR) { var dom = makeProductblockDom(data,'p_history'); $("#js-slick_arrProductHistory").html(dom); $('#js-slick_arrProductHistory').fadeIn(); detail.slickSlide($('#js-slick_arrProductHistory')); }) .fail(function(jqXHR, textStatus, errorThrown) { console.log('fail', jqXHR.status); var html = '데이터를 취득할 수 없습니다.'; $('#js-slick_arrProductHistory').html(html); }) .always(function() { detail.reviewDisp(); }); function makeProductblockDom(productList,type){ var productData = { product_id: '', product_name: '', main_list_image: '', brand_code: '', brand_name: '', maker_code: '', maker_name: '', price: '', review_count: 0, review_average: 0, favorite_count: false, is_sale: false, is_new: false, } var dom = ''; productList.forEach(function(data) { var payload = Object.assign({}, productData); if (data.product_id) { payload.product_id = data.product_id; }else if(data.pid){ payload.product_id = data.pid; } if (data.product_name) { payload.product_name = dokodemo.commonMethod.decodeURICheck(data.product_name); }else if(data.name){ if (data.name instanceof Object) { var _name= data.name[ dokodemo.apiParams.global_id ] != undefined ? data.name[ dokodemo.apiParams.global_id ] : data.name[1]; payload.product_name = dokodemo.commonMethod.decodeURICheck(_name); }else{ payload.product_name = dokodemo.commonMethod.decodeURICheck(data.name); } } if (data.image_path) { payload.main_list_image = data.image_path; }else if(data.main_list_image){ payload.main_list_image = data.main_list_image; }else if(data.image){ payload.main_list_image = data.image; } if (data.price_low) { payload.price = priceText(data.price_high, data.price_high, data.price_low, data.price_low); }else if(data.sale_price_min){ payload.price = priceText(data.sale_price_max, data.sale_price_max_con, data.sale_price_min, data.sale_price_min_con); }else if(data.price){ payload.price = priceText(data.price.max, data.price.max, data.price.min, data.price.min); }else if (data.mip || data.mipc){ payload.price = priceText(data.map, data.mapc, data.mip, data.mipc); } if (data.sale_flg) { payload.is_sale = data.sale_flg; } if (data.new_flg) { payload.is_new = data.new_flg; } if ( data.favorite && data.favorite != null ) { payload.favorite_count = data.favorite.count; if (data.favorite.is_regist) { payload.favorite_is_regist = data.favorite.is_regist; }else if(data.favorite.is_set){ payload.favorite_is_regist = data.favorite.is_set; } } if ( data.review && Number( data.review.count ) > 0 ) { payload.review_average = data.review.average; payload.review_count = data.review.count; }else if ( data.review_info && Number( data.review_info.count ) > 0 ) { payload.review_average = data.review_info.average; payload.review_count = data.review_info.count; }else if(data.rr && data.rr != null){ payload.review_average = data.rr; payload.review_count = data.rd[1] + data.rd[2] + data.rd[3] + data.rd[4] + data.rd[5]; } if ( data.brand_code != null ) { payload.brand_name = dokodemo.commonMethod.decodeURICheck(data.brand_name); payload.brand_code = data.brand_code; } if ( data.maker_code != null ) { payload.maker_name = dokodemo.commonMethod.decodeURICheck(data.maker_name); payload.maker_code = data.maker_code; }else if(data.maker && data.maker.maker_code != null ){ payload.maker_name = dokodemo.commonMethod.decodeURICheck(data.maker.maker_name); payload.maker_code = data.maker.maker_code; } var product = dokodemo.makeProductBlock( payload,"vertical","150px");//vertical or side dom += '
'; }); return dom; } detail.slickSlide = function(target) { target .on('init', function(event, slick) { // urlを書き換え if (target.selector == '#js-slick_RECOMMEND_CATEGORY') { recommendParams.init(slick); } // slick要素の初期化 $('.p-products-slickItems').css('display', 'block'); target.children('.slick-prev').css('opacity', '0'); }) .slick({ infinite: false, slidesToShow: 7, slidesToScroll: 7, responsive: [ { breakpoint: 1480, settings: { slidesToShow: 6, slidesToScroll: 6 } }, { breakpoint: 1280, settings: { slidesToShow: 5, slidesToScroll: 5 } }, { breakpoint: 1080, settings: { slidesToShow: 4, slidesToScroll: 4 } } ] }) .on('afterChange', function(event, slick, currentSlide) { // urlを書き換え if (target.selector == '#js-slick_RECOMMEND_CATEGORY') { recommendParams.rewrite(slick, currentSlide); } if (target.children('.slick-prev').attr('aria-disabled') == 'true') { target.children('.slick-prev').css('opacity', '0'); } else { target.children('.slick-prev').css('opacity', '1'); } if (target.children('.slick-next').attr('aria-disabled') == 'true') { target.children('.slick-next').css('opacity', '0'); } else { target.children('.slick-next').css('opacity', '1'); } }); }; detail.reviewDisp = function() { detail.review = { count_review: '', parcent: '', elem_hoverText: document.querySelectorAll('.js-review_element'), elem_target: '', elem_target_point5: '', elem_target_point4: '', elem_target_point3: '', elem_target_point2: '', elem_target_point1: '', elem_target_bar5: '', elem_target_bar4: '', elem_target_bar3: '', elem_target_bar2: '', elem_target_bar1: '' } detail.calcRevewPercent = function() { // 初期化 detail.review.parcent = {1:0, 2:0, 3:0, 4:0, 5:0}; var reviewTotal = Number(detail.review.count_review[1]) + Number(detail.review.count_review[2]) + Number(detail.review.count_review[3]) + Number(detail.review.count_review[4]) + Number(detail.review.count_review[5]); for(var i=1; i<=5; i++){ detail.review.parcent[i] = Math.ceil((Number(detail.review.count_review[i])/reviewTotal) * 100) + '%'; } return detail.review.parcent; } detail.review.elem_hoverText = Array.prototype.slice.call(detail.review.elem_hoverText, 0); detail.review.elem_hoverText.forEach(function(elem){ elem.addEventListener('mouseover', function(){ var rankid = elem.getAttribute('data-rankid'); var type = elem.getAttribute('data-rankType'); detail.review.elem_target = document.getElementById('js-review_target' + rankid + '_' + type); detail.review.elem_target_point5 = document.getElementById(type + '_' + rankid + '_point5'); detail.review.elem_target_point4 = document.getElementById(type + '_' + rankid + '_point4'); detail.review.elem_target_point3 = document.getElementById(type + '_' + rankid + '_point3'); detail.review.elem_target_point2 = document.getElementById(type + '_' + rankid + '_point2'); detail.review.elem_target_point1 = document.getElementById(type + '_' + rankid + '_point1'); detail.review.count_review = {1:detail.review.elem_target_point1.textContent, 2:detail.review.elem_target_point2.textContent, 3:detail.review.elem_target_point3.textContent, 4:detail.review.elem_target_point4.textContent, 5:detail.review.elem_target_point5.textContent}; detail.review.elem_target.style.opacity = 1; detail.review.elem_target.style.zIndex = 2; detail.calcRevewPercent(); detail.review.elem_target_bar5 = document.getElementById(type + '_' + rankid + '_bar5'); detail.review.elem_target_bar4 = document.getElementById(type + '_' + rankid + '_bar4'); detail.review.elem_target_bar3 = document.getElementById(type + '_' + rankid + '_bar3'); detail.review.elem_target_bar2 = document.getElementById(type + '_' + rankid + '_bar2'); detail.review.elem_target_bar1 = document.getElementById(type + '_' + rankid + '_bar1'); detail.review.elem_target_bar5.style.width = detail.review.parcent[5]; detail.review.elem_target_bar4.style.width = detail.review.parcent[4]; detail.review.elem_target_bar3.style.width = detail.review.parcent[3]; detail.review.elem_target_bar2.style.width = detail.review.parcent[2]; detail.review.elem_target_bar1.style.width = detail.review.parcent[1]; }); elem.addEventListener('mouseout', function(){ var rankid = elem.getAttribute('data-rankid'); var type = elem.getAttribute('data-rankType'); detail.review.elem_target = document.getElementById('js-review_target' + rankid + '_' + type); detail.review.elem_target.style.opacity = 0; detail.review.elem_target.style.zIndex = -1; detail.review.elem_target_bar5 = document.getElementById(type + '_' + rankid + '_bar5'); detail.review.elem_target_bar4 = document.getElementById(type + '_' + rankid + '_bar4'); detail.review.elem_target_bar3 = document.getElementById(type + '_' + rankid + '_bar3'); detail.review.elem_target_bar2 = document.getElementById(type + '_' + rankid + '_bar2'); detail.review.elem_target_bar1 = document.getElementById(type + '_' + rankid + '_bar1'); detail.review.elem_target_bar5.style.width = "0%"; detail.review.elem_target_bar4.style.width = "0%"; detail.review.elem_target_bar3.style.width = "0%"; detail.review.elem_target_bar2.style.width = "0%"; detail.review.elem_target_bar1.style.width = "0%"; }); }); }; detail.changeShop = function(product_shop_class_id) { detail.otherShopForm['product_shop_class_id'].value = product_shop_class_id; detail.otherShopForm.submit(); }; detail.changeReview = function() { detail.revewForm.submit(); } detail.changeClassID = function(classid, type, obj) { detail.productsForm['mode'].value = 'class_change'; detail.productsForm['target_class'].value = classid; // 規格変更時に必要なパラメータ if (classid == "1") { detail.productsForm['product_mode'].value = 'class1'; } else { detail.productsForm['product_mode'].value = 'class2'; } //画像では productclassid をセットする if (type == "image" && classid == '1') { detail.productsForm['classcategory_id1'].value = obj.getAttribute('data-productclassid'); } if (type == "image" && classid == '2') { detail.productsForm['classcategory_id2'].value = obj.getAttribute('data-productclassid'); } //セレクトボックスではテキストを変更する if (type == "select" && classid == '1') { detail.classImage.selectBoxText1.textContent = obj.options[obj.selectedIndex].text; } if (type == "select" && classid == '2') { detail.classImage.selectBoxText2.textContent = obj.options[obj.selectedIndex].text; } detail.productsForm.submit(); }; var instagram_list = { '1505413': [ { 'imgUrl' : '/_assets/products/1505413/instagram_1.jpg', 'url':'https://www.instagram.com/p/B5eyZFFJkGC/', 'title':'nippon_beauty', 'text':'Скандальные & дерзкие подводки ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_2.jpg', 'url':'https://www.instagram.com/p/B26t4WCgAHb/', 'title':'gabby_curiel', 'text':'She turn her wounds into power ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_3.jpg', 'url':'https://www.instagram.com/p/B1Spw0iH5Y8/', 'title':'slowcolour', 'text':'Makeup tips ・リキッドアイライナー2色。ひそかにMACのアイシャドウも目の下に。...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_4.jpg', 'url':'https://www.instagram.com/p/B0Qy6fCpvNe/', 'title':'asagiri_yume', 'text':'Morning glow ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_5.jpg', 'url':'https://www.instagram.com/p/By5BPqBnYsh/', 'title':'album_anna', 'text':'種類豊富な#uzu のカラーアイライナー ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_6.jpg', 'url':'https://www.instagram.com/p/B59yHlmBj1U/', 'title':'watashino_suki', 'text':'@uzu_byflowfushi のホワイトアイライナーを使って#メイク ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_7.jpg', 'url':'https://www.instagram.com/p/B4FaA-xAQwg/', 'title':'samurai.haruka', 'text':'#gn 最近のマイブーム ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_8.jpg', 'url':'https://www.instagram.com/p/Bx4yKLGBeCV/', 'title':'___00s___', 'text':'最近はもっぱらシロライン。...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_9.jpg', 'url':'https://www.instagram.com/p/B4KVCh-FQAL/', 'title':'naestagramdayo', 'text':'カラーライン、イエローとホワイト買ってみたけど良き！ ...' }, { 'imgUrl' : '/_assets/products/1505413/instagram_10.jpg', 'url':'https://www.instagram.com/p/By2V1hYF5Tr/', 'title':'kn__yn', 'text':'ずーっと欠品でどこ探してもなくてようやく 出会えた アイライナー ...' }, ], '1123686':[//Cure { 'imgUrl' : '/_assets/products/1123686/instagram_1.jpg', 'url':'https://www.instagram.com/p/BnHXyEiA8WN/', 'title':'wooddywood_', 'text':'Got this product recently and already impressed ...' }, { 'imgUrl' : '/_assets/products/1123686/instagram_2.jpg', 'url':'https://www.instagram.com/p/B5fzgSUnbDQ/', 'title':'danielau_model', 'text':'I get many DM’s as to what is my current skin care regime? ...' }, { 'imgUrl' : '/_assets/products/1123686/instagram_3.jpg', 'url':'https://www.instagram.com/p/B53FEzxnFTC/', 'title':'itsonlysue', 'text':'How to get rid of Dead Skin with @cureaquagelofficial ...' }, { 'imgUrl' : '/_assets/products/1123686/instagram_4.jpg', 'url':'https://www.instagram.com/p/BpqMnNFhOrT/', 'title':'fuka712', 'text':'おはようございます お天気いい ...' }, ], '259406':[//onaka { 'imgUrl' : '/_assets/products/259406/instagram_1.jpg', 'url':'https://www.instagram.com/p/BtK28NtHine/', 'title':'shigepy_', 'text':'ビルボックスジャパン さんの『onaka』をモニターさせていただきました ...' }, // { // 'imgUrl' : '/_assets/products/259406/instagram_2.jpg', // 'url':'https://www.instagram.com/p/ByhfIgogw4E/', // 'title':'moe_monita', // 'text':'今回ご縁をいただいて、ピルボックス ジャパン株式会社さんから「onaka」と ...' // }, { 'imgUrl' : '/_assets/products/259406/instagram_3.jpg', 'url':'https://www.instagram.com/p/ByE9qvpg8IY/', 'title':'flower__bell', 'text':'成分 還元パラチノース、葛の花抽出物 ...' }, { 'imgUrl' : '/_assets/products/259406/instagram_4.jpg', 'url':'https://www.instagram.com/p/BqcYhahAtV_/', 'title':'marine_0201', 'text':'最近ウエスト周りの脂肪が気になるので、 ...' }, { 'imgUrl' : '/_assets/products/259406/instagram_5.jpg', 'url':'https://www.instagram.com/p/Bvlhts2A6i3/', 'title':'itotomo78', 'text':'内臓脂肪と皮下脂肪を減らすのを助けてくれるサプリを飲んでます。 ...' } ], '215706':[//axxzia { 'imgUrl' : '/_assets/products/215706/1.jpg', 'url':'https://www.instagram.com/p/B6aOWFRFquO/', 'title':'mabellimeptd', 'text':'Are you ready for 2020?A New Year or a Year older? ...' }, { 'imgUrl' : '/_assets/products/215706/2.jpg', 'url':'https://www.instagram.com/p/B6dk8zCHG_w/', 'title':'prettibunny', 'text':'I’m so excited to be posting my first #gifted product from @dokodemo.en and @axxzia! ...' }, { 'imgUrl' : '/_assets/products/215706/3.jpg', 'url':'https://www.instagram.com/p/B7HKpSxoTq3/', 'title':'vanessasskin', 'text':'EYE SHEET MASKS?! When @dokodemo.en reached out to me asking ...' }, { 'imgUrl' : '/_assets/products/215706/4.jpg', 'url':'https://www.instagram.com/p/B6xoHeQn42q/', 'title':'doris_skincare', 'text':'《日本AXXZIA御顏晶采多效修護眼膜》 ...' }, { 'imgUrl' : '/_assets/products/215706/5.jpg', 'url':'https://www.instagram.com/p/B60YzlYlTir/', 'title':'zawszesoba', 'text':'Hej piękne Czas na pierwszą recenzję w Nowym Roku ...' }, { 'imgUrl' : '/_assets/products/215706/6.jpg', 'url':'https://www.instagram.com/p/B6cxScHn_d1/', 'title':'mika_moss91', 'text':'Сегодня познакомлю вас с инновационным японским брендом @axxzia ...' }, { 'imgUrl' : '/_assets/products/215706/7.jpg', 'url':'https://www.instagram.com/p/B458ukhn6TR/', 'title':'skincaresensei', 'text':'AXXZIA - Beauty Eyes Essence Sheet ...' }, { 'imgUrl' : '/_assets/products/215706/8.jpg', 'url':'https://www.instagram.com/p/B3r0xksAHoR/', 'title':'jordana_rev', 'text':'I\'m so excited to try the new 4th generation "AGtheory" ...' }, { 'imgUrl' : '/_assets/products/215706/9.jpg', 'url':'https://www.instagram.com/p/B4berMPnDhZ/', 'title':'skincareidol', 'text':'Featuring: @dokodemo.en x @axxzia ...' } ] }; }(detail)); $(function(){ var price = '91.2 USD' var arrPrice = price.split(' '); var price_dom = "" + arrPrice[0] + "" + arrPrice[1] + "" $("#js-price").html( price_dom ) $('.js-hover_omatomelabel').hover( function(){ $(this).children('span').css('display', 'block'); }, function(){ $(this).children('span').css('display', 'none'); }); $('#js-products-banner__slide').slick({ autoplay: true, dots: false, arrows: false }); //商品個別クーポン getMycoupon(); $(document).on('click','.coupon-ticket-right',function(){ if (dokodemo.info.customer_id) { if ( $(this).hasClass("have_coupon") ) return false; if ( $(this).hasClass("none") ) return false; $.ajax({ type: 'POST', url: 'https://dokodemo.world/api/coupon_get/', dataType: 'json', data: { "customer_id":dokodemo.info.customer_id, "coupon_id":coupon_id, "product_shop_class_id":product_shop_class_id, }, jsonpCallback: 'callback' }) .done(function (data, textStatus, jqXHR) { if (data.result) { $(".coupon-ticket-right").addClass("have_coupon"); $(".coupon-ticket-right span").text("획득 된"); } }) .fail(function (jqXHR, textStatus, errorThrown) { console.log('fail', jqXHR.status); }); }else{ if ( $(this).hasClass("none") ) return false; pageSignIn.show('coupon', ''); } }); $.ajax({ type: 'POST', url: 'https://dokodemo.world/api/reuse_rank_info/', dataType: 'json', data: { "product_id":'1600071', "global_id":dokodemo.apiParams.global_id }, jsonpCallback: 'callback' }) .done(function (data, textStatus, jqXHR) { if (data.result) { var rankInfo=''; $.each(data.data,function(k,v){ rankInfo += k+'：'+v+'
'; }); $('.rank_info').html(rankInfo); }); }); //クーポン関連 var coupon_id,product_shop_class_id; function getMycoupon() { $.ajax({ type: 'POST', url: 'https://dokodemo.world/api/my_coupon/', dataType: 'json', data: { "customer_id":dokodemo.info.customer_id, "is_event":0 }, jsonpCallback: 'callback' }) .done(function (data, textStatus, jqXHR) { if (data.result) { // return data.data; getCouponTicket(data.data); }else{ getCouponTicket([]); } }) .fail(function (jqXHR, textStatus, errorThrown) { console.log('fail', jqXHR.status); getCouponTicket([]); }); } function getCouponTicket(myCoupon){ $.ajax({ type: 'POST', url: 'https://dokodemo.world/api/product_seller/', dataType: 'json', data: { "global_id":dokodemo.apiParams.global_id, "product_id": '1600071', "country_id":dokodemo.apiParams.country_id, "shop_id": '109' }, jsonpCallback: 'callback' }) .done(function (data, textStatus, jqXHR) { if (data.result && data.data.distributor.length !== 0 && data.data.distributor[0].isCoupon != null) { var distributor = data.data.distributor[0],haveThisCoupon=false; coupon_id = distributor.isCoupon.id; product_shop_class_id = distributor.product_shop_class_id; if (Object.keys(myCoupon).length > 0) { $.each(myCoupon.individual,function(k,v){ if (v.id == distributor.isCoupon.id && v.product_shop_class_id == distributor.product_shop_class_id) { haveThisCoupon = true; } }); } var html,discount,usable_minimum_amount = "",price,price1,price2,limit,limit_base,btn,remain="",remainFlg=false; var dispPrice = "91.2 USD"; dispPrice = dispPrice.replace(",","").split(' '); //割引種類、値段 if (distributor.isCoupon.discount_amount!=null) { discount = 'Display Price of Products'+dokodemo.jpyExchangeRate(distributor.isCoupon.discount_amount)+ dokodemo.apiParams.currency_gb + 'OFF'; price = dispPrice[0] - dokodemo.jpyExchangeRate(distributor.isCoupon.discount_amount); price1 = price+dokodemo.apiParams.currency_gb; }else if(distributor.isCoupon.discount_rate!=null){ discount = 'Display Price of Products'+distributor.isCoupon.discount_rate+'%OFF'; price = dispPrice[0] - ((dispPrice[0]/100)*distributor.isCoupon.discount_rate); price1 = dokodemo.jpyExchangeRate(Math.ceil(price))+dokodemo.apiParams.currency_gb; } price2 = dispPrice[0]+dokodemo.apiParams.currency_gb; //'+price1+''+price2+'\ //利用期限 limit = distributor.isCoupon.ended_at.split(' ')[0]; limit_base = "##V0## 까지(JST)"; limit = limit_base.replace("##V0##",limit); //割引条件 if ( distributor.isCoupon.usable_minimum_amount ) { usable_minimum_amount = "동일 점포 상품" + dokodemo.jpyExchangeRate( distributor.isCoupon.usable_minimum_amount ) + dokodemo.apiParams.currency_gb + "이상 구입하면"; } //残り枚数 if (distributor.isCoupon.remain_count!=null) { if (distributor.isCoupon.remain_count==0) remainFlg=true; remain = "배포 수：나머지"+distributor.isCoupon.remain_count+"개"; } //獲得or獲得済み if (haveThisCoupon) { btn = "