关于244128133

Unity3D游戏程序员

UGUI Text 逐字出现

   在做剧情系统的时候,有个剧情模式叫立绘对话,也就是那种你说一句我说一句的那种,策划的要求是希望对话是逐字出现的,而且文字都是在表格里面配置的还需要支持字体颜色的配置.显示一句完成后自动显示下一句.

   读取表格显示字体是很简单的.但是要逐字出现,由于之前没做过,首先想到的是,字体应该都是已经全部放上去了,然后在Text的上面放上一层遮罩.没隔一段时间把上面这层遮罩缩短一个字.这样就可以实现逐字出现的样式了.但是后面发现不行,因为每个字的大小和宽度是不一样的,而且还会有标点符号的区分.

  于是只能是使用那种每次往Text组件上加上一个字,但是这样做的问题又出现了,因为是每次加上一个字的,也就是说事先定义的颜色标记是没有用的他会被逐字打印在Text上了,比如 <color>标记他会首先打印 "<" 这个符合然后陆续把<color>整个显示出来 而不会像直接显示文字那样把<color>标记里面的文字按照定义的颜色显示出来.

  为了实现这个功能我只好用个正则表达式,把<color></color>整个内容先截取出来然后再赋值颜色值整体显示出来,也就是说,只要遇到有颜色标记的字就截取出来然后整体显示出来,这样就可以实现所需要的功能了.

部分代码如下:

//截出带颜色部分字体
   Regex reg = new Regex("(?<=<color).*?(?=</color>)", RegexOptions.None);
   MatchCollection matchs = reg.Matches(dialogDeploy_.text);
   //Debug.Log(matchs[0].Index-6+"-----"+ matchs[0].Length+6+8);
   int k = 0;
   ch = dialogDeploy_.text.ToCharArray();//转换成数组
   for (int j = 0; j < ch.Length; ++j)
    {

     yield return new WaitForSeconds(0.1f);
     if (isNext)
     {
      break;
     }
      if (ch[j] == '<' && matchs[k].Length + 6 + 8 
      < dialogDeploy_.text.Length)
     {
       //匹配出带颜色的字体
       showText_.text += 
       dialogDeploy_.text.Substring(j, matchs[k].Length + 6 + 8);
       j += matchs[k++].Length + 6 + 8;
     }
     else
     {
       showText_.text += ch[j];//显示每个字
     }
               
            }
            yield return new WaitForSeconds(0.5f);
            showText_.text = "\n";
            ch = null;
            ++i;
 }

U3D动态建模

做项目时美术居然要把英雄的属性值设置成雷达图的样式,看起来直观一点,然而他们只给了我一张图片……….

我当时懵逼了,一张图让我怎么做动态改变? 难道不应该是做动画吗? 然而我想了一下似乎做动画也不是很好,然后我开始想什么东西可以让UI动态的改变呢? 根据输入的值显示不同的形状呢?

这是值得研究的问题.在网上找了一些资料发现 可以用一个面片来做,把面片放在UI上面然后动态改变面片的顶点,实现不同的形状.

雷达图如下:

QQ截图20161107163618.jpg

由于我们的UI部分是需要进行热更新的所以这个功能我是用LUA写的但是可以很容易的翻译成C#的:

 local attributeMesh = self.transform:Find("模型物体"):GetComponent(UnityEngine.MeshFilter)
 local verticesInit=attributeMesh.mesh.vertices
 this.SetHeroAttribute(attributeMesh,0,0,0.1)
 function this.SetHeroAttribute(attributeMesh,x,y,z)
    local  mesh = attributeMesh.mesh
    local vertices = mesh.vertices
    vertices[1] =verticesInit[1]-UnityEngine.Vector3(x,y,z)//把原来的顶点值减去设置的值再赋给模型的顶点
    vertices[2] =verticesInit[2]-UnityEngine.Vector3(x,y,z)//这里只改变了 第2和第3个顶点的值,这样原来的5角型就会变的不规则了.
    mesh.vertices = vertices
end

这个面片实际上有5个顶点,但是为了演示我在代码里只改变了它2个点.

Unity3D模型动态切割方案

在做项目时,美术那边提了一个需求,他们希望我们程序这边能用U3D来实现人物模型的被子弹击中爆炸的效果,也就是被子弹打中后怪物模型爆炸碎开的效果.

之前他们项目中的做法是,事先把模型切开,切成很多小块然后组装在一起,再在U3D中把每块模型步入刚体和碰撞器.

这次他们觉得这样工作量有点大,每个需要爆炸的模型都要事先切开,然后导入U3D,再处理. 于是把这个在U3D中动态切割模型的任务交给了我.我本能反应是先看看市面上的其他人的解决方案

发现并没有找到有用的方案,然后我开始找相关的插件.找到了 Shatter Toolkit 这个插件,这个插件就是用来切割模型的,而且可以自定义切开后的切口颜色.这样就很好办了.然后我按照插件上的

方法,用在了人物模型中,但是发现却切不开,于是我有弄了一个立方体,发现切开毫无问题.为什么我的人物模型切不开呢? 仔细研究发现,原来人物模型上有骨骼.如果模型带骨骼的话这个插件是切不开的.而且这个插件需要在被切割的模型上加上网格碰撞器,这是非常耗资源的.于是这个插件不可取.只能另找其他方法了.

然后我有陆续找了一下插件发现都是无法切开带骨骼的模型的,研究发现这些插件也是通过 UvMapper 获取模型上的顶点然后分解为小模块再新建出对象加上碰撞器和刚体,这样每个模块又可被分解.至于为什么带骨骼的切不开,当时没找到原因,但是可以确定的是确实是因为骨骼的原因.

于是,切割方案还是用了以前的方案进行.但是如果是普通的模型比如箱子之类的是可以使用Shatter Toolkit 这个插件的.

QQ截图20161107161634.jpg

微信自动点赞工具

  朋友圈的里面的动态更新太快,都没来得及看就被新的动态覆盖了,如果不给点赞可能很多朋友会以为我不关注他们呢,所以突发奇想,想要用按键精灵来做一个微信朋友圈自动点赞的工具.

于是利用之前学习到的按键精灵和MQ语言的知识轻轻松松就开发出来了哈哈! 

   

         

这个脚本现在只能适应在小米5 分辨率的手机上,因为我的安卓手机是小米5,如果要适应其他手机,其实只需要更改一下识别的坐标就可以了.

        

上脚本代码吧!

        

小米5版本:

Dim screenX,screenY,deviceID,colorDep,shijian
screenX = GetScreenX()
screenY = GetScreenY()
colorDep = GetScreenColorDep()
deviceID = GetDeviceID()

Dim dTime=1000

Dim dlTime=2000

Dim cTime=500 

Sub 信息提示(内容)
    TracePrint 内容
    ShowMessage 内容
    Delay dTime
End Sub

Sub 单击(x, y,含义)
Touch x, y, cTime
TracePrint 含义
Delay dTime
End Sub

Sub 单击T(x,y,t,含义)
Touch x,y,t
TracePrint 含义
Delay dTime
End Sub

Call 信息提示("启动微信~")
RunApp "com.tencent.mm"
Delay dlTime

Call 单击(342, 1467, "单击第一个微信")

Call 单击(672, 1830, "单击发现")

Call 单击(350, 330, "单击朋友圈")

