†åº—铺

'+ ''+ ''+ ''+ ''+ 'î¸ '; var search = location.search; // 生æˆè®¾å¤‡id function getReqId () { var time = Date.now(); if (typeof performance !== 'undefined' && typeof performance.now === 'function') { // 使用更高精度的时间 time += performance.now(); } return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(char) { var rand = (time + (Math.random() * 16)) % 16 | 0; time = Math.floor(time / 16); return (char === 'x' ? rand : ((rand & 0x3) | 0x8)).toString(16); }); } // å‘逿Œ‡çº¹ç»Ÿè®¡ function requestFingerprint (promotion) { // var uuid = localStorage.getItem('equip_uuid'); var uuid = Giimall.cookie.getItem('equip_uuid'); // 新设备 if (!uuid) { uuid = getReqId(); // localStorage.setItem('equip_uuid', uuid); Giimall.cookie.addItem('equip_uuid',uuid,{domain:"giimall.com",path:'/',endTime:86400}); } else { var timediff = false; var curtemp = Date.now() / 1000; // var oldtamp = localStorage.getItem(promotion + '_tamp'); var oldtamp = Giimall.cookie.getItem(promotion + '_tamp'); if(oldtamp) { timediff = (curtemp - Number(oldtamp.split('_')[1])) < 86400; } // åŒä¸€ä¸ªæŒ‡çº¹24å°æ—¶è¯·æ±‚一次 if(timediff) { return; } } var preurl = document.querySelector('meta[name="gateway"]') ? document.querySelector('meta[name="gateway"]').content : ''; if(!preurl) {return;} window.Public.fetch(preurl+'merchant_center_public',{ method:'post', body:{ method:'merchant_promotion/addPromotionCensus', params:{ promotion_code: promotion,hash: uuid } }, success: function(data) { // var oldtamp = localStorage.getItem(promotion + '_tamp'); var oldtamp = Giimall.cookie.getItem(promotion + '_tamp'); var startTimestamp = Date.now() / 1000; //ç§’å•使—¶é—´æˆ³ var diff = false; if(!oldtamp) { // localStorage.setItem(promotion + '_tamp', promotion + '_' + startTimestamp); Giimall.cookie.addItem(promotion + '_tamp',promotion + '_' + startTimestamp,{domain:"giimall.com",path:'/',endTime:86400}); }else { diff = (startTimestamp - Number(oldtamp.split('_')[1])) >= 86400; } if(diff) { // localStorage.setItem(promotion + '_tamp', promotion + '_' + startTimestamp); Giimall.cookie.addItem(promotion + '_tamp',promotion + '_' + startTimestamp,{domain:"giimall.com",path:'/',endTime:86400}); } } }); } if(search && search.indexOf('promotion') != -1) { var value = search.match(/(promotion)=([\w]+)/), host = location.host; value[2] != "" && window.Public && window.Public.cookie && window.Public.cookie.addItem(value[1],value[2],{ path:"/", domain:host.substring(host.indexOf('.') + 1), endTime:60 * 60 * 72 }); // å‘é€å”¯ä¸€æŒ‡çº¹ var curPromotion = value[2]; // 当å‰è¥é”€id requestFingerprint(curPromotion); } // 退出登录 function handleSignOut(event) { event.preventDefault(); event.stopPropagation(); var target = event.target; Cookie.removeItem('username','.giimall.com','/'); location.href = "https://m.giimall.com/?type=resmo"; } // ç™»å½•åˆ‡æ¢ function changeLogin() { var dom = document.querySelectorAll('.SITE_PANELLi'); var len = dom.length; var alreadyRun = false; for(var i =0; i< len; i++) { var cur = dom[i].querySelector('a'); if(cur) { var hrf = cur.getAttribute('href'); if(hrf.indexOf('login') > -1){ var parent = document.querySelector('.SITE_PANELUl'); oldLi = dom[i]; if(userName) { if(alreadyRun) { parent.removeChild(dom[i]); }else { alreadyRun = true; var createLi = document.createElement('LI'); createLi.className = "SITE_PANELLi mainNavLi mainLiChild touch-element-nav"; createLi.innerHTML = newLi; parent.replaceChild(createLi, dom[i]); var signOut = parent.querySelector('.subMenuLi .signOut'); signOut.addEventListener('click', handleSignOut); signOut.addEventListener('touchend', handleSignOut); } } } } } } changeLogin(); })(); if(window.innerWidth > 1024 && location.host.indexOf('m.giimall.com') != -1 && !/iPad/.test(navigator.userAgent)) { location.href="https://www.giimall.com/"; }