Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (2024)

<\/div>\r\n

\r\n

\r\n

Ends in<\/span><\/div>\r\n

00<\/div>\r\n

d:<\/span><\/div>\r\n

00<\/div>\r\n

h:<\/span><\/div>\r\n

00<\/div>\r\n

m:<\/span><\/div>\r\n

00<\/div>\r\n

s<\/span><\/div>\r\n<\/div>\r\n

<\/div>\r\n<\/div>\r\n<\/div>","reachable_head_content":"","reachable_head_content_mobile":"","reachable_ship_days":10,"coupon_head_content":"","coupon_head_content_mobile":"","is_hot":1,"is_new":1,"title_head":"","tag_data":{"suffix_image":"","id":15},"coupon_data":{"id":0,"is_detail_show":0,"prompt":"","deduct":0,"deduct_after":"12.00"},"total_review":0}; if(search&&Array.isArray(product)&&product.length>0){ $('.vi-hd .search-user-div .search-input').val(search) } let useHotFlag=false; let searchKeyList; const searchKeyStr= $('.search-content .search-input').data('searchword'); if(searchKeyStr){ searchKeyList=decodeURIComponent(searchKeyStr).split('___'); } const productId=Number(window.product_id)||0; const inputPlaceHolder= $('.vi-hd .search-user-div .search-input').attr('placeholder'); const preStoageKeywordObejct=JSON.parse( sessionStorage.getItem('search-keyword')) ||{}; const preStoageKeyword= preStoageKeywordObejct[productId]||'' if( Array.isArray(searchKeyList)&&searchKeyList.length>0&&!searchKeyList.includes(preStoageKeyword)){ const randomNumber = Math.floor(Math.random() * searchKeyList.length); $('.vi-hd .search-user-div .search-input').attr('placeholder',searchKeyList[randomNumber]) sessionStorage.setItem('search-keyword',JSON.stringify({...preStoageKeywordObejct,[productId]:searchKeyList[randomNumber]})); useHotFlag=true; } if( Array.isArray(searchKeyList)&&searchKeyList.length>0&&searchKeyList.includes(preStoageKeyword)){ $('.vi-hd .search-user-div .search-input').attr('placeholder',preStoageKeyword); useHotFlag=true; } if( Array.isArray(searchKeyList)&&searchKeyList.length==0){ sessionStorage.setItem('search-keyword',JSON.stringify({...preStoageKeywordObejct,[productId]:''})); } if(useHotFlag){ $('.vi-hd .search-user-div .search-input').attr('data-usehot',true); }else{ if(!inputPlaceHolder){ $('.vi-hd .search-user-div .search-input').attr('placeholder',"Search for anything...") } } if(productId){ setProductSearchIcon('reset'); $('.vi-hd .search-user-div .search-content .search-input').hover(function(){ if(productId){ setProductSearchIcon('set') } },function(){ if(productId){ setProductSearchIcon('reset') } }) } if(if_search_suggest) { $(document).on('input',".search-user-div .search-input",getSuggestive) // _$(".vi-hds .search-input")[0].addEventListener('input', getSuggestive); } $('.vi-hd .search-user-div .confirm').hover(function(){ $('.vi-hd .search-user-div .search-content .search-input').css('border','1px solid #333') if(productId){ setProductSearchIcon('set') } },function(){ $('.vi-hd .search-user-div .search-content .search-input').css('border',''); if(productId){ setProductSearchIcon('reset') } }) searchBoxEvent(); } function setProductSearchIcon(handle='set'){ const productId=Number(window.product_id)||0; if(handle==='set'){ $('.vi-hd .search-user-div .search-content .confirm').css('background','#333') $('.vi-hd .search-user-div .search-content .confirm').css('color','#fff') $('.vi-hd .search-user-div .search-content .confirm').css('border','1px solid #333') $('.vi-hd .search-user-div .search-content .confirm').css('border-left','unset') } if(handle==='reset'&&productId&&!isKeepSearchHover){ $('.vi-hd .search-user-div .search-content .confirm').css('background','#fff') $('.vi-hd .search-user-div .search-content .confirm').css('color','#333') $('.vi-hd .search-user-div .search-content .confirm').css('border','1px solid #d5d5d5') $('.vi-hd .search-user-div .search-content .confirm').css('border-left','unset') } } _$('.vi-hd').on('mouseover','.head-user .iconfont',function(){ $(this).addClass(act); }); _$('.vi-hd').on('mouseout','.head-user .iconfont',function(){ $(this).removeClass(act); }); var poolRunSwiper = function (cls) { setTimeout(function(){ if (_$.isFunction(_$.funcPool['runSwiper']||'')) { var container = _$(cls+' .swiper-container'); if (container.length>0) { _$.funcPool['runSwiper'](_$(cls+' .swiper-container')); } } else { poolRunSwiper(cls); } },200); } setTimeout(getNotice,1) function getNotice(){ _$.ajaxHtml('/index/noticeYang',{ajax_param:1},function(html,state){ var styleElement = $('#style-notice'); styleElement.append('.vi-hd{top:40px;}'); styleElement.append('.vi-hdm{top:100px;}'); styleElement.append('.head-notice-top{margin-top: 154px;}'); styleElement.append('.wrapper .container{margin-top:154px;}'); styleElement.append('.landing-nav.fixed-nav{top: 154px;}'); styleElement.append('.wrapper .search-glo-wrapper-top{margin-top: 180px;}') if (state!=1 || html.trim() == '') { _$('#style-notice').remove(); _$('.vi-top').addClass('d-none'); // console.log('notice error'); return false; } _$('.vi-top').removeClass('d-none'); _$('.head-top-mode').html(html); var limitHeight = 45; var hiddenMerge = function (note) { var h = note.find('.title')[0].scrollHeight || note.find('.title')[0].offsetHeight; if (h>limitHeight) { var text = note.find('.text'),str = text.text(); str = str.toString().slice(0, str.length-6) + '...'; text.text(str); hiddenMerge(note); } } _$('.head-top-mode').find('.notice-hashref').each(function(){ hiddenMerge(_$(this)); if(_$(this).hasClass('product-notice')){ // _$('.vi-top-close').remove(); _$('.head-top-mode').setStyle({'width':'100%'}); if(_$(this).find('.countdown').length > 0){ runCountdown(); } } }); poolRunSwiper('.head-top-mode'); }); } var init; function runCountdown() { var countdownList = _$('.countdown'); if (countdownList.length > 0) { countdownList.each(function () { var item = _$(this), value = item.closest('.product-notice').data('value') || 0; value = parseInt(value); if (value < 1) { return true; } var daysItem = item.find('.days'), hoursItem = item.find('.hours'), minItem = item.find('.min'), secItem = item.find('.sec'); var has_day = daysItem.length > 0 ? 1 : 0; var ret = countDown(value, has_day); if (secItem.length < 1) { return true; } var retRun = function (ret) { daysItem.length > 0 ? daysItem.text(pre0(ret[0])) : ''; hoursItem.text(pre0(ret[1])); minItem.text(pre0(ret[2])); secItem.text(pre0(ret[3])); } retRun(ret); init = setInterval(function () { value--; ret = countDown(value, has_day); retRun(ret); if(value == 0){ clearInterval(init); setTimeout(function(){ window.location.reload(); },500) return false; } }, 1000); }); } } window.head_runCountdown=runCountdown; function countDown(val, hasday) { if (val < 0) { clearInterval(init); return false; } hasday = hasday || 0; var days = 0, hours = 0, min = 0, sec = 0; val = parseInt(val); if (val > 0) { if (hasday) { days = Math.floor(val / (60 * 60 * 24)); hours = Math.floor(val / (60 * 60) % 24); } else { hours = Math.floor(val / (60 * 60)); } min = Math.floor(val / 60 % 60); sec = Math.floor(val % 60); } return [days, hours, min, sec]; } function pre0(i) { if (i < 10) { return ('0' + i).slice(-2); } else { return i; } } _$('.vi-top').on('click','.vi-top-close',function(){ _$.ajaxJson('/index/noticeClose',{ajax_param:1},function(res,state){ if (state!=1) { return false; } _$('.vi-top').remove(); _$('#style-notice').remove(); }); }); _$('.sign-out').on('click',function(){ _$.loading(); _$.ajaxJson('/user/logout',{'express':1},function(res,state){ _$.closeLoading(); if(state!=1){return false;} location.reload(); }); }); window['callie_custom_i18n']={ network_is_abnormal: "Network is abnormal.Please try again" } function listenerHeadCart(){ let minCartEl; let setTimeoutFlag; let mounseEvent=false; let outLineDiv; let miniCartGoodsId; let loadSuccess=false; let addCartEl=[0,0]; const el=document.querySelector('.head-cart'); if(!el){ return } el.addEventListener('mouseenter',function(){ generateMiniCart() clearTimeout(setTimeoutFlag); showMiniCart(); }) el.addEventListener("mouseleave", function() { if( window['minicart']&&window['minicart']['popupShow']===true){ return } setTimeoutFlag= setTimeout(() => { if(!outLineDiv){ return } closeMiniCart(); }, 500); }); function minCartEenter(){ clearTimeout(setTimeoutFlag); } function minCartOuter(){ if(window['minicart']&& window['minicart']['popupShow']===true){ return } setTimeoutFlag= setTimeout(() => { if(!outLineDiv){ return } closeMiniCart(); }, 500); } function generateMiniCart(){ if(!outLineDiv){ outLineDiv=document.createElement('div'); outLineDiv.className='outline-div'; outLineDiv.setAttribute('data-theme','pc_yang') outLineDiv.style.width='500px' outLineDiv.style.backgroundColor='#ffffff' outLineDiv.innerHTML=`

Basket Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (1)

` const topNameEl= document.querySelector('.head-cart'); const rect= topNameEl.getBoundingClientRect(); outLineDiv.style.position ='fixed'; outLineDiv.style.top=(rect.bottom+10)+'px'; outLineDiv.style.right=(window.innerWidth - rect.right)+'px'; outLineDiv.style.transform=`translateX(30px)`; outLineDiv.style['z-index']='12'; document.querySelector('body').appendChild(outLineDiv); showMiniCart(); minCartEl=document.querySelector('#min-cart-template'); if(!mounseEvent){ mounseEvent=true; outLineDiv.addEventListener('mouseenter',minCartEenter); outLineDiv.addEventListener('mouseleave',minCartOuter); outLineDiv.querySelector('.title-close').addEventListener('click',function(){ closeMiniCart(); }) } if(!loadSuccess){ loadSuccess=true; loadMinCartHtml({parentEl:outLineDiv,rectHeight:rect.top+'px'}); return } } } window.addToCartShowMinCart= async function addToCartShowMinCart(goodsId){ getAddCartPosition(); await awaitAnimateCartIcon(); miniCartGoodsId=goodsId; if(!outLineDiv){ generateMiniCart(); waitiMiniCartLoad().then(()=>{ setTimeoutFlag= setTimeout(() => { closeMiniCart(); }, 3000); }) }else{ if(goodsId){ outLineDiv.querySelector('#min-cart-template').setAttribute('data-goodsId',goodsId) } window['minicart']['isInit']=false; if( typeof window['minicart']['initFn']==="function"){ window['minicart']['initFn']() } await waitiMiniCartLoad(); showMiniCart(); outLineDiv.querySelector('.content-scroll').scrollTop=0; setTimeoutFlag= setTimeout(() => { closeMiniCart(); }, 3000); } } function waitiMiniCartLoad(){ return new Promise((resolve)=>{ const flag = setInterval(function(){ if( window['minicart']&& window['minicart']['isInit']){ clearInterval(flag); resolve(true) } },100) }) } function loadMinCartHtml(params){ const minCartEl=document.querySelector('#min-cart-template'); if(minCartEl){ return } _$.ajaxJson('/cart/miniCart',{ajax_param:1},async function(html){ const el= document.createElement('div'); el.innerHTML=html; const css= el.querySelector('#min-cart-css'); const template= el.querySelector('#min-cart-template'); const script= el.querySelector('#min-cart-script'); document.body.appendChild(css); const createScript= document.createElement('script'); createScript.innerHTML=script.textContent; template.style.width='100%'; params.parentEl.appendChild(template); document.body.appendChild(createScript); if(miniCartGoodsId){ template.setAttribute('data-goodsId',miniCartGoodsId) } el.remove(); const contentScrollHeight=`calc( 100vh - 342px - ${params.rectHeight} )`; template.querySelector('.content-scroll').setAttribute('data-height',contentScrollHeight); template.querySelector('.content-scroll').setAttribute('data-emptyHeight','30vh'); await waitiMiniCartLoad(); params.parentEl.querySelector('.loading-div').remove(); }) } function showMiniCart(){ if(outLineDiv.style.display&&outLineDiv.style.display!=='none'){ return } const topNameEl= document.querySelector('.head-cart'); if(topNameEl){ const rect= topNameEl.getBoundingClientRect(); outLineDiv.style.top=(rect.bottom+10)+'px'; } // document.body.classList.add('modal-open'); outLineDiv.style.display='unset'; setTimeout(() => { outLineDiv.classList.add('outline-div-show'); traceFun.traceParams.currentPageType='minicart'; loadTrace(); if( window['minicart']&&typeof window['minicart']['retryExposureElementFn']==="function"){ window['minicart']['retryExposureElementFn'](); } }, 300); } window.closeMiniCart=function closeMiniCart(){ outLineDiv.classList.remove('outline-div-show'); // document.body.classList.remove('modal-open'); setTimeout(() => { outLineDiv.style.display='none'; traceFun.traceParams.currentPageType=''; }, 300); unloadTrace(); miniCartGoodsId=''; if(outLineDiv.querySelector('#min-cart-template')){ outLineDiv.querySelector('#min-cart-template').setAttribute('data-goodsId',''); } if(typeof window.backDataLayer ==="function"){ window.backDataLayer(); } } let pageloadTime=0; let pageloadBizCode=''; function loadTrace(){ var bizcode = 'minicart'; var event = { eventCode: 'pageload', eventBizCode: bizcode ? bizcode : 'callie_page', } pageloadBizCode = bizcode; pageloadTime = Date.now(); traceFun.eventReport(event, {}); } function unloadTrace(){ var bizcode ='minicart'; var event = { eventCode: 'pageunload', eventBizCode: bizcode ? bizcode : 'callie_page', } if (bizcode && bizcode === pageloadBizCode && pageloadTime > 0) { event.pageStayTime = Date.now() - pageloadTime; } traceFun.eventReport(event, {}, true); } function animateCartIcon(resolve){ let iconEl= document.querySelector('.vi-hd .menu-num__cart'); if(!iconEl){ iconEl=document.querySelector('.vi-hd .head-cart .iconfont'); } const moveIcon= window.document.createElement('div'); moveIcon.className='cart-num'; document.querySelector('.vi-hd').appendChild(moveIcon); const rect=iconEl.getBoundingClientRect(); moveIcon.style.width='50px'; moveIcon.style.height='50px'; moveIcon.style.borderRadius='50%'; moveIcon.style.position='fixed'; const finalCoordinates=[(rect.top+rect.bottom)/2-10,(rect.left+rect.right)/2-10]; const startCoordinates=addCartEl; const distanceY= startCoordinates[0]-finalCoordinates[0]; const distanceX= finalCoordinates[1]-startCoordinates[1]; const maxDistance= Math.max(distanceY,distanceX); const num= maxDistance/25; const topStepNum=distanceY/num; const leftStepNum=distanceX/num; const widthStepNum=50/num; let moveIconWidth=50; move(); function move(){ //top right if(startCoordinates[0]>finalCoordinates[0]||startCoordinates[1]

finalCoordinates[0]){ startCoordinates[0]=startCoordinates[0]-topStepNum>finalCoordinates[0]?startCoordinates[0]-topStepNum:finalCoordinates[0]; } if(startCoordinates[1]16){ moveIconWidth=moveIconWidth-widthStepNum>16?moveIconWidth-widthStepNum:16; } setTimeout(() => { moveIcon.style.top=startCoordinates[0]+'px'; moveIcon.style.left=startCoordinates[1]+'px'; moveIcon.style.width=moveIconWidth+'px'; moveIcon.style.height=moveIconWidth+'px'; move(); }, 16); }else{ moveIcon.remove(); resolve(); } } } function awaitAnimateCartIcon(){ return new Promise((resolve)=>{ animateCartIcon(resolve) }) } function getAddCartPosition(){ const addBtn=window.document.querySelector('.buy .add-cart'); if(addBtn){ const rect= addBtn.getBoundingClientRect(); addCartEl=[(rect.top+rect.height/2),(rect.left+rect.width/2)]; } } } function getSearchList(){ const container = document.querySelector('.slist'); const items = container.querySelectorAll('li'); const visibleRows = 2; const itemMargin = 10; const containerWidth = container.offsetWidth; let totalWidth = 0, totalRows = 1; let visibleItemCount = 0; items.forEach(item => { totalWidth += item.offsetWidth + itemMargin; if (totalWidth <= containerWidth) { visibleItemCount++; } else if(totalRows < visibleRows) { totalRows ++; visibleItemCount++; totalWidth = item.offsetWidth + itemMargin < containerWidth ? item.offsetWidth + itemMargin : 0; } }); if (visibleItemCount < items.length) { items.forEach((item, index) => { if (index >= visibleItemCount) { $(item).addClass('d-none'); } }); const moreElement = document.createElement('span'); moreElement.classList.add('more-history'); moreElement.innerHTML = 'more'; container.appendChild(moreElement); const rect = moreElement.getBoundingClientRect(); const listRect = container.getBoundingClientRect() let isInViewport = rect.top >= 0 && rect.left >= 0 && rect.bottom <= listRect.bottom && rect.right <= listRect.right; if(!isInViewport){ let visibleLength = $('.slist li:not(".d-none")').length; $('.slist').find('li:not(".d-none")').eq(visibleLength - 1).addClass('d-none'); } } if(visibleItemCount === items.length){ const _containRect = container.getBoundingClientRect(); const height1= _containRect.height; const maxHeight= $(container).css('max-height'); $(container).css('max-height','none'); const containRect = container.getBoundingClientRect(); if(height1 { const replacedText = item.replace(regex, function(match){ return ''+match+''; }); html += `

${replacedText}

