This commit is contained in:
2026-01-05 12:47:14 +08:00
commit 1fc846fae3
1614 changed files with 162035 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const t=require("../js/z-paging-static.js"),e=require("../js/z-paging-enum.js"),o=require("../../../../../common/vendor.js"),i={name:"z-paging-load-more",data:()=>({M:e.Enum.More,zTheme:{title:{white:"#efefef",black:"#a4a4a4"},line:{white:"#efefef",black:"#eeeeee"},circleBorder:{white:"#aaaaaa",black:"#c8c8c8"},circleBorderTop:{white:"#ffffff",black:"#444444"},flower:{white:t.zStatic.base64FlowerWhite,black:t.zStatic.base64Flower},indicator:{white:"#eeeeee",black:"#777777"}}}),props:["zConfig"],computed:{ts(){return this.c.defaultThemeStyle},c(){return this.zConfig||{}},ownLoadingMoreText(){return{[this.M.Default]:this.c.defaultText,[this.M.Loading]:this.c.loadingText,[this.M.NoMore]:this.c.noMoreText,[this.M.Fail]:this.c.failText}[this.finalStatus]},finalStatus(){return this.c.defaultAsLoading&&this.c.status===this.M.Default?this.M.Loading:this.c.status},finalLoadingIconType(){return this.c.loadingIconType}},methods:{doClick(){this.$emit("doClick")}}};const n=o._export_sfc(i,[["render",function(t,e,i,n,a,c){return o.e({a:!c.c.hideContent},c.c.hideContent?{}:o.e({b:c.c.showNoMoreLine&&c.finalStatus===a.M.NoMore},c.c.showNoMoreLine&&c.finalStatus===a.M.NoMore?{c:"rpx"===c.c.unit?1:"",d:"px"===c.c.unit?1:"",e:o.s({backgroundColor:a.zTheme.line[c.ts]}),f:o.s(c.c.noMoreLineCustomStyle)}:{},{g:c.finalStatus===a.M.Loading&&!!c.c.loadingIconCustomImage},c.finalStatus===a.M.Loading&&c.c.loadingIconCustomImage?{h:c.c.loadingIconCustomImage,i:o.s(c.c.iconCustomStyle),j:c.c.loadingAnimated?1:"",k:"rpx"===c.c.unit?1:"",l:"px"===c.c.unit?1:""}:{},{m:c.finalStatus===a.M.Loading&&"flower"===c.finalLoadingIconType&&!c.c.loadingIconCustomImage.length},c.finalStatus!==a.M.Loading||"flower"!==c.finalLoadingIconType||c.c.loadingIconCustomImage.length?{}:{n:"rpx"===c.c.unit?1:"",o:"px"===c.c.unit?1:"",p:o.s(c.c.iconCustomStyle),q:a.zTheme.flower[c.ts]},{r:c.finalStatus===a.M.Loading&&"circle"===c.finalLoadingIconType&&!c.c.loadingIconCustomImage.length},c.finalStatus!==a.M.Loading||"circle"!==c.finalLoadingIconType||c.c.loadingIconCustomImage.length?{}:{s:"rpx"===c.c.unit?1:"",t:"px"===c.c.unit?1:"",v:o.s({borderColor:a.zTheme.circleBorder[c.ts],borderTopColor:a.zTheme.circleBorderTop[c.ts]}),w:o.s(c.c.iconCustomStyle)},{x:!c.c.isChat||!c.c.chatDefaultAsLoading&&c.finalStatus===a.M.Default||c.finalStatus===a.M.Fail},!c.c.isChat||!c.c.chatDefaultAsLoading&&c.finalStatus===a.M.Default||c.finalStatus===a.M.Fail?{y:o.t(c.ownLoadingMoreText),z:"rpx"===c.c.unit?1:"",A:"px"===c.c.unit?1:"",B:o.s({color:a.zTheme.title[c.ts]}),C:o.s(c.c.titleCustomStyle)}:{},{D:c.c.showNoMoreLine&&c.finalStatus===a.M.NoMore},c.c.showNoMoreLine&&c.finalStatus===a.M.NoMore?{E:"rpx"===c.c.unit?1:"",F:"px"===c.c.unit?1:"",G:o.s({backgroundColor:a.zTheme.line[c.ts]}),H:o.s(c.c.noMoreLineCustomStyle)}:{}),{I:"rpx"===c.c.unit?1:"",J:"px"===c.c.unit?1:"",K:o.s(c.c.customStyle),L:o.o(((...t)=>c.doClick&&c.doClick(...t)))})}],["__scopeId","data-v-80237b32"]]);wx.createComponent(n);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="{{['zp-l-container', 'data-v-80237b32', I && 'zp-l-container-rpx', J && 'zp-l-container-px']}}" style="{{K}}" bindtap="{{L}}"><block wx:if="{{a}}"><text wx:if="{{b}}" class="{{['data-v-80237b32', c && 'zp-l-line-rpx', d && 'zp-l-line-px']}}" style="{{e + ';' + f}}"/><image wx:if="{{g}}" src="{{h}}" style="{{i}}" class="{{['data-v-80237b32', 'zp-l-line-loading-custom-image', j && 'zp-l-line-loading-custom-image-animated', k && 'zp-l-line-loading-custom-image-rpx', l && 'zp-l-line-loading-custom-image-px']}}"/><image wx:if="{{m}}" class="{{['data-v-80237b32', 'zp-line-loading-image', n && 'zp-line-loading-image-rpx', o && 'zp-line-loading-image-px']}}" style="{{p}}" src="{{q}}"/><text wx:if="{{r}}" class="{{['zp-l-circle-loading-view', 'data-v-80237b32', s && 'zp-l-circle-loading-view-rpx', t && 'zp-l-circle-loading-view-px']}}" style="{{v + ';' + w}}"/><text wx:if="{{x}}" class="{{['data-v-80237b32', z && 'zp-l-text-rpx', A && 'zp-l-text-px']}}" style="{{B + ';' + C}}">{{y}}</text><text wx:if="{{D}}" class="{{['data-v-80237b32', E && 'zp-l-line-rpx', F && 'zp-l-line-px']}}" style="{{G + ';' + H}}"/></block></view>

View File

