diff --git a/annie/ui/SlidePage.ts b/annie/ui/SlidePage.ts index b75f6dca..14fdff62 100644 --- a/annie/ui/SlidePage.ts +++ b/annie/ui/SlidePage.ts @@ -46,21 +46,14 @@ namespace annieUI { * @public * @default 0 */ - public slideSpeed: number = 0.4; + public slideSpeed: number = 0.3; /** - * 触摸点开始点X - * @property touchStartX - * @type {number} - * @private - */ - private touchStartX: number = 0; - /** - * 触摸点开始点Y - * @property touchStartY - * @type {number} + * 是否滑动中断 + * @property _isBreak * @private + * @type {boolean} */ - private touchStartY: number = 0; + private _isBreak:boolean=false; /** * @property 滚动距离 * @type {number} @@ -184,7 +177,7 @@ namespace annieUI { s.addChild(s.view); s.view.mask = s.maskObj; s.setMask(vW, vH); - var me=s.onMouseEvent.bind(s); + var me = s.onMouseEvent.bind(s); s.addEventListener(annie.MouseEvent.MOUSE_DOWN, me); s.addEventListener(annie.MouseEvent.MOUSE_MOVE, me); s.addEventListener(annie.MouseEvent.MOUSE_UP, me); @@ -213,68 +206,51 @@ namespace annieUI { * @param e */ private onMouseEvent(e: annie.MouseEvent): void { - var s:any = this; - if(s.isMoving)return; + var s: any = this; + if (s.isMoving)return; if (e.type == annie.MouseEvent.MOUSE_DOWN) { - s.touchStartX = s.touchEndX = e.localX; - s.touchStartY = s.touchEndY = e.localY; + s.touchEndX = e.localX; + s.touchEndY = e.localY; s.movingX = s.movingY = 0; s.isMouseDown = true; + s._isBreak=false; } else if (e.type == annie.MouseEvent.MOUSE_MOVE) { - let movingX = e.localX - s.touchEndX; - let movingY = e.localY - s.touchEndY; - if (s.movingX != 0 && s.movingY != 0) { - if ((s.movingX > 0 && movingX < 0) || (s.movingX < 0 && movingX > 0) || (s.movingY > 0 && movingY < 0) || (s.movingY < 0 && movingY > 0)) { - s.isMouseDown = false; - } - } - s.touchEndX = e.localX; - s.touchEndY = e.localY; - s.movingX = movingX; - s.movingY = movingY; - let ts:number=s.touchStartY; - let te:number=s.touchEndY; + if (!s.isMouseDown)return; + let mx:number= e.localX - s.touchEndX; + let my= e.localY - s.touchEndY; + // s.touchEndX = e.localX; + // s.touchEndY = e.localY; + let ts: number = my; + let lts:number=s.movingY; if (!s.isVertical) { - ts=s.touchStartX; - te=s.touchEndX; + ts = mx; + lts=s.movingX; + } + if(Math.abs(ts)-Math.abs(lts)<1){ + s._isBreak=true; } - if (((s.currentPageIndex == 0)&&(ts < te))||((s.currentPageIndex == s.listLen - 1)&&(ts > te))) { - s.view[s.paramXY] += (te-ts) / s.distance * s.fSpeed * 0.6; + s.movingX=mx; + s.movingY=my; + if (ts > 0 && s.currentPageIndex == 0) { + s.view[s.paramXY] = ts * 0.3; + } else if (ts < 0 && (s.currentPageIndex == s.listLen - 1)) { + s.view[s.paramXY] = -s.currentPageIndex*s.distance+ts * 0.3; } } else if (e.type == annie.MouseEvent.MOUSE_UP) { - if(!s.isMouseDown)return; + if (!s.isMouseDown)return; s.isMouseDown = false; - s.touchEndX = e.localX; - s.touchEndY = e.localY; - let isNext:boolean=true; - let ts:number=s.touchStartY; - let te:number=s.touchEndY; + let ts: number = s.movingY; if (!s.isVertical) { - ts=s.touchStartX; - te=s.touchEndX; + ts = s.movingX; } - let distance = Math.abs(ts-te); - if (distance > s.distance*0.2) { - isNext = ts > te; - let xyValue=0; - let isNeedSlide=true; - if (isNext) { - if (s.currentPageIndex >= s.listLen - 1) { - xyValue=-s.distance * (s.listLen - 1); - isNeedSlide=false; - } - } else { - if (s.currentPageIndex <=0) { - isNeedSlide=false; - } - } - if(isNeedSlide){ - s.slideTo(isNext); - }else{ - let tweenData:any={}; - tweenData[s.paramXY]=xyValue; + if((s.currentPageIndex == 0&&s.view[s.paramXY]>0)||(s.currentPageIndex==(s.listLen-1)&&s.view[s.paramXY]<-s.currentPageIndex*s.distance)){ + let tweenData:any={}; + tweenData[s.paramXY]=-s.currentPageIndex*s.distance; tweenData.ease= annie.Tween.backOut; - annie.Tween.to(s.view, s.slideSpeed * 0.5, tweenData); + annie.Tween.to(s.view, 0.2, tweenData); + }else{ + if (Math.abs(ts) > 100&&!s._isBreak) { + s.slideTo(ts < 0); } } } @@ -289,15 +265,22 @@ namespace annieUI { */ public slideTo(isNext: boolean): void { var s = this; - if (s.isMoving||s.isMouseDown) { + if (s.isMoving || s.isMouseDown) { return; } if (isNext) { - s.currentPageIndex++; + if (s.currentPageIndex 0) { + s.currentPageIndex--; + } else { + return; + } } - if (s.currentPageIndex < 0 || s.currentPageIndex >= s.listLen)return; if (!s.pageList[s.currentPageIndex]) { s.pageList[s.currentPageIndex] = new s.pageClassList[s.currentPageIndex](); s.pageList[s.currentPageIndex][s.paramXY] = s.currentPageIndex * s.distance; @@ -320,6 +303,7 @@ namespace annieUI { annie.Tween.to(s.view, s.slideSpeed, tweenData); s.dispatchEvent("onSlideStart", {isNext: isNext}); } + /** * 用于插入分页 * @method addPageList @@ -327,7 +311,7 @@ namespace annieUI { * @since 1.0.3 * @public */ - public addPageList(classList:any): void { + public addPageList(classList: any): void { var s = this; s.pageClassList = s.pageClassList.concat(classList); if (s.listLen == 0 && s.pageClassList.length > 0) { diff --git a/build/annieUI.d.ts b/build/annieUI.d.ts index a4ddca18..1073af67 100644 --- a/build/annieUI.d.ts +++ b/build/annieUI.d.ts @@ -288,19 +288,12 @@ declare namespace annieUI { */ slideSpeed: number; /** - * 触摸点开始点X - * @property touchStartX - * @type {number} - * @private - */ - private touchStartX; - /** - * 触摸点开始点Y - * @property touchStartY - * @type {number} + * 是否滑动中断 + * @property _isBreak * @private + * @type {boolean} */ - private touchStartY; + private _isBreak; /** * @property 滚动距离 * @type {number} diff --git a/build/annieUI.js b/build/annieUI.js index 52c5091c..338f035d 100644 --- a/build/annieUI.js +++ b/build/annieUI.js @@ -514,21 +514,14 @@ var annieUI; * @public * @default 0 */ - this.slideSpeed = 0.4; + this.slideSpeed = 0.3; /** - * 触摸点开始点X - * @property touchStartX - * @type {number} - * @private - */ - this.touchStartX = 0; - /** - * 触摸点开始点Y - * @property touchStartY - * @type {number} + * 是否滑动中断 + * @property _isBreak * @private + * @type {boolean} */ - this.touchStartY = 0; + this._isBreak = false; /** * @property 滚动距离 * @type {number} @@ -674,70 +667,55 @@ var annieUI; if (s.isMoving) return; if (e.type == annie.MouseEvent.MOUSE_DOWN) { - s.touchStartX = s.touchEndX = e.localX; - s.touchStartY = s.touchEndY = e.localY; + s.touchEndX = e.localX; + s.touchEndY = e.localY; s.movingX = s.movingY = 0; s.isMouseDown = true; + s._isBreak = false; } else if (e.type == annie.MouseEvent.MOUSE_MOVE) { - var movingX = e.localX - s.touchEndX; - var movingY = e.localY - s.touchEndY; - if (s.movingX != 0 && s.movingY != 0) { - if ((s.movingX > 0 && movingX < 0) || (s.movingX < 0 && movingX > 0) || (s.movingY > 0 && movingY < 0) || (s.movingY < 0 && movingY > 0)) { - s.isMouseDown = false; - } - } - s.touchEndX = e.localX; - s.touchEndY = e.localY; - s.movingX = movingX; - s.movingY = movingY; - var ts = s.touchStartY; - var te = s.touchEndY; + if (!s.isMouseDown) + return; + var mx = e.localX - s.touchEndX; + var my = e.localY - s.touchEndY; + // s.touchEndX = e.localX; + // s.touchEndY = e.localY; + var ts = my; + var lts = s.movingY; if (!s.isVertical) { - ts = s.touchStartX; - te = s.touchEndX; + ts = mx; + lts = s.movingX; } - if (((s.currentPageIndex == 0) && (ts < te)) || ((s.currentPageIndex == s.listLen - 1) && (ts > te))) { - s.view[s.paramXY] += (te - ts) / s.distance * s.fSpeed * 0.6; + if (Math.abs(ts) - Math.abs(lts) < 1) { + s._isBreak = true; + } + trace(Math.abs(ts) - Math.abs(lts)); + s.movingX = mx; + s.movingY = my; + if (ts > 0 && s.currentPageIndex == 0) { + s.view[s.paramXY] = ts * 0.3; + } + else if (ts < 0 && (s.currentPageIndex == s.listLen - 1)) { + s.view[s.paramXY] = -s.currentPageIndex * s.distance + ts * 0.3; } } else if (e.type == annie.MouseEvent.MOUSE_UP) { if (!s.isMouseDown) return; s.isMouseDown = false; - s.touchEndX = e.localX; - s.touchEndY = e.localY; - var isNext = true; - var ts = s.touchStartY; - var te = s.touchEndY; + var ts = s.movingY; if (!s.isVertical) { - ts = s.touchStartX; - te = s.touchEndX; + ts = s.movingX; } - var distance = Math.abs(ts - te); - if (distance > s.distance * 0.2) { - isNext = ts > te; - var xyValue = 0; - var isNeedSlide = true; - if (isNext) { - if (s.currentPageIndex >= s.listLen - 1) { - xyValue = -s.distance * (s.listLen - 1); - isNeedSlide = false; - } - } - else { - if (s.currentPageIndex <= 0) { - isNeedSlide = false; - } - } - if (isNeedSlide) { - s.slideTo(isNext); - } - else { - var tweenData = {}; - tweenData[s.paramXY] = xyValue; - tweenData.ease = annie.Tween.backOut; - annie.Tween.to(s.view, s.slideSpeed * 0.5, tweenData); + if ((s.currentPageIndex == 0 && s.view[s.paramXY] > 0) || (s.currentPageIndex == (s.listLen - 1) && s.view[s.paramXY] < -s.currentPageIndex * s.distance)) { + var tweenData = {}; + tweenData[s.paramXY] = -s.currentPageIndex * s.distance; + tweenData.ease = annie.Tween.backOut; + annie.Tween.to(s.view, 0.2, tweenData); + } + else { + if (Math.abs(ts) > 100 && !s._isBreak) { + s.slideTo(ts < 0); } } } @@ -755,13 +733,21 @@ var annieUI; return; } if (isNext) { - s.currentPageIndex++; + if (s.currentPageIndex < s.listLen - 1) { + s.currentPageIndex++; + } + else { + return; + } } else { - s.currentPageIndex--; + if (s.currentPageIndex > 0) { + s.currentPageIndex--; + } + else { + return; + } } - if (s.currentPageIndex < 0 || s.currentPageIndex >= s.listLen) - return; if (!s.pageList[s.currentPageIndex]) { s.pageList[s.currentPageIndex] = new s.pageClassList[s.currentPageIndex](); s.pageList[s.currentPageIndex][s.paramXY] = s.currentPageIndex * s.distance; @@ -1430,7 +1416,6 @@ var annieUI; item[s.paramXY] = id * s._itemDis; id++; } - trace("flushData"); }; /** * 设置可见区域,可见区域的坐标始终在本地坐标中0,0点位置 diff --git a/build/annieUI.min.js b/build/annieUI.min.js index 4f1a591a..22c9850f 100644 --- a/build/annieUI.min.js +++ b/build/annieUI.min.js @@ -1 +1 @@ -var __extends=this&&this.__extends||function(e,t){function a(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)},annieUI;!function(e){var t=annie.Sprite,a=annie.Shape,i=function(e){function i(i,n,s,r){void 0===r&&(r=!0),e.call(this),this.isVertical=!0,this.viewWidth=0,this.viewHeight=0,this.maxDistance=1040,this.distance=0,this.minDis=2,this.maskObj=new a,this.view=new t,this.lastValue=0,this.speed=0,this.addSpeed=0,this.isStop=!0,this.maxSpeed=100,this.fSpeed=20,this.paramXY="y",this.stopTimes=-1,this.isMouseDown=!1,this.autoScroll=!1;var o=this;o._instanceType="annieUI.ScrollPage",o.isVertical=r,o.maskObj.alpha=0,o.addChild(o.maskObj),o.addChild(o.view),o.view.mask=o.maskObj,o.maxDistance=s,o.setViewRect(i,n),o.addEventListener(annie.MouseEvent.MOUSE_DOWN,o.onMouseEvent.bind(o)),o.addEventListener(annie.MouseEvent.MOUSE_MOVE,o.onMouseEvent.bind(o)),o.addEventListener(annie.MouseEvent.MOUSE_UP,o.onMouseEvent.bind(o)),o.addEventListener(annie.MouseEvent.MOUSE_OUT,o.onMouseEvent.bind(o)),o.addEventListener(annie.Event.ENTER_FRAME,function(){var e=o.view;if(!o.autoScroll)if(o.isStop)o.stopTimes>=0&&(o.stopTimes++,o.stopTimes>=15&&(o.speed=0,(e[o.paramXY]>0||e[o.paramXY]0)e[o.paramXY]+=o.speed,e[o.paramXY]>0||e[o.paramXY]0&&(o.speed=0);else if(0!=o.addSpeed){if(e[o.paramXY]>0||e[o.paramXY]0&&o.distance0?o.dispatchEvent("onScrollToEnd"):o.dispatchEvent("onScrollToStart"))}}else o.isStop=!0})}return __extends(i,e),i.prototype.changeDirection=function(e){void 0===e&&(e=!0);var t=this;t.isVertical=e,e?(t.distance=t.viewHeight,t.paramXY="y"):(t.distance=t.viewWidth,t.paramXY="x")},i.prototype.setViewRect=function(e,t){var a=this;a.maskObj.clear(),a.maskObj.beginFill("#000000"),a.maskObj.drawRect(0,0,e,t),a.viewWidth=e,a.viewHeight=t,a.maskObj.endFill(),a.isVertical?(a.distance=a.viewHeight,a.paramXY="y"):(a.distance=a.viewWidth,a.paramXY="x")},i.prototype.onMouseEvent=function(e){var t=this;if(!t.autoScroll){var a=t.view;if(e.type==annie.MouseEvent.MOUSE_DOWN)t.isStop||(t.isStop=!0),t.isVertical?t.lastValue=e.localY:t.lastValue=e.localX,t.speed=0,t.isMouseDown=!0;else if(e.type==annie.MouseEvent.MOUSE_MOVE){if(!t.isMouseDown)return;var i=void 0;if(i=t.isVertical?e.localY:e.localX,t.speed=i-t.lastValue,t.speed>t.minDis?(t.addSpeed=-2,t.speed>t.maxSpeed&&(t.speed=t.maxSpeed)):t.speed<-t.minDis?(t.speed<-t.maxSpeed&&(t.speed=-t.maxSpeed),t.addSpeed=2):t.speed=0,0!=t.speed){var n=1;(a[t.paramXY]>0||a[t.paramXY]>1,t.bitmap.y=t.radio-t.photo.height*a>>1,0==t.maskType?t.maskObj.drawCircle(t.radio>>1,t.radio>>1,t.radio>>1):t.maskObj.drawRect(0,0,t.radio,t.radio),t.maskObj.endFill(),t.dispatchEvent("onComplete")},t.addChild(t.bitmap),t.bitmap.mask=t.maskObj}return __extends(t,e),t.prototype.init=function(e,t,a){void 0===t&&(t=0),void 0===a&&(a=0);var i=this;i.radio=t,i.photo.src!=e&&(i.photo.src=e),i.maskType!=a&&(i.maskType=a)},t}(t);e.FacePhoto=a}(annieUI||(annieUI={}));var annieUI;!function(e){var t=annie.Sprite,a=function(e){function t(t,a,i){void 0===i&&(i=!0),e.call(this),this.listLen=0,this.view=new annie.Sprite,this.maskObj=new annie.Shape,this.slideSpeed=.4,this.touchStartX=0,this.touchStartY=0,this.distance=0,this.touchEndX=0,this.movingX=0,this.movingY=0,this.touchEndY=0,this.currentPageIndex=0,this.isMoving=!1,this.viewWidth=0,this.viewHeight=0,this.pageList=[],this.pageClassList=[],this.fSpeed=10,this.isMouseDown=!1,this.canSlideNext=!0,this.canSlidePrev=!0,this.paramXY="y";var n=this;n.isVertical=i,i?(n.paramXY="y",n.distance=a):(n.paramXY="x",n.distance=t),n.maskObj.alpha=0,n.addChild(n.maskObj),n.addChild(n.view),n.view.mask=n.maskObj,n.setMask(t,a);var s=n.onMouseEvent.bind(n);n.addEventListener(annie.MouseEvent.MOUSE_DOWN,s),n.addEventListener(annie.MouseEvent.MOUSE_MOVE,s),n.addEventListener(annie.MouseEvent.MOUSE_UP,s)}return __extends(t,e),t.prototype.setMask=function(e,t){var a=this;a.maskObj.clear(),a.maskObj.beginFill("#000000"),a.maskObj.drawRect(0,0,e,t),a.viewWidth=e,a.viewHeight=t,a.maskObj.endFill()},t.prototype.onMouseEvent=function(e){var t=this;if(!t.isMoving)if(e.type==annie.MouseEvent.MOUSE_DOWN)t.touchStartX=t.touchEndX=e.localX,t.touchStartY=t.touchEndY=e.localY,t.movingX=t.movingY=0,t.isMouseDown=!0;else if(e.type==annie.MouseEvent.MOUSE_MOVE){var a=e.localX-t.touchEndX,i=e.localY-t.touchEndY;0!=t.movingX&&0!=t.movingY&&(t.movingX>0&&0>a||t.movingX<0&&a>0||t.movingY>0&&0>i||t.movingY<0&&i>0)&&(t.isMouseDown=!1),t.touchEndX=e.localX,t.touchEndY=e.localY,t.movingX=a,t.movingY=i;var n=t.touchStartY,s=t.touchEndY;t.isVertical||(n=t.touchStartX,s=t.touchEndX),(0==t.currentPageIndex&&s>n||t.currentPageIndex==t.listLen-1&&n>s)&&(t.view[t.paramXY]+=(s-n)/t.distance*t.fSpeed*.6)}else if(e.type==annie.MouseEvent.MOUSE_UP){if(!t.isMouseDown)return;t.isMouseDown=!1,t.touchEndX=e.localX,t.touchEndY=e.localY;var r=!0,n=t.touchStartY,s=t.touchEndY;t.isVertical||(n=t.touchStartX,s=t.touchEndX);var o=Math.abs(n-s);if(o>.2*t.distance){r=n>s;var p=0,h=!0;if(r?t.currentPageIndex>=t.listLen-1&&(p=-t.distance*(t.listLen-1),h=!1):t.currentPageIndex<=0&&(h=!1),h)t.slideTo(r);else{var d={};d[t.paramXY]=p,d.ease=annie.Tween.backOut,annie.Tween.to(t.view,.5*t.slideSpeed,d)}}}},t.prototype.slideTo=function(e){var t=this;if(!(t.isMoving||t.isMouseDown||(e?t.currentPageIndex++:t.currentPageIndex--,t.currentPageIndex<0||t.currentPageIndex>=t.listLen))){t.pageList[t.currentPageIndex]||(t.pageList[t.currentPageIndex]=new t.pageClassList[t.currentPageIndex],t.pageList[t.currentPageIndex][t.paramXY]=t.currentPageIndex*t.distance),t.view.addChild(t.pageList[t.currentPageIndex]),t.view.mouseEnable=!1,t.isMoving=!0;var a={};a[t.paramXY]=-t.currentPageIndex*t.distance,a.onComplete=function(){t.view.mouseEnable=!0,t.isMoving=!1,e?t.view.removeChild(t.pageList[t.currentPageIndex-1]):t.view.removeChild(t.pageList[t.currentPageIndex+1]),t.dispatchEvent("onSlideEnd")},annie.Tween.to(t.view,t.slideSpeed,a),t.dispatchEvent("onSlideStart",{isNext:e})}},t.prototype.addPageList=function(e){var t=this;if(t.pageClassList=t.pageClassList.concat(e),0==t.listLen&&t.pageClassList.length>0){var a=new t.pageClassList[0];t.pageList.push(a),t.view.addChild(a)}t.listLen=t.pageClassList.length},t}(t);e.SlidePage=a}(annieUI||(annieUI={}));var annieUI;!function(e){var t=annie.Sprite,a=annie.Shape,i=annie.Event,n=annie.MouseEvent,s=annie.Point,r=function(e){function r(){e.call(this),this.totalPage=0,this.currPage=0,this.state="stop",this.timerArg0=0,this.timerArg1=0,this.px=0,this.py=0,this.rPage0=new t,this.rPage1=new t,this.pageMC=new t,this.leftPage=null,this.rightPage=null,this.rMask0=new a,this.rMask1=new a,this.shadow0=new a,this.shadow1=new a,this.sMask0=new a,this.sMask1=new a,this.pages=[],this.stageMP=new s,this.canFlip=!0,this._instanceType="annieUI.FlipBook"}return __extends(r,e),r.prototype.init=function(e,t,a,r){var o=this;o.getPageCallback=r,o.bW=e,o.bH=t,o.totalPage=a,o.currPage=o.toPage=0,o.crossGap=Math.sqrt(o.bW*o.bW+o.bH*o.bH),o.p1=new s(0,0),o.p2=new s(0,o.bH),o.p3=new s(o.bW+o.bW,0),o.p4=new s(o.bW+o.bW,o.bH),o.limitP1=new s(o.bW,0),o.limitP2=new s(o.bW,o.bH),o.toPosArr=[o.p3,o.p4,o.p1,o.p2],o.myPosArr=[o.p1,o.p2,o.p3,o.p4],o.addChild(o.pageMC),o.addChild(o.rPage0),o.addChild(o.shadow0),o.addChild(o.rPage1),o.addChild(o.shadow1),o.setShadowMask(o.shadow0,o.sMask0,1.5*o.bW,3*o.bH),o.setShadowMask(o.shadow1,o.sMask1,1.5*o.bW,3*o.bH),o.shadow0.visible=!1,o.shadow1.visible=!1,o.rPage1.mask=o.rMask1,o.rPage0.mask=o.rMask0,o.setPage(o.currPage),o.stage.addEventListener(n.MOUSE_DOWN,o.onMouseDown.bind(o)),o.stage.addEventListener(n.MOUSE_UP,o.onMouseUp.bind(o)),o.stage.addEventListener(n.MOUSE_MOVE,o.onMouseMove.bind(o)),o.addEventListener(i.ENTER_FRAME,o.onEnterFrame.bind(o))},r.prototype.drawPage=function(e,t){var a,i,n=this;1==e?(t=n.checkLimit(t,n.limitP1,n.bW),t=n.checkLimit(t,n.limitP2,n.crossGap),i=n.getBookArr(t,n.p1,n.p2),a=i[1],n.getLayerArr(t,a,n.p1,n.p2,n.limitP1,n.limitP2),n.getShadow(n.shadow0,n.sMask0,n.p1,t,[n.p1,n.p3,n.p4,n.p2],.5),n.getShadow(n.shadow1,n.sMask1,n.p1,t,n.layer1Arr,.45),n.rPage1.rotation=n.angle(t,a)+90,n.rPage1.x=i[3].x,n.rPage1.y=i[3].y,n.rPage0.x=n.p1.x,n.rPage0.y=n.p1.y):2==e?(t=n.checkLimit(t,n.limitP2,n.bW),t=n.checkLimit(t,n.limitP1,n.crossGap),i=n.getBookArr(t,n.p2,n.p1),a=i[1],n.getLayerArr(t,a,n.p2,n.p1,n.limitP2,n.limitP1),n.getShadow(n.shadow0,n.sMask0,n.p2,t,[n.p1,n.p3,n.p4,n.p2],.5),n.getShadow(n.shadow1,n.sMask1,n.p2,t,n.layer1Arr,.45),n.rPage1.rotation=n.angle(t,a)-90,n.rPage1.x=i[2].x,n.rPage1.y=i[2].y,n.rPage0.x=n.p1.x,n.rPage0.y=n.p1.y):3==e?(t=n.checkLimit(t,n.limitP1,n.bW),t=n.checkLimit(t,n.limitP2,n.crossGap),i=n.getBookArr(t,n.p3,n.p4),a=i[1],n.getLayerArr(t,a,n.p3,n.p4,n.limitP1,n.limitP2),n.getShadow(n.shadow0,n.sMask0,n.p3,t,[n.p1,n.p3,n.p4,n.p2],.5),n.getShadow(n.shadow1,n.sMask1,n.p3,t,n.layer1Arr,.4),n.rPage1.rotation=n.angle(t,a)+90,n.rPage1.x=t.x,n.rPage1.y=t.y,n.rPage0.x=n.limitP1.x,n.rPage0.y=n.limitP1.y):(t=n.checkLimit(t,n.limitP2,n.bW),t=n.checkLimit(t,n.limitP1,n.crossGap),i=n.getBookArr(t,n.p4,n.p3),a=i[1],n.getLayerArr(t,a,n.p4,n.p3,n.limitP2,n.limitP1),n.getShadow(n.shadow0,n.sMask0,n.p4,t,[n.p1,n.p3,n.p4,n.p2],.5),n.getShadow(n.shadow1,n.sMask1,n.p4,t,n.layer1Arr,.4),n.rPage1.rotation=n.angle(t,a)-90,n.rPage1.x=a.x,n.rPage1.y=a.y,n.rPage0.x=n.limitP1.x,n.rPage0.y=n.limitP1.y),n.getShape(n.rMask1,n.layer1Arr),n.getShape(n.rMask0,n.layer0Arr)},r.prototype.checkLimit=function(e,t,a){var i=this,n=Math.abs(i.pos(t,e)),r=i.angle(t,e);if(n>a){var o=a*Math.sin(r/180*Math.PI),p=a*Math.cos(r/180*Math.PI);e=new s(t.x-p,t.y-o)}return e},r.prototype.getPage=function(e){var t=this;return t.pages[e-1]||(t.pages[e-1]=t.getPageCallback(e)),t.pages[e-1]},r.prototype.getBookArr=function(e,t,a){var i=this,n=[],r=Math.abs(.5*i.pos(t,e)),o=i.angle(t,e),p=r/Math.cos(o/180*Math.PI),h=new s(t.x-p,t.y),d=i.angle(e,h)-i.angle(e,a),l=i.pos(e,a),g=l*Math.sin(d/180*Math.PI),c=l*Math.cos(d/180*Math.PI),m=new s(t.x+c,t.y+g),u=i.angle(h,e),v=i.bW*Math.sin(u/180*Math.PI),P=i.bW*Math.cos(u/180*Math.PI),w=new s(m.x+P,m.y+v),M=new s(e.x+P,e.y+v);return n.push(e),n.push(m),n.push(w),n.push(M),n},r.prototype.getLayerArr=function(e,t,a,i,n,r){var o=this,p=[],h=[],d=Math.abs(.5*o.pos(a,e)),l=o.angle(a,e),g=d/Math.sin(l/180*Math.PI),c=d/Math.cos(l/180*Math.PI),m=new s(a.x-c,a.y),u=new s(a.x,a.y-g),v=t,P=Math.abs(o.pos(e,i));if(P>o.bH){p.push(v);var w=Math.abs(.5*o.pos(v,i)),M=w/Math.cos(l/180*Math.PI);u=new s(i.x-M,i.y)}else h.push(i);p.push(u),p.push(m),p.push(e),o.layer1Arr=p,h.push(r),h.push(n),h.push(m),h.push(u),o.layer0Arr=h},r.prototype.getShape=function(e,t){var a=t.length;e.clear(),e.beginFill("#000"),e.moveTo(t[0].x,t[0].y);for(var i=1;a>i;i++)e.lineTo(t[i].x,t[i].y);e.endFill()},r.prototype.setShadowMask=function(e,t,a,i){e.beginLinearGradientFill(["rgba(0,0,0,0)","rgba(0,0,0,0.6)"],[0,1],[.5*-a,4,.5*a,4]),e.drawRect(.5*-a,.5*-i,.5*a,i),e.endFill(),e.beginLinearGradientFill(["rgba(0,0,0,0)","rgba(0,0,0,0.6)"],[1,0],[.5*-a,4,.5*a,4]),e.drawRect(0,.5*-i,.5*a,i),e.endFill(),e.mask=t},r.prototype.getShadow=function(e,t,a,i,n,s){var r,o,p=this;e.visible=!0,e.x=i.x+(a.x-i.x)*s,e.y=i.y+(a.y-i.y)*s,e.rotation=p.angle(a,i),r=.5*Math.abs(a.x-i.x)/p.bW,o=1-r*r,e.scaleX=r+.1,e.alpha=o+.1,p.getShape(t,n)},r.prototype.setPage=function(e){var t=this;e>0&&e<=t.totalPage&&(t.leftPage=t.getPage(e),t.leftPage.x=t.leftPage.y=0,t.pageMC.addChild(t.leftPage)),e+1>0&&e+10&&(t.timerArg0<3&&t.currPage>0||t.timerArg0>2&&t.currPage<=t.totalPage-2)&&(t.state="start",t.flushPage(),e.updateAfterEvent(),t.dispatchEvent("onFlipStart"))}},r.prototype.onMouseUp=function(e){var t=this;if("start"==t.state){t.stageMP.x=e.clientX,t.stageMP.y=e.clientY;var a=t.globalToLocal(t.stageMP);t.timerArg1=t.checkArea(a),t.state="auto",t.stageMP=a}},r.prototype.onMouseMove=function(e){var t=this;if("start"==t.state){t.stageMP.x=e.clientX,t.stageMP.y=e.clientY;var a=t.globalToLocal(t.stageMP);t.stageMP=a}},r.prototype.checkArea=function(e){var t,a=this,i=0,n=a.bW+a.bW,s=0,r=a.bH,o=50;return e.x>i&&e.x<=.5*n?(t=e.y>s&&e.y<=.5*r?1:e.y>.5*r&&e.ys&&e.y<=s+o?-1:e.y>r-o&&e.y.5*n&&e.xs&&e.y<=.5*r?3:e.y>.5*r&&e.y=n-o&&(t=e.y>s&&e.y<=s+o?-3:e.y>r-o&&e.y=0&&et?1:3,a.timerArg1=-1,a.toPage=e>a.totalPage?a.totalPage:e,a.state="auto",a.flushPage())},r.prototype.flushPage=function(){var e,t,a=this,i=a.myPosArr[a.timerArg0-1],n=null;1==a.timerArg0||2==a.timerArg0?(a.toPage=a.toPage==a.currPage?a.currPage-2:a.toPage,e=a.currPage,t=a.toPage+1,this.pageMC.removeChild(this.leftPage),a.currPage-2>0&&(n=a.getPage(a.currPage-2),n.x=0,this.leftPage=n,this.pageMC.addChild(n))):3!=a.timerArg0&&4!=a.timerArg0||(a.toPage=a.toPage==a.currPage?a.currPage+2:a.toPage,e=a.currPage+1,t=a.toPage,this.pageMC.removeChild(this.rightPage),a.currPage+30&&e<=a.totalPage&&(n=a.getPage(e),n.x=0,n.y=0,a.rPage0.addChild(n)),t>0&&t<=a.totalPage&&(n=a.getPage(t),n.x=0,n.y=0,a.rPage1.addChild(n))},r.prototype.onEnterFrame=function(e){var t,a,i,n,r,o,p=this,h=p.toPosArr[p.timerArg0-1],d=p.myPosArr[p.timerArg0-1];if("start"==p.state){o=.4;var l=p.stageMP;p.px+=(l.x-p.px)*o>>0,p.py+=(l.y-p.py)*o>>0;var g=new s(p.px,p.py);p.drawPage(p.timerArg0,g)}else"auto"==p.state&&(Math.abs(h.x-p.px)>1.5*p.bW&&p.timerArg1>0?(t=d.x,a=d.y,i=0):(t=h.x,a=h.y,i=1),n=t-p.px>>0,r=a-p.py>>0,p.timerArg1<0?(o=.3,p.py=p.arc(p.bW,n,h.y)):(o=.4,p.py=r*o+p.py),p.px=n*o+p.px,p.drawPage(p.timerArg0,new s(p.px,p.py)),0==n&&0==r&&(p.rPage0.removeAllChildren(),p.rPage1.removeAllChildren(),p.shadow0.visible=!1,p.shadow1.visible=!1,p.toPage=0==i?p.currPage:p.toPage,p.currPage=p.toPage,p.pageMC.removeAllChildren(),p.setPage(p.currPage),p.state="stop",p.dispatchEvent("onFlipStop")))},r.prototype.arc=function(e,t,a){var i=2*e,n=e*e+i*i,s=Math.abs(t)-e;return a-(Math.sqrt(n-s*s)-i)},r.prototype.angle=function(e,t){var a=e.x-t.x,i=e.y-t.y,n=180*Math.atan2(i,a)/Math.PI;return 0>n?n+360:n},r.prototype.pos=function(e,t){var a=e.x-t.x,i=e.y-t.y,n=Math.sqrt(a*a+i*i);return e.x>t.x?n:-n},r}(t);e.FlipBook=r}(annieUI||(annieUI={}));var annieUI;!function(e){var t=function(e){function t(t,a,i,n,s){void 0===s&&(s=!0),e.call(this,i,n,0,s),this._items=null,this._itemCount=0,this._isInit=!1,this._data=[],this.gp=new annie.Point,this.lp=new annie.Point,this.downL=null;var r=this;r._instanceType="annieUI.ScrollList",r._itemDis=a,r._items=[],r._itemClass=t,r.maxSpeed=50,r._updateViewRect(),r.addEventListener(annie.Event.ENTER_FRAME,function(e){if(0!=r.speed){var t=null;t=r.speed<0?r._items[0]:r._items[r._items.length-1];var a=r.lp,i=r.gp;a.x=t.x,a.y=t.y,r.view.localToGlobal(a,i),r.globalToLocal(i,a);var n=0;r.speed<0?(a[r.paramXY]+=r._itemDis,n=t.id+r._itemCount,a[r.paramXY]<0&&nr.distance&&n>=0&&(t.initData(n,r._data[n]),t[r.paramXY]=t.id*r._itemDis,r._items.unshift(r._items.pop())))}})}return __extends(t,e),Object.defineProperty(t.prototype,"loadingView",{get:function(){return this.downL},enumerable:!0,configurable:!0}),t.prototype.updateData=function(e,t){void 0===t&&(t=!1);var a=this;if(!a._isInit||t?(a._data=e,a._isInit=!0):a._data=a._data.concat(e),this.flushData(),a.maxDistance=a._data.length*a._itemDis,a.downL){a.downL[a.paramXY]=Math.max(a.distance,a.maxDistance);var i=a.downL.getWH();a.maxDistance+="x"==a.paramXY?i.width:i.height}},t.prototype.flushData=function(){var e=this,t=0;e._items.length>0&&(t=Math.abs(Math.ceil(e.view[e.paramXY]/e._itemDis)));for(var a=0;a0&&this._updateViewRect()},t.prototype._updateViewRect=function(){var e=this,t=Math.ceil(e.distance/e._itemDis)+4;if(t!=e._itemCount){if(t>e._itemCount){var a=0;e._itemCount>0&&(a=e._items[e._itemCount-1].id+1);for(var i=e._itemCount;t>i;i++){var n=new e._itemClass;e._items.push(n),e.view.addChild(n),a++}}else for(var i=0;i=0&&(o.stopTimes++,o.stopTimes>=15&&(o.speed=0,(e[o.paramXY]>0||e[o.paramXY]0)e[o.paramXY]+=o.speed,e[o.paramXY]>0||e[o.paramXY]0&&(o.speed=0);else if(0!=o.addSpeed){if(e[o.paramXY]>0||e[o.paramXY]0&&o.distance0?o.dispatchEvent("onScrollToEnd"):o.dispatchEvent("onScrollToStart"))}}else o.isStop=!0})}return __extends(i,e),i.prototype.changeDirection=function(e){void 0===e&&(e=!0);var t=this;t.isVertical=e,e?(t.distance=t.viewHeight,t.paramXY="y"):(t.distance=t.viewWidth,t.paramXY="x")},i.prototype.setViewRect=function(e,t){var a=this;a.maskObj.clear(),a.maskObj.beginFill("#000000"),a.maskObj.drawRect(0,0,e,t),a.viewWidth=e,a.viewHeight=t,a.maskObj.endFill(),a.isVertical?(a.distance=a.viewHeight,a.paramXY="y"):(a.distance=a.viewWidth,a.paramXY="x")},i.prototype.onMouseEvent=function(e){var t=this;if(!t.autoScroll){var a=t.view;if(e.type==annie.MouseEvent.MOUSE_DOWN)t.isStop||(t.isStop=!0),t.isVertical?t.lastValue=e.localY:t.lastValue=e.localX,t.speed=0,t.isMouseDown=!0;else if(e.type==annie.MouseEvent.MOUSE_MOVE){if(!t.isMouseDown)return;var i=void 0;if(i=t.isVertical?e.localY:e.localX,t.speed=i-t.lastValue,t.speed>t.minDis?(t.addSpeed=-2,t.speed>t.maxSpeed&&(t.speed=t.maxSpeed)):t.speed<-t.minDis?(t.speed<-t.maxSpeed&&(t.speed=-t.maxSpeed),t.addSpeed=2):t.speed=0,0!=t.speed){var s=1;(a[t.paramXY]>0||a[t.paramXY]>1,t.bitmap.y=t.radio-t.photo.height*a>>1,0==t.maskType?t.maskObj.drawCircle(t.radio>>1,t.radio>>1,t.radio>>1):t.maskObj.drawRect(0,0,t.radio,t.radio),t.maskObj.endFill(),t.dispatchEvent("onComplete")},t.addChild(t.bitmap),t.bitmap.mask=t.maskObj}return __extends(t,e),t.prototype.init=function(e,t,a){void 0===t&&(t=0),void 0===a&&(a=0);var i=this;i.radio=t,i.photo.src!=e&&(i.photo.src=e),i.maskType!=a&&(i.maskType=a)},t}(t);e.FacePhoto=a}(annieUI||(annieUI={}));var annieUI;!function(e){var t=annie.Sprite,a=function(e){function t(t,a,i){void 0===i&&(i=!0),e.call(this),this.listLen=0,this.view=new annie.Sprite,this.maskObj=new annie.Shape,this.slideSpeed=.3,this._isBreak=!1,this.distance=0,this.touchEndX=0,this.movingX=0,this.movingY=0,this.touchEndY=0,this.currentPageIndex=0,this.isMoving=!1,this.viewWidth=0,this.viewHeight=0,this.pageList=[],this.pageClassList=[],this.fSpeed=10,this.isMouseDown=!1,this.canSlideNext=!0,this.canSlidePrev=!0,this.paramXY="y";var s=this;s.isVertical=i,i?(s.paramXY="y",s.distance=a):(s.paramXY="x",s.distance=t),s.maskObj.alpha=0,s.addChild(s.maskObj),s.addChild(s.view),s.view.mask=s.maskObj,s.setMask(t,a);var n=s.onMouseEvent.bind(s);s.addEventListener(annie.MouseEvent.MOUSE_DOWN,n),s.addEventListener(annie.MouseEvent.MOUSE_MOVE,n),s.addEventListener(annie.MouseEvent.MOUSE_UP,n)}return __extends(t,e),t.prototype.setMask=function(e,t){var a=this;a.maskObj.clear(),a.maskObj.beginFill("#000000"),a.maskObj.drawRect(0,0,e,t),a.viewWidth=e,a.viewHeight=t,a.maskObj.endFill()},t.prototype.onMouseEvent=function(e){var t=this;if(!t.isMoving)if(e.type==annie.MouseEvent.MOUSE_DOWN)t.touchEndX=e.localX,t.touchEndY=e.localY,t.movingX=t.movingY=0,t.isMouseDown=!0,t._isBreak=!1;else if(e.type==annie.MouseEvent.MOUSE_MOVE){if(!t.isMouseDown)return;var a=e.localX-t.touchEndX,i=e.localY-t.touchEndY,s=i,n=t.movingY;t.isVertical||(s=a,n=t.movingX),Math.abs(s)-Math.abs(n)<1&&(t._isBreak=!0),trace(Math.abs(s)-Math.abs(n)),t.movingX=a,t.movingY=i,s>0&&0==t.currentPageIndex?t.view[t.paramXY]=.3*s:0>s&&t.currentPageIndex==t.listLen-1&&(t.view[t.paramXY]=-t.currentPageIndex*t.distance+.3*s)}else if(e.type==annie.MouseEvent.MOUSE_UP){if(!t.isMouseDown)return;t.isMouseDown=!1;var s=t.movingY;if(t.isVertical||(s=t.movingX),0==t.currentPageIndex&&t.view[t.paramXY]>0||t.currentPageIndex==t.listLen-1&&t.view[t.paramXY]<-t.currentPageIndex*t.distance){var r={};r[t.paramXY]=-t.currentPageIndex*t.distance,r.ease=annie.Tween.backOut,annie.Tween.to(t.view,.2,r)}else Math.abs(s)>100&&!t._isBreak&&t.slideTo(0>s)}},t.prototype.slideTo=function(e){var t=this;if(!t.isMoving&&!t.isMouseDown){if(e){if(!(t.currentPageIndex0))return;t.currentPageIndex--}t.pageList[t.currentPageIndex]||(t.pageList[t.currentPageIndex]=new t.pageClassList[t.currentPageIndex],t.pageList[t.currentPageIndex][t.paramXY]=t.currentPageIndex*t.distance),t.view.addChild(t.pageList[t.currentPageIndex]),t.view.mouseEnable=!1,t.isMoving=!0;var a={};a[t.paramXY]=-t.currentPageIndex*t.distance,a.onComplete=function(){t.view.mouseEnable=!0,t.isMoving=!1,e?t.view.removeChild(t.pageList[t.currentPageIndex-1]):t.view.removeChild(t.pageList[t.currentPageIndex+1]),t.dispatchEvent("onSlideEnd")},annie.Tween.to(t.view,t.slideSpeed,a),t.dispatchEvent("onSlideStart",{isNext:e})}},t.prototype.addPageList=function(e){var t=this;if(t.pageClassList=t.pageClassList.concat(e),0==t.listLen&&t.pageClassList.length>0){var a=new t.pageClassList[0];t.pageList.push(a),t.view.addChild(a)}t.listLen=t.pageClassList.length},t}(t);e.SlidePage=a}(annieUI||(annieUI={}));var annieUI;!function(e){var t=annie.Sprite,a=annie.Shape,i=annie.Event,s=annie.MouseEvent,n=annie.Point,r=function(e){function r(){e.call(this),this.totalPage=0,this.currPage=0,this.state="stop",this.timerArg0=0,this.timerArg1=0,this.px=0,this.py=0,this.rPage0=new t,this.rPage1=new t,this.pageMC=new t,this.leftPage=null,this.rightPage=null,this.rMask0=new a,this.rMask1=new a,this.shadow0=new a,this.shadow1=new a,this.sMask0=new a,this.sMask1=new a,this.pages=[],this.stageMP=new n,this.canFlip=!0,this._instanceType="annieUI.FlipBook"}return __extends(r,e),r.prototype.init=function(e,t,a,r){var o=this;o.getPageCallback=r,o.bW=e,o.bH=t,o.totalPage=a,o.currPage=o.toPage=0,o.crossGap=Math.sqrt(o.bW*o.bW+o.bH*o.bH),o.p1=new n(0,0),o.p2=new n(0,o.bH),o.p3=new n(o.bW+o.bW,0),o.p4=new n(o.bW+o.bW,o.bH),o.limitP1=new n(o.bW,0),o.limitP2=new n(o.bW,o.bH),o.toPosArr=[o.p3,o.p4,o.p1,o.p2],o.myPosArr=[o.p1,o.p2,o.p3,o.p4],o.addChild(o.pageMC),o.addChild(o.rPage0),o.addChild(o.shadow0),o.addChild(o.rPage1),o.addChild(o.shadow1),o.setShadowMask(o.shadow0,o.sMask0,1.5*o.bW,3*o.bH),o.setShadowMask(o.shadow1,o.sMask1,1.5*o.bW,3*o.bH),o.shadow0.visible=!1,o.shadow1.visible=!1,o.rPage1.mask=o.rMask1,o.rPage0.mask=o.rMask0,o.setPage(o.currPage),o.stage.addEventListener(s.MOUSE_DOWN,o.onMouseDown.bind(o)),o.stage.addEventListener(s.MOUSE_UP,o.onMouseUp.bind(o)),o.stage.addEventListener(s.MOUSE_MOVE,o.onMouseMove.bind(o)),o.addEventListener(i.ENTER_FRAME,o.onEnterFrame.bind(o))},r.prototype.drawPage=function(e,t){var a,i,s=this;1==e?(t=s.checkLimit(t,s.limitP1,s.bW),t=s.checkLimit(t,s.limitP2,s.crossGap),i=s.getBookArr(t,s.p1,s.p2),a=i[1],s.getLayerArr(t,a,s.p1,s.p2,s.limitP1,s.limitP2),s.getShadow(s.shadow0,s.sMask0,s.p1,t,[s.p1,s.p3,s.p4,s.p2],.5),s.getShadow(s.shadow1,s.sMask1,s.p1,t,s.layer1Arr,.45),s.rPage1.rotation=s.angle(t,a)+90,s.rPage1.x=i[3].x,s.rPage1.y=i[3].y,s.rPage0.x=s.p1.x,s.rPage0.y=s.p1.y):2==e?(t=s.checkLimit(t,s.limitP2,s.bW),t=s.checkLimit(t,s.limitP1,s.crossGap),i=s.getBookArr(t,s.p2,s.p1),a=i[1],s.getLayerArr(t,a,s.p2,s.p1,s.limitP2,s.limitP1),s.getShadow(s.shadow0,s.sMask0,s.p2,t,[s.p1,s.p3,s.p4,s.p2],.5),s.getShadow(s.shadow1,s.sMask1,s.p2,t,s.layer1Arr,.45),s.rPage1.rotation=s.angle(t,a)-90,s.rPage1.x=i[2].x,s.rPage1.y=i[2].y,s.rPage0.x=s.p1.x,s.rPage0.y=s.p1.y):3==e?(t=s.checkLimit(t,s.limitP1,s.bW),t=s.checkLimit(t,s.limitP2,s.crossGap),i=s.getBookArr(t,s.p3,s.p4),a=i[1],s.getLayerArr(t,a,s.p3,s.p4,s.limitP1,s.limitP2),s.getShadow(s.shadow0,s.sMask0,s.p3,t,[s.p1,s.p3,s.p4,s.p2],.5),s.getShadow(s.shadow1,s.sMask1,s.p3,t,s.layer1Arr,.4),s.rPage1.rotation=s.angle(t,a)+90,s.rPage1.x=t.x,s.rPage1.y=t.y,s.rPage0.x=s.limitP1.x,s.rPage0.y=s.limitP1.y):(t=s.checkLimit(t,s.limitP2,s.bW),t=s.checkLimit(t,s.limitP1,s.crossGap),i=s.getBookArr(t,s.p4,s.p3),a=i[1],s.getLayerArr(t,a,s.p4,s.p3,s.limitP2,s.limitP1),s.getShadow(s.shadow0,s.sMask0,s.p4,t,[s.p1,s.p3,s.p4,s.p2],.5),s.getShadow(s.shadow1,s.sMask1,s.p4,t,s.layer1Arr,.4),s.rPage1.rotation=s.angle(t,a)-90,s.rPage1.x=a.x,s.rPage1.y=a.y,s.rPage0.x=s.limitP1.x,s.rPage0.y=s.limitP1.y),s.getShape(s.rMask1,s.layer1Arr),s.getShape(s.rMask0,s.layer0Arr)},r.prototype.checkLimit=function(e,t,a){var i=this,s=Math.abs(i.pos(t,e)),r=i.angle(t,e);if(s>a){var o=a*Math.sin(r/180*Math.PI),p=a*Math.cos(r/180*Math.PI);e=new n(t.x-p,t.y-o)}return e},r.prototype.getPage=function(e){var t=this;return t.pages[e-1]||(t.pages[e-1]=t.getPageCallback(e)),t.pages[e-1]},r.prototype.getBookArr=function(e,t,a){var i=this,s=[],r=Math.abs(.5*i.pos(t,e)),o=i.angle(t,e),p=r/Math.cos(o/180*Math.PI),d=new n(t.x-p,t.y),h=i.angle(e,d)-i.angle(e,a),l=i.pos(e,a),g=l*Math.sin(h/180*Math.PI),c=l*Math.cos(h/180*Math.PI),m=new n(t.x+c,t.y+g),u=i.angle(d,e),v=i.bW*Math.sin(u/180*Math.PI),P=i.bW*Math.cos(u/180*Math.PI),w=new n(m.x+P,m.y+v),M=new n(e.x+P,e.y+v);return s.push(e),s.push(m),s.push(w),s.push(M),s},r.prototype.getLayerArr=function(e,t,a,i,s,r){var o=this,p=[],d=[],h=Math.abs(.5*o.pos(a,e)),l=o.angle(a,e),g=h/Math.sin(l/180*Math.PI),c=h/Math.cos(l/180*Math.PI),m=new n(a.x-c,a.y),u=new n(a.x,a.y-g),v=t,P=Math.abs(o.pos(e,i));if(P>o.bH){p.push(v);var w=Math.abs(.5*o.pos(v,i)),M=w/Math.cos(l/180*Math.PI);u=new n(i.x-M,i.y)}else d.push(i);p.push(u),p.push(m),p.push(e),o.layer1Arr=p,d.push(r),d.push(s),d.push(m),d.push(u),o.layer0Arr=d},r.prototype.getShape=function(e,t){var a=t.length;e.clear(),e.beginFill("#000"),e.moveTo(t[0].x,t[0].y);for(var i=1;a>i;i++)e.lineTo(t[i].x,t[i].y);e.endFill()},r.prototype.setShadowMask=function(e,t,a,i){e.beginLinearGradientFill(["rgba(0,0,0,0)","rgba(0,0,0,0.6)"],[0,1],[.5*-a,4,.5*a,4]),e.drawRect(.5*-a,.5*-i,.5*a,i),e.endFill(),e.beginLinearGradientFill(["rgba(0,0,0,0)","rgba(0,0,0,0.6)"],[1,0],[.5*-a,4,.5*a,4]),e.drawRect(0,.5*-i,.5*a,i),e.endFill(),e.mask=t},r.prototype.getShadow=function(e,t,a,i,s,n){var r,o,p=this;e.visible=!0,e.x=i.x+(a.x-i.x)*n,e.y=i.y+(a.y-i.y)*n,e.rotation=p.angle(a,i),r=.5*Math.abs(a.x-i.x)/p.bW,o=1-r*r,e.scaleX=r+.1,e.alpha=o+.1,p.getShape(t,s)},r.prototype.setPage=function(e){var t=this;e>0&&e<=t.totalPage&&(t.leftPage=t.getPage(e),t.leftPage.x=t.leftPage.y=0,t.pageMC.addChild(t.leftPage)),e+1>0&&e+10&&(t.timerArg0<3&&t.currPage>0||t.timerArg0>2&&t.currPage<=t.totalPage-2)&&(t.state="start",t.flushPage(),e.updateAfterEvent(),t.dispatchEvent("onFlipStart"))}},r.prototype.onMouseUp=function(e){var t=this;if("start"==t.state){t.stageMP.x=e.clientX,t.stageMP.y=e.clientY;var a=t.globalToLocal(t.stageMP);t.timerArg1=t.checkArea(a),t.state="auto",t.stageMP=a}},r.prototype.onMouseMove=function(e){var t=this;if("start"==t.state){t.stageMP.x=e.clientX,t.stageMP.y=e.clientY;var a=t.globalToLocal(t.stageMP);t.stageMP=a}},r.prototype.checkArea=function(e){var t,a=this,i=0,s=a.bW+a.bW,n=0,r=a.bH,o=50;return e.x>i&&e.x<=.5*s?(t=e.y>n&&e.y<=.5*r?1:e.y>.5*r&&e.yn&&e.y<=n+o?-1:e.y>r-o&&e.y.5*s&&e.xn&&e.y<=.5*r?3:e.y>.5*r&&e.y=s-o&&(t=e.y>n&&e.y<=n+o?-3:e.y>r-o&&e.y=0&&et?1:3,a.timerArg1=-1,a.toPage=e>a.totalPage?a.totalPage:e,a.state="auto",a.flushPage())},r.prototype.flushPage=function(){var e,t,a=this,i=a.myPosArr[a.timerArg0-1],s=null;1==a.timerArg0||2==a.timerArg0?(a.toPage=a.toPage==a.currPage?a.currPage-2:a.toPage,e=a.currPage,t=a.toPage+1,this.pageMC.removeChild(this.leftPage),a.currPage-2>0&&(s=a.getPage(a.currPage-2),s.x=0,this.leftPage=s,this.pageMC.addChild(s))):3!=a.timerArg0&&4!=a.timerArg0||(a.toPage=a.toPage==a.currPage?a.currPage+2:a.toPage,e=a.currPage+1,t=a.toPage,this.pageMC.removeChild(this.rightPage),a.currPage+30&&e<=a.totalPage&&(s=a.getPage(e),s.x=0,s.y=0,a.rPage0.addChild(s)),t>0&&t<=a.totalPage&&(s=a.getPage(t),s.x=0,s.y=0,a.rPage1.addChild(s))},r.prototype.onEnterFrame=function(e){var t,a,i,s,r,o,p=this,d=p.toPosArr[p.timerArg0-1],h=p.myPosArr[p.timerArg0-1];if("start"==p.state){o=.4;var l=p.stageMP;p.px+=(l.x-p.px)*o>>0,p.py+=(l.y-p.py)*o>>0;var g=new n(p.px,p.py);p.drawPage(p.timerArg0,g)}else"auto"==p.state&&(Math.abs(d.x-p.px)>1.5*p.bW&&p.timerArg1>0?(t=h.x,a=h.y,i=0):(t=d.x,a=d.y,i=1),s=t-p.px>>0,r=a-p.py>>0,p.timerArg1<0?(o=.3,p.py=p.arc(p.bW,s,d.y)):(o=.4,p.py=r*o+p.py),p.px=s*o+p.px,p.drawPage(p.timerArg0,new n(p.px,p.py)),0==s&&0==r&&(p.rPage0.removeAllChildren(),p.rPage1.removeAllChildren(),p.shadow0.visible=!1,p.shadow1.visible=!1,p.toPage=0==i?p.currPage:p.toPage,p.currPage=p.toPage,p.pageMC.removeAllChildren(),p.setPage(p.currPage),p.state="stop",p.dispatchEvent("onFlipStop")))},r.prototype.arc=function(e,t,a){var i=2*e,s=e*e+i*i,n=Math.abs(t)-e;return a-(Math.sqrt(s-n*n)-i)},r.prototype.angle=function(e,t){var a=e.x-t.x,i=e.y-t.y,s=180*Math.atan2(i,a)/Math.PI;return 0>s?s+360:s},r.prototype.pos=function(e,t){var a=e.x-t.x,i=e.y-t.y,s=Math.sqrt(a*a+i*i);return e.x>t.x?s:-s},r}(t);e.FlipBook=r}(annieUI||(annieUI={}));var annieUI;!function(e){var t=function(e){function t(t,a,i,s,n){void 0===n&&(n=!0),e.call(this,i,s,0,n),this._items=null,this._itemCount=0,this._isInit=!1,this._data=[],this.gp=new annie.Point,this.lp=new annie.Point,this.downL=null;var r=this;r._instanceType="annieUI.ScrollList",r._itemDis=a,r._items=[],r._itemClass=t,r.maxSpeed=50,r._updateViewRect(),r.addEventListener(annie.Event.ENTER_FRAME,function(e){if(0!=r.speed){var t=null;t=r.speed<0?r._items[0]:r._items[r._items.length-1];var a=r.lp,i=r.gp;a.x=t.x,a.y=t.y,r.view.localToGlobal(a,i),r.globalToLocal(i,a);var s=0;r.speed<0?(a[r.paramXY]+=r._itemDis,s=t.id+r._itemCount,a[r.paramXY]<0&&sr.distance&&s>=0&&(t.initData(s,r._data[s]),t[r.paramXY]=t.id*r._itemDis,r._items.unshift(r._items.pop())))}})}return __extends(t,e),Object.defineProperty(t.prototype,"loadingView",{get:function(){return this.downL},enumerable:!0,configurable:!0}),t.prototype.updateData=function(e,t){void 0===t&&(t=!1);var a=this;if(!a._isInit||t?(a._data=e,a._isInit=!0):a._data=a._data.concat(e),this.flushData(),a.maxDistance=a._data.length*a._itemDis,a.downL){a.downL[a.paramXY]=Math.max(a.distance,a.maxDistance);var i=a.downL.getWH();a.maxDistance+="x"==a.paramXY?i.width:i.height}},t.prototype.flushData=function(){var e=this,t=0;e._items.length>0&&(t=Math.abs(Math.ceil(e.view[e.paramXY]/e._itemDis)));for(var a=0;a0&&this._updateViewRect()},t.prototype._updateViewRect=function(){var e=this,t=Math.ceil(e.distance/e._itemDis)+4;if(t!=e._itemCount){if(t>e._itemCount){var a=0;e._itemCount>0&&(a=e._items[e._itemCount-1].id+1);for(var i=e._itemCount;t>i;i++){var s=new e._itemClass;e._items.push(s),e.view.addChild(s),a++}}else for(var i=0;i