function autoHeight(str,flag=!0,val=!1){let el_height_list=[];$(str).each(function(){let el_height=$(this).outerHeight(flag),el_height_1=$(this).height();el_height_list.push(el_height)});let max=Math.max.apply(null,el_height_list);if(val)return max;$(str).css("height",`${max}px`)}function copyText(str){$(str).click(function(e){let that=$(this);var text=that.prev().text(),input=document.createElement("input");input.value=(text+"").trim(),document.body.appendChild(input),input.select(),document.execCommand("copy"),document.body.removeChild(input),that.addClass("success"),setTimeout(()=>{that.removeClass("success")},1e3)})}function reduceExpend(fn,delay=500){let startTime=0;return function(){let nowTime=new Date().getTime();delay-(nowTime-startTime)<=0&&(startTime=nowTime,fn())}}function isViewPort(el){var elementTop=$(el).offset().top,elementBottom=elementTop+$(el).outerHeight()/2,viewportTop=$(window).scrollTop(),viewportHalf=viewportTop+$(window).height()/2;return elementBottom>viewportTop&&elementTop<viewportHalf}function resizeCustomFn(fn){fn(),$(window).resize(function(){fn()})}let window_height=window.innerHeight*2;function triggerResizeOnEnterViewport(selector,callback){const target=document.querySelector(selector);if(target){const resizeObserver=new IntersectionObserver(([entry])=>{entry.isIntersecting&&(callback?callback():ScrollTrigger.refresh(),resizeObserver.disconnect())},{threshold:0,rootMargin:`-${window_height}px 0px 0px 0px`});resizeObserver.observe(target)}}function buyNowProduct(id){$("#upCart").hide();var itemsToAdd=[{id,quantity:1}];$.ajax({type:"POST",url:"/cart/add.js",data:{items:itemsToAdd},dataType:"json",success:function(){window.location.href="/checkout"},error:function(){$("#upCart").show(),console.log("\u52A0\u8D2D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002")}})}
//# sourceMappingURL=/cdn/shop/t/129/assets/general-methods.js.map?v=116433588717066660891740204367