`; }); $('.vi-hds .association .association-list').empty().append(html); } var searchTime = null; function getSuggestive() { clearTimeout(searchTime); var key = $.trim($(".search-user-div .search-input").val()); searchTime = setTimeout(() => { if(key == '') { $('.vi-hds .trending').removeClass('d-none').siblings('.association').addClass('d-none'); } else { _$.ajaxJson('/category/searchSuggestedApi',{'search':key},function(result,state){ if(result.status && result.data.length > 0 && key == $.trim($(".search-user-div .search-input").val()) != ''){ setAssociationList(result.data, key); $('.vi-hds .association').removeClass('d-none').siblings('.trending').addClass('d-none'); } else { $('.vi-hds .trending').removeClass('d-none').siblings('.association').addClass('d-none'); } }); } }, 200) } $(document).on('click','.search-box .association-list .association-words-item',function(){ search($(this).find('a').attr('title'), 'search_suggestive', 'clickSuggestive'); }); hoverHotSearch() function hoverHotSearch(){ $('.search-box .vi-hds .olist .search-hot').each(function(){ const hoverColor=$(this).data('hovercolor')||'#E9E9E9'; const bgColor=$(this).data('bgcolor'); if(hoverColor){ $(this).hover(function(){ $(this).css('background-color',hoverColor) },function(){ if(bgColor){ $(this).css('background-color',bgColor) }else{ $(this).css('background-color','#f6f6f6') } }) } }) } observerTraceReport(); function observerTraceReport(){ if(!traceFun){ retrun } traceFun.observerExposureByName(['search-box .search-recommond-item'],['select_item'],function(bizCode, el){ if(bizCode==='select_item'){ const eventExtraNumber= $(el).data('index'); bizCode='search_recommend' traceEventReport('exposure',bizCode, 1, '', {}, '', eventExtraNumber); } }) $('.search-box .search-recommond-item').each(function(){ $(this).click(function(){ const eventExtraNumber= $(this).data('index'); traceEventReport('click','search_select_recommend', 1, '', {}, '', eventExtraNumber); }) }) } function traceEventReport(eventCode,bizcode, state, FailMsg, eventParams, eventExtra = '', eventExtraNumber = 0, eventExtraNum1 = 0) { var event = { eventCode: eventCode, eventBizCode: bizcode, eventState: state, eventFailReason: FailMsg, eventExtra: eventExtra, eventExtraNumber: eventExtraNumber, eventExtraNum1: eventExtraNum1, } if (typeof traceFun !== 'undefined') { traceFun.eventReport(event, eventParams, true); } } });})(customJs);

Photo Custom

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (2)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (3)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (4)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (5)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (6)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (7)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (8)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (9)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (10)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (11)

Preview

1/10

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (12)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (13)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (14)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (15)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (16)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (17)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (18)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (19)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (20)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (21)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (22)

£12.00

(0)

Buy More Save More

Gift Box

Your item(s) will be sent in a gift box.

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (24)

Greeting Card

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (25)

{{currencyPosition(item.price)}}

Greeting Card

{{cardDetailLength}} Left

Subtotal:

£12.00

Members can get 12 points for purchasing this item

Add To Basket

99 Day
Returns

Secure
Shopping

Privacy
Guaranteed

SHIPPING & RETURNS

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (28) Delivery

Delivery Time = Processing Time (Generally 1-5 business days) + Shipping Time

Standard Shipping

£4.0

8-10Days

Expedited Shipping

£6.0

6-8Days

Urgent Shipping

£18.0

4-6Days

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (29) 99-Day Return

Should you not be totally satisfied with your items, we offer 99 day returns and exchanges service to ensure you are left as happy as possible.

Please see here for the full list of terms and conditions for our refund and exchange policy.

Product Info

Specification

[HEARTS DESIGN]: Each tattoo features a charming connect-the-hearts design that symbolizes love, affection, and unity. The intricate details and vibrant colours make these tattoos truly eye-catching and appealing. Whether you're attending a music festival or a birthday party or want to add flair to your everyday style, these tattoos will make a statement.

[PERSONALIZED TOUCH]: What sets these tattoos apart is the ability to Personalise them with 1 to 5 names. Imagine the joy and surprise on your loved ones' faces when they see their names beautifully displayed within the heart design. It's a fantastic way to showcase your love and create a cherished memory that will last a lifetime.

[DURABLE AND WATERPROOF]: Don't worry about these temporary tattoos fading or smudging during all the festival fun. They are made with high-quality, non-toxic, and waterproof materials that ensure long-lasting wear for 2-8 days. Whether dancing in the rain, splashing in the pool, or sweating it out on the dance floor, these tattoos will stay vibrant and intact, allowing you to enjoy the festivities without any worries.

[EASY APPLICATION AND REMOVAL]: Applying these tattoos is a breeze! Dry the desired area, place the tattoo facedown, and dampen the back with a wet cloth for about 30 seconds. Gently peel off the paper, and voila! You're ready to flaunt your Personalised temporary tattoo. When the party is over, the tattoos can be easily removed with baby oil or alcohol tablets applied wet, ensuring a hassle-free cleanup.

[VERSATILE PARTY FAVORS]: These tattoos make fantastic party favors for various celebrations. Whether it's a family reunion, a wedding, a couple's retreat, or a friendship gathering, these tattoos will add a touch of excitement. They can also be used as icebreakers, conversation starters, or team-building activities, making them a versatile addition to any event.

[KINDLY NOTE]: These temporary tattoos are arranged on A4 paper and contain multiple tattoo stickers on a single one sheetr, making them easy to cut and use.

Specification
Material: Sticker
Measurement: Single Tattoo Sticker Height - 1"(2.5cm), 1.5"(3.8cm), 2"(5cm)
Feature: Non-toxicity, Skin-safe, Easy to apply and remove, Fun and temporary expression, Waterprrof and sweatproof, Family heart
Note
Customized Area: Front Printing
Package: We will choose an appropriate box for packaging based on the actual size of the product to ensure that you receive your products in the best condition.
Care: • Avoid getting the temporary tattoo wet for at least a few hours after application.• Refrain from rubbing or scratching the tattoo, as it may cause the design to fade or peel off prematurely.• When cleaning the area around the tattoo, use a mild soap and water.• Prolonged exposure to direct sunlight can fade the temporary tattoo.• When you want to remove the temporary tattoo, gently rub it with baby oil, rubbing alcohol.
Warm Tips: • Please be aware that the preview may be slightly different from the physical item in terms of color due to our lighting at our product photoshoot or your device’s display.• Due to differences in measurement methods, there may be slight discrepancies in dimensions. Please refer to the actual product.• Transportation may cause slight deformation, but it won't affect the product's quality and functionality.

ABOUT US

About Callie Contact us Terms and Conditions Blog Sitemap

CUSTOMER SERVICE

FAQ Returns Policy Privacy Policy Payment Methods Klarna

CONTACT US

Messenger

Email:support-uk@callie.com

2:00am to 11:00am Monday to Saturday (BST)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (30) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (31) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (32) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (33) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (34) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (35) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (36) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (37) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (38) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (39) Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (40)

Safety Assurance

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (41)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (42)

United Kingdom

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (43)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (44)

United States

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (46)

France

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (47)

Germany

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (48)

United Kingdom

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (50)

Italy

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (51)

Netherlands

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (52)

Spain

OPEN UNIQUE TRADING LIMITED

WORKSHOP 29 ON 5TH FLOOR CAREER AND KENSON INDUSTRIAL MANSION 58 HUNG TO RD KWUNTONG KL

Copyright © 2017-2024, CALLIE All Rights Reserved.

Product

1/1

1/10

${tempText}

` parentElement.appendChild(temp) setTimeout(function () { let offsetWidth = temp.offsetWidth let seatElement = temp.getElementsByClassName('font-scaling-seat')[0] let textElement = temp.getElementsByClassName('font-scaling-text')[0] let seatWidth = seatElement.offsetWidth textElement.style.width = seatWidth+'px' let leftpx = (offsetWidth - seatWidth) / 2 let ratio = (offsetWidth / seatWidth) textElement.style.transform = 'scale(' + (ratio > 1 ? 1 : ratio) + ')' textElement.style.left = leftpx + 'px' temp.style.right = '' temp.style.position = '' textElement.style['line-height'] = '20px' }) } fontScalingHeight(parentElement, text, className, width, height, fontSize) { width = width || '100%' parentElement.innerHTML = '' let temp = document.createElement('div') temp.classList.add('font-scaling-content') temp.style.width = width temp.style.right = '-100vw' temp.style.position = 'fixed' temp.style.height = height let globalRatio = window.innerHeight / 667 globalRatio = globalRatio > 1 ? 1 : globalRatio temp.innerHTML = `

${text}

${text}

` parentElement.appendChild(temp) setTimeout(function () { let offsetWidth = temp.offsetWidth; let seatElement = temp.getElementsByClassName('font-scaling-seat')[0]; let textElement = temp.getElementsByClassName('font-scaling-text')[0]; textElement.style['white-space'] = 'normal'; let seatWidth = seatElement.offsetWidth; let ratio = (offsetWidth * 2 / seatWidth) ratio = ratio >= 1 ? 1 : ratio textElement.style.top = '0px' textElement.style['font-size'] = Math.floor(fontSize * ratio) + 'px'; temp.style.right = '' temp.style.position = '' }) } getKeysWithPrefix(prefix) { let keysWithPrefix = []; for (let i = 0; i < localStorage.length; i++) { let key = localStorage.key(i); if (key.startsWith(prefix)) { keysWithPrefix.push(key); } } return keysWithPrefix; } initSVGA() { let that = this if (!window.SVGA && this.svgaFile) { let script = document.createElement('script'); script.type = 'text/javascript'; script.async = true script.onload = function () { that.initAnimation() } script.src = 'https://d2d36hyavd3mb7.cloudfront.net/assets/js/svga.min.js'; document.body.appendChild(script); } else if (this.svgaFile) { this.initAnimation() } } playAnimation() { if (this.player && this.player._videoItem && this.player._videoItem.frames) { this.player && this.player.startAnimation(0, true) this.activeCanvas.style['display'] = 'block' this.autoPlayer = false } else { this.autoPlayer = true } } // 预加载图片 preloadImages(images) { let that = this if (!images || !images.length) { return } let img = new Image() img.src = images[0] if (images.length > 1) { img.onload = function () { that.preloadImages(images.slice(1)) } } } isHandheldDeviceByTouchEventSupport() { return 'ontouchstart' in window || (typeof window.DocumentTouch !== 'undefined' && document instanceof DocumentTouch); } openLink(url) { var param = ''; let newTab = window.open('about:blank'); if (newTab) { newTab.location.href = url + (param != '' ? '?' + this.trim(param, '&') : ''); } else { setTimeout(() => { this.openLink(url) }) } } } class ActivePopup extends BaseObject { constructor(id) { super() this.setObject(activePopupData) this.init(id) } init(id) { if (id) { this.id = id this.class = this.camelToKebab(id) this.createMask() this.insertContentCSS() } else { console.error('activePopup init() id is empty') } } insertContentCSS() { let string = ` #${this.id} { display: none; width: 100vw; height: 100vh; position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.8); z-index: 20; } .${this.class}-frame { display: flex; align-items: center; justify-content: center; border-radius: 6px; flex-direction: column; height:100%; widht:100%; } .${this.class}-view { display: flex; align-items: center; justify-content: center; border-radius: 6px; flex-direction: column; } ` this.addCSS(string) } createMask() { let that = this let maskHtml = `

` this.insertElement(document.body, maskHtml) this.mask = document.getElementById(this.id) this.view = document.getElementsByClassName(`${this.class}-view`)[0] this.frame = document.getElementsByClassName(`${this.class}-frame`)[0] this.mask.addEventListener('click', function (e) { if (e.target === that.frame && that.activeInfo.state >= 2) that.close() }) this.view.addEventListener('click', function () {}) } open() { returnBlock.pushStateToHistory(this.id.toLowerCase()) this.mask.style.display = 'block' this.afterOpen && this.afterOpen() document.body.classList.add('active-parent--hidden') } close() { returnBlock.close() this.hide() } hide() { this.mask.style.display = 'none' document.body.classList.remove('active-parent--hidden') this.afterClose && this.afterClose() } popup(options) { options = { ...options, class: this.class + '-popup', } options.content = options.content + `Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (53)` if (window.innerWidth <= 480) { options.area = ['100%', '80%'] options.offset = 'b' options.maxRate = ['100vh', '80vh'] } else { options.area = ['80%', '80%'] options.maxRate = ['938px', '80vh'] } calliePopup.modal(options) returnBlock.pushStateToHistory(DialogType.POPUP, true); } } class MotherDayActive extends ActivePopup { constructor(id, activeInfo) { super(id); this.setObject(motherDayData) this.initData(activeInfo) this.afterInit() } initData(data) { this.titleImage = data.img this.localStorageStateId = 'motherDayActive' + data.id this.handleLocalstorage(data.id) this.cardIconInfo = { itemBackBg: data.rear_img, itemFrontBg: data.win_img || `${cdnUrl}front-default-icon.png`, lightIcon: data.win_light_img, cardList: data.prize_data, isAllowGuest: data.is_allow_guest, id: data.id, } this.preloadImages([this.cardIconInfo.itemFrontBg, this.cardIconInfo.lightIcon]) this.successImage = data.win_tips_img this.failImage = data.not_win_tips_img this.activeInfo.shareLink = data.share_link this.activeInfo.state = localStorage.getItem(this.localStorageStateId) >= 2 ? 2 : 0 this.activeInfo.notWinLink = data.not_win_link this.activeInfo.isAllowGuest = data.is_allow_guest this.activeInfo.winLink = data.win_link this.activeInfo.rulesContent = data.rules this.activeInfo.loginState = data.is_login this.activeInfo.usePrizeLink = data.use_prize_link this.activeInfo.id = data.id this.svgaFile = data.start_countdown_img if (data.record && data.record.share_time) { this.activeInfo.shareState = true } if (data.record) { this.activeInfo.drawTimes = data.record.num || 0 } } handleLocalstorage() { let that = this let array = this.getKeysWithPrefix('motherDayActive') array.forEach(function (item, index) { if (item != that.localStorageStateId) localStorage.removeItem(item) }) } afterInit() { this.createContent() if (this.activeInfo.state == 0) this.initSVGA() this.initPage() this.initResize() } initResize() { let that = this let baseHeight = 667 let baseWidth = 375 let calcFun = this.throttle(function () { let resizeHeight = window.innerHeight let resizeWidth = window.innerWidth that.ratio = Math.min(resizeHeight / baseHeight, resizeWidth / baseWidth) that.frame.style.transform = 'scale(' + that.ratio + ')' }, 10) calcFun() window.addEventListener('resize', function (e) { calcFun() }) } createContent() { let contentClassName = 'card-drawing-content' let popupClassName = 'popup-close' let failImage = '' let contentHtml = `

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (54)

${this.Remaining_Draws_Today.replace('{}','')} 0

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (55)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (56)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (57)

` this.insertElement(this.view, contentHtml) this.content = this.mask.getElementsByClassName(contentClassName)[0] this.buttonList = this.mask.getElementsByClassName('button-item') this.buttonResult = this.mask.getElementsByClassName('card-drawing-button-result')[0] this.cardDrawingTop = this.mask.getElementsByClassName('card-drawing-top')[0] this.cardDrawingResultTop = this.mask.getElementsByClassName('card-drawing-result-top')[0] this.shareButtonElement = document.getElementById('shareButton') this.drawTimes = document.getElementById('drawTimes') this.popupCloseElement = document.getElementById('popupClose') this.onClick('popupClose', 'close') this.onClick('myPrize', 'openMyPrize') this.onClick('rules', 'openRules') this.onClick('shareButton', 'shareButton') this.onClick('cardDrawingResult', 'cardDrawingResult') } openRules() { this.popup({ title: this.draw_rules, content: this.activeInfo.rulesContent }) } openMyPrize() { let that = this this.request(`/promotion/lotteryPrize?lottery_id=${this.activeInfo.id}`).then(function (res) { // res = mockDataList.data if (res && res.recordList) { that.setPrizeList(res.recordList) let content = that.setMyPrize() that.popup({ title: that.My_Prize, content, }) that.setScroll(`${that.class}-coupon-list`) let button = document.getElementsByClassName(`${that.class}-coupon-button`) that.forEachElement(button, function (item) { that.fontScaling(item, that.use_prize, '', '78px') item.addEventListener('click', function (e) { returnBlock.close() returnBlock.close() // console.log(item,'1111') window.location.replace(item.dataset.link) }) }) } }) } setPrizeList(list) { let prizeList = [] list.forEach(function (item) { let itemList = [] let currency_symbol = item.prize_data.currency_symbol item.prize_data.data.forEach(function (itemItems) { itemList.push( currency_symbol + itemItems.coupon.value ) }) prizeList.push({ time: item.lottery_time_text, couponList: itemList }) }) this.prizeList = prizeList } getPrizeInfo(index) { let that = this return new Promise(function (reslove, reject) { that.request(`/promotion/lottery`, { lottery_id: that.activeInfo.id }).then(function (res) { that.activeInfo.resultState = res.prize.data && res.prize.data.length > 0 ? 1 : 0 let currency_symbol = res.prize.currency_symbol that.activeInfo.drawTimes = res.num let list = that.setResultList(res.prize.data || [], currency_symbol) reslove({ sum: currency_symbol + res.prize.sum, list }) let eventState = traceFun.eventReport({ eventCode: 'custom', eventBizCode: 'carddraw_participated_result', eventExtraNumber: [1, 2][that.activeInfo.resultState] }, {}, true); }, function (error) { reslove({ sum: '', list: [] }) }) }) } setResultList(data, currency_symbol) { let list = [] data.forEach(function (item, index) { list.push(currency_symbol + item.coupon.value) }) return list } setMyPrize() { let that = this let content = '' if (this.prizeList.length > 0) { this.prizeList.forEach(function (item, index) { let list = that.setCouponList(item.couponList); content = content + `

${item.time}

${list}

` }) } else { content = `

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (58)

${this.No_prize}

` } return content } setCouponList(couponList) { let that = this let list = '' couponList.forEach(function (couponItem) { list = list + `

${couponItem}

` }) return list } shareButton() { let that = this if (!this.activeInfo.shareState) { this.request(`/promotion/lotteryShare?lottery_id=${this.activeInfo.id}`).then(function (res) { that.changeShareState(true) that.changeDrawTimes(res.num) // that.openLink(that.activeInfo.shareLink, '', true) // window.open(that.activeInfo.shareLink, '', true) }) } else { // that.openLink(that.activeInfo.shareLink, '', true) // window.open(this.activeInfo.shareLink, '', true) } } cardDrawingResult() { this.close() // resultState let isSuccess = this.activeInfo.resultState == 1 let url = isSuccess ? this.activeInfo.winLink : this.activeInfo.notWinLink if (!this.activeInfo.loginState && !this.activeInfo.isAllowGuest && isSuccess) { if (window.HeadTool) { HeadTool.login() return } else { url = window.origin + '/user/login#signin' } traceFun && traceFun.eventReport({ eventCode: 'click', eventBizCode: 'carddraw_item_join_now' }, {}, true) } else if (isSuccess) { traceFun && traceFun.eventReport({ eventCode: 'click', eventBizCode: 'carddraw_item_go_shopping' }, {}, true) } window.location.replace(url) } afterOpen() { let state = localStorage.getItem(this.localStorageStateId) >= 2 ? 2 : 0 this.changeState(state) this.setButtonState() this.activeInfo.state == 0 && this.playAnimation() let tempText = this.My_Prize.length>this.draw_rules.length?this.My_Prize:this.draw_rules this.fontScaling(this.shareButtonElement.getElementsByClassName('share-desc')[0], this.Extra_chance, 'share-desc-front', '135px') this.fontScaling(this.frame.getElementsByClassName('button-text')[0], this.My_Prize, '', '57px',tempText) this.fontScaling(this.frame.getElementsByClassName('button-text')[1], this.draw_rules, '', '57px',tempText) if (traceFun) { traceFun.traceParams.currentPageType = 'carddraw' traceFun.eventReport({ eventCode: 'carddrawload', eventBizCode: 'carddraw_page', }, {}, true); } } afterClose() { let state = this.activeInfo.state this.changeState(localStorage.getItem(this.localStorageStateId) >= 2 ? 2 : 0) this.cardInstance.clearTimeEvent() this.player && this.player.stopAnimation() this.cardInstance = null this.content.innerHTML = '' this.initPage() let eventBizCodeArray = ['carddraw_item_countdown_close', 'carddraw_item_countdown_close', 'carddraw_item_close', 'carddraw_item_participated_close', 'carddraw_item_participated_close' ] if (traceFun) { traceFun.eventReport({ eventCode: 'click', eventBizCode: eventBizCodeArray[state] }, {}, true) traceFun.traceParams.currentPageType = '' } } initPage() { this.cardInstance = new CardDrawing(this.content, this.cardIconInfo, this.activeInfo.state) this.cardInstance.parent = this this.changeShareState(this.activeInfo.shareState) this.changeDrawTimes(this.activeInfo.drawTimes) } changeDrawTimes(times) { this.activeInfo.drawTimes = times this.drawTimes.innerHTML = times if (this.activeInfo.drawTimes > 0 && this.activeInfo.state >= 2) { this.cardInstance.circulateFlashing() } } changeShareState(shareState) { this.activeInfo.shareState = shareState if (shareState) this.shareButtonElement.classList.add('width-54px') else this.shareButtonElement.classList.remove('width-54px') } changeState(state) { localStorage.setItem(this.localStorageStateId, state) this.activeInfo.state = state if (state == 2) this.cardInstance && this.activeInfo.drawTimes > 0 && this.cardInstance.circulateFlashing() else this.cardInstance && this.cardInstance.clearFlashing() if (state == 4 || state == 3) this.setButtonState() } setStateOpacity(opacity) { this.cardDrawingResultTop.style.opacity = opacity this.buttonResult.style.opacity = opacity this.popupCloseElement.style.opacity = opacity } setResultStyle() { let resultState = this.activeInfo.resultState resultState = resultState == 1 && !this.activeInfo.loginState && !this.activeInfo.isAllowGuest ? 2 : resultState let success = this.cardDrawingResultTop.getElementsByClassName('success-image')[0] let fail = this.cardDrawingResultTop.getElementsByClassName('fail-image')[0] this.addResultText(resultState) success.style.display = resultState == 0 ? 'none' : 'block' fail.style.display = resultState == 0 ? 'block' : 'none' let keyArray = ['card-drawing-button-fail', 'card-drawing-button-success', 'card-drawing-button-join'] let objectInfo = { 'card-drawing-button-join': 'carddraw_go_shopping', 'card-drawing-button-success': 'carddraw_go_shopping', 'card-drawing-button-fail': 'carddraw_I_Know' } traceFun && traceFun.eventReport({ eventCode: 'exposure', eventBizCode: objectInfo[keyArray[resultState]], eventTriggerElement: keyArray[resultState] }, {}, true); } addResultText(resultState) { this.buttonResult.innerHTML = '' let temp = [`

${this.I_Konw}

`, `

${this.Go_shopping}

`, `

${this.Go_shopping}

` ][resultState] this.insertElement(this.buttonResult, temp) } setButtonState() { let state = this.activeInfo.state this.setStateOpacity(1) if (state == 4) { this.setResultStyle() this.buttonResult.style.display = 'block' this.forEachElement(this.buttonList, function (item) { item.style.display = "none" }) this.cardDrawingResultTop.style.display = "block" this.cardDrawingTop.style.display = "none" } else if (state == 3) { this.buttonResult.style.display = 'block' this.forEachElement(this.buttonList, function (item) { item.style.display = "none" }) this.cardDrawingResultTop.style.display = "block" this.cardDrawingTop.style.display = "none" this.setStateOpacity(0) } else { this.buttonResult.style.display = 'none' this.forEachElement(this.buttonList, function (item) { item.style.display = "flex" }) this.cardDrawingResultTop.style.display = "none" this.cardDrawingTop.style.display = "flex" } } initAnimation() { let that = this let id = `${this.id}ActiveCanvas` this.activeCanvas = document.createElement('div') this.activeCanvas.id = id this.mask.append(this.activeCanvas); this.activeCanvas.style['display'] = 'block' this.activeCanvas.style['top'] = 0 this.activeCanvas.style['left'] = 0 this.activeCanvas.style['bottom'] = 0 this.activeCanvas.style['right'] = 0 this.activeCanvas.style['margin'] = 'auto' this.activeCanvas.style['height'] = '180px' this.activeCanvas.style['width'] = '208px' this.activeCanvas.style['position'] = 'fixed' this.player = new SVGA.Player(`#${id}`); this.parser = new SVGA.Parser(`#${id}`); // this.svgaFile this.parser.load(this.svgaFile, function ( videoItem) { that.player.setVideoItem(videoItem); that.player.loops = 1; if (that.autoPlayer) { that.playAnimation() } that.player.onFinished(function (videoItem) { that.activeCanvas.style['display'] = 'none' if (that.activeInfo.state == 0) { that.changeState(1) that.cardInstance && that.cardInstance.drawCard() } }); }); } } class CardDrawing extends BaseObject { constructor(content, cardInfo, state = 0) { super() this.setObject(CardDrawingData) this.cardInfo = cardInfo this.svgaFile = `${cdnUrl}/finger.svga` this.init(content, state) } init(content, state) { let that = this this.content = content this.initSVGA() this.width = parseInt(this.content.style.width) || this.content.style.offsetWidth this.height = parseInt(this.content.style.height) || this.content.style.offsetHeight this.setPosition(this.width, this.height) this.positionObject.positionArray.forEach(function (item, index) { if (that.cardInfo.cardList[index]) { let cardItem = that.cardInfo.cardList[index] let itemHtml = `

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (59)

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (60)

` that.content.appendChild(document.createRange().createContextualFragment(itemHtml)) } }) this.itemElement = document.getElementsByClassName(this.itemClassName) this.contentElement = document.getElementsByClassName(this.itemContentClassName) this.cardFloatEvent() this.setLightBg() this.insertContentCSS() } cardFloatEvent() { let that = this let isHandheld = this.isHandheldDeviceByTouchEventSupport() let flashingFlag this.forEachElement(this.itemElement, function (element, index) { that.getPrizeInfoDebounce = that.throttle(that.getPrizeInfo, 5000) element.getElementsByClassName('card-drawing-item-back')[0].addEventListener('click', function () { !that.lockCheck() && that.getPrizeInfoDebounce(index) }) if (!isHandheld) { let flag = false let time = 0.2 element.addEventListener('mouseout', end) element.addEventListener('touchend', end) function end() { if (flag && that.parent.activeInfo.drawTimes > 0 && that.parent.activeInfo.state == 2) { flag = false element.style['margin-top'] = '0px' if (!flashingFlag) { flashingFlag = setTimeout(function () { element.style['transition-duration'] = '0.5s' that.circulateFlashing() }, 1500 * time) } } } element.addEventListener('mouseover', function () { if (!flag && that.parent.activeInfo.drawTimes > 0 && that.parent.activeInfo.state == 2) { flag = true that.clearFlashing() clearTimeout(flashingFlag) flashingFlag = null element.style['transition-duration'] = `${time}s` element.style['margin-top'] = '-6px' } }) } }) } insertContentCSS() { let iosVersion = this.getIOSVersion() let lessThanIos13 = iosVersion && iosVersion.major <= 13 let string = `.card-drawing-item-front{ transform: translateZ(1px) rotateY(0); z-index:2; opacity: 1; } .card-drawing-item-back { transform: translateZ(-1px) rotateY(180deg); cursor: pointer; z-index: 1; ${lessThanIos13?'opacity: 0;':''} } .card-reverse>.card-drawing-item-front { transform: translateZ(-1px) rotateY(180deg); position: relative; ${lessThanIos13?'opacity: 0;':''} z-index:1; } .card-reverse>.card-drawing-item-back { transform: translateZ(1px) rotateY(360deg); opacity: 1; z-index:2; }` this.addCSS(string) } setLightBg() { if (this.cardInfo.lightIcon) { this.content.appendChild(document.createRange().createContextualFragment( `Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (61)`)) this.lightIconElement = document.getElementById('lightIcon') } } getPrizeInfo(index) { let that = this this.clearFlashing() traceFun && traceFun.eventReport({ eventCode: 'click', eventBizCode: 'carddraw_item_participated' }, {}, true) this.parent.getPrizeInfo().then(function (res) { that.changeState(3) that.setItemContent(res, index) that.clickOverTurnEvent(index) }) } setItemContent(item, index) { let template if (item.list.length >= 1) { template = this.setCouponElement(item.sum, item.list) } else { template = this.setEmpty() } template = `Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (62)

