You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

10 lines
6.9 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/mescroll-uni/mescroll-uni"],{3161:function(t,o,e){"use strict";e.r(o);var n=e("7b6a"),i=e("aa37");for(var s in i)"default"!==s&&function(t){e.d(o,t,(function(){return i[t]}))}(s);e("9e6c");var r,l=e("f0c5"),c=e("3703"),u=Object(l["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],r);"function"===typeof c["a"]&&Object(c["a"])(u),o["default"]=u.exports},3703:function(t,o,e){"use strict";var n=function(t){t.options.wxsCallMethods||(t.options.wxsCallMethods=[]),t.options.wxsCallMethods.push("wxsCall")};o["a"]=n},"526f":function(t,o,e){"use strict";(function(t){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var n=r(e("4aab")),i=r(e("a3f9")),s=r(e("00e8"));function r(t){return t&&t.__esModule?t:{default:t}}var l=function(){e.e("components/mescroll-uni/components/mescroll-empty").then(function(){return resolve(e("9856"))}.bind(null,e)).catch(e.oe)},c=function(){e.e("components/mescroll-uni/components/mescroll-top").then(function(){return resolve(e("67f3"))}.bind(null,e)).catch(e.oe)},u={mixins:[s.default],components:{MescrollEmpty:l,MescrollTop:c},data:function(){return{mescroll:{optDown:{},optUp:{}},viewId:"id_"+Math.random().toString(36).substr(2,16),downHight:0,downRate:0,downLoadType:0,upLoadType:0,isShowEmpty:!1,isShowToTop:!1,scrollTop:0,scrollAnim:!1,windowTop:0,windowBottom:0,windowHeight:0,statusBarHeight:0}},props:{down:Object,up:Object,top:[String,Number],topbar:[Boolean,String],bottom:[String,Number],safearea:Boolean,fixed:{type:Boolean,default:!0},height:[String,Number],bottombar:{type:Boolean,default:!0}},computed:{isFixed:function(){return!this.height&&this.fixed},scrollHeight:function(){return this.isFixed?"auto":this.height?this.toPx(this.height)+"px":"100%"},numTop:function(){return this.toPx(this.top)},fixedTop:function(){return this.isFixed?this.numTop+this.windowTop+"px":0},padTop:function(){return this.isFixed?0:this.numTop+"px"},numBottom:function(){return this.toPx(this.bottom)},fixedBottom:function(){return this.isFixed?this.numBottom+this.windowBottom+"px":0},padBottom:function(){return this.isFixed?0: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)":""},scrollable:function(){return 0===this.downLoadType||this.isDownReset},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 e=Number(o.replace("%",""))/100;return this.windowHeight*e}return o?t.upx2px(Number(o)):0},scroll:function(t){var o=this;this.mescroll.scroll(t.detail,(function(){o.$emit("scroll",o.mescroll)}))},emptyClick:function(){this.$emit("emptyclick",this.mescroll)},toTopClick:function(){this.mescroll.scrollTo(0,this.mescroll.optUp.toTop.duration),this.$emit("topclick",this.mescroll)},setClientHeight:function(){var t=this;0!==this.mescroll.getClientHeight(!0)||this.isExec||(this.isExec=!0,this.$nextTick((function(){t.getClientInfo((function(o){t.isExec=!1,o?t.mescroll.setClientHeight(o.height):3!=t.clientNum&&(t.clientNum=null==t.clientNum?1:t.clientNum+1,setTimeout((function(){t.setClientHeight()}),100*t.clientNum))}))})))},getClientInfo:function(o){var e=t.createSelectorQuery();e=e.in(this);var n=e.select("#"+this.viewId);n.boundingClientRect((function(t){o(t)})).exec()}},created:function(){var o=this,e={down:{inOffset:function(){o.downLoadType=1},outOffset:function(){o.downLoadType=2},onMoving:function(t,e,n){o.downHight=n,o.downRate=e},showLoading:function(t,e){o.downLoadType=3,o.downHight=e},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=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.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),o.setClientHeight()}}};n.default.extend(e,i.default);var s=JSON.parse(JSON.stringify({down:o.down,up:o.up}));n.default.extend(s,e),o.mescroll=new n.default(s),o.mescroll.viewId=o.viewId,o.$emit("init",o.mescroll);var r=t.getSystemInfoSync();r.windowTop&&(o.windowTop=r.windowTop),r.windowBottom&&(o.windowBottom=r.windowBottom),r.windowHeight&&(o.windowHeight=r.windowHeight),r.statusBarHeight&&(o.statusBarHeight=r.statusBarHeight),o.mescroll.setBodyHeight(r.windowHeight),o.mescroll.resetScrollTo((function(e,n){if(o.scrollAnim=0!==n,"string"!==typeof e){var i=o.mescroll.getScrollTop();0===n||300===n?(o.scrollTop=i,o.$nextTick((function(){o.scrollTop=e}))):o.mescroll.getStep(i,e,(function(t){o.scrollTop=t}),n)}else o.getClientInfo((function(n){var i,s=n.top;i=-1==e.indexOf("#")&&-1==e.indexOf(".")?"#"+e:e,t.createSelectorQuery().select(i).boundingClientRect((function(t){if(t){var e=o.mescroll.getScrollTop(),n=t.top-s;n+=e,o.isFixed||(n-=o.numTop),o.scrollTop=e,o.$nextTick((function(){o.scrollTop=n}))}else console.error(i+" does not exist")})).exec()}))})),o.up&&o.up.toTop&&null!=o.up.toTop.safearea||(o.mescroll.optUp.toTop.safearea=o.safearea)},mounted:function(){this.setClientHeight()}};o.default=u}).call(this,e("543d")["default"])},"7b6a":function(t,o,e){"use strict";var n;e.d(o,"b",(function(){return i})),e.d(o,"c",(function(){return s})),e.d(o,"a",(function(){return n}));var i=function(){var t=this,o=t.$createElement;t._self._c},s=[]},8708:function(t,o,e){},"9e6c":function(t,o,e){"use strict";var n=e("8708"),i=e.n(n);i.a},aa37:function(t,o,e){"use strict";e.r(o);var n=e("526f"),i=e.n(n);for(var s in n)"default"!==s&&function(t){e.d(o,t,(function(){return n[t]}))}(s);o["default"]=i.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/mescroll-uni/mescroll-uni-create-component',
{
'components/mescroll-uni/mescroll-uni-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('543d')['createComponent'](__webpack_require__("3161"))
})
},
[['components/mescroll-uni/mescroll-uni-create-component']]
]);