text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("finger-mover"),require("simulation-scroll-y")):"function"==typeof define&&define.amd?define(["finger-mover","simulation-scroll-y"],e):"object"==typeof exports?exports.ScrollFlipPage=e(require("finger-mover"),require("simulation-scroll-y")):t.ScrollFlipPage=e(t["finger-mover"],t["simulation-scroll-y"])}(window,function(t,e){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=2)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){t.exports=n(3)},function(t,e,n){"use strict";n.r(e);var o=n(0),r=n.n(o),i=n(1),a=n.n(i),u=function(t,e){for(var n in e)t[n]=e[n];return t},c=function(){},s="PULL_DOWN",l="LOAD_MORE",f="INIT_FETCH";var d=function(t,e,n,o,r,i,a,u){var c,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),o&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},s._ssrRegister=c):r&&(c=u?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(s.functional){s._injectStyles=c;var l=s.render;s.render=function(t,e){return c.call(e),l(t,e)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:s}}({name:"ScrollFlipPage",data:function(){return{pageNum:0,currentData:[],noData:!1}},computed:{isNoData:function(){return this.noData||0===this.currentData.length}},model:{prop:"value",event:"set-data"},props:{scrollBar:{type:Boolean,default:!0},unidirectional:{type:Boolean,default:!1},bounce:{type:Boolean,default:!0},pullDown:{type:Object,default:function(){return{}}},loadMore:{type:Object,default:function(){return{}}},fetch:{type:Function,required:!0},dataField:{type:String,required:!0},check:{type:Function,required:!0},initial:{type:Boolean,default:!0},pageSize:{type:Number,default:20},startPage:{type:Number,default:0},interceptor:Function},methods:{scrollTo:function(t,e,n){this.fm[0].scrollTo(t,e,n)},loadEnd:function(){var t=this;setTimeout(function(){t.fm[0].loadEnd()},500)},refresh:function(t){this.fm[0].refresh(t)},refreshSize:function(){this.fm[0].refreshSize()},getValueByField:function(t,e){var n=t;return e.split(".").forEach(function(t){try{n=n[t]}catch(t){console.error("Error accessing '".concat(e,"': ")+t.toString())}}),n},setData:function(t){var e=this.interceptor&&this.interceptor(t);e?this.$emit("set-data",e):this.$emit("set-data",t)},fetchData:function(t){var e=this;return this.noData=!1,(t=t||f)!==f&&t!==s||(this.pageNum=this.startPage),t===l&&(this.pageNum+=1),this.fetch(this.pageNum).then(function(n){var o=e.getValueByField(n,e.dataField);e.check(n)?0===o.length&&e.pageNum===e.startPage?(e.$emit("on-nothing"),e.setData(o)):o.length<e.pageSize?(e.$emit("on-having"),e.noData=!0,t===f&&(e.currentData=[],e.setData(o),e.$nextTick(function(){e.scrollTo(0,0)}),e.pageNum-=1),t===l&&(e.setData(e.currentData.concat(o)),e.pageNum-=1,e.loadEnd()),t===s&&(e.pageNum-=1,e.refresh(function(){e.setData(o)}))):(e.$emit("on-having"),e.currentData=t===l?e.currentData.concat(o):o,t===f&&(e.setData(e.currentData),e.$nextTick(function(){e.scrollTo(0,0)})),t===l&&(e.setData(e.currentData),e.loadEnd()),t===s&&e.refresh(function(){e.setData(e.currentData)})):(e.$emit("on-backend-error",n),t===l&&(e.pageNum-=1,e.loadEnd()),t===s&&e.refresh())}).catch(function(n){e.$emit("on-network-error",n),t===l&&(e.pageNum-=1,e.loadEnd()),t===s&&e.refresh()})},handlePullDown:function(){this.fetchData(s),this.$emit("on-pull-refresh")},handleLoadMore:function(){this.fetchData(l),this.$emit("on-load-more")},createInstance:function(){var t=this;this.fm?this.fm[0].refreshSize():this.fm=new r.a({el:this.$el,plugins:[a()({scrollBar:this.scrollBar,unidirectional:this.unidirectional,bounce:this.bounce,pullDown:u({use:!0,distance:50,onBegin:c,onActive:this.handlePullDown,onAfter:c},this.pullDown),loadMore:u({distance:10,onLoadMore:this.handleLoadMore},this.loadMore),onTouchStart:function(e){t.$emit("on-touchstart",e)},onTouchMove:function(e){t.$emit("on-touchmove",e)},onTouchEnd:function(e){t.$emit("on-touchend",e)},onTransMove:function(e){t.$emit("on-transmove",e)},onTransMoveEnd:function(e){t.$emit("on-transmove-end",e)},onMotionStop:function(e){t.$emit("on-motion-stop",e)}})]})}},mounted:function(){this.createInstance(),this.initial&&this.fetchData(f)},updated:function(){this.createInstance()},created:function(){this.pageNum=this.startPage}},function(){var t=this.$createElement;return(this._self._c||t)("div",[this._t("pulldown"),this._v(" "),this._t("default"),this._v(" "),this._t("loadmore",null,{isNoData:this.isNoData})],2)},[],!1,null,null,null);d.options.__file="scroll-flip-page.vue";e.default=d.exports}])});