Pārlūkot izejas kodu

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

guohh 8 gadi atpakaļ
vecāks
revīzija
9bc7cbdf17
2 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 3 2
      src/js/refresh.js
  2. 4 1
      src/sass/ipu/layout/list.scss

+ 3 - 2
src/js/refresh.js

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

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

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