function getMileageIcon(_mileages){ var intMileages = parseInt(_mileages,10); var strMileages = ""; var i=0; var intSuns = 0; var intMoons = 0; var intStars = 0; //每满100个积分升级一次;最多显示8个图标 if(intMileages==0){ strMileages = '' } else{ intSuns = parseInt(intMileages/6400,10); //6400=8*8*100 for(i=1;((i<=intSuns)&&(i<=8));i++){ strMileages += '' } intMileages = intMileages - intSuns*6400; if(intMileages>0 && i<8){ intMoons = parseInt(intMileages/800,10); for(;((i<=intMoons)&&(i<=8));i++){ strMileages += '' } } intMileages = intMileages - intMoons*800; if(intMileages>0 && i<8){ intStars = parseInt((intMileages-1)/100,10)+1; for(;((i<=intStars)&&(i<=8));i++){ strMileages += '' } } } return strMileages; } function login(){ var objUsername = doc("m_username"); objUsername.value = objUsername.value.replace(/(^\s+)|(\s+$)/ig,"").toLowerCase(); if(objUsername.value.indexOf("www.")==0){ if(!confirm("注意了!很多人用键盘输入email地址时,会习惯性地以www.开头,而这样的email地址大多数时候是错误的。\r您是否肯定自己的email地址是以www.开头?肯定请按“确定”,否则按“取消”。")){ objUsername.value = ""; objUsername.focus(); return false; } } if(objUsername.value.match(/^[\w\-\.]+@([a-z0-9\-]+\.)+[a-z]{2,6}$/ig)==null && objUsername.value.match(/^\d{11}$/ig)==null ){ window.alert("您输入的帐户email地址或手机号格式不正确。如果是手机号,必须是11位。"); objUsername.value = ""; objUsername.focus(); return false; } var objPassword = doc("m_password"); objPassword.value = objPassword.value.toLowerCase(); if(objPassword.value.length==0){ window.alert("请输入您的帐户登录密码。"); objPassword.value = ""; objPassword.focus(); return false; } if(new String(window.location).match(/redirect=([^&]+)/i)!=null){ doc('m_redirect').value = RegExp.$1; doc('m_redirect').value = decodeURIComponent(doc('m_redirect').value); } doc("buttonLogin").disabled = true; doc("formLogin").submit(); } function register(){ window.open('/member/register/','_blank'); } function getAgentId(){ var url = new String(window.location); if(url.match(/\?agent=(\d+)/)!=null){ return RegExp.$1; } else{ return "-1"; } } function getAgentUrl(mid){ if(objMember.Verified==0){ if(window.confirm("您需要成为认证会员才能参与推广获得佣金。是否现在认证?")){ window.location = "http://www.unsv.com/member/verify/"; return false; } } var url = new String(window.location); var anchor = ""; if(url.match(/(#[\w\W]+)$/)!=null){ anchor = RegExp.$1; url = url.replace(anchor,""); } if(url.match(/\?/)==null){ url = url + "?agent="+mid; } else{ if(url.match(/\?agent=/)==null){ url = url + "&agent="+mid; } else{ window.alert("当前网址已经是推广网址形式,直接分享给他人即可获得推广佣金。"); return false; } } if(navigator.userAgent.match(/MicroMessenger/)!=""){ window.alert("当前网页即将以推广网址形式重载。\r\n重载后分享到朋友圈即可获得获得推广佣金。"); } else{ window.alert("当前网页即将以推广网址形式重载。\r\n重载后将浏览器地址栏网址分享给他人即可获得推广佣金。"); } window.location = url+anchor; } function Member(){ this.ID = -1; this.Username = ""; this.Password = ""; this.Nickname = ""; this.Avatar = ""; this.Mileages = 0; this.Messages = 0; this.Orders = 0; this.State = 1; this.Type = 1; this.Verified = 0; this.Groups = ","; } var objMember = new Member(); var cookie = document.cookie; if(cookie.match(/(cookieOption=[^;$]+)/g)!=null){ cookie = RegExp.$1; cookie = decodeURIComponent(cookie); cookieArray = cookie.split("&"); cookieArray2 = null; for(var i=0;i'; strPanel += ''; strPanel += '
'; strPanel += '
'+objMember.Nickname+''; if(objMember.Verified==1){ strPanel += ' 认证会员'; } else{ strPanel += '
未认证会员'; } strPanel += '
'+objMember.Username+'
<查看订单>
'; strPanel += '
'; strPanel += ''; strPanel += '
'; strPanel += '
'; strPanel = strPanel + strVipItems; strPanel += '
'; strPanel += '
帐户设置
'; strPanel += '
退出登录
'; strPanel += '
'; } else{ strPanel = '
帐户email地址或手机号:
登录密码:*忘记了密码?
  
'+strVipItems; /*
新浪微博账号登录
腾讯QQ账号登录 */ } doc("divMemberPanel").innerHTML= strPanel; if(objMember.ID!=-1){ var jsMemberState = document.createElement("script"); jsMemberState.src = '/member/state/?id='+objMember.ID+'&agent='+getAgentId()+'&accessToken='+Math.random(); try{ doc("divMemberPanel").appendChild(jsMemberState); } catch(e){ doc("divMemberPanel").insertAdjacentElement('BeforeEnd',jsMemberState); } }