Browse Source

Merge branch 'v2' of https://github.com/jdf2e/nutui into v2

Frans 6 years ago
parent
commit
d16db7154f

+ 2 - 1
src/packages/calendar/calendar.vue

@@ -148,6 +148,7 @@ export default {
         },
         },
         
         
         getMonth(curData, type) {
         getMonth(curData, type) {
+            
             let preMonthDays = Utils.getMonthPreDay(curData[0], curData[1]);
             let preMonthDays = Utils.getMonthPreDay(curData[0], curData[1]);
             let currMonthDays = Utils.getMonthDays(curData[0], curData[1]);
             let currMonthDays = Utils.getMonthDays(curData[0], curData[1]);
             let nextMonthDays = 42 - preMonthDays - currMonthDays;
             let nextMonthDays = 42 - preMonthDays - currMonthDays;
@@ -158,7 +159,7 @@ export default {
                 monthData: [...this.getDaysStatus(preMonthDays, 'prev'), ...this.getDaysStatus(currMonthDays, 'curr')]
                 monthData: [...this.getDaysStatus(preMonthDays, 'prev'), ...this.getDaysStatus(currMonthDays, 'curr')]
             };
             };
             if (type == 'next') {
             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);
                     this.monthsData.push(monthInfo);
                 } else {
                 } else {
                     this.unLoadNext = true;
                     this.unLoadNext = true;

+ 1 - 1
src/packages/calendar/demo.vue

@@ -67,7 +67,7 @@
             @close="switchPicker('isVisible3')"
             @close="switchPicker('isVisible3')"
             @choose="setChooseValue3"
             @choose="setChooseValue3"
         >
         >
-        </nut-calendar>
+        </nut-calendar> 
     </div>
     </div>
 </template>
 </template>
 
 

+ 3 - 2
src/packages/scroller/horizontal-scroll.vue

@@ -132,8 +132,9 @@ export default {
             let moveTime = this.touchParams.lastTime - this.touchParams.startTime;
             let moveTime = this.touchParams.lastTime - this.touchParams.startTime;
             this.touchEvent(changedTouches, (move, maxMove) => {
             this.touchEvent(changedTouches, (move, maxMove) => {
                 //if (moveTime <= 300) {
                 //if (moveTime <= 300) {
+                if (Math.abs(move) > 100) {
                     move = move * 2;
                     move = move * 2;
-                //}
+                }
 
 
                 // 释放跳转之类
                 // 释放跳转之类
                 if (move < 0 && (move + this.transformX) < maxMove - 20 && this.isFirstShow) {
                 if (move < 0 && (move + this.transformX) < maxMove - 20 && this.isFirstShow) {
@@ -145,7 +146,7 @@ export default {
                     //move = maxMove - this.transformX;
                     //move = maxMove - this.transformX;
                 }
                 }
 
 
-                if (moveTime <= 300) {
+                if (moveTime <= 300 ) {
                     moveTime = moveTime + 500;
                     moveTime = moveTime + 500;
                     this.setMove(move, 'end', moveTime);
                     this.setMove(move, 'end', moveTime);
                 } else {
                 } else {

+ 3 - 0
src/packages/scroller/scroller.scss

@@ -2,6 +2,7 @@
 .nut-scroller{
 .nut-scroller{
     display: flex;
     display: flex;
     height: 100%;
     height: 100%;
+    overflow: hidden;
 }
 }
 // 横向滚动 
 // 横向滚动 
 .nut-hor-scroll{
 .nut-hor-scroll{
@@ -10,6 +11,7 @@
     // overflow: hidden;
     // overflow: hidden;
     .nut-hor-list{
     .nut-hor-list{
         height: 100%;
         height: 100%;
+        touch-action: none;
         display: inline-flex;
         display: inline-flex;
         flex-direction: row;
         flex-direction: row;
         box-orient: horizontal;
         box-orient: horizontal;
@@ -26,6 +28,7 @@
     overflow: hidden;
     overflow: hidden;
     .nut-vert-list{
     .nut-vert-list{
         width: 100%;
         width: 100%;
+        touch-action: none;
         position: relative;
         position: relative;
     }
     }
     .nut-vert-pulldown{
     .nut-vert-pulldown{

+ 7 - 9
src/packages/scroller/vertical-scroll.vue

@@ -117,20 +117,18 @@ export default {
             let maxMove = -this.$refs.list.offsetHeight + h;
             let maxMove = -this.$refs.list.offsetHeight + h;
             if (type === 'end') {
             if (type === 'end') {
                 if (updateMove > 0) {
                 if (updateMove > 0) {
-                    if (!this.isShowLoadMore || this.isFirstPull) {
+                    this.realMove = 0;
+                    if ((!this.isShowLoadMore || this.isFirstPull ) && !this.isLoading && updateMove > 20) {
                         updateMove = 50;
                         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 {
                     } else {
                         this.isFirstPull = true;
                         this.isFirstPull = true;
                         updateMove = 0;
                         updateMove = 0;
                     }
                     }
-                } else if (updateMove < maxMove + this.threshold) {
+                } else if (updateMove < 0 && updateMove < maxMove + this.threshold) {
                     if (updateMove < maxMove) {
                     if (updateMove < maxMove) {
                         updateMove = maxMove;
                         updateMove = maxMove;
                     }
                     }