While True
        
    Dim intX,intY
	FindMultiColor 978,589,1045,1248,"B09385","-13|-2|F8F8F8,10|-1|F8F8F8,-32|-1|B09385,
	19|0|B09385,-4|12|B09385,-5|-15|B09385,-21|-15|B09385,-24|17|B09385,17|-18|B09385",
	0,0.9,intX,intY
	If intX > -1 And intY > -1 Then
		Call 单击(intX, intY, "单击")	
		FindMultiColor 532,437,572,1287,"FFFFFF","7|17|F4F3F3,14|20|3D3B34,
		0|22|3D3B34,17|-2|FFFFFF,24|16|3D3B34,-9|15|FFFFFF,19|29|FFFFFF,9|31|3D3B34,
		9|-1|615F59",0,0.9,intX,intY
		If intX > -1 And intY > -1 Then
			Call 单击(intX, intY, "单击点赞")
		End If		
	End If
	If CmpColorEx("541|1876|DADADA,32|1821|F8F8F8,958|1825|F8F8F8,25|1769|D3D3D3,
	588|1769|D3D3D3,1060|1769|D3D3D3,759|1876|E1E1E1,561|1120|FFFFFF",0.9) = 1 Then
	   Exit While
	End If
	Swipe 1000, screenY / 2, 1000, screenY / 2 - 400
    Delay 1000
Wend

   

海马安卓模拟器版:

Dim screenX,screenY,deviceID,colorDep,shijian
screenX = GetScreenX()
screenY = GetScreenY()
colorDep = GetScreenColorDep()
deviceID = GetDeviceID()

Dim dTime=1000

Dim dlTime=2000

Dim cTime=500 

Sub 信息提示(内容)
    TracePrint 内容
    ShowMessage 内容
    Delay dTime
End Sub

Sub 单击(x, y,含义)
Touch x, y, cTime
TracePrint 含义
Delay dTime
End Sub

Sub 单击T(x,y,t,含义)
Touch x,y,t
TracePrint 含义
Delay dTime
End Sub

Call 信息提示("启动微信~")
RunApp "com.tencent.mm"
Delay dlTime

Call 单击(450, 1220,"单击发现")

Call 单击(250, 230, "单击朋友圈")

While True
        
    Dim intX,intY
	FindMultiColor 651,235,699,813,"B09385","-8|0|F8F8F8,8|1|F8F8F8,-19|2|B09385,-1|9|B09385"
	,0,0.9,intX,intY
	If intX > -1 And intY > -1 Then
		Call 单击(intX, intY, "单击")
		
		FindMultiColor 306,159,380,955,"3F3A39","24|-2|3F3A39,2|33|3F3A39,
		24|-26|3F3A39,48|8|3F3A39,23|21|3F3A39,44|4|FFFFFF,39|-8|C9C8C8,49|-3|FFFFFF,
		53|1|C5C4C4",0,0.9,intX,intY
		If intX > -1 And intY > -1 Then 
		    Call 单击(intX, intY, "单击点赞")
		End If

		//Call 单击(intX-367, intY, "单击点赞")
	End If
	
	If CmpColorEx("360|1249|DADADA,117|1249|F5F5F5,624|1251|EDEDED,363|1179|D3D3D3,
	632|1216|F8F8F8,31|1236|F8F8F8,355|1215|F8F8F8,165|1213|F8F8F8,672|1223|F8F8F8,
	315|1264|F8F8F8",0.9) = 1 Then
	    Exit While
	End If
	
	Swipe screenX / 2, screenY / 2, screenX / 2, screenY / 2 - 300
    Delay 1000
Wend

 如果你没有安卓手机可以试试,安装模拟器哦 把模拟器的分辨率设置到720*1280 的就可以了 ,快开始你的自动化之旅吧!

 如果你还不会使用按键精灵,请看我的这篇文章 http://huangyi.cc/?p=752 

微信小程序

   今天研究了一下微信小程序,他的设计还是很巧妙的.通过开发文档还是看得非常详细的.

   腾讯的目的是为了在微信里面建立它的APP生态圈,以后我们的手机上可能就不需要再安装这么多APP了,直接进入微信就可以享受到想要的服务.这个野心是非常大的.

   不过既然腾讯开发出了这么一套框架就肯定会花大力去推广的而且肯定会有一波红利等着我们,我需要能抓住这一波.

他的架构非常简单,分为视图层和逻辑层当然你也可以再分出一个数据层.

        小程序开发框架的目标是通过尽可能简单、高效的方式让开发者可以在微信中开发具有原生 APP 体验的服务。框架提供了自己的视图层描述语言 WXML 和 WXSS,以及基于 JavaScript 的逻辑层框架,并在视图层与逻辑层间提供了数据传输和事件系统,可以让开发者可以方便的聚焦于数据与逻辑上。框架的核心是一个响应的数据绑定系统。整个系统分为两块视图层(View)和逻辑层(App Service)框架可以让数据与视图非常简单地保持同步。当做数据修改的时候,只需要在逻辑层修改数据,视图层就会做相应的更新

         虽然现在只发布了200个开发的内测账号,但是普通的没有账号的也可以使用开发工具开发的,只是部分的API会受限制而已,只要下载安装开发工具新建第一个项目时选择 无APPID 就可以实现普通的开发了.

QQ截图20161101232153.png

    它的结构如下:

QQ截图20161101232240.png

        

这里面包括了所有用到的开发编译和调试工具,其中一个小程序项目必须要有app.js,app.json,app.wxss 这个3个文件而且必须放在根目录下其中,.js后缀的是脚本文件,.json后缀的文件是配置文件,.wxss后缀的是样式表文件。微信小程序会读取这些文件,并生成小程序实例。

 

  1. app.json 是对整个小程序的全局配置。我们可以在这个文件中配置小程序是由哪些页面组成,配置小程序的窗口背景色,配置导航条样式,配置默认标题。

  2. app.wxss 是整个小程序的公共样式表。我们可以在页面组件的 class 属性上直接使用 app.wxss 中声明的样式规则。

  3. app.js是小程序的脚本代码。我们可以在这个文件中监听并处理小程序的生命周期函数、声明全局变量。调用框架提供的丰富的 API,如本例的同步存储及同步读取本地数据。

    更多的教程和API可以从 http://www.itlnk.com/  网站查询

微信网页登录器

   

   微信登录协议分析内容很复杂,所以就简单贴出一下分析的地址吧,不一一介绍了,直接上软件吧…… 哈哈

QQ截图20160627145117.png

获取uuid
 
2F%2Fwx.qq.com%2Fcgi-bin%2Fmmwebwx-bin%2Fwebwxnewloginpage&fun=new&lang=zh_CN&_
=1465359723508

获取二维码
https://login.weixin.qq.com/qrcode/odEPIEYLqg==

等待扫描
 
XA==&tip=0&r=-776229298&_=1465360049579

等待确认 - 返回ticket
 
SALw==&tip=0&r=-778037154&_=1465361861142

返回pass_ticket,wxuin,wxsid,crypt
 
dO_aBwmczuA@qrticket_0&uuid=YccSzzSALw==&lang=zh_CN&scan=1465361886&fun=new&ve
rsion=v2&lang=zh_CN

//初始化
https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxinit?r=-2015985609

接受消息
 
%40crypt_88ee86d2_88588b32587d869bb533dfb8aa61d360&sid=eAEXFuhHNB4EIfOs&uin=27
22200005&deviceid=e631912890957112&synckey=1_650814494%7C2_650814654%7C3_65081
4621%7C11_650813066%7C13_650800143%7C201_1465361892%7C1000_1465347961%7C1001_1
465347992%7C1002_1464837848%7C1005_1464769994&_=1465361861155

获取联系人列表
 
999&seq=0&skey=@crypt_88ee86d2_88588b32587d869bb533dfb8aa61d360

上传图片
https://file.wx2.qq.com/cgi-bin/mmwebwx-bin/webwxuploadmedia?f=json

发送图片
 
h_CN

   登录器下载地址: http://pan.baidu.com/s/1nuBSPUL

网络爬虫

接上篇高校教务系统分析,虽然我在上一篇博客中说道我开发了一个模拟登陆我们学校教务系统的软件,但是我发现好多人并不是很喜欢用,因为需要他们输入账号密码,他们会以为这是盗号程序.或者什么病毒,听起来很可笑.但是确实是如此. 于是我就想,居然我都可以获取全部数据,为什么不自己做一个网站呢?

 

然后我 按照上篇说的,开始分析它的数据库和表结构,然后在数据中创建自己的表结构和关系.再写了个爬虫程序抓取了学生的信息后插入到自己的数据库,后搭建了一个PHP网站环境.然后又写了个PHP网站专门提供给学校学生查询,这样他们就不会因为教务系统常常瘫痪而烦恼了 哈哈哈.

 

这里我要感谢一下亚马逊的免费云主机 让我可以不花钱就使用他们的服务器.虽然是国外的服务器但是速度基本还可以接受吧,毕竟是免费的.在使用中发现亚马逊的云主机在配置上特别是LINUX

主机是非常复杂的,相比我以前使用的 阿里云和其他一些主机,它算是最复杂的了,不过服务和功能确实是很多,这里给它点个赞,对于不是很熟云主机配置的人来说还是直接去阿里云方便快捷.

这个网络爬虫其实还是挺简单,就是按照网站协议 POST数据过去然后我们学校网站返回的是一堆JSON数据 只需要解析JSON数据然后插入到数据表中就行啦 ! 哈哈.

 QQ截图20160423211136 

 

我们的教务系统是只能根据学号查询信息的.现在我给它加上了不仅按照学号查询,还可以 按 姓名,性别,学院,班级,专业查询 .是不要很方便呢.

高校教务系统协议分析

这几天研究了一下我们学校的教务管理系统,本想看看它在前端是怎么加密密码的,但是没想到的是用Firbug工具一抓包,发现我们学校的教务系统的账号密码居然没有在前端进行加密传输。于是瞬间有了进一步研究的兴趣。

90-

上图是登录时候的抓的包,POST过去的账号密码是明文。

然后我想了一下发现应该不会那么简单就登录上去了,于是我清空了一下cookies ,重新抓了一次包

果然不出我所料,发现第一次登录POST过去数据后并没有返回什么东西,而是又GET到其他网页去了。

 

42

 

 

 

于是我就查看了一下登录地址的后一条GET过去的地址,发现地址的后面有一串应该是加密过的字符串。

 

43

 

这一串字符串是哪里来的呢? 难道是JS加密出来的吗? 上一条POST过去的数据并没有返回什么啊。

然后我又猜测会不是cookie?去查看了一下登录地址的cookies发现果然收到了这么一串字符串。

44

原来是收到的cookies,把收到的cookies中的其中一条cookies作为了地址的后缀,或者是身份验证。

于是这就好办了,我只要把收到的cookies取出来然后,再加到地址后面不久可以模拟登录和获取其他数据了吗?

说干就干,我用VS创建了一个winform窗体程序然后做了一个登录框,然后模拟网页POST数据过去发现果然登录成功了(此处应该有掌声) 。

 

POST函数如下:

 public static string GetHtml(string url, string postData, bool isPost, CookieContainer cookieContainer)
        {
            if (string.IsNullOrEmpty(postData))
            {
                return GetHtml(url, cookieContainer);
            }
            Thread.Sleep(NetworkDelay);//等待
            currentTry++;

            HttpWebRequest httpWebRequest = null;
            HttpWebResponse httpWebResponse = null;
            try
            {
                byte[] byteRequest = Encoding.Default.GetBytes(postData);

                httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
                httpWebRequest.CookieContainer = cookieContainer;
                httpWebRequest.ContentType = contentType;
                httpWebRequest.ServicePoint.ConnectionLimit = maxTry;
                httpWebRequest.Referer =url;
                httpWebRequest.Accept = accept;
                httpWebRequest.UserAgent =userAgent;
                httpWebRequest.Method = isPost ? "POST" : "GET";
                httpWebRequest.ContentLength = byteRequest.Length;

                Stream stream = httpWebRequest.GetRequestStream();
                stream.Write(byteRequest,0, byteRequest.Length);
                stream.Close();

                httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();

              

                Stream responseStream = httpWebResponse.GetResponseStream();
                StreamReader streamReader = new StreamReader(responseStream, encoding);
                string html = streamReader.ReadToEnd();

                cc.Add(httpWebResponse.Cookies);

                streamReader.Close();
                responseStream.Close();
                currentTry = 0;
               

               
                httpWebRequest.Abort();
                httpWebResponse.Close();
                return html;
            }
            catch
            {
                if (currentTry <= maxTry)
                {
                    GetHtml(url, postData, isPost, cookieContainer);
                }
                currentTry--;
                if (httpWebRequest != null)
                {
                    httpWebRequest.Abort();
                } if (httpWebResponse != null)
                {
                    httpWebResponse.Close();
                }
                return string.Empty;
            }
        }

然后登录成功后,我开始模拟获取课程表等数据信息,但是发现却不行。于是我不甘心,又重新抓了一次包,又看到了下面这些信息。

 

54

 

原来在登录成功后,它后post了一条数据过去这条数据就是guid=”登录收的cookie”来检查guid,然后返回了一个消息,类似令牌的东西吧。然后查看了一下下面一条POST数据发现确实用到了这个返回消息里面的内容。

55

 

是的,它把这条返回的内容作为了以guid命名的cookie里面了作为它的值,看了一下它的命名是ticket车票的意思,我想这个应该就是入场券了。哈哈(此处应该大笑三声)

在拿到这些cookie之后一切的数据获取都是顺风顺水了。我就想既然我们学校的教务系统这么烂偶尔网站还访问不了,为什么不做个PC版的教务助手给学弟学妹们使用呢?

然后我就用2天时间做出了如下工具(虽然界面还是一无既往的丑,但是程序员嘛不要在乎这些了):

1 2 3 4 5

哈哈是不是很赞呢?  只要登录成功就可以查询全校学生的信息和成绩哦,不知道会不会被成绩差的人打 哈哈哈哈。

 

下载地址:http://pan.baidu.com/s/1jHKIXqm

 

QQ网页登录密码加密算法

今天研究了一下QQ网页版登录,本来想做个模拟登陆器的但是发现里面的JS的算法相当复杂。使用了MD5和RSA进行加密。 它的加密算法如下:

function getCookie(t) {
    return pt.cookie.get(t)
}
function setCookie(t) {
    pt.cookie.set(t.value)
}
function ptui_onEnableLLogin(t) {
    var e = t.low_login_enable,
    i = t.low_login_hour;
    null != e && null != i && (i.disabled = !e.checked)
}
function ptui_setDefUin(t, e) {
    if (!e) {
        var e = unescape(pt.cookie.get('ptui_loginuin')),
        i = pt.chkAccount;
        g_appid != t_appid && (i.isNick(e) || i.isName(e)) && (e = pt.cookie.get('pt2gguin').replace(/^o/, '') - 0, e = 0 == e ? '' : e),
        defaultuin = e
    }
    e && (t.u.value = e)
}
function ptui_needVC(t, e) {
    pt.chkAccount.isQQ(t) && (document.cookie = 'chkuin=' + t + ';domain=ptlogin2.' + g_domain + ';path=/'),
    t = pt.needAt ? pt.needAt : t;
    var i = (pt.isHttps ? 'https://ssl.' : 'http://check.') + 'ptlogin2.' + g_domain + '/check?';
    2 == pt.regmaster ? i = 'http://check.ptlogin2.function.qq.com/check?regmaster=2&' : 3 == pt.regmaster && (i = 'http://check.ptlogin2.crm2.qq.com/check?regmaster=3&'),
    i += 'pt_tea=1&uin=' + t + '&appid=' + e + '&js_ver=' + window.g_pt_version + '&js_type=' + pt.js_type + '&login_sig=' + window.g_login_sig + '&u1=' + encodeURIComponent(document.forms[0].u1.value) + '&r=' + Math.random(),
    pt.loadScript(i),
    g_loadcheck = !0
}
function ptui_checkVC(t, e, i, n, r) {
    clearTimeout(checkClock),
    pt.checkRet = t,
    pt.isRandSalt = r,
    pt.salt = i,
    pt.uin = i,
    '2' == t && (g_uin = '0', pt.show_err(str_inv_uin)),
    pt.submitN[pt.uin] || (pt.submitN[pt.uin] = 1);
    var o = new Date;
    g_time.time7 = o;
    var a = {
        12: g_time.time7 - g_time.time6
    };
    switch (curXui || ptui_speedReport(a), g_loadcheck = !1, t + '') {
        case '0':
        case '2':
        case '3':
            $('verifycode').value = e || 'abcd',
            loadVC(!1);
            break;
        case '1':
            pt.cap_cd = e,
            $('verifycode').value = pt.needCodeTip ? str_codetip : '',
            loadVC(!0)
    }
    pt.pt_verifysession = n
}
function ptui_changeImg(t, e, i) {
    e = window.g_appid,
    changeimg = !0;
    var n = pt.needAt ? pt.needAt : g_uin,
    r = (pt.isHttps ? 'https://ssl.' : 'http://') + 'captcha.' + t + '/getimage?&uin=' + n + '&aid=' + e + '&' + Math.random() + '&cap_cd=' + pt.cap_cd,
    o = $('imgVerify');
    try {
        if (null != o) {
            o.src = r;
            var a = $('verifycode');
            null != a && 0 == a.disabled && i && (a.focus(), a.select())
        }
    } catch (s) {
    }
}
function ptui_initFocus(t) {
    if (!pt.isIpad) try {
        var e = t.u,
        i = t.p,
        n = t.verifycode;
        if ('' == e.value || str_uintip == e.value) return void e.focus();
        if ('' == i.value) return void i.focus();
        '' == n.value && n.focus()
    } catch (r) {
    }
}
function getSubmitUrl(t) {
    var e = !0,
    i = document.forms[0],
    n = (pt.isHttps ? 'https://ssl.' : 'http://') + 'ptlogin2.' + g_domain + '/' + t + '?',
    r = document.getElementById('login2qq');
    2 == pt.regmaster ? n = 'http://ptlogin2.function.qq.com/' + t + '?regmaster=2&' : 3 == pt.regmaster && (n = 'http://ptlogin2.crm2.qq.com/' + t + '?regmaster=3&');
    for (var o = 0; o < i.length; o++) if ('ptqrlogin' != t || 'u' != i[o].name && 'p' != i[o].name && 'verifycode' != i[o].name && 'h' != i[o].name) if ('ipFlag' != i[o].name || i[o].checked) {
        if ('fp' != i[o].name && 'submit' != i[o].type) if ('ptredirect' == i[o].name && (g_ptredirect = i[o].value), 'low_login_enable' != i[o].name || i[o].checked) {
            if (('low_login_hour' != i[o].name || e) && ('webqq_type' != i[o].name || r || i[o].checked)) if (n += i[o].name, n += '=', 'u' == i[o].name && pt.needAt) n += pt.needAt + '&';
             else {
                if ('p' == i[o].name) n += $.Encryption.getEncryption(i.p.value, pt.salt, i.verifycode.value);
                 else if ('u1' == i[o].name || 'ep' == i[o].name) {
                    var a = i[o].value,
                    s = '';
                    if ('1003903' == g_appid && r) {
                        s = /\?/g.test(a) ? '&' : '?';
                        var p = document.getElementById('webqq_type').value;
                        s += 'login2qq=' + r.value + '&webqq_type=' + p
                    }
                    n += encodeURIComponent(a + s)
                } else n += i[o].value;
                n += '&'
            }
        } else e = !1
    } else n += i[o].name + '=-1&';
    return n += 'fp=loginerroralert&action=' + pt.action.join('-') + '-' + (new Date - g_begTime) + '&mibao_css=' + pt.mibao_css + '&t=' + pt.submitN[pt.uin] + '&g=1',
    n += '&js_type=' + pt.js_type + '&js_ver=' + window.g_pt_version + '&login_sig=' + window.g_login_sig,
    n += '&pt_uistyle=' + window.g_style,
    n += '&pt_randsalt=' + (pt.isRandSalt || 0),
    'login' == t && (n += '&pt_vcode_v1=0', n += '&pt_verifysession_v1=' + (pt.pt_verifysession || pt.cookie.get('verifysession'))),
    n
}
function ajax_Submit() {
    if (pt.cntCheckTimeout >= 2) return void pt.show_err(pt.checkErr[window.g_lang]);
    if ( - 1 != pt.checkRet && 3 != pt.checkRet) {
        var t = getSubmitUrl('login');
        pt.winName.set('login_param', encodeURIComponent(login_param)),
        pt.loadScript(t)
    } else {
        pt.show_err(pt.checkErr[window.g_lang]);
        try {
            $('p').focus()
        } catch (e) {
        }
    }
}
function qrlogin_submit() {
    var t = getSubmitUrl('ptqrlogin');
    pt.winName.set('login_param', encodeURIComponent(login_param)),
    pt.loadScript(t)
}
function ptuiCB(t, e, i, n, r) {
    function o() {
        var t = pt.cookie.get('uin'),
        e = pt.cookie.get('skey');
        ('' == t || '' == e) && ptui_reportAttr2('240601')
    }
    function a() {
        switch ('0' != n && o(), pt.hide_err(), n) {
            case '0':
                pt.is_mibao(i) && (i += '#login_param=' + encodeURIComponent(login_param)),
                window.location.href = i;
                break;
            case '1':
                top.location.href = i;
                break;
            case '2':
                parent.location.href = i;
                break;
            default:
                top.location.href = i
        }
    }
    $('p').blur(),
    g_time.time13 = new Date;
    var s = {
        15: g_time.time13 - g_time.time12
    };
    if (ptui_speedReport(s), g_submitting = !1, 65 == t) return void pt.switch_qrlogin(!1);
    if (66 != t) {
        if (67 == t) return void pt.go_qrlogin_step(2);
        if (10005 == t && pt.force_qrlogin(t), 10006 == t && pt.force_qrlogin(t), 0 == t) {
            pt.isQrLogin && !pt.is_mibao(i) ? (window.clearInterval(pt.qrlogin_clock), a())  : a()
        } else if (pt.submitN[pt.uin] && pt.submitN[pt.uin]++, 0 == e ? 5 != window.g_style && pt.show_err(r && '' != r ? r : str_input_error)  : (pt.show_err(r), $('p').value = '', $('p').focus(), $('p').select()), isLoadVC ? (ptui_changeImg(g_domain, g_appid, !0), $('verifycode').value = pt.needCodeTip ? str_codetip : '', loadVC(!0), $('verifycode').focus(), $('verifycode').select())  : 0 == e && (g_uin = 0), 3 == t || 4 == t) {
            if (navigator.userAgent.toLowerCase().indexOf('webkit') > - 1 && $('u').focus(), 3 == t && ($('p').value = ''), $('p').focus(), $('p').select(), 4 == t) try {
                check(),
                $('verifycode').focus(),
                $('verifycode').select()
            } catch (p) {
            }
            0 != e && 102 != e && ($('verifycode').value = pt.needCodeTip ? str_codetip : '', loadVC(!0), g_submitting = !0)
        }
    }
}
function browser_version() {
    var t = navigator.userAgent.toLowerCase();
    return t.match(/msie ([\d.]+)/) ? 1 : t.match(/firefox\/([\d.]+)/) ? 3 : t.match(/chrome\/([\d.]+)/) ? 5 : t.match(/opera.([\d.]+)/) ? 9 : t.match(/version\/([\d.]+).*safari/) ? 7 : 1
}
function ptui_reportSpeed(t, e) {
    if (!(pt.isHttps || window.flag2 && Math.random() > 0.5 || !window.flag2 && Math.random() > 0.05)) {
        var i = browser_version();
        url = 'http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=6000&flag2=' + (window.flag2 ? window.flag2 : 1) + '&flag3=' + i;
        for (var n = 0; n < g_speedArray.length; n++) url += '&' + g_speedArray[n][0] + '=' + (g_speedArray[n][1] - t);
        0 != e && (url += '&4=' + (t - e)),
        imgSendTimePoint = new Image,
        imgSendTimePoint.src = url + '&24=' + g_appid
    }
}
function ptui_reportAttr(t) {
    Math.random() > 0.05 || (url = (pt.isHttps ? 'https' : 'http') + '://ui.ptlogin2.' + g_domain + '/cgi-bin/report?id=' + t + '&t=' + Math.random(), imgAttr = new Image, imgAttr.src = url, imgAttr = null)
}
function ptui_reportAttr2(t, e) {
    Math.random() > (e || 1) || (url = (pt.isHttps ? 'https' : 'http') + '://ui.ptlogin2.' + g_domain + '/cgi-bin/report?id=' + t + '&t=' + Math.random(), imgAttr = new Image, imgAttr.src = url, imgAttr = null)
}
function ptui_reportNum(t) {
    if (!(Math.random() > 0.05)) {
        url = (pt.isHttps ? 'https' : 'http') + '://ui.ptlogin2.' + g_domain + '/cgi-bin/report?id=1000&n=' + t;
        var e = new Image;
        e.src = url
    }
}
function imgLoadReport() {
    if (!changeimg) {
        g_time.time8 = new Date;
        var t = {
            11: g_time.time8 - g_time.time7
        };
        curXui || ptui_speedReport(t)
    }
}
function webLoginReport() {
    var t = {
    };
    g_time.time0 && g_time.time0 > 0 && g_time.time1 && g_time.time1 > 0 && g_time.time2 && g_time.time2 > 0 && g_time.time3 && g_time.time3 > 0 && (t[18] = g_time.time1 - g_time.time0, t[19] = g_time.time2 - g_time.time0, t[20] = g_time.time4 - g_time.time0, t[21] = g_time.time5 - g_time.time0, t[7] = g_time.time4 - g_time.time3, t[26] = g_time.time5 - g_time.time3, ptui_speedReport(t))
}
function ptui_speedReport(t) {
    if (!(pt.isHttps || window.flag2 && Math.random() > 0.5 || !window.flag2 && Math.random() > 0.1)) {
        var e = 'http://isdspeed.qq.com/cgi-bin/r.cgi?flag1=6000&flag2=' + (window.flag2 ? window.flag2 : 1) + '&flag3=' + browser_version(),
        i = 0;
        for (var n in t) t[n] > 300000 || t[n] < 0 || (e += '&' + n + '=' + t[n], i++);
        if (0 != i) {
            var r = new Image;
            r.src = e + '&24=' + g_appid
        }
    }
}
function ptui_notifyClose() {
    try {
        window.clearInterval(pt.qrlogin_clock),
        parent.ptlogin2_onClose ? parent.ptlogin2_onClose()  : top == this && window.close()
    } catch (t) {
        window.close()
    }
}
function ptui_setUinColor(t, e, i) {
    var n = $(t);
    n.style.color = str_uintip == n.value ? i : e
}
function ptui_checkPwdOnInput() {
    return $('p').value.length >= 16 ? !1 : !0
}
function ptui_onLogin(t) {
    try {
        if (parent.ptlogin2_onLogin && !parent.ptlogin2_onLogin()) return !1;
        if (parent.ptlogin2_onLoginEx) {
            var e = t.u.value,
            i = t.verifycode.value;
            if (str_uintip == e && (e = ''), !parent.ptlogin2_onLoginEx(e, i)) return !1
        }
    } catch (n) {
    }
    return ptui_checkValidate(t)
}
function ptui_onLoginEx(t, e) {
    if (g_time.time12 = new Date, ptui_onLogin(t)) {
        var i = new Date;
        i.setHours(i.getHours() + 720),
        pt.cookie.set('ptui_loginuin', t.u.value, i, '/', e)
    }
    return !1
}
function ptui_onReset() {
    try {
        if (parent.ptlogin2_onReset && !parent.ptlogin2_onReset()) return !1
    } catch (t) {
    }
    return !0
}
function ptui_checkValidate(t) {
    var e = t.u,
    i = t.p,
    n = t.verifycode;
    if ('' == e.value || str_uintip == e.value) return pt.show_err(str_no_uin),
    e.focus(),
    !1;
    if (e.value = e.value.trim(), !pt.chkUin(e.value)) return pt.show_err(str_inv_uin),
    e.focus(),
    e.select(),
    !1;
    if ('' == i.value) return pt.show_err(str_no_pwd),
    i.focus(),
    !1;
    if ('' == n.value) {
        if (!isLoadVC) return check(),
        !1;
        pt.show_err(str_no_vcode);
        try {
            n.focus()
        } catch (r) {
        }
        return ptui_reportAttr(g_loadcheck ? 78029 : 78028),
        !1
    }
    return n.value.length < 4 ? (pt.show_err(str_inv_vcode), n.focus(), n.select(), !1)  : (i.setAttribute('maxlength', '32'), ajax_Submit(), ptui_reportNum(g_changeNum), g_changeNum = 0, !0)
}
function uin2hex(str) {
    for (var maxLength = 16, hex = parseInt(str).toString(16), len = hex.length, i = len; maxLength > i; i++) hex = '0' + hex;
    for (var arr = [
    ], j = 0; maxLength > j; j += 2) arr.push('\\x' + hex.substr(j, 2));
    var result = arr.join('');
    return eval('result="' + result + '"'),
    result
}
function checkTimeout() {
    var t = $('u').value.trim();
    (pt.chkAccount.isQQ(t) || pt.chkAccount.isQQMail(t)) && (pt.uin = pt.salt = uin2hex(t.replace('@qq.com', '')), $('verifycode').value = '', loadVC(!0), pt.checkRet = 1, pt.cntCheckTimeout++),
    ptui_reportAttr2(216082)
}
function check() {
    g_time.time6 = new Date,
    g_changeNum++;
    var t = $('u').value.trim();
    if ($('u').value = t, g_uin != t && pt.chkUin(t) || - 1 == pt.checkRet || 3 == pt.checkRet || 0 != pt.cntCheckTimeout) {
        clearTimeout(checkClock),
        checkClock = setTimeout('checkTimeout()', 5000),
        g_uin = $('u').value.trim();
        try {
            parent.ptui_uin && parent.ptui_uin(g_uin)
        } catch (e) {
        }
        ptui_needVC(g_uin, g_appid)
    }
}
function loadVC(t) {
    if (isLoadVC != t || lastUin != g_uin) if (lastUin = g_uin, isLoadVC = t, 1 == t) {
        var e = $('imgVerify'),
        i = pt.needAt ? pt.needAt : g_uin,
        n = (pt.isHttps ? 'https://ssl.' : 'http://') + 'captcha.' + g_domain + '/getimage?aid=' + g_appid + '&r=' + Math.random() + '&uin=' + i + '&cap_cd=' + pt.cap_cd;
        e.src = n,
        $('verifyinput').style.display = '',
        $('verifytip').style.display = '',
        $('verifyshow').style.display = '',
        ptui_notifySize('login');
        try {
            $('p').focus()
        } catch (r) {
        }
    } else {
        $('verifyinput').style.display = 'none',
        $('verifytip').style.display = 'none',
        $('verifyshow').style.display = 'none',
        ptui_notifySize('login');
        try {
            $('p').focus()
        } catch (r) {
        }
    }
}
function onPageClose() {
    ptui_notifyClose()
}
function onFormReset(t) {
    return ptui_onReset(t) ? (t.u.style.color = '#CCCCCC', !0)  : !1
}
function onClickForgetPwd() {
    var t = $('u'),
    e = $('label_forget_pwd');
    return 2052 == sys.getQueryValue('fgt') && (g_forget = g_forget.replace('1028', 2052)),
    e.href = g_forget,
    null != t && t.value != str_uintip && (e.href += - 1 == e.href.indexOf('?') ? '?' : '&', e.href += 'aquin=' + t.value),
    !0
}
String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, '')
};
var sys = {
    $: function (t) {
        return document.getElementById(t)
    },
    onload: function (t) {
        var e = window.onload;
        window.onload = function () {
            'function' == typeof e && e(),
            'function' == typeof t && t()
        }
    },
    getQueryValue: function (t, e) {
        var i = '';
        return i = e ? '&' + e : window.location.search.replace(/(^\?+)|(#\S*$)/g, ''),
        i = i.match(new RegExp('(^|&)' + t + '=([^&]*)(&|$)')),
        i ? decodeURIComponent(i[2])  : ''
    }
},
pt = {
    uin: 0,
    salt: '',
    ckNum: {
    },
    action: [
        0,
        0
    ],
    submitN: {
    },
    err_m: null,
    isHttps: !1,
    isIpad: !1,
    mibao_css: '',
    needAt: '',
    t_appid: 46000101,
    seller_id: 703010802,
    needCodeTip: !1,
    regmaster: 0,
    qrlogin_step: 0,
    qrlogin_clock: 0,
    qrlogin_timeout: 0,
    qrlogin_timeout_time: 70000,
    isQrLogin: !1,
    qr_uin: '',
    qr_nick: '',
    dftImg: 'http://imgcache.qq.com/ptlogin/face/1.png',
    js_type: 0,
    checkRet: - 1,
    cntCheckTimeout: 0,
    checkErr: {
        2052: '网络繁忙,请稍后重试。',
        1028: '網絡繁忙,請稍後重試。',
        1033: 'The network is busy, please try again later.'
    },
    pt_verifysession: '',
    nlog: function (t, e) {
        var i = 'https:' == location.protocol ? 'https://ssl.qq.com/ptlogin/cgi-bin/ptlogin_report?' : 'http://log.wtlogin.qq.com/cgi-bin/ptlogin_report?',
        n = encodeURIComponent(t + '|_|' + location.href + '|_|' + window.navigator.userAgent);
        e = e ? e : 0,
        i += 'id=' + e + '&msg=' + n + '&v=' + Math.random();
        var r = new Image;
        r.src = i
    },
    is_weibo_appid: function (t) {
        return 46000101 == t || 607000101 == t ? !0 : !1
    },
    is_mibao: function (t) {
        return /^http(s)?:\/\/ui.ptlogin2.(\S)+\/cgi-bin\/mibao_vry/.test(t)
    },
    chkUin: function (t) {
        if (t = t.trim(), 0 == t.length) return !1;
        if (window.location.hostname.match(/paipai.com$/) && t.length < 64 && new RegExp(/^[A-Za-z0-9]+@{1}[A-Za-z0-9]+$/).test(t)) return !0;
        if (g_appid == pt.seller_id && t.length < 64 && new RegExp(/^[A-Za-z0-9]+@{1}[0-9]+$/).test(t)) return !0;
        pt.needAt = '';
        var e = pt.chkAccount;
        if (pt.is_weibo_appid(g_appid)) {
            if (e.isQQ(t) || e.isMail(t)) return !0;
            if (e.isNick(t) || e.isName(t)) return pt.needAt = '@' + encodeURIComponent(t),
            !0;
            if (e.isPhone(t)) return pt.needAt = '@' + t.replace(/^(86|886)/, ''),
            !0;
            if (e.isSeaPhone(t)) return pt.needAt = '@00' + t.replace(/^(00)/, ''),
            /^(@0088609)/.test(pt.needAt) && (pt.needAt = pt.needAt.replace(/^(@0088609)/, '@008869')),
            !0;
            pt.needAt = ''
        } else {
            if (e.isQQ(t) || e.isMail(t)) return !0;
            if (e.isPhone(t)) return pt.needAt = '@' + t.replace(/^(86|886)/, ''),
            !0;
            if (e.isNick(t)) return sys.$('u').value = t + '@qq.com',
            !0
        }
        return e.isForeignPhone(t) ? (pt.needAt = '@' + t, !0)  : !1
    },
    chkAccount: {
        isQQ: function (t) {
            return /^[1-9]{1}\d{4,9}$/.test(t)
        },
        isQQMail: function (t) {
            return /^[1-9]{1}\d{4,9}@qq\.com$/.test(t)
        },
        isNick: function (t) {
            return /^[a-zA-Z]{1}([a-zA-Z0-9]|[-_]){0,19}$/.test(t)
        },
        isName: function (t) {
            return '<请输入帐号>' == t ? !1 : /[\u4E00-\u9FA5]/.test(t) ? t.length > 8 ? !1 : !0 : !1
        },
        isPhone: function (t) {
            return /^(?:86|886|)1\d{10}\s*$/.test(t)
        },
        isDXPhone: function (t) {
            return /^(?:86|886|)1(?:33|53|80|81|89)\d{8}$/.test(t)
        },
        isSeaPhone: function (t) {
            return /^(00)?(?:852|853|886(0)?\d{1})\d{8}$/.test(t)
        },
        isMail: function (t) {
            return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(t)
        },
        isForeignPhone: function (t) {
            return /^00\d{7,}/.test(t)
        }
    },
    cookie: {
        get: function (t) {
            var e = document.cookie.match(new RegExp('(^| )' + t + '=([^;]*)(;|$)'));
            return e ? e[2] : ''
        },
        set: function (t, e) {
            var i = arguments,
            n = arguments.length,
            r = n > 2 ? i[2].toGMTString()  : '',
            o = n > 3 ? i[3] : '',
            a = n > 4 ? i[4] : '',
            s = n > 5 ? i[5] : !1;
            document.cookie = t + '=' + escape(e) + ';expires =' + r + ';path = ' + o + ';domain =' + a + (1 == s ? ';secure' : ' ')
        }
    },
    html: {
        encode: function (t) {
            var e = '';
            return 0 == t.length ? '' : e = t.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/  /g, '&nbsp; ').replace(/'/g, '&apos;').replace(/"/g, '&quot;')
        }
    },
    init: function () {
        pt.t_appid == g_appid && (sys.$('u') && sys.$('u').setAttribute('style', ''), sys.$('u').style.cssText = ''),
        pt.isHttps = /^https/g.test(window.location),
        sys.onload(function () {
            sys.$('u').value && check(),
            pt.err_m = sys.$('err_m'),
            1003903 != g_appid && (document.body.onclick = function (t) {
                t |= window.event,
                pt.action[0]++
            }),
            document.body.onkeydown = function (t) {
                t |= window.event,
                pt.action[1]++
            },
            Math.random() < 0.1 && !pt.isHttps && pt.loadScript('http://mat1.gtimg.com/www/js/common_v2.js', function () {
                if ('function' == typeof checkNonTxDomain) try {
                    checkNonTxDomain(1, 5)
                } catch (t) {
                }
            }),
            window.setTimeout(function () {
                'http://game.zg.qq.com/index.html' == document.forms[0].u1.value && ptui_reportAttr2('358190'),
                ptui_reportAttr2('363629&union=256038', 0.05),
                window.g_login_sig || pt.nlog('旧版登录框login_sig为空|_|' + window.g_pt_version, '291551')
            }, 1000);
            try {
                var t = sys.getQueryValue('s_url'),
                e = sys.getQueryValue('style'),
                i = sys.getQueryValue('appid'),
                n = (/paipai.com$/.test(window.location.hostname), sys.getQueryValue('regmaster')),
                r = sys.getQueryValue('enable_qlogin');
                if (5 == e) {
                    var o = /\?/g.test(t) ? '&' : '?';
                    o += 'login2qq=1&webqq_type=10',
                    t += o
                }
                var a = 1 == sys.getQueryValue('hide_close_icon') || 1 == sys.getQueryValue('hide_title_bar'),
                s = document.createElement('h4');
                if (s.innerHTML = '<input type="button" class="btn_close" id="close" name="close" onclick="javascript:onPageClose();" title="关闭" /><u id="label_login_title">用户登录</u>', window.g_href && - 1 == location.href.indexOf(g_href) && /^ui.ptlogin2./.test(location.hostname)) {
                    if ('http:' == location.protocol) if ('aqjump' == window.g_jumpname && 5 != e && 3 != n && 2 != n) {
                        a || sys.$('close') || (sys.$('login').insertBefore(s, sys.$('normal_login')), sys.$('login').style.border = '1px');
                        var p = document.createElement('div');
                        p.style.textAlign = 'center',
                        p.innerHTML = '<div style="position:relative;">\r\n\t\t\t\t\t\t\t<br/>\r\n\t\t\t\t\t\t\t<p style="line-height:20px;text-align:left;width:220px;margin:0 auto;">您当前的网络存在链路层劫持,为了确保您的帐号安全,请使用安全登录。</p></div>\r\n\t\t\t\t\t\t\t<input id="safe_login" value="安全登录"" type="button" class="btn" style="text-align:center;"/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div style="margin-top:10px;margin-left:10px; height:20px;">\r\n\t\t\t\t\t\t\t<span style="float:left;height:15px;width:14px; background: url(https://ui.ptlogin2.qq.com/style/14/images/help.png) no-repeat scroll right center transparent;"></span>\r\n\t\t\t\t\t\t\t<a style="float:left; margin-left:5px;" href="http://kf.qq.com/info/80861.html" target="_blank" >什么是链路层劫持</a>\r\n\t\t\t\t\t\t\t</div>',
                        sys.$('loginform').style.display = 'none',
                        sys.$('web_login').appendChild(p),
                        ptui_notifySize('login'),
                        ptui_reportAttr2(245663);
                        var c = new Image,
                        u = encodeURIComponent(window.g_href + '|_|' + location.href + '|_|' + window.g_jumpname + '|_|mid=245663');
                        c.src = 'http://log.wtlogin.qq.com/cgi-bin/ptlogin_report?msg=' + u + '&v=' + Math.random()
                    } else {
                        var c = new Image,
                        u = encodeURIComponent(window.g_href + '|_|' + location.href + '|_|' + window.g_jumpname + '|_|mid=245580');
                        c.src = 'http://log.wtlogin.qq.com/cgi-bin/ptlogin_report?id=245580&msg=' + u + '&v=' + Math.random()
                    } else ptui_reportAttr2('aqjump' == window.g_jumpname ? 245582 : 245581);
                    switch (g_jumpname = sys.getQueryValue('jumpname'), g_target = sys.getQueryValue('target'), g_target) {
                        case 'self':
                            document.forms[0].ptredirect.value = 0;
                            break;
                        case 'top':
                            document.forms[0].ptredirect.value = 1;
                            break;
                        case 'parent':
                            document.forms[0].ptredirect.value = 2;
                            break;
                        default:
                            document.forms[0].ptredirect.value = 1
                    }
                    switch (g_qtarget = sys.getQueryValue('qtarget'), g_qtarget) {
                        case 'self':
                            g_qtarget = 0;
                            break;
                        case 'top':
                            g_qtarget = 1;
                            break;
                        case 'parent':
                            g_qtarget = 2;
                            break;
                        default:
                            g_qtarget = 1
                    }
                    var l = 1;
                    if ('' != g_jumpname) - 1 != g_qtarget && (l = g_qtarget);
                     else switch (g_target) {
                        case 'self':
                            l = 0;
                            break;
                        case 'top':
                            l = 1;
                            break;
                        case 'parent':
                            l = 2;
                            break;
                        default:
                            l = 1
                    }
                    sys.$('safe_login') && (sys.$('safe_login').onclick = function () {
                        if (1 != l) try {
                            t = top.location.href
                        } catch (e) {
                        }
                        t = encodeURIComponent(t);
                        var o = 'https://ui.ptlogin2.qq.com/cgi-bin/login';
                        window.open(o + '?style=14&pt_safe=1&appid=' + i + '&s_url=' + t + '&regmaster=' + n + '&enable_qlogin=' + r, '_top'),
                        ptui_reportAttr2(247563)
                    }, 'none' == sys.$('switch').style.display ? ptui_reportAttr2(248671)  : sys.$('switch').onclick = function () {
                        pt.hasShowSafeTips || (pt.hasShowSafeTips = !0, ptui_reportAttr2(248671))
                    }),
                    document.forms[0].u1.value = t,
                    (3 == n || 2 == n) && (pt.regmaster = n);
                    var h = 'jump' == g_jumpname || '' == g_jumpname ? encodeURIComponent('u1=' + encodeURIComponent(document.forms[0].u1.value))  : '';
                    sys.$('xui') && (sys.$('xui').src = sys.$('xui').src + '&jumpname=' + g_jumpname + '&param=' + h + '&qtarget=' + l + '&regmaster' + n)
            }
    } catch (f) {
}
}),
pt.mibao_css = window.g_mibao_css;
var t = navigator.userAgent.toLowerCase();
pt.isIpad = /ipad/i.test(t),
pt.needCodeTip = window.needCodeTip ? needCodeTip : !1;
var e = document.loginform.regmaster ? document.loginform.regmaster.value : '';
2 != e && 3 != e || pt.isHttps || (pt.regmaster = e),
pt.dftImg = pt.ishttps ? 'https://ui.ptlogin2.qq.com/face/1.png' : 'http://imgcache.qq.com/ptlogin/face/1.png'
},
show_err: function (t, e) {
if (!pt.isQrLogin) {
var i = pt.html.encode(sys.$('u').value);
return pt.err_m && 'function' == typeof ptui_notifySize ? (e || (t += '<a href="http://support.qq.com/write.shtml?guest=1&fid=713&SSTAG=10011-' + i + '" target="_blank">' + str_yjfk + '</a>'), pt.err_m.innerHTML = t, pt.err_m.style.display = 'block', void ptui_notifySize('login'))  : void alert(t)
}
},
hide_err: function () {
return pt.err_m && 'function' == typeof ptui_notifySize ? (pt.err_m.innerHTML = '', pt.err_m.style.display = 'none', void ptui_notifySize('login'))  : void 0
},
setHeader: function (t) {
for (var e in t) '' != e && sys.$('qr_head') && (sys.$('qr_head').src = t[e])
},
imgErr: function (t) {
return t.onerror = null,
t.src != pt.dftImg && (t.src = pt.dftImg),
!1
},
setFeeds: function (t) {
for (var e in t) '' != e && sys.$('qr_feeds') && pt.getShortWord(sys.$('qr_feeds'), t[e], 120)
},
get_qrlogin_pic: function () {
var t = 'ptqrshow',
e = (pt.isHttps ? 'https://ssl.' : 'http://') + 'ptlogin2.' + g_domain + '/' + t + '?';
return 2 == pt.regmaster ? e = 'http://ptlogin2.function.qq.com/' + t + '?regmaster=2&' : 3 == pt.regmaster && (e = 'http://ptlogin2.crm2.qq.com/' + t + '?regmaster=3&'),
e += 5 == window.g_style ? 'appid=' + g_appid + '&e=4&l=L&s=8&d=72&v=4' : 'appid=' + g_appid + '&e=2&l=M&s=3&d=72&v=4',
e += '&t=' + Math.random()
},
animate: function (t, e, i, n, r) {
if (t) {
t.effect || (t.effect = {
}),
'undefined' == typeof t.effect.animate && (t.effect.animate = 0);
for (var o in e) e[o] = parseInt(e[o]) || 0;
window.clearInterval(t.effect.animate);
var i = i || 10,
n = n || 20,
a = function (t) {
    var e = {
        left: t.offsetLeft,
        top: t.offsetTop
    };
    return e
},
s = a(t),
p = {
    width: t.clientWidth,
    height: t.clientHeight,
    left: s.left,
    top: s.top
},
c = [
],
u = window.navigator.userAgent.toLowerCase();
if ( - 1 == u.indexOf('msie') || 'BackCompat' != document.compatMode) {
    var l = document.defaultView ? document.defaultView.getComputedStyle(t, null)  : t.currentStyle,
    h = e.width || 0 == e.width ? parseInt(e.width)  : null,
    f = e.height || 0 == e.height ? parseInt(e.height)  : null;
    'number' == typeof h && (c.push('width'), e.width = h - l.paddingLeft.replace(/\D/g, '') - l.paddingRight.replace(/\D/g, '')),
    'number' == typeof f && (c.push('height'), e.height = f - l.paddingTop.replace(/\D/g, '') - l.paddingBottom.replace(/\D/g, '')),
    15 > n && (i = Math.floor(15 * i / n), n = 15)
}
var g = e.left || 0 == e.left ? parseInt(e.left)  : null,
m = e.top || 0 == e.top ? parseInt(e.top)  : null;
'number' == typeof g && (c.push('left'), t.style.position = 'absolute'),
'number' == typeof m && (c.push('top'), t.style.position = 'absolute');
for (var d = [
], _ = c.length, o = 0; _ > o; o++) d[c[o]] = p[c[o]] < e[c[o]] ? 1 : - 1;
var v = t.style,
y = function () {
    for (var n = !0, o = 0; _ > o; o++) p[c[o]] = p[c[o]] + d[c[o]] * Math.abs(e[c[o]] - Math.floor(p[c[o]]) * i / 100),
    (Math.round(p[c[o]]) - e[c[o]]) * d[c[o]] >= 0 ? (n = n && !0, v[c[o]] = e[c[o]] + 'px')  : (n = n && !1, v[c[o]] = p[c[o]] + 'px');
    n && (window.clearInterval(t.effect.animate), 'function' == typeof r && r(t))
};
t.effect.animate = window.setInterval(y, n)
}
},
go_qrlogin_step: function (t) {
switch (t) {
case 1:
    sys.$('qrlogin_step1').style.display = 'block',
    sys.$('qrlogin_step2').style.display = 'none',
    sys.$('qrlogin_step3').style.display = 'none';
    break;
case 2:
    sys.$('qrlogin_step1').style.display = 'none',
    sys.$('qrlogin_step2').style.display = 'block',
    sys.$('qrlogin_step3').style.display = 'none';
    break;
case 3:
    sys.$('qr_nick').innerHTML = pt.html.encode(pt.qr_nick),
    sys.$('qr_uin').innerHTML = pt.qr_uin,
    sys.$('qrlogin_step3').style.display = 'block',
    sys.$('qrlogin_step2').style.display = 'none',
    sys.$('qrlogin_step1').style.display = 'none';
    var e = (sys.$('qrlogin_step3').offsetWidth - sys.$('qr_card').offsetWidth) / 2,
    i = (sys.$('qrlogin_step3').offsetWidth - 270) / 2;
    pt.animate(sys.$('qr_card'), {
        left: e,
        top: 20
    }, 20, 20, function () {
        pt.animate(sys.$('qr_card'), {
            width: 270,
            height: 120,
            left: i,
            top: 0
        })
    })
}
},
switch_qrlogin: function (t) {
t ? (ptui_reportAttr2(228433), sys.$('normal_login').style.display = 'none', sys.$('qrlogin').style.display = 'block', pt.go_qrlogin_step(1), sys.$('qrlogin_img').src = pt.get_qrlogin_pic(), pt.qrlogin_clock = window.setInterval('qrlogin_submit();', 2000), window.clearTimeout(pt.qrlogin_timeout), pt.qrlogin_timeout = window.setTimeout(function () {
pt.switch_qrlogin(!1)
}, pt.qrlogin_timeout_time))  : (sys.$('qrlogin').style.display = 'none', sys.$('normal_login').style.display = 'block', window.clearInterval(pt.qrlogin_clock), window.clearTimeout(pt.qrlogin_timeout)),
pt.isQrLogin = t,
ptui_notifySize('login')
},
force_qrlogin: function (t) {
if (5 == window.g_style) {
switch (t + '') {
    case '10005':
        msg = '对不起,你的号码登录异常,请前往SmartQQ扫描二维码安全登录,<a href=\'http://w.qq.com/login.html?f_qr=1\' target=\'_blank\'>立刻前往,</a><a href=\'http://ptlogin2.qq.com/qq_cheat_help\' target=\'_blank\'>帮助反馈。</a>';
        break;
    case '10006':
        msg = '你已开启登录设备保护,请前往SmartQQ使用最新的QQ手机版扫描二维码安全登录,<a href=\'http://w.qq.com/login.html?f_qr=1\' target=\'_blank\'>立刻前往。</a>';
        break;
    default:
        msg = '对不起,你的号码登录异常,请前往SmartQQ扫描二维码安全登录,<a href=\'http://w.qq.com/login.html?f_qr=1\' target=\'_blank\'>立刻前往。</a>'
}
pt.show_err(msg, 10005 == t)
}
},
no_force_qrlogin: function () {
},
getShortWord: function (t, e, i) {
i = t.getAttribute('w') || i,
e = e ? e : '';
var n = '...';
if (t.innerHTML = pt.html.encode(e), t.clientWidth <= i);
 else for (var r = Math.min(e.length, 20), o = r; o > 0; o--) {
var a = e.substring(0, o);
if (t.innerHTML = pt.html.encode(a + n), t.clientWidth <= i) break
}
t.style.width = i + 'px'
},
bind_account: function () {
window.open('http://id.qq.com/index.html#account'),
ptui_reportAttr2('234964')
},
loadScript: function (t, e) {
var i = document.createElement('script');
i.charset = 'UTF-8',
i.onload = i.onreadystatechange = function () {
this.readyState && 'loaded' !== this.readyState && 'complete' !== this.readyState || ('function' == typeof e && e(i), i.onload = i.onreadystatechange = null, i.parentNode && i.parentNode.removeChild(i))
},
i.src = t,
document.getElementsByTagName('head') [0].appendChild(i)
},
clearScript: function (t) {
window.setTimeout(function () {
t.parentNode.removeChild(t)
}, 5000)
},
winName: {
set: function (t, e) {
var i = window.name || '';
window.name = i.match(new RegExp(';' + t + '=([^;]*)(;|$)')) ? i.replace(new RegExp(';' + t + '=([^;]*)'), ';' + t + '=' + e)  : i + ';' + t + '=' + e
},
get: function (t) {
var e = window.name || '',
i = e.match(new RegExp(';' + t + '=([^;]*)(;|$)'));
return i ? i[1] : ''
},
clear: function (t) {
var e = window.name || '';
window.name = e.replace(new RegExp(';' + t + '=([^;]*)'), '')
}
}
};
pt.init();
var checkClock = 0,
lastUin = 1,
t_appid = 46000101,
g_changeNum = 0,
changeimg = !1,
defaultuin = '',
login_param = g_href.substring(g_href.indexOf('?') + 1),
g_ptredirect = - 1,
g_xmlhttp,
g_loadcheck = !0,
g_submitting = !1;
isAbleSubmit = !0,
$ = window.$ || {
},
$pt = window.$pt || {
},
$.RSA = $pt.RSA = function () {
function t(t, e) {
return new a(t, e)
}
function e(t, e) {
if (e < t.length + 11) return uv_alert('Message too long for RSA'),
null;
for (var i = new Array, n = t.length - 1; n >= 0 && e > 0; ) {
var r = t.charCodeAt(n--);
i[--e] = r
}
i[--e] = 0;
for (var o = new Y, s = new Array; e > 2; ) {
for (s[0] = 0; 0 == s[0]; ) o.nextBytes(s);
i[--e] = s[0]
}
return i[--e] = 2,
i[--e] = 0,
new a(i)
}
function i() {
this.n = null,
this.e = 0,
this.d = null,
this.p = null,
this.q = null,
this.dmp1 = null,
this.dmq1 = null,
this.coeff = null
}
function n(e, i) {
null != e && null != i && e.length > 0 && i.length > 0 ? (this.n = t(e, 16), this.e = parseInt(i, 16))  : uv_alert('Invalid RSA public key')
}
function r(t) {
return t.modPowInt(this.e, this.n)
}
function o(t) {
var i = e(t, this.n.bitLength() + 7 >> 3);
if (null == i) return null;
var n = this.doPublic(i);
if (null == n) return null;
var r = n.toString(16);
return 0 == (1 & r.length) ? r : '0' + r
}
function a(t, e, i) {
null != t && ('number' == typeof t ? this.fromNumber(t, e, i)  : null == e && 'string' != typeof t ? this.fromString(t, 256)  : this.fromString(t, e))
}
function s() {
return new a(null)
}
function p(t, e, i, n, r, o) {
for (; --o >= 0; ) {
var a = e * this[t++] + i[n] + r;
r = Math.floor(a / 67108864),
i[n++] = 67108863 & a
}
return r
}
function c(t, e, i, n, r, o) {
for (var a = 32767 & e, s = e >> 15; --o >= 0; ) {
var p = 32767 & this[t],
c = this[t++] >> 15,
u = s * p + c * a;
p = a * p + ((32767 & u) << 15) + i[n] + (1073741823 & r),
r = (p >>> 30) + (u >>> 15) + s * c + (r >>> 30),
i[n++] = 1073741823 & p
}
return r
}
function u(t, e, i, n, r, o) {
for (var a = 16383 & e, s = e >> 14; --o >= 0; ) {
var p = 16383 & this[t],
c = this[t++] >> 14,
u = s * p + c * a;
p = a * p + ((16383 & u) << 14) + i[n] + r,
r = (p >> 28) + (u >> 14) + s * c,
i[n++] = 268435455 & p
}
return r
}
function l(t) {
return lt.charAt(t)
}
function h(t, e) {
var i = ht[t.charCodeAt(e)];
return null == i ? - 1 : i
}
function f(t) {
for (var e = this.t - 1; e >= 0; --e) t[e] = this[e];
t.t = this.t,
t.s = this.s
}
function g(t) {
this.t = 1,
this.s = 0 > t ? - 1 : 0,
t > 0 ? this[0] = t : - 1 > t ? this[0] = t + DV : this.t = 0
}
function m(t) {
var e = s();
return e.fromInt(t),
e
}
function d(t, e) {
var i;
if (16 == e) i = 4;
 else if (8 == e) i = 3;
 else if (256 == e) i = 8;
 else if (2 == e) i = 1;
 else if (32 == e) i = 5;
 else {
if (4 != e) return void this.fromRadix(t, e);
i = 2
}
this.t = 0,
this.s = 0;
for (var n = t.length, r = !1, o = 0; --n >= 0; ) {
var s = 8 == i ? 255 & t[n] : h(t, n);
0 > s ? '-' == t.charAt(n) && (r = !0)  : (r = !1, 0 == o ? this[this.t++] = s : o + i > this.DB ? (this[this.t - 1] |= (s & (1 << this.DB - o) - 1) << o, this[this.t++] = s >> this.DB - o)  : this[this.t - 1] |= s << o, o += i, o >= this.DB && (o -= this.DB))
}
8 == i && 0 != (128 & t[0]) && (this.s = - 1, o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o)),
this.clamp(),
r && a.ZERO.subTo(this, this)
}
function _() {
for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; ) --this.t
}
function v(t) {
if (this.s < 0) return '-' + this.negate().toString(t);
var e;
if (16 == t) e = 4;
 else if (8 == t) e = 3;
 else if (2 == t) e = 1;
 else if (32 == t) e = 5;
 else {
if (4 != t) return this.toRadix(t);
e = 2
}
var i,
n = (1 << e) - 1,
r = !1,
o = '',
a = this.t,
s = this.DB - a * this.DB % e;
if (a-- > 0) for (s < this.DB && (i = this[a] >> s) > 0 && (r = !0, o = l(i)); a >= 0; ) e > s ? (i = (this[a] & (1 << s) - 1) << e - s, i |= this[--a] >> (s += this.DB - e))  : (i = this[a] >> (s -= e) & n, 0 >= s && (s += this.DB, --a)),
i > 0 && (r = !0),
r && (o += l(i));
return r ? o : '0'
}
function y() {
var t = s();
return a.ZERO.subTo(this, t),
t
}
function w() {
return this.s < 0 ? this.negate()  : this
}
function b(t) {
var e = this.s - t.s;
if (0 != e) return e;
var i = this.t;
if (e = i - t.t, 0 != e) return e;
for (; --i >= 0; ) if (0 != (e = this[i] - t[i])) return e;
return 0
}
function A(t) {
var e,
i = 1;
return 0 != (e = t >>> 16) && (t = e, i += 16),
0 != (e = t >> 8) && (t = e, i += 8),
0 != (e = t >> 4) && (t = e, i += 4),
0 != (e = t >> 2) && (t = e, i += 2),
0 != (e = t >> 1) && (t = e, i += 1),
i
}
function q() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + A(this[this.t - 1] ^ this.s & this.DM)
}
function k(t, e) {
var i;
for (i = this.t - 1; i >= 0; --i) e[i + t] = this[i];
for (i = t - 1; i >= 0; --i) e[i] = 0;
e.t = this.t + t,
e.s = this.s
}
function C(t, e) {
for (var i = t; i < this.t; ++i) e[i - t] = this[i];
e.t = Math.max(this.t - t, 0),
e.s = this.s
}
function $(t, e) {
var i,
n = t % this.DB,
r = this.DB - n,
o = (1 << r) - 1,
a = Math.floor(t / this.DB),
s = this.s << n & this.DM;
for (i = this.t - 1; i >= 0; --i) e[i + a + 1] = this[i] >> r | s,
s = (this[i] & o) << n;
for (i = a - 1; i >= 0; --i) e[i] = 0;
e[a] = s,
e.t = this.t + a + 1,
e.s = this.s,
e.clamp()
}
function T(t, e) {
e.s = this.s;
var i = Math.floor(t / this.DB);
if (i >= this.t) return void (e.t = 0);
var n = t % this.DB,
r = this.DB - n,
o = (1 << n) - 1;
e[0] = this[i] >> n;
for (var a = i + 1; a < this.t; ++a) e[a - i - 1] |= (this[a] & o) << r,
e[a - i] = this[a] >> n;
n > 0 && (e[this.t - i - 1] |= (this.s & o) << r),
e.t = this.t - i,
e.clamp()
}
function S(t, e) {
for (var i = 0, n = 0, r = Math.min(t.t, this.t); r > i; ) n += this[i] - t[i],
e[i++] = n & this.DM,
n >>= this.DB;
if (t.t < this.t) {
for (n -= t.s; i < this.t; ) n += this[i],
e[i++] = n & this.DM,
n >>= this.DB;
n += this.s
} else {
for (n += this.s; i < t.t; ) n -= t[i],
e[i++] = n & this.DM,
n >>= this.DB;
n -= t.s
}
e.s = 0 > n ? - 1 : 0,
- 1 > n ? e[i++] = this.DV + n : n > 0 && (e[i++] = n),
e.t = i,
e.clamp()
}
function D(t, e) {
var i = this.abs(),
n = t.abs(),
r = i.t;
for (e.t = r + n.t; --r >= 0; ) e[r] = 0;
for (r = 0; r < n.t; ++r) e[r + i.t] = i.am(0, n[r], e, r, 0, i.t);
e.s = 0,
e.clamp(),
this.s != t.s && a.ZERO.subTo(e, e)
}
function x(t) {
for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0; ) t[i] = 0;
for (i = 0; i < e.t - 1; ++i) {
var n = e.am(i, e[i], t, 2 * i, 0, 1);
(t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, n, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1)
}
t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)),
t.s = 0,
t.clamp()
}
function E(t, e, i) {
var n = t.abs();
if (!(n.t <= 0)) {
var r = this.abs();
if (r.t < n.t) return null != e && e.fromInt(0),
void (null != i && this.copyTo(i));
null == i && (i = s());
var o = s(),
p = this.s,
c = t.s,
u = this.DB - A(n[n.t - 1]);
u > 0 ? (n.lShiftTo(u, o), r.lShiftTo(u, i))  : (n.copyTo(o), r.copyTo(i));
var l = o.t,
h = o[l - 1];
if (0 != h) {
    var f = h * (1 << this.F1) + (l > 1 ? o[l - 2] >> this.F2 : 0),
    g = this.FV / f,
    m = (1 << this.F1) / f,
    d = 1 << this.F2,
    _ = i.t,
    v = _ - l,
    y = null == e ? s()  : e;
    for (o.dlShiftTo(v, y), i.compareTo(y) >= 0 && (i[i.t++] = 1, i.subTo(y, i)), a.ONE.dlShiftTo(l, y), y.subTo(o, o); o.t < l; ) o[o.t++] = 0;
    for (; --v >= 0; ) {
        var w = i[--_] == h ? this.DM : Math.floor(i[_] * g + (i[_ - 1] + d) * m);
        if ((i[_] += o.am(0, w, i, v, 0, l)) < w) for (o.dlShiftTo(v, y), i.subTo(y, i); i[_] < --w; ) i.subTo(y, i)
    }
    null != e && (i.drShiftTo(l, e), p != c && a.ZERO.subTo(e, e)),
    i.t = l,
    i.clamp(),
    u > 0 && i.rShiftTo(u, i),
    0 > p && a.ZERO.subTo(i, i)
}
}
}
function R(t) {
var e = s();
return this.abs().divRemTo(t, null, e),
this.s < 0 && e.compareTo(a.ZERO) > 0 && t.subTo(e, e),
e
}
function B(t) {
this.m = t
}
function M(t) {
return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m)  : t
}
function I(t) {
return t
}
function V(t) {
t.divRemTo(this.m, null, t)
}
function j(t, e, i) {
t.multiplyTo(e, i),
this.reduce(i)
}
function L(t, e) {
t.squareTo(e),
this.reduce(e)
}
function N() {
if (this.t < 1) return 0;
var t = this[0];
if (0 == (1 & t)) return 0;
var e = 3 & t;
return e = e * (2 - (15 & t) * e) & 15,
e = e * (2 - (255 & t) * e) & 255,
e = e * (2 - ((65535 & t) * e & 65535)) & 65535,
e = e * (2 - t * e % this.DV) % this.DV,
e > 0 ? this.DV - e : - e
}
function F(t) {
this.m = t,
this.mp = t.invDigit(),
this.mpl = 32767 & this.mp,
this.mph = this.mp >> 15,
this.um = (1 << t.DB - 15) - 1,
this.mt2 = 2 * t.t
}
function Q(t) {
var e = s();
return t.abs().dlShiftTo(this.m.t, e),
e.divRemTo(this.m, null, e),
t.s < 0 && e.compareTo(a.ZERO) > 0 && this.m.subTo(e, e),
e
}
function H(t) {
var e = s();
return t.copyTo(e),
this.reduce(e),
e
}
function z(t) {
for (; t.t <= this.mt2; ) t[t.t++] = 0;
for (var e = 0; e < this.m.t; ++e) {
var i = 32767 & t[e],
n = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
for (i = e + this.m.t, t[i] += this.m.am(0, n, t, e, 0, this.m.t); t[i] >= t.DV; ) t[i] -= t.DV,
t[++i]++
}
t.clamp(),
t.drShiftTo(this.m.t, t),
t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
}
function U(t, e) {
t.squareTo(e),
this.reduce(e)
}
function P(t, e, i) {
t.multiplyTo(e, i),
this.reduce(i)
}
function O() {
return 0 == (this.t > 0 ? 1 & this[0] : this.s)
}
function Z(t, e) {
if (t > 4294967295 || 1 > t) return a.ONE;
var i = s(),
n = s(),
r = e.convert(this),
o = A(t) - 1;
for (r.copyTo(i); --o >= 0; ) if (e.sqrTo(i, n), (t & 1 << o) > 0) e.mulTo(n, r, i);
 else {
var p = i;
i = n,
n = p
}
return e.revert(i)
}
function W(t, e) {
var i;
return i = 256 > t || e.isEven() ? new B(e)  : new F(e),
this.exp(t, i)
}
function X(t) {
gt[mt++] ^= 255 & t,
gt[mt++] ^= t >> 8 & 255,
gt[mt++] ^= t >> 16 & 255,
gt[mt++] ^= t >> 24 & 255,
mt >= vt && (mt -= vt)
}
function G() {
X((new Date).getTime())
}
function J() {
if (null == ft) {
for (G(), ft = nt(), ft.init(gt), mt = 0; mt < gt.length; ++mt) gt[mt] = 0;
mt = 0
}
return ft.next()
}
function K(t) {
var e;
for (e = 0; e < t.length; ++e) t[e] = J()
}
function Y() {
}
function tt() {
this.i = 0,
this.j = 0,
this.S = new Array
}
function et(t) {
var e,
i,
n;
for (e = 0; 256 > e; ++e) this.S[e] = e;
for (i = 0, e = 0; 256 > e; ++e) i = i + this.S[e] + t[e % t.length] & 255,
n = this.S[e],
this.S[e] = this.S[i],
this.S[i] = n;
this.i = 0,
this.j = 0
}
function it() {
var t;
return this.i = this.i + 1 & 255,
this.j = this.j + this.S[this.i] & 255,
t = this.S[this.i],
this.S[this.i] = this.S[this.j],
this.S[this.j] = t,
this.S[t + this.S[this.i] & 255]
}
function nt() {
return new tt
}
function rt(t, e, n) {
e = 'F20CE00BAE5361F8FA3AE9CEFA495362FF7DA1BA628F64A347F0A8C012BF0B254A30CD92ABFFE7A6EE0DC424CB6166F8819EFA5BCCB20EDFB4AD02E412CCF579B1CA711D55B8B0B3AEB60153D5E0693A2A86F3167D7847A0CB8B00004716A9095D9BADC977CBB804DBDCBA6029A9710869A453F27DFDDF83C016D928B3CBF4C7',
n = '3';
var r = new i;
return r.setPublic(e, n),
r.encrypt(t)
}
i.prototype.doPublic = r,
i.prototype.setPublic = n,
i.prototype.encrypt = o;
var ot,
at = 244837814094590,
st = 15715070 == (16777215 & at);
st && 'Microsoft Internet Explorer' == navigator.appName ? (a.prototype.am = c, ot = 30)  : st && 'Netscape' != navigator.appName ? (a.prototype.am = p, ot = 26)  : (a.prototype.am = u, ot = 28),
a.prototype.DB = ot,
a.prototype.DM = (1 << ot) - 1,
a.prototype.DV = 1 << ot;
var pt = 52;
a.prototype.FV = Math.pow(2, pt),
a.prototype.F1 = pt - ot,
a.prototype.F2 = 2 * ot - pt;
var ct,
ut,
lt = '0123456789abcdefghijklmnopqrstuvwxyz',
ht = new Array;
for (ct = '0'.charCodeAt(0), ut = 0; 9 >= ut; ++ut) ht[ct++] = ut;
for (ct = 'a'.charCodeAt(0), ut = 10; 36 > ut; ++ut) ht[ct++] = ut;
for (ct = 'A'.charCodeAt(0), ut = 10; 36 > ut; ++ut) ht[ct++] = ut;
B.prototype.convert = M,
B.prototype.revert = I,
B.prototype.reduce = V,
B.prototype.mulTo = j,
B.prototype.sqrTo = L,
F.prototype.convert = Q,
F.prototype.revert = H,
F.prototype.reduce = z,
F.prototype.mulTo = P,
F.prototype.sqrTo = U,
a.prototype.copyTo = f,
a.prototype.fromInt = g,
a.prototype.fromString = d,
a.prototype.clamp = _,
a.prototype.dlShiftTo = k,
a.prototype.drShiftTo = C,
a.prototype.lShiftTo = $,
a.prototype.rShiftTo = T,
a.prototype.subTo = S,
a.prototype.multiplyTo = D,
a.prototype.squareTo = x,
a.prototype.divRemTo = E,
a.prototype.invDigit = N,
a.prototype.isEven = O,
a.prototype.exp = Z,
a.prototype.toString = v,
a.prototype.negate = y,
a.prototype.abs = w,
a.prototype.compareTo = b,
a.prototype.bitLength = q,
a.prototype.mod = R,
a.prototype.modPowInt = W,
a.ZERO = m(0),
a.ONE = m(1);
var ft,
gt,
mt;
if (null == gt) {
gt = new Array,
mt = 0;
var dt;
if ('Netscape' == navigator.appName && navigator.appVersion < '5' && window.crypto && window.crypto.random) {
var _t = window.crypto.random(32);
for (dt = 0; dt < _t.length; ++dt) gt[mt++] = 255 & _t.charCodeAt(dt)
}
for (; vt > mt; ) dt = Math.floor(65536 * Math.random()),
gt[mt++] = dt >>> 8,
gt[mt++] = 255 & dt;
mt = 0,
G()
}
Y.prototype.nextBytes = K,
tt.prototype.init = et,
tt.prototype.next = it;
var vt = 256;
return {
rsa_encrypt: rt
}
}(),
function (t) {
function e() {
return Math.round(4294967295 * Math.random())
}
function i(t, e, i) {
(!i || i > 4) && (i = 4);
for (var n = 0, r = e; e + i > r; r++) n <<= 8,
n |= t[r];
return (4294967295 & n) >>> 0
}
function n(t, e, i) {
t[e + 3] = i >> 0 & 255,
t[e + 2] = i >> 8 & 255,
t[e + 1] = i >> 16 & 255,
t[e + 0] = i >> 24 & 255
}
function r(t) {
if (!t) return '';
for (var e = '', i = 0; i < t.length; i++) {
var n = Number(t[i]).toString(16);
1 == n.length && (n = '0' + n),
e += n
}
return e
}
function o(t) {
for (var e = '', i = 0; i < t.length; i += 2) e += String.fromCharCode(parseInt(t.substr(i, 2), 16));
return e
}
function a(t, e) {
if (!t) return '';
e && (t = s(t));
for (var i = [
], n = 0; n < t.length; n++) i[n] = t.charCodeAt(n);
return r(i)
}
function s(t) {
var e,
i,
n = [
],
r = t.length;
for (e = 0; r > e; e++) i = t.charCodeAt(e),
i > 0 && 127 >= i ? n.push(t.charAt(e))  : i >= 128 && 2047 >= i ? n.push(String.fromCharCode(192 | i >> 6 & 31), String.fromCharCode(128 | 63 & i))  : i >= 2048 && 65535 >= i && n.push(String.fromCharCode(224 | i >> 12 & 15), String.fromCharCode(128 | i >> 6 & 63), String.fromCharCode(128 | 63 & i));
return n.join('')
}
function p(t) {
_ = new Array(8),
v = new Array(8),
y = w = 0,
q = !0,
d = 0;
var i = t.length,
n = 0;
d = (i + 10) % 8,
0 != d && (d = 8 - d),
b = new Array(i + d + 10),
_[0] = 255 & (248 & e() | d);
for (var r = 1; d >= r; r++) _[r] = 255 & e();
d++;
for (var r = 0; 8 > r; r++) v[r] = 0;
for (n = 1; 2 >= n; ) 8 > d && (_[d++] = 255 & e(), n++),
8 == d && u();
for (var r = 0; i > 0; ) 8 > d && (_[d++] = t[r++], i--),
8 == d && u();
for (n = 1; 7 >= n; ) 8 > d && (_[d++] = 0, n++),
8 == d && u();
return b
}
function c(t) {
var e = 0,
i = new Array(8),
n = t.length;
if (A = t, n % 8 != 0 || 16 > n) return null;
if (v = h(t), d = 7 & v[0], e = n - d - 10, 0 > e) return null;
for (var r = 0; r < i.length; r++) i[r] = 0;
b = new Array(e),
w = 0,
y = 8,
d++;
for (var o = 1; 2 >= o; ) if (8 > d && (d++, o++), 8 == d && (i = t, !f())) return null;
for (var r = 0; 0 != e; ) if (8 > d && (b[r] = 255 & (i[w + d] ^ v[d]), r++, e--, d++), 8 == d && (i = t, w = y - 8, !f())) return null;
for (o = 1; 8 > o; o++) {
if (8 > d) {
    if (0 != (i[w + d] ^ v[d])) return null;
    d++
}
if (8 == d && (i = t, w = y, !f())) return null
}
return b
}
function u() {
for (var t = 0; 8 > t; t++) _[t] ^= q ? v[t] : b[w + t];
for (var e = l(_), t = 0; 8 > t; t++) b[y + t] = e[t] ^ v[t],
v[t] = _[t];
w = y,
y += 8,
d = 0,
q = !1
}
function l(t) {
for (var e = 16, r = i(t, 0, 4), o = i(t, 4, 4), a = i(m, 0, 4), s = i(m, 4, 4), p = i(m, 8, 4), c = i(m, 12, 4), u = 0, l = 2654435769; e-- > 0; ) u += l,
u = (4294967295 & u) >>> 0,
r += (o << 4) + a ^ o + u ^ (o >>> 5) + s,
r = (4294967295 & r) >>> 0,
o += (r << 4) + p ^ r + u ^ (r >>> 5) + c,
o = (4294967295 & o) >>> 0;
var h = new Array(8);
return n(h, 0, r),
n(h, 4, o),
h
}
function h(t) {
for (var e = 16, r = i(t, 0, 4), o = i(t, 4, 4), a = i(m, 0, 4), s = i(m, 4, 4), p = i(m, 8, 4), c = i(m, 12, 4), u = 3816266640, l = 2654435769; e-- > 0; ) o -= (r << 4) + p ^ r + u ^ (r >>> 5) + c,
o = (4294967295 & o) >>> 0,
r -= (o << 4) + a ^ o + u ^ (o >>> 5) + s,
r = (4294967295 & r) >>> 0,
u -= l,
u = (4294967295 & u) >>> 0;
var h = new Array(8);
return n(h, 0, r),
n(h, 4, o),
h
}
function f() {
for (var t = (A.length, 0); 8 > t; t++) v[t] ^= A[y + t];
return v = h(v),
y += 8,
d = 0,
!0
}
function g(t, e) {
var i = [
];
if (e) for (var n = 0; n < t.length; n++) i[n] = 255 & t.charCodeAt(n);
 else for (var r = 0, n = 0; n < t.length; n += 2) i[r++] = parseInt(t.substr(n, 2), 16);
return i
}
var m = '',
d = 0,
_ = [
],
v = [
],
y = 0,
w = 0,
b = [
],
A = [
],
q = !0;
t.TEA = {
encrypt: function (t, e) {
var i = g(t, e),
n = p(i);
return r(n)
},
enAsBase64: function (t, e) {
for (var i = g(t, e), n = p(i), r = '', o = 0; o < n.length; o++) r += String.fromCharCode(n[o]);
return btoa(r)
},
decrypt: function (t) {
var e = g(t, !1),
i = c(e);
return r(i)
},
initkey: function (t, e) {
m = g(t, e)
},
bytesToStr: o,
strToBytes: a,
bytesInStr: r,
dataFromStr: g
};
var k = {
};
k.PADCHAR = '=',
k.ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
k.getbyte = function (t, e) {
var i = t.charCodeAt(e);
if (i > 255) throw 'INVALID_CHARACTER_ERR: DOM Exception 5';
return i
},
k.encode = function (t) {
if (1 != arguments.length) throw 'SyntaxError: Not enough arguments';
var e,
i,
n = k.PADCHAR,
r = k.ALPHA,
o = k.getbyte,
a = [
];
t = '' + t;
var s = t.length - t.length % 3;
if (0 == t.length) return t;
for (e = 0; s > e; e += 3) i = o(t, e) << 16 | o(t, e + 1) << 8 | o(t, e + 2),
a.push(r.charAt(i >> 18)),
a.push(r.charAt(i >> 12 & 63)),
a.push(r.charAt(i >> 6 & 63)),
a.push(r.charAt(63 & i));
switch (t.length - s) {
case 1:
    i = o(t, e) << 16,
    a.push(r.charAt(i >> 18) + r.charAt(i >> 12 & 63) + n + n);
    break;
case 2:
    i = o(t, e) << 16 | o(t, e + 1) << 8,
    a.push(r.charAt(i >> 18) + r.charAt(i >> 12 & 63) + r.charAt(i >> 6 & 63) + n)
}
return a.join('')
},
window.btoa || (window.btoa = k.encode)
}(window),
$ = window.$ || {
},
$pt = window.$pt || {
},
$.Encryption = $pt.Encryption = function () {
function md5(t) {
return hex_md5(t)
}
function hex_md5(t) {
return binl2hex(core_md5(str2binl(t), t.length * chrsz))
}
function str_md5(t) {
return binl2str(core_md5(str2binl(t), t.length * chrsz))
}
function hex_hmac_md5(t, e) {
return binl2hex(core_hmac_md5(t, e))
}
function b64_hmac_md5(t, e) {
return binl2b64(core_hmac_md5(t, e))
}
function str_hmac_md5(t, e) {
return binl2str(core_hmac_md5(t, e))
}
function core_md5(t, e) {
t[e >> 5] |= 128 << e % 32,
t[(e + 64 >>> 9 << 4) + 14] = e;
for (var i = 1732584193, n = - 271733879, r = - 1732584194, o = 271733878, a = 0; a < t.length; a += 16) {
var s = i,
p = n,
c = r,
u = o;
i = md5_ff(i, n, r, o, t[a + 0], 7, - 680876936),
o = md5_ff(o, i, n, r, t[a + 1], 12, - 389564586),
r = md5_ff(r, o, i, n, t[a + 2], 17, 606105819),
n = md5_ff(n, r, o, i, t[a + 3], 22, - 1044525330),
i = md5_ff(i, n, r, o, t[a + 4], 7, - 176418897),
o = md5_ff(o, i, n, r, t[a + 5], 12, 1200080426),
r = md5_ff(r, o, i, n, t[a + 6], 17, - 1473231341),
n = md5_ff(n, r, o, i, t[a + 7], 22, - 45705983),
i = md5_ff(i, n, r, o, t[a + 8], 7, 1770035416),
o = md5_ff(o, i, n, r, t[a + 9], 12, - 1958414417),
r = md5_ff(r, o, i, n, t[a + 10], 17, - 42063),
n = md5_ff(n, r, o, i, t[a + 11], 22, - 1990404162),
i = md5_ff(i, n, r, o, t[a + 12], 7, 1804603682),
o = md5_ff(o, i, n, r, t[a + 13], 12, - 40341101),
r = md5_ff(r, o, i, n, t[a + 14], 17, - 1502002290),
n = md5_ff(n, r, o, i, t[a + 15], 22, 1236535329),
i = md5_gg(i, n, r, o, t[a + 1], 5, - 165796510),
o = md5_gg(o, i, n, r, t[a + 6], 9, - 1069501632),
r = md5_gg(r, o, i, n, t[a + 11], 14, 643717713),
n = md5_gg(n, r, o, i, t[a + 0], 20, - 373897302),
i = md5_gg(i, n, r, o, t[a + 5], 5, - 701558691),
o = md5_gg(o, i, n, r, t[a + 10], 9, 38016083),
r = md5_gg(r, o, i, n, t[a + 15], 14, - 660478335),
n = md5_gg(n, r, o, i, t[a + 4], 20, - 405537848),
i = md5_gg(i, n, r, o, t[a + 9], 5, 568446438),
o = md5_gg(o, i, n, r, t[a + 14], 9, - 1019803690),
r = md5_gg(r, o, i, n, t[a + 3], 14, - 187363961),
n = md5_gg(n, r, o, i, t[a + 8], 20, 1163531501),
i = md5_gg(i, n, r, o, t[a + 13], 5, - 1444681467),
o = md5_gg(o, i, n, r, t[a + 2], 9, - 51403784),
r = md5_gg(r, o, i, n, t[a + 7], 14, 1735328473),
n = md5_gg(n, r, o, i, t[a + 12], 20, - 1926607734),
i = md5_hh(i, n, r, o, t[a + 5], 4, - 378558),
o = md5_hh(o, i, n, r, t[a + 8], 11, - 2022574463),
r = md5_hh(r, o, i, n, t[a + 11], 16, 1839030562),
n = md5_hh(n, r, o, i, t[a + 14], 23, - 35309556),
i = md5_hh(i, n, r, o, t[a + 1], 4, - 1530992060),
o = md5_hh(o, i, n, r, t[a + 4], 11, 1272893353),
r = md5_hh(r, o, i, n, t[a + 7], 16, - 155497632),
n = md5_hh(n, r, o, i, t[a + 10], 23, - 1094730640),
i = md5_hh(i, n, r, o, t[a + 13], 4, 681279174),
o = md5_hh(o, i, n, r, t[a + 0], 11, - 358537222),
r = md5_hh(r, o, i, n, t[a + 3], 16, - 722521979),
n = md5_hh(n, r, o, i, t[a + 6], 23, 76029189),
i = md5_hh(i, n, r, o, t[a + 9], 4, - 640364487),
o = md5_hh(o, i, n, r, t[a + 12], 11, - 421815835),
r = md5_hh(r, o, i, n, t[a + 15], 16, 530742520),
n = md5_hh(n, r, o, i, t[a + 2], 23, - 995338651),
i = md5_ii(i, n, r, o, t[a + 0], 6, - 198630844),
o = md5_ii(o, i, n, r, t[a + 7], 10, 1126891415),
r = md5_ii(r, o, i, n, t[a + 14], 15, - 1416354905),
n = md5_ii(n, r, o, i, t[a + 5], 21, - 57434055),
i = md5_ii(i, n, r, o, t[a + 12], 6, 1700485571),
o = md5_ii(o, i, n, r, t[a + 3], 10, - 1894986606),
r = md5_ii(r, o, i, n, t[a + 10], 15, - 1051523),
n = md5_ii(n, r, o, i, t[a + 1], 21, - 2054922799),
i = md5_ii(i, n, r, o, t[a + 8], 6, 1873313359),
o = md5_ii(o, i, n, r, t[a + 15], 10, - 30611744),
r = md5_ii(r, o, i, n, t[a + 6], 15, - 1560198380),
n = md5_ii(n, r, o, i, t[a + 13], 21, 1309151649),
i = md5_ii(i, n, r, o, t[a + 4], 6, - 145523070),
o = md5_ii(o, i, n, r, t[a + 11], 10, - 1120210379),
r = md5_ii(r, o, i, n, t[a + 2], 15, 718787259),
n = md5_ii(n, r, o, i, t[a + 9], 21, - 343485551),
i = safe_add(i, s),
n = safe_add(n, p),
r = safe_add(r, c),
o = safe_add(o, u)
}
return 16 == mode ? Array(n, r)  : Array(i, n, r, o)
}
function md5_cmn(t, e, i, n, r, o) {
return safe_add(bit_rol(safe_add(safe_add(e, t), safe_add(n, o)), r), i)
}
function md5_ff(t, e, i, n, r, o, a) {
return md5_cmn(e & i | ~e & n, t, e, r, o, a)
}
function md5_gg(t, e, i, n, r, o, a) {
return md5_cmn(e & n | i & ~n, t, e, r, o, a)
}
function md5_hh(t, e, i, n, r, o, a) {
return md5_cmn(e ^ i ^ n, t, e, r, o, a)
}
function md5_ii(t, e, i, n, r, o, a) {
return md5_cmn(i ^ (e | ~n), t, e, r, o, a)
}
function core_hmac_md5(t, e) {
var i = str2binl(t);
i.length > 16 && (i = core_md5(i, t.length * chrsz));
for (var n = Array(16), r = Array(16), o = 0; 16 > o; o++) n[o] = 909522486 ^ i[o],
r[o] = 1549556828 ^ i[o];
var a = core_md5(n.concat(str2binl(e)), 512 + e.length * chrsz);
return core_md5(r.concat(a), 640)
}
function safe_add(t, e) {
var i = (65535 & t) + (65535 & e),
n = (t >> 16) + (e >> 16) + (i >> 16);
return n << 16 | 65535 & i
}
function bit_rol(t, e) {
return t << e | t >>> 32 - e
}
function str2binl(t) {
for (var e = Array(), i = (1 << chrsz) - 1, n = 0; n < t.length * chrsz; n += chrsz) e[n >> 5] |= (t.charCodeAt(n / chrsz) & i) << n % 32;
return e
}
function binl2str(t) {
for (var e = '', i = (1 << chrsz) - 1, n = 0; n < 32 * t.length; n += chrsz) e += String.fromCharCode(t[n >> 5] >>> n % 32 & i);
return e
}
function binl2hex(t) {
for (var e = hexcase ? '0123456789ABCDEF' : '0123456789abcdef', i = '', n = 0; n < 4 * t.length; n++) i += e.charAt(t[n >> 2] >> n % 4 * 8 + 4 & 15) + e.charAt(t[n >> 2] >> n % 4 * 8 & 15);
return i
}
function binl2b64(t) {
for (var e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', i = '', n = 0; n < 4 * t.length; n += 3) for (var r = (t[n >> 2] >> 8 * (n % 4) & 255) << 16 | (t[n + 1 >> 2] >> 8 * ((n + 1) % 4) & 255) << 8 | t[n + 2 >> 2] >> 8 * ((n + 2) % 4) & 255, o = 0; 4 > o; o++) i += 8 * n + 6 * o > 32 * t.length ? b64pad : e.charAt(r >> 6 * (3 - o) & 63);
return i
}
function hexchar2bin(str) {
for (var arr = [
], i = 0; i < str.length; i += 2) arr.push('\\x' + str.substr(i, 2));
return arr = arr.join(''),
eval('var temp = \'' + arr + '\''),
temp
}
function __monitor(t, e) {
if (!(Math.random() > (e || 1))) try {
var i = location.protocol + '//ui.ptlogin2.qq.com/cgi-bin/report?id=' + t,
n = document.createElement('img');
n.src = i
} catch (r) {
}
}
function getEncryption(t, e, i, n) {
i = i || '',
t = t || '';
for (var r = n ? t : md5(t), o = hexchar2bin(r), a = md5(o + e), s = $pt.RSA.rsa_encrypt(o), p = (s.length / 2).toString(16), c = TEA.strToBytes(i.toUpperCase(), !0), u = Number(c.length / 2).toString(16); u.length < 4; ) u = '0' + u;
for (; p.length < 4; ) p = '0' + p;
TEA.initkey(a);
var l = TEA.enAsBase64(p + s + TEA.strToBytes(e) + u + c);
return TEA.initkey(''),
setTimeout(function () {
__monitor(488358, 1)
}, 0),
l.replace(/[\/\+=]/g, function (t) {
return {
    '/': '-',
    '+': '*',
    '=': '_'
}
[
    t
]
})
}
function getRSAEncryption(t, e, i) {
var n = i ? t : md5(t),
r = n + e.toUpperCase(),
o = $.RSA.rsa_encrypt(r);
return o
}
var hexcase = 1,
b64pad = '',
chrsz = 8,
mode = 32;
return {
getEncryption: getEncryption,
getRSAEncryption: getRSAEncryption,
md5: md5
}
}();

 

NGUI之UIGrid自适应屏幕

今天做项目遇到了一个很无奈的事. 在使用NGUI做Scroll View功能时我在Scroll View下面使用了UIGrid进行排列拖动项.

但是最后发现UIGrid居然不可以设置锚点.每个可拖动项也不可以设置锚点,因为即使加了脚本后可以设置也会出现问题,运行后拖动选择项会出现抖动现象,因为他们是有锚点的会根据位置调整一下,出现抖动的反应.

后来我发现虽然不可以在UIGrid上设置锚点但是可以控制UIGrid上Transform的大小这样里面的选择项也会跟着放大和缩小了.找到方法后我开始想怎么实现它最好.然后我找到了UIStretch这个脚本,可根据设置改变对象的大小.但上面的设置选项并没有符合我要求的选项.索性我就自己加了一条.

//首先在脚本的前面加入一个选择项
public enum Style
	{
		None,
		Horizontal,
		Vertical,
		Both,
		BasedOnHeight,
                BasedOnWidth,//fgreen加入的代码;
		FillKeepingRatio, 
		FitInternalKeepingRatio 
	}

//然后在UPDATE里面加入if判断根据自己设置的默认宽高进行比例缩放
  if (style == Style.BasedOnHeight)
  {
   size.x = relativeSize.x * rectHeight;
   size.y = relativeSize.y * rectHeight;
  }
 else if (style == Style.BasedOnWidth)//fgreen加入的代码
 {
    size.x = relativeSize.x * Screen.height/854;//我项目中设置默认的是854的高和480的宽;
    size.y = relativeSize.y * Screen.width/480;//当屏幕宽带大于或小于它们时求它们的除数;
    size.z = size.x;
 }