Skip to content

Commit 78b6d8f

Browse files
committed
1.1.1版本
1 parent fe5654c commit 78b6d8f

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

mescroll-uni/dist/mescroll-uni-option.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// mescroll 全局配置
22
const GlobalOption = {
33
down: {
4+
// 其他down的配置参数也可以写,这里只展示了常用的配置:
45
textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
56
textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
67
textLoading: '加载中 ...', // 加载中的提示文本
78
offset: 80 // 在列表顶部,下拉大于80upx,松手即可触发下拉刷新的回调
89
},
910
up: {
11+
// 其他up的配置参数也可以写,这里只展示了常用的配置:
1012
textLoading: '加载中 ...', // 加载中的提示文本
1113
textNoMore: '-- END --', // 没有更多数据的提示文本
1214
offset: 80, // 距底部多远时,触发upCallback

mescroll-uni/dist/mescroll-uni.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mescroll-uni
2-
* version 1.1.0
3-
* 2019-07-01 wenju
2+
* version 1.1.1
3+
* 2019-07-16 wenju
44
* http://www.mescroll.com
55
*/
66

mescroll-uni/dist/mescroll-uni.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* mescroll-uni
2-
* version 1.1.0
3-
* 2019-07-01 wenju
2+
* version 1.1.1
3+
* 2019-07-16 wenju
44
* http://www.mescroll.com
55
*/
66

@@ -146,6 +146,7 @@ MeScroll.prototype.touchstartEvent = function(e) {
146146
let me = this;
147147

148148
me.startPoint = me.getPoint(e); // 记录起点
149+
me.startTop = me.getScrollTop(); // 记录此时的滚动条位置
149150
me.lastPoint = me.startPoint; // 重置上次move的点
150151
me.maxTouchmoveY = me.getBodyHeight() - me.optDown.bottomOffset; // 手指触摸的最大范围(写在touchstart避免body获取高度为0的情况)
151152
me.inTouchend = false; // 标记不是touchend
@@ -170,9 +171,8 @@ MeScroll.prototype.touchmoveEvent = function(e) {
170171
let curPoint = me.getPoint(e); // 当前点
171172

172173
let moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
173-
174-
// (向下拉&&在顶部)
175-
if (moveY > 0 && scrollTop <= 0) {
174+
// (向下拉&&在顶部) scroll-view在滚动时不会触发touchmove,当触顶/底/左/右时,才会触发touchmove
175+
if (moveY > 0 && scrollTop === me.startTop) { // scroll-view滚动到顶部时,scrollTop不一定为0, 暂时不根据scrollTop<=0判断
176176

177177
// 可下拉的条件
178178
if (me.optDown.use && !me.inTouchend && !me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || (me.isUpScrolling &&
@@ -437,6 +437,7 @@ MeScroll.prototype.resetUpScroll = function(isShowLoading) {
437437
this.num = page.num; // 把最新的页数赋值在mescroll上,避免对page的影响
438438
this.size = page.size; // 把最新的页码赋值在mescroll上,避免对page的影响
439439
this.time = page.time; // 把最新的页码赋值在mescroll上,避免对page的影响
440+
this.optUp.hasNext = true; // 标记还有下一页
440441
this.optUp.callback && this.optUp.callback(this); // 执行上拉回调
441442
}
442443
}

mescroll-uni/dist/mescroll-uni.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<view class="mescroll-uni-warp">
33
<scroll-view :class="{'mescroll-uni':true, 'mescroll-uni-fixed':fixed}" :style="{'padding-top':padTop,'padding-bottom':padBottom,'top':fixedTop,'bottom':fixedBottom}" :lower-threshold="upOffset" :scroll-top="scrollTop" :scroll-with-animation="scrollAnim" @scroll="scroll" @scrolltolower="scrolltolower" @touchstart="touchstartEvent" @touchmove="touchmoveEvent" @touchend="touchendEvent" @touchcancel="touchendEvent" :scroll-y='scrollAble' :enable-back-to-top="true">
44
<!-- 下拉加载区域 (部分css样式需写成style,否则编译到浏览器会丢失,坐等HBuilderX优化编译器..)-->
5-
<view v-if="optDown" class="mescroll-downwarp" :class="{'mescroll-downwarp-reset':isDownReset}" :style="{'height': downHight+'px', 'position': 'relative', 'overflow': 'hidden', '-webkit-transition': isDownReset?'height 300ms':''}">
5+
<view v-if="optDown&&optDown.use" class="mescroll-downwarp" :class="{'mescroll-downwarp-reset':isDownReset}" :style="{'height': downHight+'px', 'position': 'relative', 'overflow': 'hidden', '-webkit-transition': isDownReset?'height 300ms':''}">
66
<view class="downwarp-content" style="text-align: center;position: absolute;left: 0;bottom: 0;width: 100%;padding: 20upx 0;">
77
<view class="downwarp-progress" :style="{'transform':'rotate(' + downRotate + 'deg)'}" :class="{'mescroll-rotate':isDownLoading}"></view>
88
<view class="downwarp-tip">{{downText}}</view>
@@ -20,7 +20,7 @@
2020
</view>
2121

2222
<!-- 上拉加载区域 -->
23-
<view v-if="optUp" class="mescroll-upwarp">
23+
<view v-if="optUp&&optUp.use" class="mescroll-upwarp">
2424
<!-- 加载中.. -->
2525
<template v-if="isUpLoading">
2626
<view class="upwarp-progress mescroll-rotate"></view>
@@ -66,8 +66,8 @@
6666
props: {
6767
down: Object, // 下拉刷新的参数配置
6868
up: Object, // 上拉加载的参数配置
69-
top: [String,Number], // padding-top的数值,单位upx. 目的是使下拉布局往下偏移
70-
bottom: [String,Number], // padding-bottom的数值,单位upx. 目的是使上拉布局往上偏移
69+
top: [String,Number], // 下拉布局往下偏移的数值, 已默认单位为upx.
70+
bottom: [String,Number], // 上拉布局往上偏移的数值, 已默认单位为upx.
7171
fixed: { // 是否通过fixed固定mescroll的高度, 默认true
7272
type: Boolean,
7373
default(){

0 commit comments

Comments
 (0)