${template}

` document.getElementsByClassName('card-drawing-item-front')[index].innerHTML = '' this.insertElement(document.getElementsByClassName('card-drawing-item-front')[index], template) this.setScroll('result-card-list-view') if (item.list.length >= 1) { this.fontScaling(document.getElementsByClassName('result-card-coupon')[0], item.sum, '', '180px') let couponText = item.list.length > 1 ? this.parent.win_coupons : this.parent.win_coupon.replace('{coupon}', item.sum) this.fontScalingHeight(document.getElementsByClassName('result-card-desc')[0], couponText, '', '183px', '36px', '15') if (!this.parent.activeInfo.loginState && !this.parent.activeInfo.isAllowGuest) { this.fontScalingHeight(document.getElementsByClassName('result-card-tips')[0], this.parent.Sign_in_to_get_prize, '', '193px', '30px', '13') } } } setCouponElement(coupon, couponList = []) { let element = `

${coupon}

` element = element + ( `

${couponList.length>1?this.parent.win_coupons:this.parent.win_coupon.replace('{coupon}',coupon)}

` ) element = element + (couponList.length > 1 ? `

${this.parent.setCouponList(couponList)}

` : '') element = element + (this.parent.activeInfo.loginState || this.parent.activeInfo.isAllowGuest ? '' : `

${this.parent.Sign_in_to_get_prize }

`) return element } setEmpty() { return `Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (63)

${this.parent.No_prize_prompt}

` } setPosition(width, height, row = 3, line = 2, marginHeight = 5, marginWidth = 13) { let widthItem = parseInt((width - (row - 1) * marginWidth) / row) let heightItem = parseInt((height - (line - 1) * marginHeight) / line) this.positionObject.center = { top: (height - heightItem) / 2, left: (width - widthItem) / 2 } for (let i = 0; i < line; i++) for (let j = 0; j < row; j++) this.positionObject.positionArray.push({ top: i * heightItem + i * marginHeight, left: j * widthItem + j * marginWidth, width: widthItem, height: heightItem }) } circulateFlashing() { let that = this if (!this.circulateFlashingInterval && this.parent.activeInfo.drawTimes) { let list = this.itemElement let length = list.length let positionArray = this.positionObject.positionArray let index = 0 let showFingerSvga = function () { if (that.activeCanvas) { let item = positionArray[index] let left = item.left + item.width / 2 - 11 let top = item.top + item.height / 2 - 12 that.activeCanvas.style['top'] = top + 'px' that.activeCanvas.style['left'] = left + 'px' that.activeCanvas.style['display'] = 'block' that.activeCanvas.dataset.index = parseInt(index) that.activeCanvas.getElementsByTagName('canvas')[0].dataset.index = parseInt(index) that.playAnimation() that.activeCanvas.addEventListener('click', function (e) { !that.lockCheck() && that.getPrizeInfoDebounce(parseInt(e.target.dataset.index)) }) } } flashingEvent() if (length > 1) { this.circulateFlashingInterval = setInterval(flashingEvent, 1500) } function flashingEvent() { let item = list[index] showFingerSvga() if (length > 1) { let lastItem = list[index - 1 < 0 ? length - 1 : index - 1] item && item.classList.add('flashing-animation') lastItem && lastItem.classList.remove('flashing-animation') index = index + 1 >= length ? 0 : index + 1 } else { item && item.classList.add('flashing-animation') } } } } clearTimeEvent() { this.clearFlashing() for (let i = 1; i <= 4; i++) { let key = 'timeout' + i this[key] && clearTimeout(this[key]) this[key] = null } } clearFlashing() { this.circulateFlashingInterval && clearInterval(this.circulateFlashingInterval) this.circulateFlashingInterval = null this.forEachElement(this.itemElement, function (item, index) { item.classList.remove('flashing-animation') item.style['transition-duration'] = `0.5s` }) if (this.activeCanvas) { this.activeCanvas.style['display'] = 'none' } } overturnEvent(index = 0) { if (this.contentElement && this.contentElement.length > 0) { let element = this.contentElement[index] if (element.classList.value.includes('card-reverse')) { element.classList.remove('card-reverse') } else { element.classList.add('card-reverse') } } } clickOverTurnEvent(index = 0) { let that = this if (this.itemElement && this.itemElement.length > 0) { let element = this.itemElement[index] let content = this.contentElement[index] let animationTime = 0.8 this.forEachElement(this.itemElement, function (item, itemIndex) { if (itemIndex !== index) { item.style.display = 'none' } }) let timeout4 = setTimeout(function () { that.changeState(4) }, 1000 * animationTime) let styleList = content.getElementsByClassName('card-drawing-item-child-style') this.forEachElement(styleList, function (item) { item.style['transition-timing-function'] = 'ease-in-out'; item.style['transition-duration'] = `${animationTime}s`; }) content.classList.remove('card-reverse') element.classList.add('card-enlarged') this.lightIconElement && this.lightIconElement.classList.add('enlarged') } } lockCheck() { let activeInfo = this.parent.activeInfo let flag = true if (activeInfo.drawTimes > 0 && activeInfo.state == 2) flag = false else flag = true if (activeInfo.drawTimes == 0 && activeInfo.state == 2) { if (!activeInfo.shareState) { calliePopup.toast(this.parent.share_to_win) } else { calliePopup.toast(this.parent.no_chance_draw) } traceFun && traceFun.eventReport({ eventCode: 'custom', eventBizCode: 'carddraw_participated_result', eventExtraNumber: 0 }, {}, true); } return flag } changeState(state) { this.parent && this.parent.changeState(state) } initAnimation() { let that = this let id = `CardDrawingFinger${this.cardInfo.id}` this.activeCanvas = document.createElement('div') this.activeCanvas.id = id this.content.append(this.activeCanvas); this.activeCanvas.style['display'] = 'none' this.activeCanvas.style['height'] = '50px' this.activeCanvas.style['width'] = '55px' this.activeCanvas.style['position'] = 'absolute' this.activeCanvas.style['transition'] = 'all 0.2s' this.activeCanvas.style['z-index'] = '5' this.player = new SVGA.Player(`#${id}`); this.parser = new SVGA.Parser(`#${id}`); this.parser.load(this.svgaFile, function ( videoItem) { that.player.setVideoItem(videoItem); if (that.autoPlayer) { that.playAnimation() } }); } drawCard() { let that = this if (this.contentElement && this.contentElement.length) { this.forEachElement(this.contentElement, function (item, index) { that.overturnEvent(index) }) } this.timeout1 = setTimeout(function () { if (that.itemElement && that.itemElement.length > 0) { that.forEachElement(that.itemElement, function (item, index) { item.style.top = that.positionObject.center.top + 'px'; item.style.left = that.positionObject.center.left + 'px'; }) } }, 500) this.timeout2 = setTimeout(function () { if (that.itemElement && that.itemElement.length > 0) { that.forEachElement(that.itemElement, function (item, index) { item.style.top = that.positionObject.positionArray[index].top + 'px'; item.style.left = that.positionObject.positionArray[index].left + 'px'; }) } that.timeout3 = setTimeout(function () { that.changeState(2) }, 1000) }, 1400) } }

🙌 Congrats! You've Successfully Claimed Your Coupon!

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (64)

Oops! The magic has faded. The event has ended.

` document.body.appendChild(temp); } let activeEntry = _$("#active-entry"); seatImg = _$("#seat-img"); activeEntryModal = _$("#activeEntryMask"); if (!ifJumpList) { activeEntryModal && activeEntryModal.append(`

`) activeViewGet = _$("#activeViewGet"); } activeViewSuccess = _$("#activeViewSuccess"); activeViewSuccessContent = _$("#activeViewSuccessContent"); activeViewFailContent = _$("#activeViewFailContent"); } function checkEmail(email) { return new Promise(function (resolve, reject) { $.post( "/user/emailCheck", { email }, function (res, state) { var result = res.data; resolve(result); } ); }); } function getUrlParams(name) { let search = window.location.search || window.location.hash || '?' let params = {} search = search.split('?') search = search[1]?.split('&') || [] for (let i = 0; i < search.length; i++) { let element = search[i].split('=') if (element[1]) params[element[0]] = element[1].split('#')[0] } search.forEach(function (element) {}); return params[name] } function initEntryInfo(_$) { var iframeContent = document.getElementById('activeViewGetIframe') if (!iframeContent && activeViewGet) { activeViewGet.append( `

`) iframeContent = document.getElementById('activeViewGetIframe') } if (advertise && iframeContent) { iframeContent.contentWindow.postMessage({ event: 'setLogin', params: !!isLogin }) iframeContent.contentWindow.postMessage({ event: 'setAdvertise', params: advertise }) let email = getUrlParams('_em') if (email) { const url = window.location.href; const updatedUrl = url.replace(/([?&])_em=[^&]+(&|$)/, ''); window.history.replaceState(null, null, updatedUrl); } else { email = window.localStorage.getItem(`email${advertise.id}`) } checkEmail(email).then(function(res) { if (res) { window.localStorage.setItem(`email${advertise.id}`, email) iframeContent.contentWindow.postMessage({ event: 'setEmail' }) } }) } } function showSeatImg() { if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['ad_window_corner'],['ad_window_corner']); } activeCanvas && activeCanvas.hide(); seatImg && seatImg.show(); if (!sessionStorage.getItem('keyFirstPop') && advertise.is_first_auto_pop && (advertise.href_type === 2 || advertise.href_type === 1) && !ifJumpList) { sessionStorage.setItem('keyFirstPop', new Date()) openActive() } } function openActive() { if (advertise.href_type === 1) { if (ifJumpList === 0) { openGetCoupon(); } else if (ifJumpList === 1) { getCoupons(); } } else if (advertise.href_type === 0 && advertise.href) { window.location.href = advertise.href } else if (advertise.href_type === 2 && advertise.lottery_data.id && advertise.lottery_id) { motherDayActive.open(); } } function openGetCoupon() { initEntryInfo(); returnBlock.pushStateToHistory('active'); activeEntryModal && activeEntryModal.show(); activeViewGet && activeViewGet.show(); activeViewSuccess && activeViewSuccess.hide(); } function openSuccess(type, data) { returnBlock.pushStateToHistory('success') if (typeof traceFun !== 'undefined') { if (type == 1) { traceFun.observerExposureByName(['active-view-success'],['ad_window_coupon_result']); } else { traceFun.observerExposureByName(['active-view-fail-content'],['ad_window_coupon_result']); } } activeEntryModal && activeEntryModal.show(); activeViewSuccess && activeViewSuccess.show(); activeViewGet && activeViewGet.hide(); var event = { eventCode: 'custom', eventBizCode: 'ad_window_coupon_result' } if (type == 1) { setCouponList(data) activeViewSuccessContent && activeViewSuccessContent.show() activeViewFailContent && activeViewFailContent.hide() event.eventState = 1 } else { activeViewSuccessContent && activeViewSuccessContent.hide() activeViewFailContent && activeViewFailContent.show() event.eventState = 0 } if (typeof traceFun !== 'undefined') { traceFun.eventReport(event, {}, true); } } function loginSuccess() { localStorage.removeItem("isNewUser"); localStorage.removeItem(`email${advertise.id}`); let flag = isLogin isLogin = true loadFlag = flag !== isLogin } function getCouponsFail() { getCouponsFailFlag = true openSuccess(0) } function getCouponsSuccess(data) { ifJumpList = 1 couponsList = data.coupon_list openSuccess(1, data) } function overallSituationBackEvent(value) { if (document.getElementById('activeViewGet') && getComputedStyle(document.getElementById('activeViewGet')).display === 'block') { var iframeContent = document.getElementById('activeViewGetIframe') iframeContent.contentWindow.postMessage({ event: 'closeUserPage', }) } else { closeActiveEntryMaskAfter(value) } } function closeActiveEntryMaskAfter(value) { history.back() if (value === true || getCouponsFailFlag || loadFlag) { getCouponsFailFlag = false reloadEvent() } } function reloadEvent() { history.replaceState(null, null, ' '); window.location.reload() } function closeActiveEntryMask() { activeEntryModal && activeEntryModal.hide(); activeViewSuccess && activeViewSuccess.hide(); activeViewGet && activeViewGet.hide(); } var addNomral = antiShake(function () { seatImg.addClass("nomral"); }, 2000); function antiShake(callback, delay = 500) { var timeout = null; return function () { clearTimeout(timeout); timeout = setTimeout(function() { callback.apply(this, [...arguments]); }, delay); }; } function currencyFormat(number, decimals, dec_point, thousands_sep) { number = (number + '').replace(/[^0-9+-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = dec_point == '1' ? '.' : ',', s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + Math.round(n * k) / k; }; s = (prec ? toFixedFix(n, prec) : '' + Math.floor(n)).split('.'); var re = /(-?\d+)(\d{3})/; while (re.test(s[0])) { s[0] = s[0].replace(re, "$1" + sep + "$2"); } if ((s[1] || '').length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1).join('0'); } return s.join(dec); } function initSVGA(_$) { activeCanvas = document.createElement('div') activeCanvas.id = 'activeCanvas' document.body.append(activeCanvas); activeCanvas = _$('#activeCanvas') activeCanvas && activeCanvas.show() if (!window.SVGA) { var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true script.onload = function() { initAnimation() } script.src = 'https://d2d36hyavd3mb7.cloudfront.net/assets/js/svga.min.js'; document.body.appendChild(script); } else { initAnimation() } }

` let priceElement = `

${itemInfo.type === 2?itemInfo.value:currencyFormat(itemInfo.value, 2, data.currency_point, ' ')}

` let couponPercent = `

${itemInfo.coupon_percent}

` let CouponMaxElement = `

${CouponMax}

` let limitAmount = `${currencyFormat(itemInfo.limit_amount, 2, data.currency_point, ' ')}` let stateArray = ['', '', Used, Expired] let item = `

${itemInfo.type === 3?(couponPercent+USDElement + ' ' +CouponMaxElement):(data.currency_position === 1 || itemInfo.type === 2?priceElement+USDElement:USDElement+priceElement)}

${itemInfo.type == 3?(Over+ ' '+itemInfo.limit_num +' '+items):(Over+' '+(data.currency_position === 1?limitAmount+ USD:USD+limitAmount))}

${ValidUntyil} ${(new Date(itemInfo.end_time*1000)).toJSON().substring(0,10)}

${stateArray[itemInfo.state]}

` return item }

' + '

IN

'; } else { html += '

MM

' + '

IN

'; } html += '

' + '

' + '

' + '' + '' + head_title + '' + '' + ''; $.each(des_data['CM'],function(index,item){ html += ''; $.each(item,function(key,value){ html += ''; }) html += ''; }) html += '' + '
' + value + '

' + '

' + '

' + '

' + '' + '' + head_title + '' + '' + ''; $.each(des_data['IN'],function(index,item){ html += ''; $.each(item,function(key,value){ html += ''; }) html += ''; }) html += '' +'
' + value + '

' +'

' +'

*' + des_data['des'] + '

' +'

' +'

' +'

' + des_data['new_content'] + '

' +'

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (65)

' +'

'; } calliePopup.modal({ title: des_data['title'], content: html, class: 'catelog-desc-content' + new_css, area: ['48.85%', '80%'], maxRate: ['938px', '80vh'], success: function() { if(size_guide_type == "0"){ $('.catelog-desc-content .tab-content[data-type="0"]').addClass('active').siblings().removeClass('active'); } else { $('.catelog-desc-content .tab-content[data-type="1"]').addClass('active').siblings().removeClass('active'); } } }) } var mapBoxOpen = true; window.mapBoxFn = function(options, callback){ if(!mapBoxOpen){return false;} hasMap = true; mapBoxOpen = false; var pre_src = options['base64'] || ''; var id = options['id'] || 0; var style1 = options['map_style1'] || '',style2 = options['map_style2'] || ''; var grid = options['map_grid'] || ''; var center = [0,0], zoom = 13; try{ gridArr = grid.split(','); center = [gridArr[0],[gridArr[1]]]; if(options['mapbox_center'].length > 0 && options['mapbox_center'][0] != 0 && options['mapbox_center'][1] != 0){ var new_center = options['mapbox_center'].join(','); center = new_center.split(','); } zoom = options['mapbox_zoom'] || zoom; } catch (e) {} var fn = function (dom, index) { _$.jsLoader("https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/mapbox.min.js?v=24.2.3.4", function () { var optionsData = { 'selector': '.map-container', width: 500, height: 500, 'accessToken': mapboxToken, 'leftStyle': style1, 'rightStyle': style2, 'center': center, 'zoom': zoom, 'error': function (msg, stack) { calliePopup.toast('[map]:' + msg); _$.closeLoading(); _$.ajaxJson('/error/frontend', { stack: stack }, function () { }); calliePopup.close(index); }, 'loaded': function () { mapBoxOpen = true; _$.closeLoading(); } }; var Mb = new Mapbox(optionsData); Mb.render(function (container) { }, function (ret) { var returnOption = {} var url = ret['url'], base64 = ret['base64'], blob = ret['blob']; center = ret['center'], zoom = ret['zoom']; var d = {}; d[id] = base64; upImage[id] = { isload: 0, src: url, blob: url }; // cart('.charlet-map'); calliePopup.close(index); returnOption['src'] = url; returnOption['mapbox_center'] = center; returnOption['mapbox_zoom'] = zoom; _$.ajaxJson('/product/cartImage', { file: d }, function (res, state) { if (state != 1) { returnOption['src'] = pre_src; return false; } var res_url = res[id] || res['data'][id] || ''; upImage[id] = { isload: 1, src: res_url, blob: url }; }); typeof callback ==='function' ? callback(returnOption) : ''; }); }); }; var data = _$.dataMode({ 'url': '/product/mapbox', 'reset': 0, },{}); _$.cacheContent(data,function(html){ calliePopup.open({ type: 1, content: html, class: 'map-modal', title: "Map Custom", area: ['48.85%', '80%'], maxRate: ['938px', '80vh'], vessel: false, success: function(dialog,index) { fn(dialog,index); } }) }) return false; } window.carveImage = function(data,id,callback,fn){ var file = data.file, itemImage = data.image; $('.charlet-file').attr('data-id',id); var src = ""; var pre_src = ""; if(file){ var imageType = /^image\//; var size=0,type='',name=''; try{size = file.size || 0;type = file.type;name = file.name;}catch(e){} if( size<1 ){ _$.callFunc(fn,0); calliePopup.toast("Pictures size error"); return false; } if( size > maxSize ){calliePopup.toast("Pictures must not exceed "+mSize+"M"); return false;} if (!imageType.test(file.type)) { _$.callFunc(fn,0); calliePopup.toast("Pictures type error"); return false; } src = getObjectURL( file ); } else { src = itemImage; } if (has_custom) { try{ setTimeout(function(){ $('.img-zoom').addClass('active'); $('body').addClass('modal-open_absolute'); if(hasVideo && $('.video-item').length > 0) { $('.video-item video')[0].pause(); } },50); }catch(e){} } if(file){ _$.thumbImage(src,1000,function(blob,base64){ if (!blob){ calliePopup.toast("Pictures type error"); _$.callFunc(fn,0,pre_src); return false; } var url = URL.createObjectURL(blob); pre_src = base64; var d = {}; d[id] = base64; upImage[id] = {isload:0,src:url,blob:url}; if (has_custom) { if(canvas!=null){ //toup: var drawAttr = Object.deepAssign({},optsAttr); setNewCanvasObj(drawAttr); $.each(upImage,function(i,uim){ if(uim['blob']==''||uim['blob']==null){ return true; } try{ drawAttr[i]['image'] = uim['blob']; } catch (e) {} }); canvas.confRender(JSON.stringify(optsAttr),{imageId:id}); } // canvasImage(); } _$.callFunc(fn,1,url); // cart('.charlet-file'); _$.ajaxJson('/product/cartImage',{file:d},function(res,state){ if(state!=1){ typeof callback ==='function' ? callback() : ''; return false; } var res_url = {}; res_url['url'] = res[id] || res['data'][id] || ''; res_url['blob'] = url; res_url['id'] = id; upImage[id] = {isload:1,src:res_url['url'],blob:url}; if(!has_custom){ uploadImageState[id]=true; } typeof callback ==='function' ? callback(res_url) : ''; }); }); } else { upImage[id] = {isload:1,src:src,blob:src}; } } window.getCalendar = function(title, value, callback){ value = value || ''; var fn = function (dom, index) { _$.loopJs(calendarJs,function(){ var cDom = $(dom).find('.calendar-content')[0]; var Ca = new Calendar({ 'selector':cDom, 'confirm': function (value) { value = dateFormat(value,'yyyy/mm/dd',dateFormatStr); typeof callback ==='function' ? callback(value) : ''; calliePopup.close(index) } }); value = dateFormat(value,'yyyy-mm-dd',dateFormatStr); Ca.render(value); }); } var data = _$.dataMode({ 'selector':'.calendar-popup', 'reset': 0, },{}); _$.cacheContent(data,function(html){ calliePopup.open({ type: 1, content: html, title: title, area: ['48.85%', 'auto'], maxRate: ['938px', '80vh'], vessel: false, success: function(dialog,index) { fn(dialog,index); } }) }) } window.showHelp = function(title, content){ calliePopup.modal({ title, content, class: 'help-dialog', area: ['48.85%', 'auto'], maxRate: ['938px', '80vh'], }) $('.help-btn').trigger('click'); } window.changeSlide = function(src){ refImage(src); } window.preivewToggle = function(type){ if(type == 1){ $('.preview-box').css('position','static'); } else { $('.preview-box').css('position','sticky'); } } _$('.canvas-control-upload').on('click',function(){ var node = null; if(hasMap){ sendMessage({'productMessageType':'changeMap'}); } else { $('.charlet-file').trigger('click'); } }); $(document).on('change','.charlet-file',function(e){ var id = $(this).attr('data-id') || attrmaps['objects'][0]['ccvsId']; var files = this.files[0]; iWindow.replaceImage(files,id); }); function getDevice() { var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios if (isAndroid) return 'android'; if (isiOS) return 'ios'; } if (getDevice() === 'ios') { document.body.addEventListener('focusin', () => { window.preivewToggle(1); }); document.body.addEventListener('focusout', () => { window.preivewToggle(0); }); } else if (getDevice() === 'android') { var default_h = document.documentElement.clientHeight || document.body.clientHeight; window.addEventListener('resize', () => { var resizeHeight = document.documentElement.clientHeight || document.body.clientHeight; if (resizeHeight < default_h) { window.preivewToggle(1); } else { window.preivewToggle(0); } }) } var iWindow = iframe.contentWindow; var iDocument = iframe.contentDocument || iframe.document; var isInit = false; sendMessage = function (value) { iWindow.postMessage(value, iframe.src) } function setNewCanvasObj(obj){ const newOptsAttr={} _.forEach(obj, function(value, key){ if (key > 0 && obj.hasOwnProperty(key)) { newOptsAttr[key] = obj[key] } if((value.type == 4 || value.type == 5 || value.type == 6) && (value.text == "" || value.text == null || typeof value.text == "undefined")){ if(value.required === 0){ delete newOptsAttr[key]; } else { newOptsAttr[key] = {}; } } if((value.type == 2 || value.type == 3) && (value.image == null || typeof value.image == "undefined")){ newOptsAttr[key]['image'] = ''; } if(value.type == 7){ if((value.local_img_url === "" || value.local_img_url === null)){ if(!uploadImageState[key]){ try{ upImage[key]['src'] = ''; upImage[key]['blob'] = ''; upImage[key]['isload'] = ''; } catch(e) {} } if(value.required === 0){ delete newOptsAttr[key]; } } else if(typeof value.local_img_url == "undefined" && value.required === 0) { delete newOptsAttr[key]; } else if(value.image === "" || value.blob === "") { newOptsAttr[key]['image'] = value.local_img_url; newOptsAttr[key]['blob'] = value.local_img_url; } try{ newOptsAttr[key]['image'] = upImage[key]['blob']; if(upImage[key]['blob'] == ''){ newOptsAttr[key]['image'] = emptyImg; newOptsAttr[key]['blob'] = emptyImg; } } catch(e){} if(value.local_img_url&&uploadImageState[key]){ uploadImageState[key]=false; } } }) optsAttr = newOptsAttr; try { if (Object.getOwnPropertyNames(optsAttr).length === 0) { traceEventReport('product_custom_setNewCanvasObj', 0, JSON.stringify(obj), {}); } } catch (error) {} } window.addEventListener('message',function(event){ if (!isReportPageTraceData) { traceEventReport('product_page', 1, '', getTraceProductInfo()); isReportPageTraceData = true; } if(event.origin == window.location.origin){ if(event.data.action_event==='trace'){ traceEventReport(event.data.payload.traceName, 1, event.data.payload.failMessage, getTraceProductInfo()); } if(event.data.action_event==='is_custom_change'){ traceEventReport('product_select_personalized', 1, '', getTraceProductInfo()); } if(_.hasIn(event.data, 'readDataType')){isDateCache = event.data.readDataType == 'cache' ? true : false;} if(event.data.isInit != false && canvas_swiper == 0){canvas_init = 0;} else{canvas_init = 1;canvas_swiper = 1;} if (typeof event.data.isInit != "undefined" && !isIframeFirstSelected && !event.data.isInit) { isIframeFirstSelected = true; } if(typeof event.data.canvasInitData != "undefined" && !_$.isEmptyObject(event.data.canvasInitData) && event.data.canvasInitData != null){ setNewCanvasObj(event.data.canvasInitData); if(canvas!=null){ canvas.confRender(JSON.stringify(optsAttr)); } } else { //traceEventReport('product_custom_canvasInitData', 0, 'canvasInitData is null', {}); } if(event.data.price){ sku_old_price = event.data.old_price; debounceSetPrice(product_stock,event.data.price,event.data.old_price) } if(typeof event.data.params != "undefined" && event.data.params != null){ if (!_$.isEmptyObject(event.data.params)) { setNewCanvasObj(event.data.params); } cartSku(event.data.params); } } else { return; } }) window.messageInit = true; listenRegist = true; if ((ccvsRegist && has_custom) || (listenRegist && !has_custom)) { window.canvasInit = true; } $(document).on('click','.add-cart',function(){ if($(this).parents().hasClass('preview-zoom-modal')){ $('.preview-zoom-modal .bg').trigger('click'); } var validateResult = iWindow.validateCustomItem(); var data = validateResult['data'], flag = validateResult['flag']; if(flag == true){ if (!_$.isEmptyObject(data)) { setNewCanvasObj(data); } else { try { traceEventReport('product_custom_data', 0, 'add to cart data is null :' + product_custom_num, {}); } catch (error) {} if(product_custom_num > 0){ calliePopup.toast("Network is abnormal.Please try again"); traceEventReport('product_add_to_cart', 0, 'add to cart data null', getTraceProductInfo()); return false; } } debounceSubmit() } else { try { traceEventReport('product_add_to_cart', 0, 'add to cart data invalid', getTraceProductInfo(), validateResult['emptyDataStr']); } catch (error) {} return false; } }); // iframe end var zoomIdx = 0,zoomMin=1,zoomMax=0; var zoomFunc = function (container,node) { zoomIdx = _$(node).data('zoom') || 0; zoomIdx = parseInt(zoomIdx); var nextZoom = _$('.zoom-image-'+(zoomIdx+1)),preZoom = _$('.zoom-image-'+(zoomIdx-1)); var cont = _$(container); cont.addClass('product-zoom'); if (preZoom.length>0 || nextZoom.length>0 || zoomMax>0) { cont.addClass(act) } }; var addZoomFunc = function (node) { node.prompt = zoomFunc; var zoom = _$(node).data('zoom') || 0; if (zoom>zoomMax) { zoomMax = zoom; } if (zoom < zoomMin) { zoomMin = zoom; } }; var hasCustomUpload = 0; var canvasImage = function(){ if(canvas!=null){ canvas.toImage(0,function(image){ canvas.newLoad = false; if(image==''||image==null){ return false; } clipImage = image; if($('.preview-zoom-modal .swiper-slide').length > 0){ _$('.preview-zoom-modal .swiper-slide img').setAttr({'src':image,'data-src':image}); } var preview = _$('.custom-img-preview'); preview.length>0 ? preview.setAttr({src:image}) : ''; if( !isIframeFirstSelected && hasGroupKey !== 2 ){ if (isOrigin && isDateCache) { canvas_init = 1; if(typeof $('.gallery-top')[0]._sp != 'undefined'){ canvas_swiper = 1; } else { isIframeFirstSelected = true; setTimeout(()=>{ canvasImage(image); },200) } } else { return false } } if(canvas_init > 0 && canvas_swiper == 1){ previewAdd(image); swiper_container.each(function(idx,item){ var currentNode = _$(item).find('img[class^="custom-img"]').closest('.swiper-slide'), parentNode = item.querySelectorAll('.swiper-slide'); if(typeof item._sp != 'undefined' && _$(item).find('img[class^="custom-img"]').length > 0){ // var activeIndex = [].indexOf.call(parentNode,currentNode[0]);item._sp.slideToLoop(0); } }); }else{ canvas_init = 1; canvas_swiper = 1; if (load_prod_draw == 'load_prod_draw') { previewAdd(image); swiper_container.each(function(idx,item){ item._sp.slideToLoop(1); }); } } }); } }var previewSilderNum = 0;var previewAdd = function(image) { if(typeof $('.gallery-top')[0]._sp != 'undefined'){ slide_canvas = _$(".slide-canvas"); if(slide_canvas.length > 0) { slide_canvas.find('img').setAttr({src:image,'zoom-src':image}); traceEventReport('product_request_image', 1, '', getTraceProductInfo(), '', 0, 2); } else { $('.gallery-thumbs')[0]._sp.prependSlide('

