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.
yanzong/public/assets/mescroll-mixins.a7931123.js

2 lines
27 KiB

11 months ago
import{o as t,c as o,w as e,a as n,e as i,f as s,t as l,k as r,n as p,g as c,i as a,y as h,r as u,B as d,v as w,x as g}from"./index-4ddb689d.js";import{_ as m}from"./_plugin-vue_export-helper.1b428a4d.js";import{r as f}from"./uni-app.es.24af5d4f.js";const y={down:{offset:80,native:!1},up:{offset:150,toTop:{src:"https://www.mescroll.com/img/mescroll-totop.png",offset:1e3,right:20,bottom:120,width:72},empty:{use:!0,icon:"/static/empty.png"}},i18n:{zh:{down:{textInOffset:"下拉刷新",textOutOffset:"释放更新",textLoading:"加载中 ...",textSuccess:"加载成功",textErr:"加载失败"},up:{textLoading:"加载中 ...",textNoMore:"亲, 没有更多了",empty:{tip:"亲,暂无相关数据"}}},en:{down:{textInOffset:"drop down refresh",textOutOffset:"release updates",textLoading:"loading ...",textSuccess:"loaded successfully",textErr:"loading failed"},up:{textLoading:"loading ...",textNoMore:"-- END --",empty:{tip:"~ absolutely empty ~"}}}}},S={def:"zh",getType(){return uni.getStorageSync("mescroll-i18n")||this.def},setType(t){uni.setStorageSync("mescroll-i18n",t)}};const D=m({props:{option:{type:Object,default:()=>({})}},computed:{icon(){if(null!=this.option.icon)return this.option.icon;{let t=S.getType();return this.option.i18n?this.option.i18n[t].icon:y.i18n[t].up.empty.icon||y.up.empty.icon}},tip(){if(null!=this.option.tip)return this.option.tip;{let t=S.getType();return this.option.i18n?this.option.i18n[t].tip:y.i18n[t].up.empty.tip||y.up.empty.tip}},btnText(){if(this.option.i18n){let t=S.getType();return this.option.i18n[t].btnText}return this.option.btnText}},methods:{emptyClick(){this.$emit("emptyclick")}}},[["render",function(h,u,d,w,g,m){const f=c,y=a;return t(),o(y,{class:r(["mescroll-empty",{"empty-fixed":d.option.fixed}]),style:p({"z-index":d.option.zIndex,top:d.option.top})},{default:e((()=>[n(y,null,{default:e((()=>[m.icon?(t(),o(f,{key:0,class:"empty-icon",src:m.icon,mode:"widthFix"},null,8,["src"])):i("",!0)])),_:1}),m.tip?(t(),o(y,{key:0,class:"empty-tip"},{default:e((()=>[s(l(m.tip),1)])),_:1})):i("",!0),m.btnText?(t(),o(y,{key:1,class:"empty-btn",onClick:m.emptyClick},{default:e((()=>[s(l(m.btnText),1)])),_:1},8,["onClick"])):i("",!0)])),_:1},8,["class","style"])}],["__scopeId","data-v-58b94e32"]]);function T(t,o){let e=this;e.version="1.3.7",e.options=t||{},e.isScrollBody=o||!1,e.isDownScrolling=!1,e.isUpScrolling=!1;let n=e.options.down&&e.options.down.callback;e.initDownScroll(),e.initUpScroll(),setTimeout((function(){(e.optDown.use||e.optDown.native)&&e.optDown.auto&&n&&(e.optDown.autoShowLoading?e.triggerDownScroll():e.optDown.callback&&e.optDown.callback(e)),e.isUpAutoLoad||setTimeout((function(){e.optUp.use&&e.optUp.auto&&!e.isUpAutoLoad&&e.triggerUpScroll()}),100)}),30)}T.prototype.extendDownScroll=function(t){T.extend(t,{use:!0,auto:!0,native:!1,autoShowLoading:!1,isLock:!1,offset:80,startTop:100,inOffsetRate:1,outOffsetRate:.2,bottomOffset:20,minAngle:45,textInOffset:"下拉刷新",textOutOffset:"释放更新",textLoading:"加载中 ...",textSuccess:"加载成功",textErr:"加载失败",beforeEndDelay:0,bgColor:"transparent",textColor:"gray",inited:null,inOffset:null,outOffset:null,onMoving:null,beforeLoading:null,showLoading:null,afterLoading:null,beforeEndDownScroll:null,endDownScroll:null,afterEndDownScroll:null,callback:function(t){t.resetUpScroll()}})},T.prototype.extendUpScroll=function(t){T.extend(t,{use:!0,auto:!0,isLock:!1,isBoth:!0,callback:null,page:{num:0,size:10,time:null},noMoreSize:5,offset:150,textLoading:"加载中 ...",textNoMore:"-- END --",bgColor:"transparent",textColor:"gray",inited:null,showLoading:null,showNoMore:null,hideUpScroll:null,errDistance:60,toTop:{src:null,offset:1e3,duration:300,btnClick:null,onShow:null,zIndex:9990,left:null,right:20,bottom:120,safearea:!1,width:72,radius:"50%"},empty:{use:!0,icon:null,tip:"~ 暂无相关数据 ~",btnText:"",btnClick:null,onShow:null,fixed:!1,top:"100rpx",zIndex:99},onScroll:!1})},T.extend=function(t,o){if(!t)return o;for(let e in o)if(null==t[e]){let n=o[e];t[e]=null!=n&&"object"==typeof n?T.extend({},n):n}else"object"==