@@ -0,0 +1 @@
.zp-line-loading-image.data-v-80237b32{animation:loading-flower-80237b32 1s steps(12) infinite;color:#666}.zp-line-loading-image-rpx.data-v-80237b32{margin-right:8rpx;width:34rpx;height:34rpx}.zp-line-loading-image-px.data-v-80237b32{margin-right:4px;width:17px;height:17px}.zp-loading-image-ios-rpx.data-v-80237b32{width:40rpx;height:40rpx}.zp-loading-image-ios-px.data-v-80237b32{width:20px;height:20px}.zp-loading-image-android-rpx.data-v-80237b32{width:34rpx;height:34rpx}.zp-loading-image-android-px.data-v-80237b32{width:17px;height:17px}@keyframes loading-flower-80237b32{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.zp-l-container.data-v-80237b32{clear:both;display:flex;flex-direction:row;align-items:center;justify-content:center}.zp-l-container-rpx.data-v-80237b32{height:80rpx;font-size:27rpx}.zp-l-container-px.data-v-80237b32{height:40px;font-size:14px}.zp-l-line-loading-custom-image.data-v-80237b32{color:#a4a4a4}.zp-l-line-loading-custom-image-rpx.data-v-80237b32{margin-right:8rpx;width:28rpx;height:28rpx}.zp-l-line-loading-custom-image-px.data-v-80237b32{margin-right:4px;width:14px;height:14px}.zp-l-line-loading-custom-image-animated.data-v-80237b32{animation:loading-circle-80237b32 1s linear infinite}.zp-l-circle-loading-view.data-v-80237b32{border:3rpx solid #dddddd;border-radius:50%;animation:loading-circle-80237b32 1s linear infinite}.zp-l-circle-loading-view-rpx.data-v-80237b32{margin-right:8rpx;width:23rpx;height:23rpx}.zp-l-circle-loading-view-px.data-v-80237b32{margin-right:4px;width:12px;height:12px}.zp-l-text-rpx.data-v-80237b32{font-size:30rpx;margin:0rpx 6rpx}.zp-l-text-px.data-v-80237b32{font-size:15px;margin:0 3px}.zp-l-line-rpx.data-v-80237b32{height:1px;width:100rpx;margin:0rpx 10rpx}.zp-l-line-px.data-v-80237b32{height:1px;width:50px;margin:0rpx 5px}@keyframes loading-circle-80237b32{0%{transform:rotate(0)}to{transform:rotate(360deg)}}

View File

@@ -0,0 +1 @@
"use strict";const e=require("../js/z-paging-static.js"),t=require("../js/z-paging-utils.js"),i=require("../js/z-paging-enum.js"),s=require("../../../../../common/vendor.js"),r={name:"z-paging-refresh",data:()=>({R:i.Enum.Refresher,refresherTimeText:"",zTheme:{title:{white:"#efefef",black:"#555555"},arrow:{white:e.zStatic.base64ArrowWhite,black:e.zStatic.base64Arrow},flower:{white:e.zStatic.base64FlowerWhite,black:e.zStatic.base64Flower},success:{white:e.zStatic.base64SuccessWhite,black:e.zStatic.base64Success},indicator:{white:"#eeeeee",black:"#777777"}}}),props:["status","defaultThemeStyle","defaultText","pullingText","refreshingText","completeText","goF2Text","defaultImg","pullingImg","refreshingImg","completeImg","refreshingAnimated","showUpdateTime","updateTimeKey","imgStyle","titleStyle","updateTimeStyle","updateTimeTextMap","unit","isIos"],computed:{ts(){return this.defaultThemeStyle},statusTextMap(){this.updateTime();const{R:e,defaultText:t,pullingText:i,refreshingText:s,completeText:r,goF2Text:a}=this;return{[e.Default]:t,[e.ReleaseToRefresh]:i,[e.Loading]:s,[e.Complete]:r,[e.GoF2]:a}},currentTitle(){return this.statusTextMap[this.status]||this.defaultText},leftImageClass(){const e=`zp-r-left-image-pre-size-${this.unit}`;return this.status===this.R.Complete?e:`zp-r-left-image ${e} ${this.status===this.R.Default?"zp-r-arrow-down":"zp-r-arrow-top"}`},leftImageStyle(){const e=this.showUpdateTime,i=e?t.u.addUnit(36,this.unit):t.u.addUnit(34,this.unit);return{width:i,height:i,"margin-right":e?t.u.addUnit(20,this.unit):t.u.addUnit(9,this.unit)}},leftImageSrc(){const e=this.R,t=this.status;return t===e.Default?this.defaultImg?this.defaultImg:this.zTheme.arrow[this.ts]:t===e.ReleaseToRefresh?this.pullingImg?this.pullingImg:this.defaultImg?this.defaultImg:this.zTheme.arrow[this.ts]:t===e.Loading?this.refreshingImg?this.refreshingImg:this.zTheme.flower[this.ts]:t===e.Complete?this.completeImg?this.completeImg:this.zTheme.success[this.ts]:t===e.GoF2?this.zTheme.arrow[this.ts]:""},rightTextStyle(){let e={};return e.color=this.zTheme.title[this.ts],e["font-size"]=t.u.addUnit(30,this.unit),e}},methods:{addUnit:(e,i)=>t.u.addUnit(e,i),updateTime(){this.showUpdateTime&&(this.refresherTimeText=t.u.getRefesrherFormatTimeByKey(this.updateTimeKey,this.updateTimeTextMap))}}};const a=s._export_sfc(r,[["render",function(e,t,i,r,a,h){return s.e({a:i.status!==a.R.Loading},i.status!==a.R.Loading?{b:s.n(h.leftImageClass),c:s.s(h.leftImageStyle),d:s.s(i.imgStyle),e:h.leftImageSrc}:{f:i.refreshingAnimated?1:"",g:"rpx"===i.unit?1:"",h:"px"===i.unit?1:"",i:s.s(h.leftImageStyle),j:s.s(i.imgStyle),k:h.leftImageSrc},{l:s.t(h.currentTitle),m:s.s(h.rightTextStyle),n:s.s(i.titleStyle),o:i.showUpdateTime&&a.refresherTimeText.length},i.showUpdateTime&&a.refresherTimeText.length?{p:s.t(a.refresherTimeText),q:"rpx"===i.unit?1:"",r:"px"===i.unit?1:"",s:s.s({color:a.zTheme.title[h.ts]}),t:s.s(i.updateTimeStyle)}:{},{v:s.n(i.showUpdateTime?"zp-r-container zp-r-container-padding":"zp-r-container")})}],["__scopeId","data-v-2ee9a40c"]]);wx.createComponent(a);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="data-v-2ee9a40c" style="height:100%"><view class="{{['data-v-2ee9a40c', v]}}"><view class="zp-r-left data-v-2ee9a40c"><image wx:if="{{a}}" class="{{['data-v-2ee9a40c', b]}}" style="{{c + ';' + d}}" src="{{e}}"/><image wx:else class="{{['data-v-2ee9a40c', f && 'zp-line-loading-image', 'zp-r-left-image', g && 'zp-r-left-image-pre-size-rpx', h && 'zp-r-left-image-pre-size-px']}}" style="{{i + ';' + j}}" src="{{k}}"/></view><view class="zp-r-right data-v-2ee9a40c"><text class="zp-r-right-text data-v-2ee9a40c" style="{{m + ';' + n}}">{{l}}</text><text wx:if="{{o}}" class="{{['zp-r-right-text', 'data-v-2ee9a40c', q && 'zp-r-right-time-text-rpx', r && 'zp-r-right-time-text-px']}}" style="{{s + ';' + t}}">{{p}}</text></view></view></view>

View File

@@ -0,0 +1 @@
.zp-line-loading-image.data-v-2ee9a40c{animation:loading-flower-2ee9a40c 1s steps(12) infinite;color:#666}.zp-line-loading-image-rpx.data-v-2ee9a40c{margin-right:8rpx;width:34rpx;height:34rpx}.zp-line-loading-image-px.data-v-2ee9a40c{margin-right:4px;width:17px;height:17px}.zp-loading-image-ios-rpx.data-v-2ee9a40c{width:40rpx;height:40rpx}.zp-loading-image-ios-px.data-v-2ee9a40c{width:20px;height:20px}.zp-loading-image-android-rpx.data-v-2ee9a40c{width:34rpx;height:34rpx}.zp-loading-image-android-px.data-v-2ee9a40c{width:17px;height:17px}@keyframes loading-flower-2ee9a40c{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.zp-r-container.data-v-2ee9a40c{display:flex;height:100%;flex-direction:row;justify-content:center;align-items:center}.zp-r-left.data-v-2ee9a40c{display:flex;flex-direction:row;align-items:center;overflow:hidden}.zp-r-left-image.data-v-2ee9a40c{transition-duration:.2s;transition-property:transform;color:#666}.zp-r-left-image-pre-size-rpx.data-v-2ee9a40c{width:34rpx;height:34rpx;overflow:hidden}.zp-r-left-image-pre-size-px.data-v-2ee9a40c{width:17px;height:17px;overflow:hidden}.zp-r-arrow-top.data-v-2ee9a40c{transform:rotate(0)}.zp-r-arrow-down.data-v-2ee9a40c{transform:rotate(180deg)}.zp-r-right.data-v-2ee9a40c{display:flex;flex-direction:column;align-items:center;justify-content:center}.zp-r-right-time-text-rpx.data-v-2ee9a40c{margin-top:10rpx;font-size:26rpx}.zp-r-right-time-text-px.data-v-2ee9a40c{margin-top:5px;font-size:13px}

View File

@@ -0,0 +1 @@
"use strict";exports.zLocalConfig={};

View File

@@ -0,0 +1 @@
"use strict";const e={en:{"zp.refresher.default":"Pull down to refresh","zp.refresher.pulling":"Release to refresh","zp.refresher.refreshing":"Refreshing...","zp.refresher.complete":"Refresh succeeded","zp.refresher.f2":"Refresh to enter 2f","zp.loadingMore.default":"Click to load more","zp.loadingMore.loading":"Loading...","zp.loadingMore.noMore":"No more data","zp.loadingMore.fail":"Load failed,click to reload","zp.emptyView.title":"No data","zp.emptyView.reload":"Reload","zp.emptyView.error":"Sorry,load failed","zp.refresherUpdateTime.title":"Last update: ","zp.refresherUpdateTime.none":"None","zp.refresherUpdateTime.today":"Today","zp.refresherUpdateTime.yesterday":"Yesterday","zp.systemLoading.title":"Loading..."},"zh-Hans":{"zp.refresher.default":"继续下拉刷新","zp.refresher.pulling":"松开立即刷新","zp.refresher.refreshing":"正在刷新...","zp.refresher.complete":"刷新成功","zp.refresher.f2":"松手进入二楼","zp.loadingMore.default":"点击加载更多","zp.loadingMore.loading":"正在加载...","zp.loadingMore.noMore":"没有更多了","zp.loadingMore.fail":"加载失败,点击重新加载","zp.emptyView.title":"没有数据哦~","zp.emptyView.reload":"重新加载","zp.emptyView.error":"很抱歉,加载失败","zp.refresherUpdateTime.title":"最后更新:","zp.refresherUpdateTime.none":"无","zp.refresherUpdateTime.today":"今天","zp.refresherUpdateTime.yesterday":"昨天","zp.systemLoading.title":"加载中..."},"zh-Hant":{"zp.refresher.default":"繼續下拉重繪","zp.refresher.pulling":"鬆開立即重繪","zp.refresher.refreshing":"正在重繪...","zp.refresher.complete":"重繪成功","zp.refresher.f2":"鬆手進入二樓","zp.loadingMore.default":"點擊加載更多","zp.loadingMore.loading":"正在加載...","zp.loadingMore.noMore":"沒有更多了","zp.loadingMore.fail":"加載失敗,點擊重新加載","zp.emptyView.title":"沒有數據哦~","zp.emptyView.reload":"重新加載","zp.emptyView.error":"很抱歉,加載失敗","zp.refresherUpdateTime.title":"最後更新:","zp.refresherUpdateTime.none":"無","zp.refresherUpdateTime.today":"今天","zp.refresherUpdateTime.yesterday":"昨天","zp.systemLoading.title":"加載中..."}};exports.messages=e;

View File

@@ -0,0 +1 @@
"use strict";const o=require("../z-paging-utils.js"),t={props:{autoShowBackToTop:{type:Boolean,default:o.u.gc("autoShowBackToTop",!1)},backToTopThreshold:{type:[Number,String],default:o.u.gc("backToTopThreshold","400rpx")},backToTopImg:{type:String,default:o.u.gc("backToTopImg","")},backToTopWithAnimate:{type:Boolean,default:o.u.gc("backToTopWithAnimate",!0)},backToTopBottom:{type:[Number,String],default:o.u.gc("backToTopBottom","160rpx")},backToTopStyle:{type:Object,default:o.u.gc("backToTopStyle",{})},enableBackToTop:{type:Boolean,default:o.u.gc("enableBackToTop",!0)}},data:()=>({backToTopClass:"zp-back-to-top zp-back-to-top-hide",lastBackToTopShowTime:0,showBackToTopClass:!1}),computed:{backToTopThresholdUnitConverted(){return o.u.addUnit(this.backToTopThreshold,this.unit)},backToTopBottomUnitConverted(){return o.u.addUnit(this.backToTopBottom,this.unit)},finalEnableBackToTop(){return!this.usePageScroll&&this.enableBackToTop},finalBackToTopThreshold(){return o.u.convertToPx(this.backToTopThresholdUnitConverted)},finalBackToTopStyle(){const t=this.backToTopStyle;return t.bottom||(t.bottom=this.windowBottom+o.u.convertToPx(this.backToTopBottomUnitConverted)+"px"),t.position||(t.position=this.usePageScroll?"fixed":"absolute"),t},finalBackToTopClass(){return`${this.backToTopClass} zp-back-to-top-${this.unit}`}},methods:{_backToTopClick(){let o=!1;this.$emit("backToTopClick",(t=>{(void 0===t||!0===t)&&this._handleToTop(),o=!0})),this.$nextTick((()=>{!o&&this._handleToTop()}))},_handleToTop(){!this.backToTopWithAnimate&&this._checkShouldShowBackToTop(0),this.useChatRecordMode?this.scrollToBottom(this.backToTopWithAnimate):this.scrollToTop(this.backToTopWithAnimate)},_checkShouldShowBackToTop(t){this.autoShowBackToTop?t>this.finalBackToTopThreshold?this.showBackToTopClass||(this.showBackToTopClass=!0,this.lastBackToTopShowTime=(new Date).getTime(),o.u.delay((()=>{this.backToTopClass="zp-back-to-top zp-back-to-top-show"}),300)):this.showBackToTopClass&&(this.backToTopClass="zp-back-to-top zp-back-to-top-hide",o.u.delay((()=>{this.showBackToTopClass=!1}),(new Date).getTime()-this.lastBackToTopShowTime<500?0:300)):this.showBackToTopClass=!1}}};exports.backToTopModule=t;

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../../../common/vendor.js"),e=require("../z-paging-utils.js"),o={props:{useChatRecordMode:{type:Boolean,default:e.u.gc("useChatRecordMode",!1)},chatRecordMoreOffset:{type:[Number,String],default:e.u.gc("chatRecordMoreOffset","0rpx")},autoHideKeyboardWhenChat:{type:Boolean,default:e.u.gc("autoHideKeyboardWhenChat",!0)},autoAdjustPositionWhenChat:{type:Boolean,default:e.u.gc("autoAdjustPositionWhenChat",!0)},chatAdjustPositionOffset:{type:[Number,String],default:e.u.gc("chatAdjustPositionOffset","0rpx")},autoToBottomWhenChat:{type:Boolean,default:e.u.gc("autoToBottomWhenChat",!1)},showChatLoadingWhenReload:{type:Boolean,default:e.u.gc("showChatLoadingWhenReload",!1)},chatLoadingMoreDefaultAsLoading:{type:Boolean,default:e.u.gc("chatLoadingMoreDefaultAsLoading",!0)}},data:()=>({keyboardHeight:0,isKeyboardHeightChanged:!1}),computed:{finalChatRecordMoreOffset(){return e.u.convertToPx(this.chatRecordMoreOffset)},finalChatAdjustPositionOffset(){return e.u.convertToPx(this.chatAdjustPositionOffset)},chatRecordRotateStyle(){let t;return t=this.useChatRecordMode?{transform:"scaleY(-1)"}:{},this.$emit("update:cellStyle",t),this.$emit("cellStyleChange",t),this.$nextTick((()=>{this.isFirstPage&&this.isChatRecordModeAndNotInversion&&this.$nextTick((()=>{this._scrollToBottom(!1),e.u.delay((()=>{this._scrollToBottom(!1),e.u.delay((()=>{this._scrollToBottom(!1)}),50)}),50)}))})),t},isChatRecordModeHasTransform(){return this.useChatRecordMode&&this.chatRecordRotateStyle&&this.chatRecordRotateStyle.transform},isChatRecordModeAndNotInversion(){return this.isChatRecordModeHasTransform&&"scaleY(1)"===this.chatRecordRotateStyle.transform},isChatRecordModeAndInversion(){return this.isChatRecordModeHasTransform&&"scaleY(-1)"===this.chatRecordRotateStyle.transform},chatRecordModeSafeAreaBottom(){return this.safeAreaInsetBottom&&!this.keyboardHeight?this.safeAreaBottom:0}},mounted(){this.useChatRecordMode&&t.index.onKeyboardHeightChange(this._handleKeyboardHeightChange)},methods:{addChatRecordData(t,e=!0,o=!0){this.useChatRecordMode&&(this.isTotalChangeFromAddData=!0,this.addDataFromTop(t,e,o))},doChatRecordLoadMore(){this.useChatRecordMode&&this._onLoadingMore("click")},_handleKeyboardHeightChange(t){this.$emit("keyboardHeightChange",t),this.autoAdjustPositionWhenChat&&(this.isKeyboardHeightChanged=!0,this.keyboardHeight=t.height>0?t.height+this.finalChatAdjustPositionOffset:t.height),this.autoToBottomWhenChat&&this.keyboardHeight>0&&e.u.delay((()=>{this.scrollToBottom(!1),e.u.delay((()=>{this.scrollToBottom(!1)}))}))}}};exports.chatRecordModerModule=o;

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../../../common/vendor.js"),t=require("../z-paging-utils.js"),s={data:()=>({systemInfo:null,cssSafeAreaInsetBottom:-1,isReadyDestroy:!1}),computed:{windowTop(){return this.systemInfo&&this.systemInfo.windowTop||0},safeAreaBottom(){if(!this.systemInfo)return 0;let e=0;return e=Math.max(this.cssSafeAreaInsetBottom,0),e},isOldWebView(){try{const e=t.u.getSystemInfoSync(!0).system.split(" "),s=e[0],o=parseInt(e[1]);if("iOS"===s&&o<=10||"Android"===s&&o<=6)return!0}catch(e){return!1}return!1},zSlots(){return this.$slots}},beforeDestroy(){this.isReadyDestroy=!0},unmounted(){this.isReadyDestroy=!0},methods:{updateFixedLayout(){this.fixed&&this.$nextTick((()=>{this.systemInfo=t.u.getSystemInfoSync()}))},_getNodeClientRect(t,s=!0,o=!1){if(this.isReadyDestroy)return Promise.resolve(!1);let i=s?e.index.createSelectorQuery().in(!0===s?this:s):e.index.createSelectorQuery();return o?i.select(t).scrollOffset():i.select(t).boundingClientRect(),new Promise(((e,t)=>{i.exec((t=>{e(!(!t||""==t||null==t||!t.length)&&t)}))}))},_updateLeftAndRightWidth(e,t){this.$nextTick((()=>{setTimeout((()=>{["left","right"].map((s=>{this._getNodeClientRect(`.${t}-${s}`).then((t=>{this.$set(e,s,t?t[0].width+"px":"0px")}))}))}),0)}))},_getCssSafeAreaInsetBottom(e){this._getNodeClientRect(".zp-safe-area-inset-bottom").then((t=>{this.cssSafeAreaInsetBottom=t?t[0].height:-1,t&&e&&e()}))},_getSystemInfoSync:(e=!1)=>t.u.getSystemInfoSync(e)}};exports.commonLayoutModule=s;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const e=require("../z-paging-utils.js"),t={props:{hideEmptyView:{type:Boolean,default:e.u.gc("hideEmptyView",!1)},emptyViewText:{type:[String,Object],default:e.u.gc("emptyViewText",null)},showEmptyViewReload:{type:Boolean,default:e.u.gc("showEmptyViewReload",!1)},showEmptyViewReloadWhenError:{type:Boolean,default:e.u.gc("showEmptyViewReloadWhenError",!0)},emptyViewReloadText:{type:[String,Object],default:e.u.gc("emptyViewReloadText",null)},emptyViewImg:{type:String,default:e.u.gc("emptyViewImg","")},emptyViewErrorText:{type:[String,Object],default:e.u.gc("emptyViewErrorText",null)},emptyViewErrorImg:{type:String,default:e.u.gc("emptyViewErrorImg","")},emptyViewStyle:{type:Object,default:e.u.gc("emptyViewStyle",{})},emptyViewSuperStyle:{type:Object,default:e.u.gc("emptyViewSuperStyle",{})},emptyViewImgStyle:{type:Object,default:e.u.gc("emptyViewImgStyle",{})},emptyViewTitleStyle:{type:Object,default:e.u.gc("emptyViewTitleStyle",{})},emptyViewReloadStyle:{type:Object,default:e.u.gc("emptyViewReloadStyle",{})},emptyViewFixed:{type:Boolean,default:e.u.gc("emptyViewFixed",!1)},emptyViewCenter:{type:Boolean,default:e.u.gc("emptyViewCenter",!0)},autoHideEmptyViewWhenLoading:{type:Boolean,default:e.u.gc("autoHideEmptyViewWhenLoading",!0)},autoHideEmptyViewWhenPull:{type:Boolean,default:e.u.gc("autoHideEmptyViewWhenPull",!0)},emptyViewZIndex:{type:Number,default:e.u.gc("emptyViewZIndex",9)}},data:()=>({customerEmptyViewErrorText:""}),computed:{finalEmptyViewImg(){return this.isLoadFailed?this.emptyViewErrorImg:this.emptyViewImg},finalShowEmptyViewReload(){return this.isLoadFailed?this.showEmptyViewReloadWhenError:this.showEmptyViewReload},showEmpty(){return!(this.refresherOnly||this.hideEmptyView||this.realTotalData.length)&&(!this.autoHideEmptyViewWhenLoading||(!(!this.isAddedData||this.firstPageLoaded||this.loading)||!this.autoHideEmptyViewWhenPull&&!this.isUserReload))}},methods:{_emptyViewReload(){let e=!1;this.$emit("emptyViewReload",(t=>{void 0!==t&&!0!==t||(this.fromEmptyViewReload=!0,this.reload().catch((()=>{}))),e=!0})),this.$nextTick((()=>{e||(this.fromEmptyViewReload=!0,this.reload().catch((()=>{})))}))},_emptyViewClick(){this.$emit("emptyViewClick")}}};exports.emptyModule=t;

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../../../common/vendor.js"),t=require("../../i18n/index.js"),r=require("../z-paging-interceptor.js"),{t:i}=e.initVueI18n(t.messages),n={computed:{finalLanguage(){try{const t=e.index.getLocale(),i=this.systemInfo.appLanguage;return"auto"===t?r.interceptor._handleLanguage2Local(i,this._language2Local(i)):t}catch(t){return"zh-Hans"}},finalRefresherDefaultText(){return this._getI18nText("zp.refresher.default",this.refresherDefaultText)},finalRefresherPullingText(){return this._getI18nText("zp.refresher.pulling",this.refresherPullingText)},finalRefresherRefreshingText(){return this._getI18nText("zp.refresher.refreshing",this.refresherRefreshingText)},finalRefresherCompleteText(){return this._getI18nText("zp.refresher.complete",this.refresherCompleteText)},finalRefresherUpdateTimeTextMap:()=>({title:i("zp.refresherUpdateTime.title"),none:i("zp.refresherUpdateTime.none"),today:i("zp.refresherUpdateTime.today"),yesterday:i("zp.refresherUpdateTime.yesterday")}),finalRefresherGoF2Text(){return this._getI18nText("zp.refresher.f2",this.refresherGoF2Text)},finalLoadingMoreDefaultText(){return this._getI18nText("zp.loadingMore.default",this.loadingMoreDefaultText)},finalLoadingMoreLoadingText(){return this._getI18nText("zp.loadingMore.loading",this.loadingMoreLoadingText)},finalLoadingMoreNoMoreText(){return this._getI18nText("zp.loadingMore.noMore",this.loadingMoreNoMoreText)},finalLoadingMoreFailText(){return this._getI18nText("zp.loadingMore.fail",this.loadingMoreFailText)},finalEmptyViewText(){return this.isLoadFailed?this.finalEmptyViewErrorText:this._getI18nText("zp.emptyView.title",this.emptyViewText)},finalEmptyViewReloadText(){return this._getI18nText("zp.emptyView.reload",this.emptyViewReloadText)},finalEmptyViewErrorText(){return this.customerEmptyViewErrorText||this._getI18nText("zp.emptyView.error",this.emptyViewErrorText)},finalSystemLoadingText(){return this._getI18nText("zp.systemLoading.title",this.systemLoadingText)}},methods:{getLanguage(){return this.finalLanguage},_getI18nText(e,t){const r=Object.prototype.toString.call(t);if("[object Object]"===r){const e=t[this.finalLanguage];if(e)return e}else if("[object String]"===r)return t;return i(e)},_language2Local(e){const t=e.toLowerCase().replace(new RegExp("_",""),"-");return-1!==t.indexOf("zh")?"zh"===t||"zh-cn"===t||-1!==t.indexOf("zh-hans")?"zh-Hans":"zh-Hant":-1!==t.indexOf("en")?"en":e}}};exports.i18nModule=n;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../../../common/vendor.js"),i=require("../z-paging-utils.js"),o=require("../z-paging-enum.js"),t={props:{autoHideLoadingAfterFirstLoaded:{type:Boolean,default:i.u.gc("autoHideLoadingAfterFirstLoaded",!0)},loadingFullFixed:{type:Boolean,default:i.u.gc("loadingFullFixed",!1)},autoShowSystemLoading:{type:Boolean,default:i.u.gc("autoShowSystemLoading",!1)},systemLoadingMask:{type:Boolean,default:i.u.gc("systemLoadingMask",!0)},systemLoadingText:{type:[String,Object],default:i.u.gc("systemLoadingText",null)}},data:()=>({loading:!1,loadingForNow:!1}),watch:{loadingStatus(e){this.$emit("loadingStatusChange",e),this.$nextTick((()=>{this.loadingStatusAfterRender=e})),!this.useChatRecordMode||!this.isFirstPage||e!==o.Enum.More.NoMore&&e!==o.Enum.More.Fail?this.isFirstPageAndNoMore=!1:this.isFirstPageAndNoMore=!0},loading(e){e&&(this.loadingForNow=e)}},computed:{showLoading(){return!(this.firstPageLoaded||!this.loading||!this.loadingForNow)&&(this.finalShowSystemLoading&&e.index.showLoading({title:this.finalSystemLoadingText,mask:this.systemLoadingMask}),this.autoHideLoadingAfterFirstLoaded?!!this.fromEmptyViewReload||!this.pagingLoaded:this.loadingType===o.Enum.LoadingType.Refresher)},finalShowSystemLoading(){return this.autoShowSystemLoading&&this.loadingType===o.Enum.LoadingType.Refresher}},methods:{_startLoading(e=!1){(this.showLoadingMoreWhenReload&&!this.isUserPullDown||!e)&&(this.loadingStatus=o.Enum.More.Loading),this.loading=!0},_endSystemLoadingAndRefresh(){this.finalShowSystemLoading&&e.index.hideLoading(),!this.useCustomRefresher&&e.index.stopPullDownRefresh()}}};exports.loadingModule=t;

View File

@@ -0,0 +1 @@
"use strict";const e=require("../z-paging-utils.js"),r={props:{},data:()=>({nRefresherLoading:!1,nListIsDragging:!1,nShowBottom:!0,nFixFreezing:!1,nShowRefresherReveal:!1,nLoadingMoreFixedHeight:!1,nShowRefresherRevealHeight:0,nOldShowRefresherRevealHeight:-1,nRefresherWidth:e.u.rpx2px(750),nF2Opacity:0}),computed:{},mounted(){},methods:{}};exports.nvueModule=r;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";exports.c={version:"2.8.6",delayTime:100,errorUpdateKey:"z-paging-error-emit",completeUpdateKey:"z-paging-complete-emit",cachePrefixKey:"z-paging-cache",listCellIndexKey:"zp_index",listCellIndexUniqueKey:"zp_unique_index"};

View File

@@ -0,0 +1 @@
"use strict";exports.Enum={LoadingType:{Refresher:"refresher",LoadMore:"load-more"},Refresher:{Default:"default",ReleaseToRefresh:"release-to-refresh",Loading:"loading",Complete:"complete",GoF2:"go-f2"},More:{Default:"default",Loading:"loading",NoMore:"no-more",Fail:"fail"},QueryFrom:{UserPullDown:"user-pull-down",Reload:"reload",Refresh:"refresh",LoadMore:"load-more"},CellHeightMode:{Fixed:"fixed",Dynamic:"dynamic"},CacheMode:{Default:"default",Always:"always"}};

View File

@@ -0,0 +1 @@
"use strict";function n(){return getApp()}function t(){return n()&&n().globalData}function e(e,a){try{setTimeout((function(){t()&&(n().globalData[`zp_handle${e}Callback`]=a)}),1)}catch(u){}}function a(e){return t()?n().globalData[`zp_handle${e}Callback`]:null}const u={handleQuery:function(n){return e("Query",n),this},_handleQuery:function(n,t,e,u){const c=a("Query");return c?c(n,t,e,u):[n,t,e]},handleFetchParams:function(n){return e("FetchParams",n),this},_handleFetchParams:function(n,t){const e=a("FetchParams");return e?e(n,t||{}):{pageNo:n.pageNo,pageSize:n.pageSize,...t||{}}},handleFetchResult:function(n){return e("FetchResult",n),this},_handleFetchResult:function(n,t,e){const u=a("FetchResult");return u&&u(n,t,e),!!u},handleLanguage2Local:function(n){return e("Language2Local",n),this},_handleLanguage2Local:function(n,t){const e=a("Language2Local");return e?e(n,t):t}};exports.interceptor=u;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../../common/vendor.js"),n=require("../config/index.js"),t=require("./z-paging-constant.js"),r="Z-PAGING-REFRESHER-TIME-STORAGE-KEY";let o=null,c=!1,i=null;const u={};function a(){return e.index.getStorageSync(r)}function s(n){return e.index.upx2px(n)}function l(){return(new Date).getTime()}function f(e){return 1===(e=e.toString()).length?"0"+e:e}const g={gc:function(t,r){return()=>{if(function(){if(c)return;n.zLocalConfig&&Object.keys(n.zLocalConfig).length&&(o=n.zLocalConfig);!o&&e.index.$zp&&(o=e.index.$zp.config);o=o?Object.keys(o).reduce(((e,n)=>(e[function(e){return e.replace(/-([a-z])/g,((e,n)=>n.toUpperCase()))}(n)]=o[n],e)),{}):null,c=!0}(),!o)return r;const i=o[t];return void 0===i?r:i}},setRefesrherTime:function(n,t){const o=a()||{};o[t]=n,e.index.setStorageSync(r,o)},getRefesrherFormatTimeByKey:function(e,n){const t=function(e){const n=a();return n&&n[e]?n[e]:null}(e),r=t?function(e,n){const t=new Date(e),r=new Date,o=new Date(e).setHours(0,0,0,0),c=(new Date).setHours(0,0,0,0),i=o-c;let u="";const a=function(e){const n=e.getHours(),t=e.getMinutes();return`${f(n)}:${f(t)}`}(t);u=0===i?n.today:-864e5===i?n.yesterday:function(e,n=!0){const t=e.getFullYear(),r=e.getMonth()+1,o=e.getDate();return n?`${t}-${f(r)}-${f(o)}`:`${f(r)}-${f(o)}`}(t,t.getFullYear()!==r.getFullYear());return`${u} ${a}`}(t,n):n.none;return`${n.title}${r}`},getTouch:function(e){let n=null;if(e.touches&&e.touches.length)n=e.touches[0];else if(e.changedTouches&&e.changedTouches.length)n=e.changedTouches[0];else{if(!e.datail||e.datail=={})return{touchX:0,touchY:0};n=e.datail}return{touchX:n.clientX,touchY:n.clientY}},getTouchFromZPaging:function e(n){if(n&&n.tagName&&"BODY"!==n.tagName&&"UNI-PAGE-BODY"!==n.tagName){const t=n.classList;return t&&t.contains("z-paging-content")?{isFromZp:!0,isPageScroll:t.contains("z-paging-content-page"),isReachedTop:t.contains("z-paging-reached-top"),isUseChatRecordMode:t.contains("z-paging-use-chat-record-mode")}:e(n.parentNode)}return{isFromZp:!1}},getParent:function e(n){return n?n.$refs.paging?n:e(n.$parent):null},convertToPx:function(e){if("[object Number]"===Object.prototype.toString.call(e))return e;let n=!1;return-1!==e.indexOf("rpx")||-1!==e.indexOf("upx")?(e=e.replace("rpx","").replace("upx",""),n=!0):-1!==e.indexOf("px")&&(e=e.replace("px","")),isNaN(e)?0:Number(n?s(e):e)},getTime:l,getInstanceId:function(){const e=[];for(let n=0;n<10;n++)e[n]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);return e.join("")+l()},consoleErr:function(e){console.error(`[z-paging]${e}`)},delay:function(e,n=t.c.delayTime,r){const o=setTimeout(e,n);return r&&(u[r]&&clearTimeout(u[r]),u[r]=o),o},wait:function(e){return new Promise((n=>{setTimeout(n,e)}))},isPromise:function(e){return"[object Promise]"===Object.prototype.toString.call(e)},addUnit:function(e,n){if("[object String]"===Object.prototype.toString.call(e)){let n=e;n=n.replace("rpx","").replace("upx","").replace("px",""),-1===e.indexOf("rpx")&&-1===e.indexOf("upx")&&-1!==e.indexOf("px")&&(n=2*parseFloat(n)),e=n}return"rpx"===n?e+"rpx":e/2+"px"},deepCopy:function e(n){if("object"!=typeof n||null===n)return n;let t=Array.isArray(n)?[]:{};for(let r in n)n.hasOwnProperty(r)&&(t[r]=e(n[r]));return t},rpx2px:s,getSystemInfoSync:function(n=!1){if(n&&i)return i;const{deviceInfo:t,appBaseInfo:r,windowInfo:o}=["DeviceInfo","AppBaseInfo","WindowInfo"].reduce(((n,t)=>{const r=`get${t}`;return e.index[r]&&e.index.canIUse(r)&&(n[t.charAt(0).toLowerCase()+t.slice(1)]=e.index[r]()),n}),{});return i=t&&r&&o?{...t,...r,...o}:e.index.getSystemInfoSync(),i}};exports.u=g;

View File

@@ -0,0 +1,382 @@
// [z-paging]微信小程序、QQ小程序、app-vue、h5上使用wxs实现自定义下拉刷新降低逻辑层与视图层的通信折损提升性能
var currentDis = 0;
var isPCFlag = -1;
var startY = -1;
// 监听js层传过来的数据
function propObserver(newVal, oldVal, ownerIns, ins) {
var state = ownerIns.getState() || {};
state.currentIns = ins;
var dataset = ins.getDataset();
var loading = dataset.loading == true;
// 如果是下拉刷新结束更新transform
if (newVal && newVal.indexOf('end') != -1) {
var transition = newVal.split('end')[0];
_setTransform('translateY(0px)', ins, false, transition);
state.moveDis = 0;
state.oldMoveDis = 0;
currentDis = 0;
} else if (newVal && newVal.indexOf('begin') != -1) {
// 如果是下拉刷新开始更新transform
var refresherThreshold = ins.getDataset().refresherthreshold;
_setTransformValue(refresherThreshold, ins, state, false);
}
}
// touch开始
function touchstart(e, ownerIns) {
var ins = _getIns(ownerIns);
var state = {};
var dataset = {};
ownerIns.callMethod('_handleListTouchstart');
if (ins) {
state = ins.getState();
dataset = ins.getDataset();
if (_touchDisabled(e, ins, 0)) return;
}
var isTouchEnded = state.isTouchEnded;
state.oldMoveDis = 0;
var touch = _getTouch(e);
var loading = _isTrue(dataset.loading);
state.startY = touch.touchY;
startY = state.startY;
state.lastTouch = touch;
if (!loading && isTouchEnded) {
state.isTouchmoving = false;
}
state.isTouchEnded = false;
// 通知js层touch开始
ownerIns.callMethod('_handleRefresherTouchstart', touch);
}
// touch中
function touchmove(e, ownerIns) {
var touch = _getTouch(e);
var ins = _getIns(ownerIns);
var dataset = ins.getDataset();
var refresherThreshold = dataset.refresherthreshold;
var refresherF2Threshold = dataset.refresherf2threshold;
var refresherF2Enabled = _isTrue(dataset.refresherf2enabled);
var isIos = _isTrue(dataset.isios);
var state = ins.getState();
var watchTouchDirectionChange = _isTrue(dataset.watchtouchdirectionchange);
var moveDisObj = {};
var moveDis = 0;
var prevent = false;
// 如果需要监听touch方向的改变
if (watchTouchDirectionChange) {
moveDisObj = _getMoveDis(e, ins);
moveDis = moveDisObj.currentDis;
prevent = moveDisObj.isDown;
var direction = prevent ? 'top' : 'bottom';
// 确保只在touch方向改变时通知一次js层而不是touchmove中持续通知
if (prevent == state.oldTouchDirection && prevent != state.oldEmitedTouchDirection) {
ownerIns.callMethod('_handleTouchDirectionChange', { direction: direction });
state.oldEmitedTouchDirection = prevent;
}
state.oldTouchDirection = prevent;
}
// 判断是否允许下拉刷新
if (_touchDisabled(e, ins, 1)) {
_handlePullingDown(state, ownerIns, false);
return true;
}
// 判断下拉刷新的角度是否在要求范围内
if (!_getAngleIsInRange(e, touch, state, dataset)) {
_handlePullingDown(state, ownerIns, false);
return true;
}
moveDisObj = _getMoveDis(e, ins);
moveDis = moveDisObj.currentDis;
prevent = moveDisObj.isDown;
if (moveDis < 0) {
// moveDis小于0将transform重置为0
_setTransformValue(0, ins, state, false);
_handlePullingDown(state, ownerIns, false);
return true;
}
if (prevent && !state.disabledBounce) {
// 如果是用户下拉并且需要触发下拉刷新需要通知js层将列表禁止滚动防止在下拉刷新过程中列表也可以滚动导致的下拉刷新偏移过大的问题在下拉刷新过程中仅通知一次
ownerIns.callMethod('_handleScrollViewBounce', { bounce: false });
state.disabledBounce = true;
_handlePullingDown(state, ownerIns, prevent);
return !prevent;
}
// 更新transform
_setTransformValue(moveDis, ins, state, false);
var oldRefresherStatus = state.refresherStatus;
var oldIsTouchmoving = _isTrue(dataset.oldistouchmoving);
var hasTouchmove = _isTrue(dataset.hastouchmove);
var isTouchmoving = state.isTouchmoving;
state.refresherStatus = moveDis >= refresherThreshold ? (refresherF2Enabled && moveDis > refresherF2Threshold ? 'goF2' : 'releaseToRefresh') : 'default';
if (!isTouchmoving) {
state.isTouchmoving = true;
isTouchmoving = true;
}
if (state.isTouchEnded) {
state.isTouchEnded = false;
}
// 如果需要实时监听下拉位置偏移则需要实时通知js层此操作会使wxs层与js层频繁通信从而导致在一些性能较差设备中下拉刷新卡顿
if (hasTouchmove) {
ownerIns.callMethod('_handleWxsPullingDown', { moveDis: moveDis, diffDis: moveDisObj.diffDis });
}
// 在下拉刷新状态改变时通知js层
if (oldRefresherStatus == undefined || oldRefresherStatus != state.refresherStatus || oldIsTouchmoving != isTouchmoving) {
ownerIns.callMethod('_handleRefresherTouchmove', moveDis, touch);
}
_handlePullingDown(state, ownerIns, prevent);
return !prevent;
}
// touch结束
function touchend(e, ownerIns) {
var touch = _getTouch(e);
var ins = _getIns(ownerIns);
var dataset = ins.getDataset();
var state = ins.getState();
if (state.disabledBounce) {
// 通知js允许列表滚动
ownerIns.callMethod('_handleScrollViewBounce', { bounce: true });
state.disabledBounce = false;
}
if (_touchDisabled(e, ins, 2)) return;
state.reachMaxAngle = true;
state.hitReachMaxAngleCount = 0;
state.fixedIsTopHitCount = 0;
if (!state.isTouchmoving) return;
var oldRefresherStatus = state.refresherStatus;
var oldMoveDis = state.moveDis;
var refresherThreshold = ins.getDataset().refresherthreshold;
var moveDis = _getMoveDis(e, ins).currentDis;
if (!(moveDis >= refresherThreshold && oldRefresherStatus === 'releaseToRefresh')) {
state.isTouchmoving = false;
}
// 通知js层touch结束
ownerIns.callMethod('_handleRefresherTouchend', moveDis);
state.isTouchEnded = true;
if (oldMoveDis < refresherThreshold) return;
var animate = false;
if (moveDis >= refresherThreshold) {
moveDis = refresherThreshold;
animate = true;
}
_setTransformValue(moveDis, ins, state, animate);
}
// #ifdef H5
// 判断是否是pc平台
function isPC() {
if (!navigator) return false;
if (isPCFlag != -1) return isPCFlag;
var agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
isPCFlag = agents.every(function(item) { return navigator.userAgent.indexOf(item) < 0 });
return isPCFlag;
}
var movable = false;
// 在pc平台监听mousedown、mousemove、mouseup等相关事件并转为对应touch事件处理使得在pc平台也支持通过鼠标进行下拉刷新
function mousedown(e, ins) {
if (!isPC()) return;
touchstart(e, ins);
movable = true;
}
function mousemove(e, ins) {
if (!isPC() || !movable) return;
touchmove(e, ins);
}
function mouseup(e, ins) {
if (!isPC()) return;
touchend(e, ins);
movable = false;
}
function mouseleave(e, ins) {
if (!isPC()) return;
movable = false;
}
// #endif
// 修改视图层transform
function _setTransformValue(value, ins, state, animate) {
value = value || 0;
if (state.moveDis == value) return;
state.moveDis = value;
_setTransform('translateY(' + value + 'px)', ins, animate, '');
}
// 设置视图层transform直接在视图层操作下拉刷新使得js层不需要频繁和视图层通信从而大大提升下拉刷新性能
function _setTransform(transform, ins, animate, transition) {
var dataset = ins.getDataset();
if (_isTrue(dataset.refreshernotransform)) return;
transform = transform == 'translateY(0px)' ? 'none' : transform;
ins.requestAnimationFrame(function() {
var stl = { 'transform': transform };
if (animate) {
stl['transition'] = 'transform .1s linear';
}
if (transition.length) {
stl['transition'] = transition;
}
ins.setStyle(stl);
})
}
// 进一步处理下拉刷新的偏移数据
function _getMoveDis(e, ins) {
var state = ins.getState();
var refresherThreshold = parseFloat(ins.getDataset().refresherthreshold);
var refresherOutRate = parseFloat(ins.getDataset().refresheroutrate);
var refresherPullRate = parseFloat(ins.getDataset().refresherpullrate);
var touch = _getTouch(e);
var currentStartY = !state.startY || state.startY == 'NaN' ? startY : state.startY;
var moveDis = touch.touchY - currentStartY;
var oldMoveDis = state.oldMoveDis || 0;
state.oldMoveDis = moveDis;
// 获取当前下拉刷新位置与上次的偏移量
var diffDis = moveDis - oldMoveDis;
if (diffDis > 0) {
// 对偏移量进行进一步处理通过refresherPullRate等配置进行约束
diffDis = diffDis * refresherPullRate;
if (currentDis > refresherThreshold) {
diffDis = diffDis * (1 - refresherOutRate);
}
}
// 控制diffDis过大的情况比如进入页面突然猛然下拉此时diffDis不应进行太大的偏移
diffDis = diffDis > 100 ? diffDis / 100 : (diffDis > 20 ? diffDis / 2.2 : diffDis);
currentDis += diffDis;
currentDis = Math.max(0, currentDis);
return {
currentDis: currentDis,
diffDis: diffDis,
isDown: diffDis > 0
};
}
// 获取经过统一格式包装的当前touch对象
function _getTouch(e) {
var touch = e;
if (e.touches && e.touches.length) {
touch = e.touches[0];
} else if (e.changedTouches && e.changedTouches.length) {
touch = e.changedTouches[0];
} else if (e.datail && e.datail != {}) {
touch = e.datail;
}
return {
touchX: touch.clientX,
touchY: touch.clientY
};
}
// 获取当前currentIns
function _getIns(ownerIns) {
var ins = ownerIns.getState().currentIns;
if (!ins) {
ownerIns.callMethod('_handlePropUpdate');
}
return ins;
}
// 判断当前状态是否允许下拉刷新
function _touchDisabled(e, ins, processTag) {
var dataset = ins.getDataset();
var state = ins.getState();
var loading = _isTrue(dataset.loading);
var useChatRecordMode = _isTrue(dataset.usechatrecordmode);
var refresherEnabled = _isTrue(dataset.refresherenabled);
var useCustomRefresher = _isTrue(dataset.usecustomrefresher);
var usePageScroll = _isTrue(dataset.usepagescroll);
var pageScrollTop = parseFloat(dataset.pagescrolltop);
var scrollTop = parseFloat(dataset.scrolltop);
var finalScrollTop = usePageScroll ? pageScrollTop : scrollTop;
var fixedIsTop = false;
// 是否要处理滚动到顶部scrollTop不为0时候的容错为解决在安卓中scroll-view有概率滚动到顶部时scrollTop不为0导致下拉刷新判断异常但此方案会导致某些情况例如滚动到距离顶部10px处下拉抖动因此改为通过获取zp-scroll-view的节点信息中的scrollTop进行验证的方案
var handleFaultTolerantMove = false;
if (handleFaultTolerantMove && finalScrollTop == (state.startScrollTop || 0) && finalScrollTop <= 105) {
fixedIsTop = true;
}
var fixedIsTopHitCount = state.fixedIsTopHitCount || 0;
if (fixedIsTop) {
fixedIsTopHitCount ++;
if (fixedIsTopHitCount <= 2) {
fixedIsTop = false;
}
state.fixedIsTopHitCount = fixedIsTopHitCount;
} else {
state.fixedIsTopHitCount = 0;
}
if (handleFaultTolerantMove && processTag === 0) {
state.startScrollTop = finalScrollTop || 0;
}
if (handleFaultTolerantMove && processTag === 2) {
fixedIsTop = true;
}
return loading || useChatRecordMode || !refresherEnabled || !useCustomRefresher ||
((usePageScroll && useCustomRefresher && pageScrollTop > 5) && !fixedIsTop) ||
((!usePageScroll && useCustomRefresher && scrollTop > 5) && !fixedIsTop);
}
// 判断下拉刷新的角度是否在要求范围内
function _getAngleIsInRange(e, touch, state, dataset) {
var maxAngle = dataset.refreshermaxangle;
var refresherAecc = _isTrue(dataset.refresheraecc);
var lastTouch = state.lastTouch;
var reachMaxAngle = state.reachMaxAngle;
var moveDis = state.oldMoveDis;
if (!lastTouch) return true;
if (maxAngle >= 0 && maxAngle <= 90 && lastTouch) {
// 考虑下拉刷新手势由水平移动转为垂直方向移动的情况此时不应当只判断垂直方向角度是否符合要求应当直接禁止以避免在swiper中使用下拉刷新时横向切换swiper途中手未离开屏幕还可以下拉刷新的问题
if ((!moveDis || moveDis < 1) && !refresherAecc && reachMaxAngle != null && !reachMaxAngle) return false;
var x = Math.abs(touch.touchX - lastTouch.touchX);
var y = Math.abs(touch.touchY - lastTouch.touchY);
var z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
if ((x || y) && x > 1) {
// 获取下拉刷新前后两次位移的角度
var angle = Math.asin(y / z) / Math.PI * 180;
if (angle < maxAngle) {
// 如果角度小于配置要求则return同时通过hitReachMaxAngleCount控制角度判断的灵敏程度以最大程度兼容各种使用场景
var hitReachMaxAngleCount = state.hitReachMaxAngleCount || 0;
state.hitReachMaxAngleCount = ++hitReachMaxAngleCount;
if (state.hitReachMaxAngleCount > 2) {
state.lastTouch = touch;
state.reachMaxAngle = false;
}
return false;
}
}
}
state.lastTouch = touch;
return true;
}
// 进一步处理是否在下拉刷新并通知js层
function _handlePullingDown(state, ins, onPullingDown) {
var oldOnPullingDown = state.onPullingDown || false;
if (oldOnPullingDown != onPullingDown) {
ins.callMethod('_handleWxsPullingDownStatusChange', onPullingDown);
}
state.onPullingDown = onPullingDown;
}
// 判断js层传过来的值是否为true
function _isTrue(value) {
value = (typeof(value) === 'string' ? JSON.parse(value) : value) || false;
return value == true || value == 'true';
}
module.exports = {
touchstart: touchstart,
touchmove: touchmove,
touchend: touchend,
mousedown: mousedown,
mousemove: mousemove,
mouseup: mouseup,
mouseleave: mouseleave,
propObserver: propObserver
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"z-paging-empty-view": "../z-paging-empty-view/z-paging-empty-view",
"z-paging-refresh": "./components/z-paging-refresh",
"z-paging-load-more": "./components/z-paging-load-more"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
.z-paging-content.data-v-f50e1bf5{position:relative;flex-direction:column;overflow:hidden}.z-paging-content-full.data-v-f50e1bf5{display:flex;width:100%;height:100%}.z-paging-content-fixed.data-v-f50e1bf5,.zp-loading-fixed.data-v-f50e1bf5{position:fixed;height:auto;width:auto;top:0;left:0;bottom:0;right:0}.zp-f2-content.data-v-f50e1bf5{width:100%;position:fixed;top:0;left:0;background-color:#fff}.zp-page-top.data-v-f50e1bf5,.zp-page-bottom.data-v-f50e1bf5{width:auto;position:fixed;left:0;right:0;z-index:999}.zp-page-left.data-v-f50e1bf5,.zp-page-right.data-v-f50e1bf5{height:100%}.zp-scroll-view-super.data-v-f50e1bf5{flex:1;overflow:hidden;position:relative}.zp-view-super.data-v-f50e1bf5{display:flex;flex-direction:row}.zp-scroll-view-container.data-v-f50e1bf5,.zp-scroll-view.data-v-f50e1bf5{position:relative;height:100%;width:100%}.zp-absoulte.data-v-f50e1bf5{position:absolute;top:0;width:auto}.zp-scroll-view-absolute.data-v-f50e1bf5{position:absolute;top:0;left:0}.zp-scroll-view-hide-scrollbar.data-v-f50e1bf5 ::-webkit-scrollbar{display:none;-webkit-appearance:none;width:0!important;height:0!important;background:transparent}.zp-paging-touch-view.data-v-f50e1bf5{width:100%;height:100%;position:relative}.zp-fixed-bac-view.data-v-f50e1bf5{position:absolute;width:100%;top:0;left:0;height:200px}.zp-paging-main.data-v-f50e1bf5{height:100%;display:flex;flex-direction:column}.zp-paging-container.data-v-f50e1bf5{flex:1;position:relative;display:flex;flex-direction:column}.zp-chat-record-loading-custom-image.data-v-f50e1bf5{width:35rpx;height:35rpx;animation:loading-flower-f50e1bf5 1s linear infinite}.zp-page-bottom-keyboard-placeholder-animate.data-v-f50e1bf5{transition-property:height;transition-duration:.15s;will-change:height}.zp-custom-refresher-container.data-v-f50e1bf5{overflow:hidden}.zp-custom-refresher-refresh.data-v-f50e1bf5{display:block}.zp-back-to-top.data-v-f50e1bf5{z-index:999;position:absolute;bottom:0rpx;transition-duration:.3s;transition-property:opacity}.zp-back-to-top-rpx.data-v-f50e1bf5{width:76rpx;height:76rpx;bottom:0rpx;right:25rpx}.zp-back-to-top-px.data-v-f50e1bf5{width:38px;height:38px;bottom:0;right:13px}.zp-back-to-top-show.data-v-f50e1bf5{opacity:1}.zp-back-to-top-hide.data-v-f50e1bf5{opacity:0}.zp-back-to-top-img.data-v-f50e1bf5{width:100%;height:100%;z-index:999}.zp-back-to-top-img-inversion.data-v-f50e1bf5{transform:rotate(180deg)}.zp-empty-view.data-v-f50e1bf5{flex:1}.zp-empty-view-center.data-v-f50e1bf5{display:flex;flex-direction:column;align-items:center;justify-content:center}.zp-loading-fixed.data-v-f50e1bf5{z-index:9999}.zp-safe-area-inset-bottom.data-v-f50e1bf5{position:absolute;height:env(safe-area-inset-bottom)}.zp-n-refresh-container.data-v-f50e1bf5{display:flex;justify-content:center;width:750rpx}.zp-n-list-container.data-v-f50e1bf5{display:flex;flex-direction:row;flex:1}.zp-line-loading-image.data-v-f50e1bf5{animation:loading-flower-f50e1bf5 1s steps(12) infinite;color:#666}.zp-line-loading-image-rpx.data-v-f50e1bf5{margin-right:8rpx;width:34rpx;height:34rpx}.zp-line-loading-image-px.data-v-f50e1bf5{margin-right:4px;width:17px;height:17px}.zp-loading-image-ios-rpx.data-v-f50e1bf5{width:40rpx;height:40rpx}.zp-loading-image-ios-px.data-v-f50e1bf5{width:20px;height:20px}.zp-loading-image-android-rpx.data-v-f50e1bf5{width:34rpx;height:34rpx}.zp-loading-image-android-px.data-v-f50e1bf5{width:17px;height:17px}@keyframes loading-flower-f50e1bf5{0%{transform:rotate(0)}to{transform:rotate(1turn)}}