Live preview

'); var topHtml = `

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (66)

`; $('.gallery-top')[0]._sp.prependSlide(topHtml); previewSilderNum ++; try{ _$('.gallery-thumbs')[0]._sp.update(); _$('.gallery-top')[0]._sp.update(); traceEventReport('product_request_image', 1, '', getTraceProductInfo(), '', 0, 2); if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['slide-canvas'], ['product_item_image'], callBackExposure); } } catch(e) {console.log(e);} } } else { setTimeout(()=>{ previewAdd(image) },200) } } var refImage = function(image){ if(image==''||has_custom){ return false; } image = s3+image.replace(s3,'',image); if(slide_img!=null){ slide_img.find('img').setAttr({'src':image,'zoom-src':image}); swiper_container[0]._sp.slideToLoop(0); var img_zoom_img = _$(".img-zoom img"); img_zoom_img.setAttr({'src':image}); img_zoom_img.data('src',image); traceEventReport('product_request_image', 1, '', getTraceProductInfo(), '', 0, 1); }else{ if(typeof swiper_container[0]._sp=='undefined'){ setTimeout(function(){ refImage(image); },300); }else{ var html = '

Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (67)

'; $('.swiper-controls .swiper-pagination__product .swiper-pagination-total').each(function(){ var total = parseInt($(this).attr('data-total')) + 1; $(this).attr('data-total',total); $(this).text(total); }) swiper_container[0]._sp.prependSlide(html); swiper_container[1]._sp.prependSlide(html); slide_img = _$(".slide-img"); try{ addZoomFunc(slide_img.eq(0).find('img')[0]); } catch (e) {} var img_zoom_img = _$(".img-zoom img"); img_zoom_img.setAttr({'src':image}); img_zoom_img.data('src',image); try{ swiper_container[0]._sp.slideToLoop(0); traceEventReport('product_request_image', 1, '', getTraceProductInfo(), '', 0, 1); if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['slide-img'], ['product_item_image'], callBackExposure); } }catch(e){} } } } var cartSku = function(opts){ var opsku = attribute_sku["0"]; var sku = Object.assign({},opsku); var stock = sku['stock']; //price & stock & giftBox //todo: sku promotion price var boxProductList = [],has_box=false; try{ if(Object.keys(boxProductList[product_sku.toLowerCase()]).length > 0){has_box=true;} }catch(e){} sku = promotionValue(sku); for(var ids in opts){ var item = attribute_sku[ids]; if(!has_box && Object.keys(attribute_sku).length > 1){ try{ var item_sku = ids == 0 ? product_sku.toLowerCase() : attribute_sku[ids]['sku'].toLowerCase(); if(Object.keys(boxProductList[item_sku]).length > 0){ $('.gift-box-content').removeClass(dn); has_box = true; } else { $('.gift-box-content').addClass(dn); } } catch(e){ $('.gift-box-content').addClass(dn); } } try{if( item['is_sku']==1 ){continue;} stock = item['stock'] < stock ? item['stock'] : stock; sku['old_price'] = _$.calfloat([sku['old_price'],item['old_price']]); sku['price'] = _$.calfloat([sku['price'],item['price']]); sku['weight'] = _$.calfloat([sku['weight'],item['weight']]); sku['stock'] = stock; sku['promotion_value'] = _$.calfloat([sku['promotion_value'],item['promotion_value']]); }catch(e){} } debounceSetPrice(stock,null,sku_old_price); } var setPrice = function(stock,advance=0,old_price){ old_price = old_price || sku_old_price; var num = parseInt(_$(".cart .qty-num--input").val()); sku_price = advance > 0 ? advance : sku_price; var promotion_value = old_price - sku_price; var promotion_sale_off = promotionSaleOff(old_price,promotion_value); // sku_price = sku['price']; // stock stock = stock<0 ? 0 : stock; product_stock = stock; if(num>stock){ num = stock; }else if(stock>0 && num<=0){ num = 1; } else if(stock > 99){ stock = 99; } var num_html = ''; for(var n = 1; n <= stock; n++) { var selected = n == num ? 'selected' : ''; num_html += '

  • ' + ''+n+'' + '
  • ' } $('.qty-num-box .select-box-dropdown__list').empty().append(num_html); $(".cart .qty-num--input").val(num).attr('data-value',num); $('.qty-num-box .select-box-dropdown__list'); const savePrice= countTotalOldPrice(sku_price,num); // total var total_price = sku_price * num; // var card_price = $('.card .item.active').data('price') - 0 || 0; var card_price = 0; try{card_price = productVue.checkedCard.price - 0 || 0;} catch(e) {} total_price = parseFloat(total_price+card_price).toFixed(2); var total_price_str = total_price, sku_price_str = sku_price; product_total_price = total_price; if (currency_point==2) { sku_price_str = sku_price.replace('.',','); total_price_str = total_price_str.replace('.',','); } //klarna var klarnaPlacement = _$('.klarna-official-placement').find('klarna-placement'); if (klarnaPlacement.length>0) { klarnaPlacement.setAttr({'id':'klarna-payment-container'}); klarnaPlacement.data('purchase-amount',Number(sku_price*100).toFixed(0)); window.KlarnaOnsiteService = window.KlarnaOnsiteService || []; window.KlarnaOnsiteService.push({ eventName: 'refresh-placements' }); } //afterpay var afterpayPlacement = _$('.afterpay-official-placement'); if (afterpayPlacement.length>0) { try{ _$('afterpay-placement').remove(); Afterpay.createPlacements({ targetSelector: '.afterpay-box', attributes: { logoType:'lockup', size:'xs', modalTheme: 'white', locale: Afterpay.locale.EN_US, currency: Afterpay.currency.USD, amount: sku_price, amountSelector: '.placement-card .product-price-selector', } }); } catch (e) {} } //paypal var payaplPlacement = $('.paypal-official-placement'); if (payaplPlacement.length>0) { try{ if (paypal) { paypal.Messages({ amount: sku_price, placement: "product", buyerCountry: "UK", style: { layout: "text", logo: { type: "inline", }, }, }).render("#pp-pay-later-message"); } } catch (e) {} } $(".product-price .now .value").text(sku_price_str); if($(".total-price-box").length > 0){$(".total-price .value").text(total_price_str);} setCouponPrompTips(sku_price); if(savePrice){ const saveText="Save" if($(".total-price-box").length > 0){ $(".total-price .save-price").remove() $(".total-price").prepend(`(${saveText} ${setCurrency(savePrice.toFixed(2)+'')})`); } const singleGoodsPrice=old_price- savePrice/num; promotion_sale_off= promotionSaleOff(old_price,old_price-singleGoodsPrice); let save_price_sku_price_str=singleGoodsPrice.toFixed(2)+''; const savePriceTotal=(old_price*num-savePrice+card_price).toFixed(2); if (currency_point==2) { save_price_sku_price_str = save_price_sku_price_str.replace('.',','); $(".total-price .price-value").text( String(savePriceTotal).replace('.',',')); }else{ $(".total-price .price-value").text( String(savePriceTotal)); } total_price=savePriceTotal; setCouponPrompTips(singleGoodsPrice) $(".product-price .now .value").text(save_price_sku_price_str); const oldElement= $('.product-price').find('.old'); if(oldElement.length===0){ const symbolSign=$('.product-price .now .symbol').text(); const signHtmlStr=currency_position=="1"?`${symbolSign}`:`${symbolSign}` $('.product-price').append(`

    ${signHtmlStr}

    `) } setPrompTag(promotion_sale_off) }else if(productInfo.promotion_type===2&&productInfo.promotion_data.discount_type===1){ $(".total-price .save-price").remove(); $('.product-price .old').remove(); setPrompTag(promotion_sale_off); } $(".figure .sale-item__price").text(promotion_sale_off); $(".product-price .old .value").text(old_price); // $(".product-price .sale-price .value").text(sku['promotion_value']); setPointsTotal(total_price); var paymentArr = []; if(paymentArr.length > 0){ $.each(paymentArr,function(index,item){ if(item['installment']['is_official'] == 0){ var html = ''; if(Number(sku_price) < Number(item['installment']['min_periods_amount']) || Number(sku_price) > Number(item['installment']['max_periods_amount']) ){ html = item['installment']['installment_no_text']; } else { html = item['installment']['installment_yes_text']; } if(paymentArr.length == 1){ html += " with" + ' Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (68)'; } html = setInstalmentsText(html,item); $('.payment-content .tab-content.'+item.key+'-placement').html(html+' '); } }) } } var debounceSetPrice=_.throttle(setPrice); function setPrompTag(text){ // const ele=$('.figure .figure-bottom .sale-item__price') if(!text){ return } if(text==='- 0%'){ $('.figure .figure-bottom .sale-list .sale-item__price').remove() return } const ele=$('.figure').find('.figure-bottom .sale-list .sale-item__price'); if(ele.length===0){ $('.figure .figure-bottom .sale-list').prepend(`

    ${text}

    `) } } var productCouponData; var productOldSkuPrice; function setCouponPrompTips(oldSkuPrice){ if(!productCouponData){ productOldSkuPrice=oldSkuPrice return; } const coupon_data=productCouponData; if(coupon_data.is_detail_show!==1){ return } const deduct=coupon_data.deduct; const prompt=coupon_data.prompt; const diffPrice=(oldSkuPrice-deduct).toFixed(2); const str="Your coupon saves:"; $('.coupon-prompt').text(`${str} ${setCurrency(deduct+"")}`); } function countTotalOldPrice(skuPrice,num){ const promotion_type=productInfo.promotion_type; if(![1,2,3].includes(promotion_type)){ return; } const discount_type=productInfo.promotion_data.discount_type const old_price=sku_old_price; const oldTotalPrice=num*old_price; let discount_rule; if(typeof productInfo.promotion_data.discount_rule==='string'){ discount_rule=JSON.parse(productInfo.promotion_data.discount_rule) ; } discount_rule=productInfo.promotion_data.discount_rule; if(discount_type===1){ const discount_rule_list=_.toPairs(discount_rule); const newList= discount_rule_list.sort(function(lista,listb){ return Number(listb[0])-Number(lista[0]) }); const discountRate=_.find(discount_rule_list,function(list){ return num >= Number(list[0]) }) if(!discountRate){ return } const savePrice=oldTotalPrice-old_price*num*Number(100-discountRate[1])/100; return savePrice } const savePrice=oldTotalPrice-skuPrice*num; return savePrice } var opts = function(fn){ if(clog>0){return true;} clog = 1; setTimeout(function(){ clog = 0; var group = {}; _$.each(_$(".g-im"),function(g,gim){ var self = _$(gim); if(self.hasClass(dn)){return true;} var box = self.find('.box'),type=parseInt(box.data('type')),required=parseInt(box.data('required')),gid=parseInt(box.data('group-id')); if (type==8) { return true; } group[gid] = {}; var items = _$.inArray(type,[1,2,3]) ? self.find('.item.'+act) : (_$.inArray(type,[4,5,6]) ? self.find('.fitem') : (type===7? self.find('.uitem') : {})); _$.each(items,function(){ var elem = _$(this); var id =elem.data('id'); var img = _$.inArray(type,[1,2,3]) ? elem.find('.charlet-image').data('src') : (type===7?(upImage[id]['src']||''):''); img = img==noImg ? '' : img; if(required==1){ group[gid][id] = {}; } if(_$.inArray(type,[1,2])){group[gid]={};} if(elem.hasClass(dn)){ delete group[gid][id]; return true; } if(_$.inArray(type,[4,5,6])){ var ftxt = elem.find('.ftxt'); var val = _$.trim(ftxt.val()),len = val.length||0,min=ftxt.data('min')||0; if(val==''||len

    max){return false;} if(len>max){_$(ipt).closest('.fitem').find('.fln').addClass('error')} else{_$(ipt).closest('.fitem').find('.fln').removeClass('error')} try{ _$(ipt).closest('.fitem').find('.left-num').text(max-len); if(len>=min){ _$(ipt).closest('.fitem').find('.min-num').text(''); _$(ipt).closest('.fitem').find('.to-num').text(''); } else { _$(ipt).closest('.fitem').find('.min-num').text(min-len); _$(ipt).closest('.fitem').find('.to-num').text('-'); } } catch (e) {} } var hasSubmit = 0; var confirm = function(cartData) { _$.loading(); cartData['upImage'] = upImage; var canvasJson = canvas ? canvas.toJson() : ''; var cartDataJson = JSON.stringify(cartData); if(isSupportView&&load_prod_draw==='preview'){ isSupportView=false supportPreview(cartDataJson,canvasJson) return } hasSubmit = 0; try{ var cartGroup = cartData['group'] || {}; if (Object.keys(cartGroup).length<2) { canvasJson = ""; } } catch (e) {} if (load_prod_draw == 'load_prod_draw') { downloadProductImage(cartDataJson, canvasJson); } else { _$.ajaxJson('/product/cart',{cart:cartDataJson,canvasJson:canvasJson},function(res,state){ try{ $('.preview-zoom-modal .bg').trigger('click'); } catch(e) {} if(state!=1){ _$.closeLoading(); calliePopup.toast("Network is abnormal.Please try again"); traceEventReport('product_add_to_cart', 0, 'Network is abnormal', getTraceProductInfo()); return false; } var status = res.status; if(status!=1){ _$.closeLoading(); calliePopup.toast(res.msg); traceEventReport('product_add_to_cart', 0, res.msg, getTraceProductInfo()); return false; } else { var num = parseInt(_$('.menu-num__cart').text()), add = cartData.num; _$('.menu-num__cart').text(num+add); _$('.menu-num__cart').addClass('big'); traceEventReport('product_add_to_cart', 1, '', getTraceProductInfo()); } _$.closeLoading(); if(Number(isMiniCart)&&typeof window.addToCartShowMinCart==="function"){ window.addToCartShowMinCart(res.data); }else{ _$.open('/cart/index',{id:res.data}); } }); } } function supportPreview(cartData, canvasJson){ //support privew _$.ajaxJson('/product/cartPreviewSupport',{cart:cartData,canvasJson:canvasJson},function(res,state){ _$.closeLoading(); if(res.code!==1){ calliePopup.toast(res.msg); return } const cartList=res.data.cart_list let selectStr='.support-preview-modal .line-content' const elementAppendList=[{select:"goods-id",key:'product_id'},{select:'goods-sku',key:'sku'},{select:"goods-name",key:'product_name'},{select:"goods-qua",key:'num'},{select:"goods-total",key:'pay_total'},{select:"goods-box",key:'box_data'},{select:"goods-custom",key:'attribute_list'}] const parentElement= document.querySelector(selectStr) while (parentElement.firstChild) { parentElement.removeChild(parentElement.firstChild); } for (let index = 0; index < cartList.length; index++) { const cartListItem = cartList[index]; const itemRootElement=document.createElement('div') itemRootElement.className=`line-contnet-item line-contnet-item-`+index parentElement.appendChild(itemRootElement) elementAppendList.forEach(item=>{ const selectName=item.select const gerentAfterElement=document.createElement('div') gerentAfterElement.className=`${selectName}-item` itemRootElement.appendChild(gerentAfterElement) if(['product_id','product_name','num','pay_total','sku'].includes(item.key)){ $(gerentAfterElement).text(cartListItem[item.key]) } if(item.key==='box_data'){ if(Object.keys(cartListItem.box_data).length<=0){ $(gerentAfterElement).html('') }else{ $(gerentAfterElement).html( //

    title: ${cartListItem.box_data.title}

    //

    price: ${cartListItem.box_data.price}

    `

    ${cartListItem.box_data.sku}

    ` ) } } if(item.key==='attribute_list'){ let skuStr='' cartListItem.attribute_list.forEach(item=>{ skuStr=skuStr+ `

    ${item.trans_name}:${item.trans_value}

    ` }) $(gerentAfterElement).html(skuStr) } }) } document.querySelector('.support-preview-modal').classList.add('support-preview-modal-show') }) } function downloadProductImage(cartData, canvasJson) { var is_supplier = "1"; _$.ajaxJson('/product/loadDrawImgByAttr',{cart:cartData, canvasJson:canvasJson, is_supplier:is_supplier},function(res,state){ if(state!=1){ _$.closeLoading(); calliePopup.toast("Network is abnormal.Please try again"); return false; } var status = res.status; if( status!=1 ){ _$.closeLoading(); calliePopup.toast(res.msg); return false; } var url = res.data.url; var attr = res.data.attr; var attr_data = res.data.attr_data; var height = res.data.height; var width = res.data.width; var drawData = {attr:attr,attr_data:attr_data}; if (typeof height !='undefined') { drawData.height = height; drawData.width = width; } _$.ajax({ url: url, type: 'post', data: JSON.stringify(drawData), dataType: 'json', headers: { "content-type": "application/json; charset=utf-8" }, success: function (ret) { var base64Image = ret.data.file; var fileName = ".png"; downloadFileByBase64(base64Image, fileName); calliePopup.toast("下载成功!"); _$.closeLoading(); }, error: function (e) { calliePopup.toast("下载出错了!"); _$.closeLoading(); } }); }); } function dataURLtoBlob(dataurl) { var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); while (n--) { u8arr[n] = bstr.charCodeAt(n); } return new Blob([u8arr], { type: mime }); } function downloadFile(url,name){ var a = document.createElement("a") a.setAttribute("href",url) a.setAttribute("download",name) a.setAttribute("target","_blank") let clickEvent = document.createEvent("MouseEvents"); clickEvent.initEvent("click", true, true); a.dispatchEvent(clickEvent); } function downloadFileByBase64(base64,name){ var myBlob = dataURLtoBlob(base64); var myUrl = URL.createObjectURL(myBlob); downloadFile(myUrl,name) } var submit = function(no_submit){ if (hasSubmit==1) { return false; } hasSubmit = 1; no_submit = no_submit || false; var container = _$('.container'),verify=1,mrd = 'm-rd'; //var width = document.body.clientWidth, th = width/10*4 + 54; var height = document.body.clientHeight; var documentEle = $(document.scrollingElement || document.documentElement); if(verify==0){hasSubmit = 0;return false;} if (no_submit) { hasSubmit = 0; return true; } _.forEach(optsAttr, function(value, key){ if((value.type == 4 || value.type == 5 || value.type == 6) && (value.text == "" || value.text == null || typeof value.text == "undefined")){ if(value.required === 0){ delete optsAttr[key]; } else { optsAttr[key] = {}; } } }) //upImage verify var uim_verify = 0; _$.each(upImage,function(uid,uim){ if(typeof optsAttr[uid] != 'undefined'){ optsAttr[uid]['image'] = uim['src']; if(uim['src']==''||uim['src']==null){ return true; } if(uim['isload']!=1){ uim_verify = parseInt(uid); return false; } } }); if(uim_verify>0){ calliePopup.toast(name+" is uploading, Please wait for a moment."); hasSubmit = 0; return false; } _.forEach(optsAttr, function(value, key){ optsGroup[value.gid] = value.gid; }) var op = {attr:optsAttr,group:optsGroup,sku:optsSku}; var num = parseInt(_$('.qty-num--input').val()); // var card = parseInt(_$('.card').find('.item.active').data('id')) || 0; // var card_content = card > 0 ? $('.card').find('.item.active .card-content').val() : ''; var card = productVue.checkedCard.card_id || 0; var card_content = card > 0 ? productVue.checkedCard.content : ''; var cartData = Object.assign({},op,{id:product_id,num:num,card:card,card_content:card_content,design_img:'',cmData:cmData}); if(has_custom){ if(canvas==null){ calliePopup.toast("The sample photo according to your customization is loading."); hasSubmit = 0; return false; } //toup: mask image var observer = []; var idBase64 = {}; _$.each(upImage,function(id,item){ if(id==0){return true;} var obj = {},maskobj = {}; _$.each(canvas.objects,function(i,o){ if(o.ccvsId==id){ obj = Object.assign({},o); } if(o.ccvsId==clipId){ maskobj = Object.assign({},o); } }); if(_$.isEmptyObject(obj)){ return true; } observer.push(new Promise(function(resolve,reject){ if (_$.isEmptyObject(maskobj)) { resolve(1); } else { canvas.maskImage(id,maskobj,obj,function(id,base64){ resolve(1); idBase64[id] = base64; }); } setTimeout(function(){ reject(1); },15000); })); }); if(observer.length>0){ Promise.all(observer).then(function (value) { canvas.toImage(1,function(image){ image = image ? image : emptyImg; cartData['design_img'] = image; cartData['design_cutimg'] = idBase64; confirm(cartData); }); }).catch(function (e) { console.log(e); canvas.toImage(1,function(image){ image = image ? image : emptyImg; cartData['design_img'] = image; confirm(cartData); }); }); }else{ try{ canvas.toImage(1,function(image){ image = image ? image : emptyImg; cartData['design_img'] = image; confirm(cartData); }); } catch (e) { var broken_image = canvas.options['broken_image'] || ''; if (broken_image) { _$.imageToBase64(broken_image,function(base64){ cartData['design_img'] = base64; confirm(cartData); }); } else { calliePopup.toast("Picture could not be loaded, Please check your network connection and try again later."); } } } }else{ confirm(cartData); } setTimeout(function(){ hasSubmit = 0; },3000); } var debounceSubmit=_.debounce(submit,500) $(document).on('click','.vi-p .toggle',function(e){ var self = _$(this), that = $(this); var tip = self.hasClass('tip') || false; var type = self.closest().find('.box').hasClass('type-option') || false; self.closest('.g-im').removeClass('m-rd'); self.closest().find('.form-error').addClass(dn); if(type){ if(type){ that.parent().siblings().find('.box.type-option').hide(); that.parent().siblings().find('.toggle').removeClass('active'); } if(!self.closest().hasClass('card') && !self.closest().hasClass('sp')){ that.parent().find('.box').slideToggle(300,function(){ var container = $("html"), containerTop = container[0].scrollTop, groupTop = self.closest('.g-im').offset('top'); var diff = Math.abs(containerTop - groupTop); if (containerTop > 100 && diff > 400) { container.animate({ scrollTop: groupTop - 20 }, 0); } }); } else { that.parent().find('.box').slideToggle(300); } that.toggleClass('active'); e.stopPropagation(); var bizCode = $(this).attr('data-trace-bizcode'); if (typeof bizCode != 'undefined') { callBackExposure(bizCode, $(this)); } } else { if(tip){ that.parent().find('.box').slideToggle(300); } } }); //todo: var textNumRelate = function(node) { var v = _$(node).val(); var conf = _$(node).closest('.fitem').data('conf'),conf_json={}; try{ conf_json = JSON.parse(conf); }catch(e){} var len = v.length || 0,num_relate = conf_json['num_relate'] || '',num_relate_arr=num_relate.split(','); var dlen = num_relate_arr.length || 0; len = len > dlen ? dlen : len; var gids = num_relate_arr.length>0 ? num_relate_arr.slice(0,len) : []; var attrIds = []; _$.each(num_relate_arr,function(i,gid){ _$('.g-im-'+gid).addClass(dn); }); _$.each(gids,function(i,gid){ var gnode = _$('.g-im-'+gid); if(gnode.length<1){return true;} var gtitle = gnode.find('.title').data('title'); gnode.find('.title .t-name').text(v[i]+gtitle); gnode.find('.aitem').each(function(i,item){ attrIds.push(_$(item).data('id')); }); }); levelSelected(gids,attrIds); } var textConf = function (ipt,cb) { var fn = typeof cb === 'function' ? cb : function(){}; var _ipt = _$(ipt),conf = _ipt.closest('.aitem').data('conf') || ''; var val = _ipt.val(), is_empty = val.replace(/(^\s*)|(\s*$)/,''); var type = 0; if (conf!=''){ var json = JSON.parse(conf) || {}; try{ type = json['type'] || 0; type = parseInt(type); } catch (e) {} } return fn(_ipt,type,is_empty,val); } var inputWidget = function (ipt) { return textConf(ipt,function(_ipt,type,is_empty,val){ if (is_empty.length<1) { return val; } switch (type) { case 1: // var strArr = val.match(/[a-zA-Z\s]/g);val = strArr ? strArr.join('') : ''; val = val.toUpperCase(); break; case 2: // var strArr = val.match(/[a-zA-Z\s]/g);val = strArr ? strArr.join('') : ''; val = val.toLowerCase(); break; case 3: // var strArr = val.match(/[a-zA-Z\s]/g);val = strArr ? strArr.join('') : ''; // is_empty = val.replace(/(^\s*)|(\s*$)/,''); var first_chart = is_empty.charAt(0),first_upper = first_chart.toUpperCase(),first_idx = val.indexOf(first_chart); var val1 = val.toLowerCase(); var arr = val1.split(''); arr.splice(first_idx,1,first_upper); val = arr.join(''); break; case 4: var numArr = val.match(/-?\d{0,100}(\.\d{0,100})?/g); val = numArr ? numArr.join('') : ''; break; case 7: var wordArr = val.split(/\s+/); _$.each(wordArr,function(i,wd){ if (!wd) { return true; } wordArr[i] = wd.charAt(0).toUpperCase() + wd.slice(1); }); val = wordArr.join(' '); break; } return val; }) } var inputValue = function(ipt){ var _ipt = _$(ipt),val = _ipt.val(),value = _ipt.data('value') || '',def = _ipt.data('default') || ''; var mrd = 'm-rd', min = _ipt.data('min') || 0 , max = _ipt.data('max') || 0; if(val==value&&value!=''){return true;} //if val empty var is_empty = val.replace(/(^\s*)|(\s*$)/,''); var errorNode = _ipt.closest('.xitem').find('.form-error'); var emptyText = errorNode.data('empty') || ''; var requireText = errorNode.data('require') || ''; var limitText = errorNode.data('limit') || ''; var previewNode = _ipt.closest('.xitem').find('.font-preview-content'); val = inputWidget(ipt,val); _ipt.val(val); _ipt.data('value',val); textnum(ipt); cart('.ftxt'); textNumRelate(ipt); previewNode.find('.font-preview').text(val); var required = _ipt.closest('.g-im').data('required') || 0; if (((required==1&&val.length>0&&val.length>=min)||(required==0&&val.length>=min))&&val.length<=max) { _ipt.closest('.textform').removeClass(mrd); _ipt.closest('.g-im').removeClass(mrd); errorNode.addClass(dn); previewNode.removeClass(dn); } else { _ipt.closest('.textform').addClass(mrd); _ipt.closest('.g-im').removeClass(mrd); errorNode.removeClass(dn); previewNode.addClass(dn); } // if (val!=''&&val!=def) { // _ipt.closest('.textform').addClass('active'); // } else { // _ipt.closest('.textform').removeClass('active'); // } if (is_empty==''&&emptyText&&val.length>0) { errorNode.text(emptyText); errorNode.removeClass(dn); previewNode.addClass(dn); } else if(val.length>0&&val.length>max) { errorNode.text(limitText); } else { errorNode.text(requireText); } } _$('.ctmops').on('change','.ftxt',function(e){inputValue(this);}); _$('.ctmops').on('blur','.ftxt',function(){ var self = _$(this); var value = self.val() || '',def = self.data('default') || ''; if (value==''&&def!='') { self.val(def); } setTimeout(function() { inputValue(self[0]); }, 100); }); var levelSelected = function (level_group,level_attr) { var group_attr = {}; _$(level_attr).each(function(i,v){ _$('.aitem-'+v).removeClass(dn); var gid = parseInt(v/10000); if (group_attr[gid]) { group_attr[gid].push(v); } else { group_attr[gid] = [v]; } }); var level_attr_selected = []; _$(level_group).each(function(i,v){ var gnode = _$('.g-im-'+v),gdef=gnode.data('default') || '',required=gnode.data('required')||0; var type = gnode.data('type') || 0; gnode.removeClass(dn); var gdefArr = gdef!='' ? gdef.split(',') : []; _$(gdefArr).each(function(ai,av){ if(_$.inArray(av,level_attr)) { level_attr_selected.push(av); } }); if (required && gdefArr.length<1 && _$.inArray(type,[1,2,3])) { var first = group_attr[v][0] || 0; if (first>0) { level_attr_selected.push(first); } } gnode.find('.aitem').removeClass(act); gnode.find('.group-value').html(''); }); _$(level_attr_selected).each(function(i,v){ var aitem = _$('.aitem-'+v),title = aitem.data('title'),icon=aitem.data('icon')||'',id=aitem.data('id'); aitem.addClass(act); //show selected name var name = title.split('(+')[0],price = Number(aitem.data('difference')) > 0 ? aitem.data('difference') : ''; var priceStr = price != '' ? '+' + setCurrency(price) + '': '', priceStyle = price != '' ? 'has-long' : ''; var gvalue = aitem.closest('.g-im').find('.group-value'),gvalue_html = gvalue.html() || ''; var multiple_close_html = ''; var type = aitem.closest('.g-im').data('type') || 0; var close = type == 3 ? multiple_close_html : ''; if (icon!='') { gvalue_html += '

    Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (69)

    '+name+''+priceStr+close+'

    '; } else { gvalue_html += '

    '+name+''+priceStr+close+'

    '; } gvalue.html(gvalue_html); }); return level_attr_selected; } var requireSelected = function() { var ctmops = _$('.ctmops'); if (_$.isEmptyObject(attribute_relate)) { var level_group_arr = [],level_attr_arr = []; _$('.g-im').each(function(idx,gnode){ level_group_arr.push(_$(gnode).data('id')); }); _$('.aitem').each(function(idx,anode){ level_attr_arr.push(_$(anode).data('id')); }); var selected = levelSelected(level_group_arr,level_attr_arr); } else { ctmops.find('.g-im').addClass(dn); ctmops.find('.aitem').addClass(dn); var gRelate = attribute_relate[1],aRelate = attribute_relate[2]; var deduceLevel = [[0],[0],[0],[0],[0]]; for (var i=0;i<5;i++) { var combine = []; _$.each(deduceLevel[0],function(i1,v1){ _$.each(deduceLevel[1],function(i2,v2){ _$.each(deduceLevel[2],function(i3,v3){ _$.each(deduceLevel[3],function(i4,v4){ combine.push([v1,v2,v3,v4]); }); }); }); }); var is_continue = 1; var level_group_arr = {}, level_attr_arr = {}; _$.each(combine,function(idx,arr){ var level_group = [],level_attr = []; try{ level_group = gRelate[arr[0]][arr[1]][arr[2]][arr[3]]['value'].split(','); level_attr = aRelate[arr[0]][arr[1]][arr[2]][arr[3]]['value'].split(','); }catch(e){} if (level_group.length<1||level_attr.length<1) { return true; } _$.each(level_group,function(i,gid){ level_group_arr[gid] = gid; }); _$.each(level_attr,function(i,aid){ level_attr_arr[aid] = aid; }); }); level_group_arr = !_$.isEmptyObject(level_group_arr) ? Object.values(level_group_arr) : []; level_attr_arr = !_$.isEmptyObject(level_attr_arr) ? Object.values(level_attr_arr): []; if (level_group_arr.length<1||level_attr_arr.length<1) { break; } var selected = levelSelected(level_group_arr,level_attr_arr); if (selected.length<1) { break; } deduceLevel[i] = selected; } } //text relate _$('.fitem').each(function(idx,fitem){ var fnode = _$(fitem); if (fnode.hasClass(dn)) { return true; } var ftxt = fnode.find('.ftxt'); textnum(ftxt); textNumRelate(ftxt); }); ctmops.removeClass(dn); } var clickMulti = function (box, gnode, self){ var multiCheck = true; var select_min = parseInt(box.data('select_min')) || 1, select_max = parseInt(box.data('select_max')) || null; var gdef = gnode.data('default') || '', gdefArr = gdef.split(',') || []; gdefArr = gdefArr.filter(function (s) { return s && s.trim(); }); if(self){ var id = self.data('id'); var idx = gdefArr.indexOf(id); if (self.hasClass(act)) { if (idx > -1) { gdefArr.splice(idx, 1); } } else { if (idx == -1) { gdefArr.push(id); } } } if (gdefArr.length > select_max && select_max != null) { multiCheck = false; } if (multiCheck) { gnode.data('default', gdefArr.join(',')); } if (gdefArr.length > select_max - 1 && select_max != null) { box.find('.item').each(function () { var id = $(this).data('id').toString(); if ($.inArray(id,gdefArr) == -1) { $(this).addClass('disabled'); } }) } else { box.find('.item').each(function () { $(this).removeClass('disabled'); }) } return multiCheck; } $(document).on('click','.ctmops .item',function(e){ var self = _$(this); if(self.hasClass('uitem')){return true;} //multi option var box = self.closest('.box'),multi=box.data('multi')||0,gnode=self.closest('.g-im'); var id = self.data('id'); var multiCheck = true; if (multi==1) { multiCheck = clickMulti(box, gnode, self); } else { gnode.data('default',id); } if(!(multi==1 && multiCheck==false)){ requireSelected(); } cart('.item'); var charlet_img = _$(this).find('.charlet-image').data('src') || ''; refImage(charlet_img); var container = $("html"), containerTop = container[0].scrollTop, groupTop = self.closest('.g-im').offset('top'); if(!self.closest('.type-option').hasClass('type-3')) { setTimeout(function(){ if (self.closest('.g-im').length>0 && containerTop>groupTop) { container.animate({scrollTop:groupTop},200,closeTypeOption()); } else { closeTypeOption(); } self.closest('.g-im').find('.toggle').removeClass('active'); },50) e.preventDefault(); } }); _$('.ctmops').on('click','.charlet-del',function(){ var self = _$(this); var multi = self.closest('.multi-item'); var id = null; if (multi.length>0) { id = multi.data('id'); } else { var uitem = self.closest('.uitem');uimg=uitem.find('.charlet-image'); id = uitem.data('id'); } charletDel(id); },false); function charletDel(id) { var class_item = ".aitem-"+id, class_mitem = ".multi-item-"+id, class_del = ".charlet-del", class_mimg = ".multi-img", class_img = ".charlet-image", class_item_icon = ".icon", class_item_input = '.charlet-file'; var item = _$(class_item),mitem = _$(class_mitem); if (mitem.length>0) { mitem.find(class_mimg).remove(); mitem.find(class_del).addClass(dn); mitem.find('.loading-box').remove(); mitem.closest('.uitem-multi-items').find(class_item_input).val(''); multiImgFunc(id); } var itemdel = item.find(class_del); var uimg = item.find(class_img); item.find(class_item_input).val(''); uimg.setAttr({src:noImg}); uimg.data('src',''); upImage[id]['src'] = ''; upImage[id]['blob'] = ''; upImage[id]['isload'] = ''; itemdel.addClass(dn); itemdel.closest(class_item_icon).removeClass(act); item.find('.loading-box').remove(); cart(class_del); } function multiImgFunc(id) { if (!id) { return false; } var class_mitem = ".multi-item-"+id; var class_mitems = '.uitem-multi-items',itemsBox = _$(class_mitem).closest(class_mitems); var class_add = '.multi-add',class_num = '.multi-num'; var class_mitem = '.multi-item',class_mimg=".multi-img" var max = itemsBox.data('max') || 0; var len = itemsBox.find(class_mitem+' '+class_mimg).length; var multiNum = itemsBox.closest('.g-im').find(class_num); multiNum.text(len); if (len>=max) { itemsBox.find(class_add).addClass(dn); } else { itemsBox.find(class_add).removeClass(dn); } var itemsDescript = itemsBox.closest('.uitem-multi').find('.name-descript'); var is_descript = ""; itemsBox.find(class_mitem).each(function(idx,item){ if (_$(item).find(class_mimg).length<1) { var i = _$(item).data('id'); //var name = _$('.aitem-'+i).find('.name-descript .name').text() || ''; var desc = _$('.aitem-'+i).find('.name-descript .descript').text() || ''; //itemsDescript.find('.name').text(name); is_descript = desc; return false; } }); itemsDescript.find('.descript').text(is_descript); itemsBox.find('.multi-add').removeClass('m-rd'); } _$('.ctmops').on('click','.uitem-multi .upload-img',function(){ var itemsBox = _$(this).closest('.uitem-multi-items'),max = itemsBox.data('max') || 0; var items = itemsBox.find('.multi-img'); if (items.length>max) { return false; } _$(this).closest('.uitem-multi').find('.charlet-file').trigger('click'); }); function uploadImage(file,id,fn) { var imageType = /^image\//; var size=0,type='',name=''; try{size = file.size || 0;type = file.type;name = file.name;}catch(e){} if( size<1 ){ _$.callFunc(fn,0); calliePopup.toast("Pictures size error"); return false; } if( size > maxSize ){calliePopup.toast("Pictures must not exceed "+mSize+"M"); return false;} if (!imageType.test(file.type)) { _$.callFunc(fn,0); calliePopup.toast("Pictures type error"); return false; } var class_item = ".aitem-"+id,class_mitem = ".multi-item-"+id,class_mimg = ".multi-img"; var item = $(class_item),mitem = $(class_mitem); var uimg = item.find('.charlet-image'),uclear=item.find('.charlet-del'),mclear=mitem.find('.charlet-del'); var pre_src = uimg[0].src; var src = getObjectURL( file ); uclear.addClass(dn); uclear.closest('.icon').removeClass(act); uimg.parent('.upload-img').append(''); // uimg.attr({"src":"https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/loading.svg"}); if (has_custom) { try{ setTimeout(function(){ $('.img-zoom').addClass('active'); $('body').addClass('modal-open_absolute'); },50); }catch(e){} } _$.thumbImage(src,1000,function(blob,base64){ if (!blob){ uimg.attr({src:pre_src}); calliePopup.toast("Pictures type error"); _$.callFunc(fn,0,pre_src); return false; } var url = URL.createObjectURL(blob); uimg.attr({src:url}); var d = {}; d[id] = base64; upImage[id] = {isload:0,src:url,blob:url}; _$.callFunc(fn,1,url); cart('.charlet-file'); _$.ajaxJson('/product/cartImage',{file:d},function(res,state){ if(state!=1){ uimg.attr({src:pre_src}); //multi reback if (mitem.length>0) { mitem.parent(class_mimg).setAttr({src:pre_src}); mitem.find('.loading-box').remove(); mclear.addClass(dn); mclear.closest('.icon').removeClass(act); } uimg.closest('.upload-img').find('.loading-box').remove(); uclear.addClass(dn); uclear.closest('.icon').removeClass(act); //todo: error show return false; } var res_url = res[id] || res['data'][id] || ''; upImage[id] = {isload:1,src:res_url,blob:url}; if (mitem.length>0) { mitem.find('.loading-box').remove(); mclear.removeClass(dn); mclear.closest('.icon').addClass(act); } uimg.parent('.upload-img').find('.loading-box').remove(); uclear.removeClass(dn); uclear.closest('.icon').addClass(act); }); }); } _$('.cart').on('click','.buy-now',function(){cart('buy-now',function(){submit();});}); $(document).on('click','.to-canvas .magnify',function(e){ e.stopPropagation(); $('.img-zoom').addClass('active'); $('body').addClass('modal-open_absolute'); }); $(document).on('click','.img-zoom .confirm,.img-zoom .close',function(){$('.img-zoom').removeClass('active');$('body').removeClass('modal-open_absolute');canvasImage();}); var wish = function(s){ s = s ? 1 : 0; var sh_show = s ? '.enwish' : '.unwish'; var toast_msg = s ? "Saved to Wishlist" : "Removed from Wishlist"; _$.ajaxJson('/product/wish',{id:product_id,status:s},function(res,state){ var status = res.status,code = res.code || 0; if(state!=1){calliePopup.toast("Network is abnormal.Please try again");return false;} if(code==-1){ HeadTool.login("#createaccount"); return false; } if(status!=1){ calliePopup.toast(res.msg); return false; } else { calliePopup.toast(toast_msg); } _$('.wishlist .icon').addClass(dn); _$(sh_show).removeClass(dn); }); } _$('.wishlist').on('click','.unwish',function(){ wish(1); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }, false); _$('.wishlist').on('click','.enwish',function(){wish(0);},false); _$('.share').on('click','.sp-fb',function(){ var url = 'http://www.facebook.com/sharer/sharer.php?u='+window.location.href; window.open(url); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }); _$('.share').on('click','.sp-twwiter',function(){ var url = 'https://twitter.com/intent/tweet?url='+window.location.href; window.open(url); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }); _$('.share').on('click','.sp-pin',function(){ var img = ''; try{ img = $('.pmn .gallery-top').find('.swiper-slide.referer-image:last img').eq(0)[0].src || $('.pmn .gallery-top').find('.swiper-slide img').eq(0)[0].getAttribute("src"); }catch(e){} var url = 'https://www.pinterest.com/pin/create/button/?url='+window.location.href+'&media='+img; window.open(url); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }); //init _$.each(_$('.uitem .charlet-image'),function(idx,elem){ var self = _$(this),src = self.data('src') || '',uitem=self.closest('.uitem'),id = uitem.data('id'); if(src){upImage[id] = {isload:1,src:src,blob:''};}else{upImage[id] = {isload:0,src:'',blob:''};} }); //init active requireSelected(); cart('.init'); if(has_custom){ var colorId = function(name){var n = 0;_$.each(colors,function(i,c){if(c.value==name){n=c.id;return false;}});return n;} var fontId = function(name){var n=0;_$.each(typeface,function(i,f){if(f.md5name==name){n=f.id;return false;}});return n;} if(!_$.isObject(attrmaps)){ try{ attrmaps = JSON.parse(attrmaps); }catch(e){ attrmaps = {}; } } //init text _$.each((attrmaps.objects || {}),function(idx,ob) { if(_$.inArray(ob.ccvsType,['text','curvedText','textarea'])){ var gid = parseInt(ob.ccvsGid),id=parseInt(ob.ccvsId),ccvs=ob.ccvsParam||{},text=ccvs.text||'',color=ccvs.fontColor||'',font=ccvs.fontFamily||''; var fitem = _$('.g-im .aitem-'+id); var ftxt=fitem.find('.ftxt'),def_text=ftxt.val(); if (def_text!='') { ftxt.setAttr({'placeholder':def_text}); ftxt.data('default',def_text); ftxt.val(def_text); textnum(ftxt[0]); if(color!=''){fitem.find('.f-color').val(colorId(color));} if(font!=''){fitem.find('.f-type').val(fontId(font));} } } }); if(_$('.ctmops .type-7').length>0){ _$('.canvas-selectable-msg').setStyle({display:'block'}); } _$.loopJs(jsArr,function(){ var canvas_editor = _$('.canvas-editor'); var _renderAll = 0; canvas = new Ccvs( canvas_editor[0],{ canvas_json:attrmaps, canvas_conf:'',//default config width: 500, height: 500, img_cdn:'https://d1w6lranmzyrqf.cloudfront.net', is_webp:'0', broken_image:'https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/browser_broken.jpg', msg_img_loading:"Image is loading,please wait a moment!", msg_toimg_loading:"Loading, please wait!", load_timeout:30000, //broken_image:'https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/browser_broken.jpg', abort:function(self, e){ canvas.skip = 1; calliePopup.alert("Picture could not be loaded, Please check your network connection and try again later.",{ 'title':"Error", 'btn':[{ 'name':"Refresh", 'callback':function(){ window.location.reload(); } }] }); try { traceEventReport('product_canvas_load_error', 0, e.toString(), {}); } catch (error) {} }, toast:function(msg,type,timeout){ calliePopup.toast(msg); }, renderAll:function(){ if(_renderAll==1){return true;} _renderAll = 1; setTimeout(function(){ _renderAll = 0; canvasImage(); },100); } }); ccvsRegist = true; if(listenRegist){ window.canvasInit = true; } var modelData = canvas.modelData; if(!_$.isEmptyObject(optsAttr)){ canvas.confRender(JSON.stringify(optsAttr)); } }); } //qty var getQuery = function(variable) { try{ var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i 0){ $('.select-box-dropdown__list').animate({scrollTop: select[0].offsetTop},0); } }); $(document).on('click','.select-box .select-box-dropdown__item:not(.disabled)',function(){ $(this).addClass('selected').siblings().removeClass('selected'); $(this).parents('.select-box').find('.box-input__inner').val($(this).children().text()).attr('data-value',$(this).attr('data-value')); $(this).parents('.select-box').find('.box-input').click(); var value = $(this).attr('data-value'); // cart(); cartSku(); }); $(document).on('click',function(e){ if($('.select-box').has(e.target).length <= 0){ $('.select-box').find('.select-box-dropdown').hide(200); $('.select-box').find('.box-input__icon').removeClass('is-reverse'); } }) var poolRunSwiper = function (cls,callback=function(){}) { setTimeout(function(){ if (_$.isFunction(_$.funcPool['runSwiper']||'')) { var container = _$(cls+' .swiper-container'); if (container.length>0) { _$.funcPool['runSwiper'](_$(cls+' .swiper-container')); callback(); } } else { poolRunSwiper(cls,callback()); } },200); } //product zoom images _$('.bg-f').find('.zoom-image').each(function(i,item){ addZoomFunc(item); }); _$('.product-zoom').on('click','.custom-toast_pre',function(){ zoomIdx = parseInt(zoomIdx); zoomMax = parseInt(zoomMax); var pre = _$('.zoom-image-'+ (zoomIdx - 1)); if (pre.length<1) { pre = _$('.zoom-image-'+ (zoomIdx - 2)); if (pre.length<1){ pre = _$('.zoom-image-'+ (zoomMax + 1)); if (pre.length<1) { pre = _$('.zoom-image-'+ zoomMax); } } } if (pre.length<1) { return false; } var src = pre[0].getAttribute('zoom-src') || ''; if (src) { var content = _$(this).closest('.product-zoom').find('.custom-toast_content'); var img = 'Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (70) '; content.html(img); zoomIdx = parseInt(pre.data('zoom')) || 0; } }); _$('.product-zoom').on('click','.custom-toast_next',function(){ var next = _$('.zoom-image-'+ (zoomIdx + 1)); if (next.length<1) { next = _$('.zoom-image-'+ (zoomIdx + 2)); if (next.length<1){ next = _$('.zoom-image-'+ zoomMin); } } if (next.length<1) { return false; } var src = next[next.length-1].getAttribute('zoom-src') || ''; if (src) { var content = _$(this).closest('.product-zoom').find('.custom-toast_content'); var img = 'Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (71) '; content.html(img); zoomIdx = parseInt(next.data('zoom')) || 0; } }); //font color _$('.fitem').each(function(idx,item){ var sf = _$(item); try{ var conf = sf.data('conf') || ''; var if_input_typeface = 0; var font_size = '', input_color = '', line_height = '16px'; if (conf) { confObj = JSON.parse(conf); if_input_typeface = confObj['if_input_typeface'] || 0; font_size = confObj['font_size'] || ''; line_height = confObj['font_size'] || '16px'; input_color = confObj['input_color'] || ''; } var ftype = sf.find('.f-type').val(); var fcolor= sf.find('.f-color').val(); let type = sf.find('.typeface-'+ftype).data('class'),color = sf.find('.color-'+fcolor).data('class'); // var ftxt = sf.find('.ftxt'); var ftxt = sf.find('.font-preview'),ptxt = sf.find('.font-preview-content'); var style = {}; if (font_size) { style['font-size'] = font_size; } if (input_color) { style['color'] = input_color; color = ''; } else { style['color'] = ''; color = ''; } if (if_input_typeface==1) { fontfaceTypeColor(ftxt[0],'',color); } else { fontfaceTypeColor(ftxt[0],type,color); } if (!_$.isEmptyObject(style)) { ftxt.setStyle(style); ptxt.find('div').eq(0).setStyle({'line-height':line_height}); } } catch (e) { console.log(e); } }); function fontfaceTypeColor(node,type,color) { if (!node) { return false; } try{ type = type || ''; color = color || ''; var ft = 'font-type',fc = 'font-color'; var sf = _$(node); var ftype = sf.data(ft) || '',fcolor = sf.data(fc) || ''; ftype !='' ? sf.removeClass(ftype) : ''; fcolor!='' ? sf.removeClass(fcolor): ''; sf.data(ft,type); sf.data(fc,color); type != '' ? sf.addClass(type) : ''; color!='' ? sf.addClass(color) : ''; } catch (e) { console.log(e); } } //multi upload img _$.each(_$('.uitem-multi'),function(idx,item){ var id = _$(item).find('.multi-item').eq(0).data('id') || 0; multiImgFunc(id); }); //text map address autocomplete var ftxt6 = _$('.ftxt-6'); if (ftxt6.length>0) { _$.jsLoader("https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/mapaddress.min.js?v=24.2.3.4",function(){ ftxt6.each(function(idx,ftxt){ var options = {'token':addressToken}; var conf = _$(ftxt).closest('.fitem').data('conf') || ''; var country_code = ''; if (conf) { confObj = JSON.parse(conf); country_code = confObj['country_code'] || ''; } if (country_code) { options['country'] = country_code.split(','); } var Ma = new Mapaddress(options); Ma.render(ftxt,autoAddress); }); }); } function autoAddress(state,dom,res,oriRes) { if (state!=1) { return false; } var address = res['address_format']; _$(dom).val(address); inputValue(dom); } //sku promotion price function promotionValue(sku) { var type; try{ type = sku['promotion_type'] || ''; } catch (e) {} if (!type) { return sku; } var promotion = 0, promotion_value = sku['promotion_value']; switch (type) { case 4: promotion = 0; break; default: promotion = promotion_value; break; } sku['promotion_value'] = promotion; sku['price'] = _$.calfloat([sku['old_price'],promotion], 2 , '-'); return sku; } function promotionSaleOff(total,promotion_value) { if(productInfo.promotion_data.sticker_type===3){ return productInfo.discount_text } var promotion_sale_off = _$.calfloat([promotion_value,total], 2, '/'); promotion_sale_off = -(-(_$.calfloat([promotion_sale_off,100], 2, '*'))); // var text = $(".product-price .sale-item__price").text().replaceAll(/[0-9]+/g,promotion_sale_off); // return promotion_sale_off = "saved "+promotion_sale_off+"%"; // var text = $(".product-price .sale-item__price").text() return `- ${promotion_sale_off}%`; } function dateFormat(value,format,oriformat) { if (!value) { return value; } var D = new Date(value); var yyyy = D.getFullYear(); if (!yyyy) { var arrRange = function(value,fm,sn) { if (value.indexOf(sn)===-1) { return ''; } var arr0 = value.split(sn), arr1 = fm.split(sn); var d = {}; d[arr1[0]] = arr0[0]; d[arr1[1]] = arr0[1]; d[arr1[2]] = arr0[2]; return d; }; var arr = ['-','/','.'],ymd = ''; for (var i in arr) { ymd = arrRange(value,oriformat,arr[i]); if (ymd) { break; } } var y = ymd['yyyy'] ? ymd['yyyy'] : ymd['yy']; var m = ymd['mm'] ? ymd['mm'] : ''; var d = ymd['dd'] ? ymd['dd'] : ''; if (!m||!d) { return value; } if (y<1900) { y = y>=70 ? '19'+y : '20'+y; } D = new Date(y + '-' + m + '-' + d); yyyy = D.getFullYear(); } var mm = D.getMonth() + 1; mm = mm.toString().padStart(2, '0'); var dd = D.getDate(); dd = dd.toString().padStart(2, '0'); var yy = yyyy.toString().substr(2,2); var formatValue = format; formatValue = formatValue.replace(/yyyy/g,yyyy); formatValue = formatValue.replace(/yy/g,yy); formatValue = formatValue.replace(/mm/g,mm); formatValue = formatValue.replace(/dd/g,dd); return formatValue; } var previewSwiper; function showPreview(src){ var newSwiper = '

    Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (72)

    '; _$('.preview-zoom-modal .swiper-wrapper').html(newSwiper); previewSwiper = new Swiper('.preview-zoom-modal .swiper',{ zoom: { toggle: false, minRatio: 1, maxRatio: 2, }, on: { zoomChange: function(swiper, scale, imageEl, slideEl){ if(scale == 2){ $('.preview-zoom-modal .preview-zoom-in').addClass('disabled').siblings().removeClass('disabled'); } else if(scale == 1){ $('.preview-zoom-modal .preview-zoom-out').addClass('disabled').siblings().removeClass('disabled'); } }, }, }); $('.preview-zoom-modal .preview-zoom-out').addClass('disabled').siblings().removeClass('disabled'); _$('body').addClass('modal-open'); _$('.preview-zoom-modal').addClass(act); previewSwiper.update(); } $(document).on('click','.preview-button',function(){ var validateResult = iWindow.validateCustomItem(); var data = validateResult['data'], flag = validateResult['flag']; if(flag){ var src = clipImage; showPreview(src); traceEventReport('product_preview', 1, '', getTraceProductInfo()); } else { traceEventReport('product_preview', 0, 'validate custom item', getTraceProductInfo()); return false; } }); $(document).on('click','.preview-zoom-modal .bg, .preview-zoom-modal .close',function(e){ $('.preview-zoom-modal .swiper-wrapper').empty(); try{ previewSwiper.zoom.out(); previewSwiper.destroy(); $('.preview-zoom-modal .preview-zoom-in').removeClass('disabled').siblings().addClass('disabled'); } catch(e){} }) $(document).on('click','.preview-zoom-modal .preview-zoom-in',function(){ previewSwiper.zoom.in(); }) $(document).on('click','.preview-zoom-modal .preview-zoom-out',function(){ previewSwiper.zoom.out(); }) // video var userAgent = navigator.userAgent; if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1) { _$('.video-item').remove(); _$('.video-modal').remove(); var count = _$('.pmn .swiper-pagination-num').find('.count');num = count.text(),num = parseInt(num); count.text(num-1); count.setAttr({'data-total':(num-1)}); setTimeout(function(){ if(typeof swiper_container[0]._sp != 'undefined'){ swiper_container[0]._sp.update(); } },500); } _$('.video-modal').on('click','.close,.bg',function(){ _$('.video-modal').setStyle({'display':'none'}); _$('.video-modal iframe').rmAttr(['src']); }) $(document).on('click','.video-play-button',function(e){ var src = _$(this)[0].getAttribute('data-link'); calliePopup.modal({ area: ['48.85%', '80%'], maxRate: ['938px', '80vh'], class: 'video-modal', content: ``, }) e.stopPropagation(); }) // reviews var translateReviewArray = []; _$('.review').on('click','.toggle-preview-wrapper',function(){ var dom = _$(this).closest('.reviews-preview').find('.cont'); _$(this).addClass(dn); if(dom.hasClass('ellipsis3')){ dom.removeClass('ellipsis3'); } else { dom.addClass('ellipsis3'); } },false) var reviewMode = '';var reviewPage = 1,reviewsEnd=0; $(document).on('click','.review-sort .review-sort-item',function(){ reviewMode = $(this).data('name') || ''; $('.review-sort .review-sort-item[data-name="'+reviewMode+'"]').each(function(){ $(this).addClass('active').siblings().removeClass('active'); }) var dom = $(this).parents('.reviews-modal').length > 0 ? 'modal' : ''; var limit = dom == 'modal' ? 20 : 5; reviewPage = 1; _$.loading(); getReviews(1,limit,dom).then(()=>{ _$.closeLoading(); setReviewTranslate(); }); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }) //reviews function rankSpan(rankStr){ var rankArr = rankStr.split('.') || [], rank = ['4_0', '4_1', '4_2', '4_3', '4_4'], a = parseInt(rankArr[0]); a = a >= 5 ? 5 : a; var b = 5 - a, d = rankArr.length > 1 ? parseInt(rankArr[1]) : 0; var span = []; for (var i = 0; i < a; i++) { span.push(rank[4]); } if (a < 5) { if (d <= 0) { span.push(rank[0]); } else if (d <= 25) { span.push(rank[1]); } else if (d <= 50) { span.push(rank[2]); } else if (d <= 75) { span.push(rank[3]); } else { span.push(rank[4]); } for (var i = 1; i < b; i++) { span.push(rank[0]); } } return span; } _$.ajaxJson('/product/reviewsData',{product_id:product_id},function(data){ if(data.status){ var result = data.data; var rank_count = result.total; var rank_rate = result.rank_rate; if(!result.has_img) { _$('.review-sort').remove(); } _$('.rank_count--num').each(function(){ _$(this).text(rank_count); }) if(rank_count > 0){ _$('.review').removeClass(dn); } var rateArr = rankSpan(rank_rate); var html = ''; for (var i = 0; i < rateArr.length; i++) { html += ''; } _$('.rank_rate').html(html); } }); $(document).on('click','.pagination li',function(){ var p = $(this).find('a').data('query').page; getReviews(p,5).then(()=>{ var top = $('.review')[0].offsetTop || 0; $('html,body').animate({scrollTop:top},200); setReviewTranslate(); }); }) function getReviews(page,limit,dom){ return new Promise((resolve, reject) => { _$.ajaxHtml('/product/reviews',{product_id:product_id,page:page,limit:limit,mode:reviewMode},function(html,state){ if(state!=1){ reject(); return false; } var cls = '.gtmclass .review-wrapper'; if(dom == 'modal'){ var cls = '.modal-main.review-wrapper'; } $(cls).empty().append(html); var review_cont = dom == 'modal' ? _$('.modal-main .reviews-preview .cont') : _$('.reviews-preview .cont'); if(_$(cls).height() == 0){setTimeout(function(){setToggle()},0)} else{setToggle();} function setToggle() { review_cont.each(function(){ var sh = $(this)[0].scrollHeight, oh = $(this)[0].offsetHeight; if(sh <= oh + 4){ $(this).parents('.reviews-preview').find('.toggle-preview-wrapper').addClass(dn); } }) } reviewsEnd = _$(cls).find('.review-content').data('status'); // _$.closeLoading(); $('.pagination li:first-child').addClass('btn-page-prev'); $('.pagination li:last-child').addClass('btn-page-next'); $('.pagination li:first-child a,.pagination li:first-child span').html(''); $('.pagination li:last-child a,.pagination li:last-child span').html(''); resolve(); if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['product_item_review_translate','review-item'], ['product_item_review_translate','product_item_review'], callBackExposure); } }); }) } // type: 0-prev, 1-next function clickScrollBtn(btnDom, type, diff){ var dom = btnDom.parents('.item-right').find('.img-content'); var x = Number(dom.css("transform").replace(/[^0-9\-,]/g,'').split(',')[4]) || 0; var maxW = Number(dom.width()), listNum = dom.children().length - 3; btnDom.removeClass('disabled').siblings().removeClass('disabled'); if(type == 0) { x = x - 0 + diff; if(x >= 0 || x < -listNum * diff){ x = 0; btnDom.addClass('disabled'); } } else if (type == 1) { x -= diff; if(x < -listNum * diff){ x = -(diff * listNum); } if(x <= -(diff * listNum)){ btnDom.addClass('disabled'); } } dom.css("transform","translateX("+x+"px)"); } $(document).on('click','.review-wrapper .review-item .review-list-prev:not(.disabled)',function(){ clickScrollBtn($(this), 0, 110); }) $(document).on('click','.review-wrapper .review-item .review-list-next:not(.disabled)',function(){ clickScrollBtn($(this), 1, 110); }) $(document).on('click', '.review-item .link-translate', function(){ var self = $(this), id = $(this).parents('.review-item').data('review-id'); self.addClass('active'); translateReviewArray.push(id); traceEventReport('product_select_review_translate', 1, '', getTraceProductInfo()); setTimeout(() => { self.removeClass('active').hide(); self.parents('.review-item').find('.translate-content').removeClass(dn); }, 200); }) $(document).on('click', '.review-item .translate-content .translate-close', function(){ var id = $(this).parents('.review-item').data('review-id'); translateReviewArray.splice($.inArray(id,translateReviewArray),1); $(this).parent('.translate-content').addClass(dn); $(this).parents('.review-item').find('.link-translate').removeClass('active').show(); }) function setReviewTranslate() { $.each(translateReviewArray,function(index, value){ if( $('.review').find('.review-item[data-review-id="'+ value +'"]').length > 0 ) { $('.review').find('.review-item[data-review-id="'+ value +'"] .link-translate').eq(0).click(); } }) } var reviewSwiper={}; $(document).on('click','.review .reviews-zoom-image',function(){ var reviewId = $(this).data('review-id').toString(); var index = $(this).index(); var review_swiper_parent = '.review-zoom-container[data-review-zoom="'+reviewId+'"]'; if( $.inArray($(this).data('review-id'), translateReviewArray) != -1 ) { $(review_swiper_parent).find('.normal-preview').addClass(dn); $(review_swiper_parent).find('.translate-preview').removeClass(dn); } else { $(review_swiper_parent).find('.normal-preview').removeClass(dn); $(review_swiper_parent).find('.translate-preview').addClass(dn); } $(review_swiper_parent).removeClass(dn); reviewSwiper[reviewId] = new Swiper(review_swiper_parent+' .swiper',{ pagination: { el: review_swiper_parent+' .swiper-pagination', type: 'fraction', }, navigation: { nextEl: review_swiper_parent+' .preview-button-next', prevEl: review_swiper_parent+' .preview-button-prev', }, zoom: { toggle: false, minRatio: 1, maxRatio: 2, }, lazy:{ loadPrevNext: true, }, on: { zoomChange: function(swiper, scale, imageEl, slideEl){ if(scale == 2){ $(review_swiper_parent).find('.preview-zoom-in').addClass('disabled').siblings().removeClass('disabled'); } else if(scale == 1){ $(review_swiper_parent).find('.preview-zoom-out').addClass('disabled').siblings().removeClass('disabled'); } }, }, }); $('body').addClass('modal-open'); reviewSwiper[reviewId].update(); reviewSwiper[reviewId].slideTo(index,0,false); var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }) $(document).on('click','.review-zoom-container .close,.review-zoom-container .review-zoom-bg',function(){ $(this).closest('.review-zoom-container').addClass(dn); var reviewId = $(this).closest('.review-zoom-container').data('review-zoom').toString(); reviewSwiper[reviewId].zoom.out(); reviewSwiper[reviewId].destroy(); $('body').removeClass('modal-open'); }); $(document).on('click','.review-zoom-container .preview-zoom-in',function(){ var reviewId = $(this).closest('.review-zoom-container').data('review-zoom').toString(); reviewSwiper[reviewId].zoom.in(); }) $(document).on('click','.review-zoom-container .preview-zoom-out',function(){ var reviewId = $(this).closest('.review-zoom-container').data('review-zoom').toString(); reviewSwiper[reviewId].zoom.out(); }) //recomment init _$.ajaxHtml('/product/recomment',{product_id:product_id},function(html,state){ var cls = '.relate'; if(state!=1){ _$(cls).remove(); return false; } if(html != ''){ _$(cls).html(html); poolRunSwiper(cls); if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['list-item'], ['item_recommend'], callBackExposureRecommend); } } else { _$(cls).remove(); } }); //recomment click $(document).on('click','.relate .list-item',function(e){ var item = _$(this).closest('.list-item'); var productId = item.data('id'); var sku = item.data('sku'); var price = item.data('price'); var name = item.find('.product-name').text(); var index = item.data('index'); traceReportRecommendProduct('select_item', productId, name, sku, price, index); }); /*yang start*/ /*tag*/ _$('.figure').on('click','.sale-item__delivery',function(){ try{ $(this).find('.sale-item--tip').toggleClass(dn); } catch(e) {} },false); _$('body').on('click',function(e){ try{ var _dom = $('.sale-item--tip'); if (!_dom.is(e.target)) { $('.sale-item--tip').addClass(dn); } } catch(e) {} }) /*review*/ _$('.figure').on('click','.figure-top__rank',function(){ if(_$('.review').length > 0){ var reviewTop = _$('.review')[0].offsetTop; $(document.documentElement).animate({scrollTop:reviewTop},200); } var bizCode = $(this).attr('data-trace-bizcode'); callBackExposure(bizCode, $(this)); }); /*option*/ $(document).on('click','.group-value .remove',function(e){ e.stopPropagation(); var id = $(this).data('id').toString(), gnode = _$(this).closest('.g-im'), box = gnode.find('.box'), valArr = gnode.data('default').split(','); valArr.splice($.inArray(id,valArr),1); var valStr = valArr.join(','); gnode.find('.aitem-'+id).removeClass(act); gnode.setAttr({'data-default':valStr}); _$(this).closest('.selected').remove(); clickMulti(box, gnode); });/*video*/ if(hasVideo) { _$.jsLoader('https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/video/hls.min.js',function(){ _$.cssLoader("https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/video/plyr.css"); _$.jsLoader('https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/video/plyr.min.js',function(){ const source = ""; const slideVideo = $('.gallery-top .video-item video')[0]; const player = new Plyr(slideVideo, { captions: { active: false, update: true, language: 'en', }, storage:{ enabled: false}, muted: true, fullscreen:{ iosNative:true, }, loop: { active: false }, iconUrl: 'https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/video/video-icons.svg', controls: ['play-large', 'play', 'current-time', 'duration', 'mute', 'volume', 'fullscreen', 'progress'] }); if (!Hls.isSupported()) { slideVideo.src = source; } else { const hls = new Hls(); hls.loadSource(source); hls.attachMedia(slideVideo); window.hls = hls; player.on('languagechange', () => { setTimeout(() => hls.subtitleTrack = player.currentTrack, 50); }); } let seekingPause = true, manualPause = false; player.on('ready', (event) => { player.elements.controls.hidden = true; $('.gallery-top')[0]._sp.allowTouchMove = true; }); player.on('play', (event) => { manualPause = false; player.elements.controls.hidden = false; $('.gallery-top-parent .swiper-controls').hide();traceEventReport('product_select_video_play', 1, '', getTraceProductInfo()); }); player.on('seeking', (event) => { seekingPause = true; }); player.on('seeked', (event) => { seekingPause = false; });player.on('enterfullscreen', (event) => { traceEventReport('product_select_video_fullscreen', 1, '', getTraceProductInfo()); }); player.on('pause', (event) => { if(manualPause && !seekingPause){ player.elements.controls.hidden = true; manualPause = false; $('.gallery-top-parent .swiper-controls').show(); }traceEventReport('product_select_video_pause', 1, '', getTraceProductInfo()); });if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['video-item'], ['product_item_image'], callBackExposure); } $('.gallery-top-parent .video-item').on('mouseup', function(swiper,event){ manualPause = true; }); window.player = player;window.addEventListener('beforeunload', function (event) { var bizcode = 'product_video_visibletime'; var eventExtra = ''; try{ var currentTime = window.player ? window.player.currentTime : 0; var totalTime = window.player ? window.player.duration : 1; eventExtra = parseFloat(currentTime / totalTime * 100).toFixed(2) + '%'; } catch(e) {} var event = { eventCode: 'custom', eventBizCode: bizcode ? bizcode : 'callie_page', eventExtra: eventExtra } if (typeof traceFun !== 'undefined') { traceFun.eventReport(event, {}, true); } }); }) }) } getGallerySwiper(); function showCaseTab(swiper){ var realSlideIndex = swiper.realIndex + 1, currentSlideIndex = swiper.activeIndex; var currentSlideElement = swiper.slides.eq(currentSlideIndex); var tabName = currentSlideElement.attr('data-tab-name') || 'product', previewSlideList = previewSilderNum; if(previewSlideList > 0) { $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab .tab-item[data-name="preview"]').show(); } else { $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab .tab-item[data-name="preview"]').hide(); } var visibleDom = 0; $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab .tab-item').each(function(){ if($(this)[0].offsetParent !== null) visibleDom ++; }) if(visibleDom <= 1){ $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab').hide(); } if(tabName == 'preview'){ $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab__preview').show().siblings().hide(); $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab .tab-item[data-name=' + tabName + ']').addClass('active').siblings().removeClass('active'); $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-controls .swiper-pagination__' + tabName).removeClass('d-none').siblings('.swiper-pagination').addClass('d-none'); } else { $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab__preview').hide().siblings().show(); $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-tab .tab-item[data-name=' + tabName + ']').addClass('active').siblings().removeClass('active'); $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-controls .swiper-pagination__' + tabName).removeClass('d-none').siblings('.swiper-pagination').addClass('d-none'); let showcaseTotal = $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-controls .swiper-pagination__showcase .swiper-pagination-total').attr('data-total'), productTotal = $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-controls .swiper-pagination__product .swiper-pagination-total').attr('data-total'); let num = previewSlideList > 0 ? realSlideIndex - previewSlideList : realSlideIndex; if(tabName == 'showcase') { num = previewSlideList > 0 ? realSlideIndex - productTotal - previewSlideList : realSlideIndex - productTotal; } $(swiper.$el).parents('.swiper-controls-parent').find('.swiper-controls .swiper-pagination__' + tabName + ' .swiper-pagination-current').text(num); } } function getGallerySwiper() { setTimeout(function(){ if(window.callieSwiper){ var container = $('.gallery-top'); if(typeof container[0]._sp != 'undefined'){ let fn = container[0]._sp.passedParams.on.slideChange; container[0]._sp.on('slideChange', function(swiper){ fn(); try{ if(hasVideo){ window.player.pause(); player.elements.controls.hidden = true; manualPause = false; $('.gallery-top-parent .swiper-controls').show(); } } catch(e) {} showCaseTab(swiper); }); container[0]._sp.on('touchStart', function(swiper,event){ if($(event.target).hasClass('plyr__controls') || $(event.target).parents('.plyr__controls').length > 0){ swiper.allowTouchMove = false; } else { swiper.allowTouchMove = true; } }); container[0]._sp.update(); } } else { getGallerySwiper(); } }, 200) } $(document).on('click', '.swiper-tab .tab-item', function(){ let name = $(this).attr('data-name'), tabName = name || 'product'; $(this).addClass('active').siblings().removeClass('active'); $('.swiper-pagination__' + tabName).removeClass('d-none').siblings('.swiper-pagination').addClass('d-none'); if($(this).parents('.swiper-zoom-modal').length > 0){ try{ zoomSwiper.update(); var index = 0; if (tabName == 'product'){ index = previewSilderNum > 0 ? previewSilderNum : 0;traceEventReport('product_select_preview_product', 1, '', getTraceProductInfo()); } else if (tabName == 'showcase'){ var prevNum = parseInt(zoomSwiper.$el.parents('.swiper-controls-parent').find('.swiper-pagination__product .swiper-pagination-total').attr('data-total')) + previewSilderNum; index = prevNum;traceEventReport('product_select_preview_showcase', 1, '', getTraceProductInfo()); } else {traceEventReport('product_select_preview_live', 1, '', getTraceProductInfo());} zoomSwiper.slideToLoop(index, 0, false); } catch(e) {} } else { var thisSwiper = $(this).parents('.swiper-controls').parent().find('.swiper-container'); var index = 0; if (tabName == 'product'){ index = previewSilderNum > 0 ? previewSilderNum : 0; traceEventReport('product_select_image_product', 1, '', getTraceProductInfo()); } else if (tabName == 'showcase'){ var prevNum = parseInt($(this).parents('.swiper-controls').find('.swiper-pagination__product .swiper-pagination-total').attr('data-total')) + previewSilderNum; index = prevNum; traceEventReport('product_select_image_showcase', 1, '', getTraceProductInfo()); } try{ thisSwiper[0]._sp.update(); thisSwiper[0]._sp.slideTo(index, 0, false); } catch(e) {} } }) /* popup swiper*/ $(document).on('click','.gallery-top-parent .gallery-top .swiper-slide',function(e){if($(e.target).parents('.video-item').length > 0 || $(e.target).hasClass('.video-item')){ return false; } var activeIndex = $(this).index(); swiperModal($('.gallery-top-parent .gallery-top .swiper-slide'), $('.pmn .gallery-thumbs .swiper-slide'), activeIndex); callBackExposure('product_select_image', $(this)); }) $(document).on('click','.swiper-zoom-modal .bg, .swiper-zoom-modal .close, .swiper-zoom-modal .modal-bottom-button',function(e){ var index = zoomSwiper.realIndex; $('.gallery-top-parent .gallery-top')[0]._sp.slideToLoop(index, 0, false); $('.swiper-zoom-modal .swiper.gallery-top .swiper-wrapper').empty(); $('.swiper-zoom-modal .swiper.gallery-thumbs .swiper-wrapper').empty(); zoomSwiper.destroy(); zoomThumbsSwiper.destroy(); $('.swiper-zoom-modal .preview-zoom-in').removeClass('disabled').siblings().addClass('disabled'); }) var zoomSwiper, zoomThumbsSwiper; function swiperModal(dom, thumbsDow, index){ var newSwiper = '', newSwiper_thumbs = ''; dom.each(function(){ var src = ''; var index = 0; var imgClass = ''; var type = $(this).attr('data-tab-name') || 'product'; if(!$(this).hasClass('video-item')){ if ($(this).find('img').length > 0) { src = $(this).find('img')[0].getAttribute('zoom-src'); index = $(this).find('img')[0].getAttribute('data-zoom'); } else { src = $(this)[0].getAttribute('zoom-src'); } if (index == 0) { $(this).hasClass('slide-canvas') ? imgClass = ' slide-canvas' : imgClass = ' slide-img'; } } else{ src = $(this).find('video').attr('poster'); index = $(this).index(); imgClass = ' video-item'; } newSwiper += '

    Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (73)

    '; }); thumbsDow.each(function(){ var src_thumbs = ''; var type = $(this).attr('data-tab-name') || 'product'; if(!$(this).hasClass('video-item')){ if ($(this).find('img').length > 0) { src_thumbs = $(this).find('img')[0].getAttribute('data-src') || $(this).find('img')[0].getAttribute('src'); } else { src_thumbs = $(this)[0].getAttribute('data-src'); } } else { src_thumbs = $(this).find('video').attr('poster'); } if($(this).hasClass('slide-canvas')){ newSwiper_thumbs += '

    Live preview

    '; } else { newSwiper_thumbs += '

    Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (74)

    '; } }); $('.swiper-zoom-modal .swiper').addClass('swiper-container'); $('.swiper-zoom-modal .gallery-thumbs .swiper-wrapper').html(newSwiper_thumbs); $('.swiper-zoom-modal .gallery-top .swiper-wrapper').html(newSwiper); $('body').addClass('modal-open'); $('.swiper-zoom-modal').addClass(act); zoomThumbsSwiper = new Swiper('.swiper-zoom-modal .swiper.gallery-thumbs',{ lazy: false, loop: false, direction: 'vertical', freeMode: true, slidesPerView: 'auto', slidesPerGroup: 1, watchSlidesVisibility:true, watchSlidesProgress: true, observer: false, observeParents: false, watchOverflow: true, noSwiping: true, }); zoomThumbsSwiper.update(); zoomSwiper = new Swiper('.swiper-zoom-modal .swiper.gallery-top',{ zoom: { toggle: true, minRatio: 1, maxRatio: 2, }, lazy:{ loadPrevNext: true, loadPrevNextAmount: 3, }, thumbs: { swiper: zoomThumbsSwiper, autoScrollOffset: 0, }, autoHeight: false, navigation: { nextEl: '.swiper-zoom-modal .swiper-button-next', prevEl: '.swiper-zoom-modal .swiper-button-prev', }, watchSlidesVisibility: true, watchSlidesProgress: true, observer: false, observeParents: false, watchOverflow: true, noSwiping: true, loop: thumbsDow.length > 1, on: { zoomChange: function(swiper, scale, imageEl, slideEl){ if(scale == 2){ $('.swiper-zoom-modal .preview-zoom-in').addClass('disabled').siblings().removeClass('disabled'); } else if(scale == 1){ $('.swiper-zoom-modal .preview-zoom-out').addClass('disabled').siblings().removeClass('disabled'); } }, slideChange: function(swiper){ showCaseTab(swiper) }, } }); zoomSwiper.update(); zoomSwiper.slideToLoop(index,0,false); zoomThumbsSwiper.slideTo(index,0,false); if (typeof traceFun !== 'undefined') { traceFun.observerExposureByName(['swiper-zoom-container-zoom'], ['product_item_image_preview'], callBackExposure); } } $(document).on('click','.swiper-zoom-modal .preview-zoom-in',function(){ zoomSwiper.zoom.in(); }) $(document).on('click','.swiper-zoom-modal .preview-zoom-out',function(){ zoomSwiper.zoom.out(); }) /*size guide*/ $(document).on('click', '.size-tab .tab', function () { var index = $(this).index(); var node = $(this).parents('.size-tab'); $(this).addClass('active').siblings().removeClass('active'); node.find('.tab-content').eq(index).addClass('active').siblings().removeClass('active'); }); /*desc*/ $(document).on('click','.tabs-wrapper .tabs-item',function(){ var index = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $(this).parents('.tabs-wrapper').find('.tab-pane').eq(index).addClass('active').siblings().removeClass('active'); var bizCode = $(this).attr('data-trace-bizcode'); if (typeof bizCode != 'undefined') { callBackExposure(bizCode, $(this)); } }) $('.tabs-wrapper .tabs-item:first-child').trigger('click'); /*patent*/ $(document).on('click','.patent-content .patent-title',function(){ $(this).parents('.patent-content').find('.patent-box').toggleClass('active'); }) $(document).on('click','body',function(e){ var target = e.target; if($(target).parents('.patent-title').length <= 0 && !$(target).is('.patent-title') && !$(target).is('.patent-box')){ $('.patent-content .patent-box').removeClass('active'); } }) /* product group */ var urlKey = window.location.search.replace('?',''); var urlKeyArr = urlKey.split('&'); var pathnameArr = window.parent.location.pathname.split('/'); var hasPathname = $.inArray('tkid', pathnameArr) > -1 ? true : false; var hasGroupKey = 0, groupUrl; $.each(urlKeyArr,function(index,item){ var arr = item.split('='); if(arr[0] == 'collectgroup'){ hasGroupKey = 1; groupUrl = item; return false; } else if(arr[0] == 'customgroup'){ hasGroupKey = 2; groupUrl = item; return false; } }) if (hasGroupKey === 1) { getProductGroup(); } else if (hasGroupKey === 2) { getCustomGroup(); } else { $('#product_group_css').remove(); } function getProductGroup(){ var data = {'parameter': groupUrl,'product_id': 10984}; if(hasPathname) { data['tkid'] = pathnameArr.slice(-1)[0]; } $.post('/product/getProductGroup', data, function(result) { var data = result.data; var node = $('.product_group-content'); if(result.code == 1 && !$.isEmptyObject(data)){ var html = '', product_type = data.product_type, product_group_name = data.product_group_name product_array = data.product_array, keys = data.keys, parameter = data.parameter; var choose_name = ''; html += '

    '; if (product_type == 1) { choose_name = '' + product_group_name + ':'; } else { choose_name = '' + product_group_name + ''; } html += '

    ' + choose_name + '

    '; if(product_type == 2 || product_type == 3){ html += '

    ' + '

    ' + '

    ' + '

    ' + '

    '; } html += '

    ' + '

    '; $.each(product_array,function(index,item){ var isDefault = item['default'] == 1?'active':''; if(product_type == 1){ html += '

    ' + '

    ' + '

    ' + 'Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (75)' + '

    ' + '

    ' + '

    '; } else if(product_type == 2 || product_type == 4){ html += '

    ' + '

    ' + '

    ' + item.product_name + '

    ' + '

    ' + '

    '; } else if(product_type == 3){ html += '

    ' + '

    ' + '

    ' + 'Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (76)' + '

    ' + '

    ' + item.product_name + '

    ' + '

    ' + '

    '; } }) html += '

    '; html += '

    '; node.empty().append(html).removeClass('d-none'); selectItem(); } else { $('#product_group_css').remove(); } }) } function getCustomGroup(bond='',background='',classic='',fn){ var data = {'parameter': groupUrl,'product_id': 10984,'bond':bond,'background':background,'classic_text':classic}; if(hasPathname) { data['tkid'] = pathnameArr.slice(-1)[0]; } $.post('/product/getProductGroup', data, function(result) { var data = result.data.customList || {}; var webSite = result.data.webSite || ''; var node = $('.product_group-content'); if(result.code == 1 && webSite != ''){ if(hasPathname) {window.location.href = webSite;} else {window.location.href = "/"+webSite;} return false; } if(result.code == 1 && !$.isEmptyObject(data)){ var html = '', backgroundArray = data.backgroundArray, bondArray = data.bondArray, classicTextArray = data.classicTextArray; var choose_name = ''; node.empty(); $.each(data,function(key,value){ if(value.length <= 1){html += '

    ';} else {html += '

    ';} switch(key){ case 'bondArray': choose_name = '' + "Relationship" + ''; break; case 'classicTextArray': choose_name = '' + "Quote" + ''; break; case 'backgroundArray': choose_name = '' + "Background" + ''; break; } html += '

    ' + choose_name + '

    '; html += '

    ' + '

    ' + '

    ' + "Please Select" + '

    ' + '

    ' + '

    '; html += '

    ' + '

    '; $.each(value,function(index,item){ var isDefault = item['default'] == 1?'active':''; if(item['default'] == 1){ if(key == 'bondArray'){bond = item.value} else if(key == 'backgroundArray'){background = item.value} else if(key == 'classicTextArray'){classic = item.value} } html += '

    ' + '

    ' + '

    ' + item.value + '

    ' + '

    ' + '

    '; }) html += '

    '; html += '

    '; }) node.append(html).removeClass('d-none'); selectItem(); } else { $('#product_group_css').remove(); } }) } $(document).on('click','.product_group-content .item',function(){ if($(this).hasClass('active')){ var toggleNode = $(this).parents('.g-im').find('.group.toggle'); if(toggleNode.length > 0){ toggleNode.click(); } return false; } var href = $(this).data('href') || ''; $(this).addClass('active').siblings().removeClass('active'); if(href != '' && hasGroupKey === 1){ if(hasPathname) {window.location.href = href;} else {window.location.href = "/"+href;} } else if (hasGroupKey === 2){ selectItem(); var bond = '', background = '', classic = ''; var key = $(this).parents('.g-im').find('.g-title .t-name').attr('data-name'); switch(key){ case 'bond': bond = $('.product_group-content [data-name="bond"]').parents('.g-im').find('.item.active').data('name') || ''; break; case 'background': bond = $('.product_group-content [data-name="bond"]').parents('.g-im').find('.item.active').data('name') || ''; background = $('.product_group-content [data-name="background"]').parents('.g-im').find('.item.active').data('name') || ''; break; case 'classic_text': bond = $('.product_group-content [data-name="bond"]').parents('.g-im').find('.item.active').data('name') || ''; background = $('.product_group-content [data-name="background"]').parents('.g-im').find('.item.active').data('name') || ''; classic = $('.product_group-content [data-name="classic_text"]').parents('.g-im').find('.item.active').data('name') || ''; break; } getCustomGroup(bond,background,classic); } }); $(document).on('click','.product_group-content .toggle',function(e){ e.preventDefault(); $(this).toggleClass('active'); $(this).next('.box').css('height','auto').toggle(0); }); function selectItem(){ $('.product_group-content .g-im').each(function(){ var default_node = $(this).find('.item.active'); var default_img = default_node.attr('data-icon') || '', default_name = default_node.attr('data-name') || "Please Select"; var html = ''; html += '

    '; if(default_img != ''){ html += 'Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (77)'; } html += '

    ' + '' + default_name + '' + '

    ' + '

    '; $(this).find('.group .group-value').empty().append(html); }) } // inspire overflow function setInspireStyle(){ try{ var pw = Math.ceil($('.inspire-content').width()), sw = Math.ceil($('.inspire-content')[0].scrollWidth); if (sw > pw) { $('.inspire-content .tag-list>li:last-child').remove(); setInspireStyle(); } else { return false; } } catch(e) {} } setInspireStyle(); // installment _$('body').on('click','.payment-content .tab-content .iconfont',function(){ var paymentArr = []; var key = $(this).data('key'); var obj = paymentArr.find(function(item){return item.key == key}); var html = ''; if(Number(sku_price) < Number(obj['installment']['min_periods_amount']) || Number(sku_price) > Number(obj['installment']['max_periods_amount'])){ html = obj['installment']['installment_no_alert']; } else { html = obj['installment']['installment_yes_alert']; } html = setInstalmentsText(html,obj); html = '

    ' + html; $('.payment-detail-'+key+' .fixed-wrapper').html(html); _$(this).closest().find('.popup-b2t').trigger('click'); callBackExposure('product_select_staging', $(this)); }); function setPoint(num){ return currency_point == 2 ? num.replace('.',',') : num; } function setCurrency(num){ num = setPoint(num); return currency_position == "1" ? num + currency : currency + num; } function setInstalmentsText(html,obj){ var new_html = html || ''; try{ var instalments = (Math.round( Number(sku_price / obj['installment']['free_periods_num']) * Math.pow(10,2)) /Math.pow(10,2)).toFixed(2); if(obj['key'] == 'klarna'){ instalments = (Math.floor(sku_price * 100 / obj['installment']['free_periods_num']) / 100).toFixed(2); } new_html = new_html.replaceAll('{Amount}',setCurrency(sku_price)); new_html = new_html.replaceAll('{installment_times}',obj['installment']['free_periods_num']); new_html = new_html.replaceAll('{per_installment}',setCurrency(instalments)); new_html = new_html.replaceAll('{mini_amount}',setCurrency(obj['installment']['min_periods_amount'])); new_html = new_html.replaceAll('{max_amount}',setCurrency(obj['installment']['max_periods_amount'])); } catch(e) { console.log(e); } return new_html; } getProductData(); function getProductData(){ const productId="10984"; _$.ajaxJson('/product/productData',{'product_id':productId},function(res,state){ if(state!=1){return false;} getCountdownRichText(res.data); productCouponData=res.data.coupon_data; if(productOldSkuPrice){ setCouponPrompTips(productOldSkuPrice) } }) } function getCountdownRichText(data){ let promotionCountdownTime=-1; let promotionCountdownContent=''; let reachCountDownTime=-1; let reachCountdownContent=''; if(data && data.promotion_data && data.promotion_data.id){ promotionCountdownContent=data.promotion_data.countdown_content; promotionCountdownTime=data.promotion_data.countdown; } if(data && data.reachable_data && data.reachable_data.id){ reachCountdownContent=data.reachable_data.countdown_content; reachCountDownTime=data.reachable_data.countdown; } setReachableContent(reachCountdownContent,reachCountDownTime,promotionCountdownContent,promotionCountdownTime); } getABTest(); var page_subtotal = 1 == 1 ? 1 : 2; function getABTest(){ _$.ajaxJson('/index/abTest',{page:'product'},function(res,state){ if(state!=1){setABTest();return false;} const data=res.data; if (data.ab_test) { page_subtotal = data.ab_test.page_subtotal || page_subtotal; if (typeof traceFun !== 'undefined') { traceFun.eventReport({eventCode: 'custom', eventBizCode: 'product_abtest'}, {abTest1:'product',abTest2:'page_subtotal',abTest3:page_subtotal}, false); } } setABTest(); }); } function setABTest() { if (page_subtotal == 1) { $('.total-price-box').removeClass(dn); } } function setReachableContent(reachable_content,reachable_countdown,countdown_content_mobileStr,promotion_countdown){ let hasReachableBar=false; if(productInfo.reachable_bar){ hasReachableBar=true; } if(reachable_content&&reachable_countdown>0){ if($('.product-reachable-div').find('.reachable-bar-img-div').length>0){ $('.product-reachable-div .reachable-content').css('margin-top','5px') } $('.product-reachable-div .reachable-content').append(`

    ${reachable_content}

    `) hasReachableBar=true; }else{ $('.product-reachable-div .reachable-content').remove() } if(countdown_content_mobileStr&&promotion_countdown>0){ $('.promotion-countdown-content').append(`

    ${countdown_content_mobileStr}

    `) }else{ $('.promotion-countdown-content').remove() } if(hasReachableBar){ $('.right-layout .product__name-share').css('margin-top','10px') } head_runCountdown() } // points function setPointsTotal(price){ var point_percent = "1"; var text = `Members can get {Commodity_Points} points for purchasing this item`; var point_total = Math.ceil(price * point_percent); text = text.replace('{Commodity_Points}', point_total); if($('.point-tips').length > 0){$('.point-tips').html(text);} } $(document).on('click','.payment-content .tab-item',function(){ var index = $(this).index(); $(this).addClass('active').siblings('.tab-item').removeClass('active'); $('.payment-content .tab-content').eq(index).addClass('active').siblings('.tab-content').removeClass('active'); }) initPaymentTab(); function initPaymentTab(){ if($('.payment-content .tab-item').length > 0) { $('.payment-content .tab-item').eq(0).click(); } else { $('.payment-content .tab-content').eq(0).addClass('active'); } } $('img').each(function(){ if($(this).width() > 100 && $(this).parents('#product-app').length == 0){ var src = $(this).attr('data-src') ? $(this).attr('data-src').split('?d=150')[0] : $(this).attr('src').split('?d=150')[0]; $(this).attr('data-src', src); if($(this).attr('src') != 'https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/yang/lazyload.svg'){ $(this).attr('src', src); } } }) $('.support-preview-modal .content .close img').on('click',function(){ $('.support-preview-modal').removeClass('support-preview-modal-show') }) $('.support-preview-button').on('click',function(){ isSupportView=true; const res= iWindow.validateCustomItem(); if(res.flag){ setNewCanvasObj(res.data); debounceSubmit(); } }) // message animate var messageIndex = 0, initMessageShow = 1, messageBox = $(".message-notice-scroll"); if(messageBox.length > 0){ function startAnimation(){ messageBox.find(".message-notice-item").eq(messageIndex).show().siblings().hide(); if(initMessageShow){ messageBox.find(".message-notice-item").eq(messageIndex).animate({"opacity":1, "top":"0%"},500); initMessageShow = 0; } if(messageIndex >= $(".message-notice-scroll .message-notice-item").length){ return false; }else { //trace var element = messageBox.find(".message-notice-item").eq(messageIndex); if (element.hasClass('message-item__day-view') || element.hasClass('message-item__hour-view')) { traceEventReport('product_message_viewed', 1, '', getTraceProductInfo()); } else { traceEventReport('product_message_added', 1, '', getTraceProductInfo()); } messageIndex++; } messageBox.animate({"opacity":1, "top":"0%"},500,function(){ setTimeout(()=>{ messageBox.animate({"opacity":0,"top":"-50%"}, 500, function(){ messageBox.css({"top":"50%"}); setTimeout(()=>{ if(messageIndex < $(".message-notice-scroll .message-notice-item").length){ startAnimation(); } else { return false; } },5000) }); },3500) }); } setTimeout(()=>{ startAnimation(); },1000); } var productVue = {}; var productCartMixin = { data() { return { user_svip: "0", prodcutId: "10984", default_mainly: [], mainly_popularize_card: [], product_card_expand: 0, product_card_status: 0, checkedCard:{"card_id":0,"font_len":100,"card_name":"","content":"","price":0}, cardData:{"image":"","name":"","content":""}, productCardSwiper: null, productCardOpen: 0, showCardZoom: false, mainlyZoomSwiper: null, cardCount: 0, prodcutCardMaxLength: 100, } }, watch:{ checkedCard:{ handler(newValue, oldValue){ this.prodcutCardMaxLength = newValue.font_len > 0 ? newValue.font_len : this.cardData.font_len; if(newValue.content.length > this.prodcutCardMaxLength){ this.checkedCard.content = newValue.content.substr(0,this.prodcutCardMaxLength); this.cardData.content = newValue.content.substr(0,this.prodcutCardMaxLength); } else { this.cardData.content = newValue.content; } setPrice(product_stock); }, deep: true, }, }, computed:{ productCardDetailLength(){ var textLen = this.checkedCard.content ? this.checkedCard.content.length : 0; return _.subtract(this.prodcutCardMaxLength, textLen); }, }, mounted() { }, created() { this.initData(); }, methods:{ initData(){ var that = this; this.getCardList(this.prodcutId).then((data) => { this.cardListData = data.card_list; this.mainly_popularize_card = data.mainly_popularize_card; this.default_mainly = data.mainly_popularize_card; this.cardCount = data.cardCount; this.state = data.featured_id; if(data.mainly_popularize_card.length == 0){ this.product_card_status = 0; this.product_card_expand = 0; this.productCardOpen = 0; } else { this.product_card_status = data.product_card_status; this.product_card_expand = data.product_card_expand; this.productCardOpen = data.product_card_expand; this.initProductSwiper(); } }).catch((error) => { console.log(error); }) }, setCardItemPrice(price){ if(this.user_svip == 1){ return this.currencyPosition(0); } else { return this.currencyPosition(price); } }, zoomCardImage(index){ this.showCardZoom = true; this.initMainlyZoomSwiper(index); $('body').addClass('modal-open'); }, openCardBox(ref){ this.productCardOpen = !this.productCardOpen; if(this.productCardOpen){ var st = $("html")[0].scrollTop; var top = this.$refs[ref].offsetTop, h = $('.card-option').height() + this.$refs[ref].offsetHeight; let isThumb=false try { isThumb=window.isThumb } catch (error) { } if(st < top - h){ _.defer(()=>{ if(isThumb){ $("html,body").animate({scrollTop:top - 200}); }else{ $("html,body").animate({scrollTop:top - 100}); } }) } } }, chooseNotCard(){ this.cardData = { "image": "", "name": "", "content": this.checkedCard.content, "font_len": this.checkedCard.content, "price": "0", "old_price": "0", "card_id": 0, }; this.checkedCard = { "card_id": 0, "font_len": this.checkedCard.content, "card_name": "", "content": this.checkedCard.content, "price": 0, }; if(!this.product_card_expand){ this.productCardOpen = 0; } }, openProductCardList(){ this.showList = true; this.cardListBackType = 'close'; this.getTabActive(this.state); $('body').addClass('modal-open'); }, setProductCard(){ if(this.swiperInstance != null) { var index = this.swiperInstance.activeIndex; this.setCardNewData(this.cardImageList[index]); } var tempMainly = JSON.parse(JSON.stringify(this.mainly_popularize_card)); var newData = JSON.parse(JSON.stringify(this.cardData)); var hasIndex = _.lastIndexOf(tempMainly, _.find(tempMainly, ['card_id', this.cardData.card_id]) || {}); var defaultHas = _.lastIndexOf(this.default_mainly, _.find(this.default_mainly, ['card_id', this.cardData.card_id]) || {}); if(hasIndex != -1){ tempMainly[hasIndex] = newData; if(tempMainly.length > 5 && defaultHas != -1){ tempMainly.shift(); hasIndex--; } } else { if(tempMainly.length > 5){ tempMainly[0] = newData; } else { tempMainly.unshift(newData); } } this.mainly_popularize_card = tempMainly; try{ this.productCardSwiper.update(); if(hasIndex != -1){ this.productCardSwiper.slideTo(hasIndex); } else { this.productCardSwiper.slideTo(0); } }catch(e){} this.checkedCard = { "card_id": this.cardData.card_id, "font_len": this.cardData.font_len, "card_name": this.cardData.card_name, "content": this.cardData.content, "price": this.cardData.price, }; this.showList = false; this.showEditCard = false; $('body').removeClass('modal-open'); }, closeCardZoom(){ this.showCardZoom = false; $('body').removeClass('modal-open'); }, initMainlyZoomSwiper(index = 0){ var that = this; const isMainlySwiper = setTimeout(()=>{ try { if (window.callieSwiper) { clearTimeout(isMainlySwiper); that.mainlyZoomSwiper = new window.callieSwiper('.swiper-mainly-list', { initialSlide: index, effect: 'slide', watchOverflow: true, grabCursor: true, centeredSlides: false, loop: false, lazy: {loadPrevNext: true}, observer: true, observeParents: true, navigation: { nextEl: '.swiper-mainly-list .swiper-button-next', prevEl: '.swiper-mainly-list .swiper-button-prev', }, }) // that.mainlyZoomSwiper.update(); } } catch (error) {} },0) }, selectProductCard(){ if(this.mainlyZoomSwiper != null) { var index = this.mainlyZoomSwiper.activeIndex; this.setCardNewData(this.mainly_popularize_card[index]); this.mainlyZoomSwiper.slideTo(index); this.productCardSwiper.slideTo(index); } this.checkedCard = { "card_id": this.cardData.card_id, "font_len": this.cardData.font_len, "card_name": this.cardData.card_name, "content": this.cardData.content, "price": this.cardData.price, }; this.showCardZoom = false; $('body').removeClass('modal-open'); } },} ;var yangTabs = { props: { titleList: { type:Array, default(){ return []; } }, tabDefalutValue:{ type:String, default:"" } }, data: function () { return { value: "", } }, created() { this.$nextTick(function(){ this.value = this.tabDefalutValue; this.scrollIntoView(this.tabDefalutValue,1); }) }, methods: { navClick(item){ if (this.value == item.key) {return ;} this.scrollIntoView(item.key); this.value = item.key; if(this.$listeners['choose']){ this.$emit("choose",item); } }, scrollIntoView(key,isRead) { isRead = isRead || 0; const titles = this.$refs; const nav = this.$refs['tabs']; if (!titles[key]) { return; } const title = this.$refs[key][0]; const to = title.offsetLeft - (nav.offsetWidth - title.offsetWidth)/2; $(nav).animate({scrollLeft:to},500); const left = title.offsetLeft + title.offsetWidth / 2 - 20; if(!isRead){ $(".yang-tabs__line").animate({left:left},0); } else { $(".yang-tabs__line").animate({left:left},0); } }, }, template: `

    {{item.title}}

    `} var cardListMixin = { components: { 'yangTabs':yangTabs, }, data() { return { isLoad: false, active: "all", state: 0, cardListBoxStyle: 'height:85%', cardListBackType: 'close', titleList: [{"key":"all","title":"all","state":0,"index":0}], activeList: {}, showList: false, cardListData: [], } }, created() { }, watch:{ cardListData:{ handler(newVal,oldVal){ var that = this; var keyArray = []; _.forEach(newVal, function(value, key) { keyArray.push({ "title": value.name, "key": value.name.toLowerCase(), "state": value.id, "index": key }) }) if(keyArray.length > 0 && !_.isEqual(newVal,oldVal)) { this.titleList = keyArray; var list = _.find(keyArray,function(o) { return o.state == that.state; }); if ( typeof list == 'undefined' ) { this.state = 0; this.active = 'all'; } try{ this.getTabActive(this.state) // this.active = list[key]; // this.cardImageList = this.cardListData[0]['categoryCardList']; } catch(e) {} } }, immediate: true, deep: true, }, }, computed:{ }, methods:{ closeCardList(){ this.showList = false; if(this.cardListBackType == 'back'){ this.showEditCard = true; } else { $('body').removeClass('modal-open'); } }, tabClick(item){ this.isLoad = true; this.state = item.state; this.active = item.key; this.activeList = this.cardListData[item.index]['categoryCardList']; setTimeout(()=>{ this.isLoad = false; },500) }, getTabActive(state){ var item = _.find(this.titleList,function(o){return o.state == state}); if (! _.isEmpty(item)) { this.active = item.key; this.state = item.state; this.activeList = this.cardListData[item.index]['categoryCardList']; this.cardImageList = this.cardListData[item.index]['categoryCardList']; } }, chooseCard(item){ if(this.cardListBackType == 'close') { var cart_id = this.cardData['cart_id']; this.setCardNewData(item); this.cardData['cart_id'] = cart_id; var activeIndex = 0; _(this.cardImageList).forEach(function(val, index) { if(val['card_id'] == item['card_id']) { activeIndex = index; } }) if(this.source != 'product'){ this.initCardSwiper(activeIndex); } else { this.initProductCardListSwiper(activeIndex); } this.editCardBackType = "back"; } else { this.setCardNewData(item); this.editCardBackType = "close"; this.showList = false; } this.showEditCard = true; this.$nextTick(() => { this.$refs['change_text'].focus(); }) $('body').addClass('modal-open'); }, getCardList(id){ var data = {id}; return new Promise(function (resolve, reject) { _$.ajaxJson('/product/getProductCard', data, function(result, state){ if (state!=1) { reject(result.msg); return false; } resolve(result.data); }) }) }, openCardList(product_id,cart_id,card_data){ if(card_data.length == 0){ card_data = {"image":"","name":"","content":""}; } this.cardData = JSON.parse(JSON.stringify(card_data)); this.cardData['cart_id'] = cart_id; this.getCardList(product_id).then((data) => { this.state = data.featured_id; this.showList = true; this.cardListBackType = 'close'; var list = _.find(data.card_list,function(o) { return o.id == data.featured_id; }); if( typeof list == 'undefined'){ this.state = 0; } else { this.active = list.name.toLowerCase(); } this.cardListData = data.card_list; // this.getTabActive(this.state); $('body').addClass('modal-open'); }).catch((error) => { console.log(error); }) }, openCardListToChange(){ this.showEditCard = false; this.showList = true; this.getTabActive(this.state); this.cardListBackType = 'back'; $('body').addClass('modal-open'); }, },}var editCardMixin = { data() { return { editCardBackType: 'close', showEditCard: false, swiperInstance: null, source: null, cardMaxLength: 100, cardImageList: [], tempCardData:{}, } }, watch:{ cardData:{ handler(newValue, oldValue){ this.cardMaxLength = newValue.font_len; if(newValue.content.length > newValue.font_len){ this.cardData.content = newValue.content.substr(0,newValue.font_len); } }, immediate:true, deep: true, }, showEditCard(newVal){ if(!newVal){ this.swiperInstance = null; } }, state:{ handler(newValue, oldValue){ var index = _.find(this.titleList,function(o){return o.state == newValue})['index'] || 0; try{ this.cardImageList = this.cardListData[index]['categoryCardList']; } catch(e) {} }, immediate: true, deep: true, } }, computed:{ cardDetailLength(){ var textLen = this.cardData.content ? this.cardData.content.length : 0; return _.subtract(this.cardMaxLength, textLen); }, }, created() { }, methods:{ closeEditCard(){ var that = this; var ifChangeCard = false; if(that.source === 'product') { ifChangeCard = !_.isEqual(that.cardData.card_id, that.checkedCard.card_id) || !_.isEqual(that.cardData.content, that.checkedCard.content); } else { ifChangeCard = !_.isEqual(that.cardData.card_id, that.tempCardData.card_id) || !_.isEqual(that.cardData.content, that.tempCardData.content); } if(ifChangeCard){ calliePopup.confirm("Do you want to save the current content?",{ 'btn':[{ 'name':"No", 'callback':function(dom, index){ calliePopup.close(index); if(that.editCardBackType == 'close'){ that.showList = false; $('body').removeClass('modal-open'); } that.showEditCard = false; } }, { 'name':"Yes", 'callback':function(dom, index){ that.saveCardDetail(); calliePopup.close(index); } }] }); } else { that.showEditCard = false; if(that.source === 'product'){ that.showList = false; } if(that.editCardBackType == 'close'){ $('body').removeClass('modal-open'); } } }, saveCardDetail(){ if(this.source == 'product'){ try{ this.setProductCard(); } catch(e) {} } else { this.setCard(); } }, setCard(){ var that = this; if(this.swiperInstance != null) { var index = this.swiperInstance.getActiveIndex(); this.setCardNewData(this.cardImageList[index]); } _$.loading(); _$.ajaxJson('/cart/saveCartCard', that.cardData, function(result, state){ _$.closeLoading(); if (state!=1) { return false; } var data = result.data; that.settlement = data.settlement; that.freeShippingStatus = result.data.shipping_conditions_status; that.freeShippingDetail = result.data.free_shipping_promotion; that.setPrice(that.settlement); that.showList = false; that.showEditCard = false; if(data.cartBox.length > 0){ Vue.set(that.cartBoxList,that.cardData["cart_id"],data.cartBox); } var list = typeof that.allCartList != 'undefined' ? that.allCartList : that.cartList; list.forEach((item,index)=>{ if(item.id == that.cardData["cart_id"]){ if(typeof that.allCartList != 'undefined') { Vue.set(that.allCartList, index, data.cart); } else { Vue.set(that.cartList, index, data.cart); } return; } }) $('body').removeClass('modal-open'); }) }, setCardNewData(data){ _.forEach(data,(val,key)=>{ this.cardData[key] = val; }); }, changeCard(id,d){ this.tempCardData = d; _$.loading(); this.getCardList(id).then((data) => { this.cardListData = data.card_list; _$.closeLoading(); this.showEditCard = true; this.editCardBackType = 'close'; this.state = data.featured_id; this.cardData = JSON.parse(JSON.stringify(d)); this.$nextTick(() => { this.$refs['change_text'].focus(); }) $('body').addClass('modal-open'); }).catch((error) => { _$.closeLoading(); console.log(error); }) }, initCardSwiper(index = 0){ var that = this; this.swiperInstance = new SwiperInstance({ el: '.swiper-card-list', initialSlide: index, watchOverflow: true, lazy: { loadPrevNext: true, }, navigation: { nextEl: '.swiper-card-list .swiper-button-next', prevEl: '.swiper-card-list .swiper-button-prev', }, on:{ slideChange: function(swiper){ var index = swiper.activeIndex; var len = that.cardImageList[index]['font_len']; Vue.set(that.cardData,'font_len',len); that.cardMaxLength = that.cardImageList[index]['font_len']; Vue.set(that.cardData,'content',that.cardData.content.substr(0,len)); } } }) }, initProductCardListSwiper(index = 0){ var that = this; const isSwiper = setTimeout(()=>{ try { if (window.callieSwiper) { clearTimeout(isSwiper); that.swiperInstance = new window.callieSwiper('.swiper-card-list', { initialSlide: index, effect: 'slide', grabCursor: false, watchOverflow:true, centeredSlides: false, loop: false, lazy: {loadPrevNext: true}, observer: true, observeParents: true, navigation: { nextEl: '.swiper-card-list .swiper-button-next', prevEl: '.swiper-card-list .swiper-button-prev', }, on:{ slideChange: function(swiper){ var index = swiper.activeIndex; Vue.set(that.cardData,'font_len',that.cardImageList[index]['font_len']) that.cardMaxLength = that.cardImageList[index]['font_len']; } } }) } } catch (error) { console.log(error)} },0) }, },} _$.jsLoader("https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/common/vue.js?v=24.2.3.4",function(){ _$.jsLoader("https://d2d36hyavd3mb7.cloudfront.net/assets/js/index/n2022/vue-lazyload.js",function(){ Vue.use(VueLazyload, { preLoad: 1, loading: 'https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/yang/lazyload.svg', error: 'https://d2d36hyavd3mb7.cloudfront.net/assets/img/index/yang/lazyload.svg', attempt: 1, dispatchEvent: true, listenEvents: ['scroll','click'] }); productVue = new Vue({ el: '#product-app', mixins:[productCartMixin,cardListMixin,editCardMixin], data() { return { currencyArr: { currency: "GBP", currency_symbol: "£", currency_point: "1", currency_position: "0" }, } }, watch:{ }, computed:{ }, created() { this.source = 'product'; }, methods:{ currencyPosition(price){ var currencyArr = this.currencyArr; price = this.currencyShow(price); if (currencyArr.currency_position == 1) { return price+currencyArr.currency_symbol } return currencyArr.currency_symbol+price; }, currencyShow(number, decimals = 2, dec_point, thousands_sep){ dec_point = dec_point || this.currencyArr.currency_point; number = (number + '').replace(/[^0-9+-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = dec_point == '1' ? '.' : ',', s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + Math.round(n * k) / k; }; s = (prec ? toFixedFix(n, prec) : '' + Math.floor(n)).split('.'); var re = /(-?\d+)(\d{3})/; while (re.test(s[0])) { s[0] = s[0].replace(re, "$1" + sep + "$2"); } s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1).join('0'); return s.join(dec); }, webpShow(src,size){ var that = this; var imgUrl = that.imgUrl; if (src) { if (src.indexOf('https://')!==-1 || src.indexOf('http://')!==-1) { if (src.indexOf(imgUrl)===-1) { return src; } } } src = that.isWEBP == 1 ? src+'.webp' : src; src = size ? src+'?d='+size : src; if (src.indexOf(imgUrl)!==-1) { return src; } return imgUrl + src; }, initProductSwiper(){ var that = this; const isSwiper = setInterval(()=>{ try { if (window.callieSwiper) { clearInterval(isSwiper); that.productCardSwiper = new window.callieSwiper('.card .swiper-container', { effect: 'slide', grabCursor: false, centeredSlides: false, slidesPerView: 'auto', spaceBetween : 40, slidesPerGroup : 3, loop: false, lazy: {loadPrevNext: true}, observer: true, observeParents: true, navigation: { nextEl: '.card-box .swiper-button-next', prevEl: '.card-box .swiper-button-prev', }, on: { click: function(swiper,event){ const obj = $(event.target).parents('.card-item').length > 0 ? $(event.target).parents('.card-item') : $(event.target); if(obj.hasClass('card-item') && !$(event.target).hasClass('icon-card-preview')){ const card_name = obj.data('name') || "", image = obj.data('image'), font_len = obj.data('len') || 100, price = obj.data('price'), card_id = obj.data('id') || 0; that.cardData = { "image": image, "name": card_name, "content": that.checkedCard.content, "font_len": font_len, "price": price, "old_price": price, "card_id": card_id, }; that.checkedCard = { "card_id": card_id, "font_len": font_len, "card_name": card_name, "content": _.truncate(that.checkedCard.content,{'length':font_len,'omission':''}), "price": price }; debounceSetPrice(product_stock); } } } }) } } catch (error) {} },200) }, }, }) }); }); }); })(customJs);

    Personalised Set of 3 Non-toxicity Waterproof Hearts Temporary Tattoo with 1-5 Names Festival Party Favors Father's Day Gift for Family Couple - CALLIE (2024)

    References

    Top Articles
    Latest Posts
    Article information

    Author: Lakeisha Bayer VM

    Last Updated:

    Views: 5811

    Rating: 4.9 / 5 (69 voted)

    Reviews: 84% of readers found this page helpful

    Author information

    Name: Lakeisha Bayer VM

    Birthday: 1997-10-17

    Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

    Phone: +3571527672278

    Job: Manufacturing Agent

    Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

    Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.