Просмотр исходного кода

修复刷新组件,在刚满一屏时,不自动加载问题,优化表单字体颜色处理

guohh лет назад: 8
Родитель
Сommit
9bc7cbdf17
2 измененных файлов с 7 добавлено и 3 удалено
  1. 3 2
      src/js/refresh.js
  2. 4 1
      src/sass/ipu/layout/list.scss

+ 3 - 2
src/js/refresh.js

@ -14,6 +14,7 @@
14 14
                // 默认阶段,不是顶部加载状态时,且拖动时未达到加载距离,无特殊class,移除ui-refresh-top-loading
15 15
                // 拖动达到加载距离,则增加class:ui-refresh-toload
16 16
                // 加载中,则增加class:ui-refresh-top-loading,移除class:ui-refresh-toload
17
        bottomAddLen: 0,  // 底部提前加载距离,单位px
17 18
        iScrollOptions:{} // 主要是用来接收外面一些函数,不能传递回调的相关函数如refresh,也可在本地函数调用完后,再调用参数的函数,不推荐
18 19
    };
19 20
@ -64,7 +65,7 @@
64 65
        this.topEl = $(this.options.topLoadHtml).prependTo(this.scrollEl);
65 66
66 67
        this.topPullOffset = this.topEl.outerHeight();
67
        this.bottomPullOffset = this.bottomEl.outerHeight();
68
        this.bottomPullOffset = this.bottomEl.outerHeight() + this.options.bottomAddLen; // 增加100;最好配一个额外参数
68 69
69 70
        this.topLoading = false;        // 顶部正在载加载
70 71
        this.bottomLoading = false;     // 底部正在加载
@ -95,7 +96,7 @@
95 96
96 97
    // 检查内容是否超出容器高度,未超出时,自动调用底部加载
97 98
    Refresh.prototype._checkContentLoading = function () {
98
        if(this.iScroll.maxScrollY >= 0){
99
        if(this.iScroll.maxScrollY >= -this.bottomPullOffset){ // 此处要计算底端的高度
99 100
            this._startBottomLoading();
100 101
        }
101 102
    };

+ 4 - 1
src/sass/ipu/layout/list.scss

@ -93,19 +93,22 @@
93 93
.ui-list-form{
94 94
    .ui-list-item-label{
95 95
        width: 35%;
96
        color:#666;
96
        color:#444;
97 97
    }
98 98
    .ui-list-item-input-wrap{
99 99
        @include flex-grow(1);
100 100
        width: 0%;
101
        color: #777;
101 102
        .ui-list-item-input, .ui-list-item-textarea{
102 103
            display: block;
103 104
            box-sizing: border-box;
104 105
            width: 100%;
105 106
            border: none;
107
            color: #777;
106 108
        }
107 109
        .ui-list-item-textarea{
108 110
            resize: none;
111
            height:.65rem;
109 112
        }
110 113
    }
111 114
}