mescroll-body.js 5.8 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/mescroll-uni/mescroll-body"],{"0c0b":function(t,o,n){"use strict";n.d(o,"b",(function(){return e})),n.d(o,"c",(function(){return i})),n.d(o,"a",(function(){}));var e=function(){var t=this.$createElement;this._self._c},i=[]},"0c4d":function(t,o,n){"use strict";var e=n("44d7"),i=n.n(e);i.a},"44d7":function(t,o,n){},9049:function(t,o,n){"use strict";(function(t){var e=n("4ea4");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var i=e(n("a2f4")),r=e(n("aa17")),s=e(n("f044")),c={mixins:[s.default],components:{MescrollEmpty:function(){Promise.all([n.e("common/vendor"),n.e("components/mescroll-uni/components/mescroll-empty")]).then(function(){return resolve(n("f089"))}.bind(null,n)).catch(n.oe)},MescrollTop:function(){n.e("components/mescroll-uni/components/mescroll-top").then(function(){return resolve(n("4237"))}.bind(null,n)).catch(n.oe)}},data:function(){return{mescroll:{optDown:{},optUp:{}},downHight:0,downRate:0,downLoadType:0,upLoadType:0,isShowEmpty:!1,isShowToTop:!1,windowHeight:0,windowBottom:0,statusBarHeight:0}},props:{isshow:{type:Boolean,default:function(){return!0}},down:Object,up:Object,top:[String,Number],topbar:[Boolean,String],bottom:[String,Number],safearea:Boolean,height:[String,Number],bottombar:{type:Boolean,default:!1},sticky:Boolean},watch:{downLoadType:function(t){this.$emit("changedownloding",t)}},computed:{minHeight:function(){return"string"==typeof this.height?this.height:this.toPx(this.height||"100%")+"px"},numTop:function(){return this.toPx(this.top)},padTop:function(){return this.numTop+"px"},numBottom:function(){return this.toPx(this.bottom)},padBottom:function(){return this.numBottom+"px"},isDownReset:function(){return 3===this.downLoadType||4===this.downLoadType},transition:function(){return this.isDownReset?"transform 300ms":""},translateY:function(){return this.downHight>0?"translateY("+this.downHight+"px)":""},isDownLoading:function(){return 3===this.downLoadType},downRotate:function(){return"rotate("+360*this.downRate+"deg)"},downText:function(){if(!this.mescroll)return"";switch(this.downLoadType){case 1:return this.mescroll.optDown.textInOffset;case 2:return this.mescroll.optDown.textOutOffset;case 3:return this.mescroll.optDown.textLoading;case 4:return this.mescroll.isDownEndSuccess?this.mescroll.optDown.textSuccess:0==this.mescroll.isDownEndSuccess?this.mescroll.optDown.textErr:this.mescroll.optDown.textInOffset;default:return this.mescroll.optDown.textInOffset}}},methods:{toPx:function(o){if("string"===typeof o)if(-1!==o.indexOf("px"))if(-1!==o.indexOf("rpx"))o=o.replace("rpx","");else{if(-1===o.indexOf("upx"))return Number(o.replace("px",""));o=o.replace("upx","")}else if(-1!==o.indexOf("%")){var n=Number(o.replace("%",""))/100;return this.windowHeight*n}return o?t.upx2px(Number(o)):0},emptyClick:function(){this.$emit("emptyclick",this.mescroll)},toTopClick:function(){this.mescroll.scrollTo(0,this.mescroll.optUp.toTop.duration),this.$emit("topclick",this.mescroll)}},created:function(){var o=this,n={down:{inOffset:function(){o.downLoadType=1},outOffset:function(){o.downLoadType=2},onMoving:function(t,n,e){o.downHight=e,o.downRate=n},showLoading:function(t,n){o.downLoadType=3,o.downHight=n},beforeEndDownScroll:function(t){return o.downLoadType=4,t.optDown.beforeEndDelay},endDownScroll:function(){o.downLoadType=4,o.downHight=0,o.downResetTimer&&(clearTimeout(o.downResetTimer),o.downResetTimer=null),o.downResetTimer=setTimeout((function(){4===o.downLoadType&&(o.downLoadType=0)}),300)},callback:function(t){o.$emit("down",t)}},up:{showLoading:function(){o.upLoadType=1},showNoMore:function(){o.$nextTick((function(){o.upLoadType=2}))},hideUpScroll:function(t){o.upLoadType=t.optUp.hasNext?0:3},empty:{onShow:function(t){o.isShowEmpty=t}},toTop:{onShow:function(t){o.isShowToTop=t}},callback:function(t){o.$emit("up",t)}}};i.default.extend(n,r.default);var e=JSON.parse(JSON.stringify({down:o.down,up:o.up}));i.default.extend(e,n),o.mescroll=new i.default(e,!0),o.$emit("init",o.mescroll);var s=t.getSystemInfoSync();s.windowHeight&&(o.windowHeight=s.windowHeight),s.windowBottom&&(o.windowBottom=s.windowBottom),s.statusBarHeight&&(o.statusBarHeight=s.statusBarHeight),o.mescroll.setBodyHeight(s.windowHeight),o.mescroll.resetScrollTo((function(n,e){"string"===typeof n?setTimeout((function(){var i;i=-1==n.indexOf("#")&&-1==n.indexOf(".")?"#"+n:n,t.createSelectorQuery().select(i).boundingClientRect((function(n){if(n){var r=n.top;r+=o.mescroll.getScrollTop(),t.pageScrollTo({scrollTop:r,duration:e})}else console.error(i+" does not exist")})).exec()}),30):t.pageScrollTo({scrollTop:n,duration:e})})),o.up&&o.up.toTop&&null!=o.up.toTop.safearea||(o.mescroll.optUp.toTop.safearea=o.safearea)}};o.default=c}).call(this,n("543d")["default"])},ab37:function(t,o,n){"use strict";o["a"]=function(t){t.options.wxsCallMethods||(t.options.wxsCallMethods=[]),t.options.wxsCallMethods.push("wxsCall")}},f921:function(t,o,n){"use strict";n.r(o);var e=n("9049"),i=n.n(e);for(var r in e)["default"].indexOf(r)<0&&function(t){n.d(o,t,(function(){return e[t]}))}(r);o["default"]=i.a},fd11:function(t,o,n){"use strict";n.r(o);var e=n("0c0b"),i=n("f921");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(o,t,(function(){return i[t]}))}(r);n("0c4d");var s=n("f0c5"),c=n("ab37"),u=Object(s["a"])(i["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],void 0);"function"===typeof c["a"]&&Object(c["a"])(u),o["default"]=u.exports}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/mescroll-uni/mescroll-body-create-component',
  4. {
  5. 'components/mescroll-uni/mescroll-body-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("fd11"))
  7. })
  8. },
  9. [['components/mescroll-uni/mescroll-body-create-component']]
  10. ]);