Skip to content

Commit

Permalink
Merge branch 'v2' of https://github.com/jdf2e/nutui into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Franslee committed Apr 4, 2019
2 parents 76d47fd + fc90b1c commit d16db71
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/packages/calendar/calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default {
},
getMonth(curData, type) {
let preMonthDays = Utils.getMonthPreDay(curData[0], curData[1]);
let currMonthDays = Utils.getMonthDays(curData[0], curData[1]);
let nextMonthDays = 42 - preMonthDays - currMonthDays;
Expand All @@ -158,7 +159,7 @@ export default {
monthData: [...this.getDaysStatus(preMonthDays, 'prev'), ...this.getDaysStatus(currMonthDays, 'curr')]
};
if (type == 'next') {
if (!this.endData || Utils.compareDate(`${curData[0]}-${curData[1]}-${curData[2]}`, `${this.endData[0]}-${this.endData[1]}-31`)) {
if (!this.endData || !Utils.compareDate(`${this.endData[0]}-${this.endData[1]}-${Utils.getMonthDays(this.endData[0], this.endData[1])}`, `${curData[0]}-${curData[1]}-${curData[2]}`)) {
this.monthsData.push(monthInfo);
} else {
this.unLoadNext = true;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/calendar/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
@close="switchPicker('isVisible3')"
@choose="setChooseValue3"
>
</nut-calendar>
</nut-calendar>
</div>
</template>

Expand Down
5 changes: 3 additions & 2 deletions src/packages/scroller/horizontal-scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ export default {
let moveTime = this.touchParams.lastTime - this.touchParams.startTime;
this.touchEvent(changedTouches, (move, maxMove) => {
//if (moveTime <= 300) {
if (Math.abs(move) > 100) {
move = move * 2;
//}
}
// 释放跳转之类
if (move < 0 && (move + this.transformX) < maxMove - 20 && this.isFirstShow) {
Expand All @@ -145,7 +146,7 @@ export default {
//move = maxMove - this.transformX;
}
if (moveTime <= 300) {
if (moveTime <= 300 ) {
moveTime = moveTime + 500;
this.setMove(move, 'end', moveTime);
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/packages/scroller/scroller.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.nut-scroller{
display: flex;
height: 100%;
overflow: hidden;
}
// 横向滚动
.nut-hor-scroll{
Expand All @@ -10,6 +11,7 @@
// overflow: hidden;
.nut-hor-list{
height: 100%;
touch-action: none;
display: inline-flex;
flex-direction: row;
box-orient: horizontal;
Expand All @@ -26,6 +28,7 @@
overflow: hidden;
.nut-vert-list{
width: 100%;
touch-action: none;
position: relative;
}
.nut-vert-pulldown{
Expand Down
16 changes: 7 additions & 9 deletions src/packages/scroller/vertical-scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,18 @@ export default {
let maxMove = -this.$refs.list.offsetHeight + h;
if (type === 'end') {
if (updateMove > 0) {
if (!this.isShowLoadMore || this.isFirstPull) {
this.realMove = 0;
if ((!this.isShowLoadMore || this.isFirstPull ) && !this.isLoading && updateMove > 20) {
updateMove = 50;
this.realMove = 0;
if (!this.isLoading) {
clearTimeout(this.timerEmit);
this.timerEmit = setTimeout(() => {
this.$emit('pulldown');
}, time / 2);
}
clearTimeout(this.timerEmit);
this.timerEmit = setTimeout(() => {
this.$emit('pulldown');
}, time / 2);
} else {
this.isFirstPull = true;
updateMove = 0;
}
} else if (updateMove < maxMove + this.threshold) {
} else if (updateMove < 0 && updateMove < maxMove + this.threshold) {
if (updateMove < maxMove) {
updateMove = maxMove;
}
Expand Down

0 comments on commit d16db71

Please sign in to comment.