Bladeren bron

一些小优化

guohh 8 jaren geleden
bovenliggende
commit
667bb33f3a

+ 1 - 1
demo/index.html

@ -197,7 +197,7 @@
197 197
    </div>
198 198
199 199
    <div class="ui-col ui-col-auto">
200
        <nav class="ui-navbar ui-navbar-ipu ui-border-t">
200
        <nav class="ui-navbar ">
201 201
            <a class="ui-navbar-item " href="javascript:;">
202 202
                <span class="ui-icon fa fa-home"></span>
203 203
                <span class="ui-navbar-item-label">插件</span>

+ 1 - 1
demo/js/require-config.js

@ -6,7 +6,7 @@
6 6
 * 3.如果以"http:"或者"https:"开头
7 7
 */
8 8
require.config({
9
    baseUrl:'js', //也是个相对路径?是的,看你的写法 ../demo/js
9
    baseUrl:'/demo/js', //也是个相对路径?是的,看你的写法 ../demo/js
10 10
    //指定别名. zepto.event如果不使用引号,会导致异常
11 11
    paths:{
12 12
        'iScroll':'lib/iscroll/iscroll',

+ 20 - 18
demo/static/component/category.html

@ -27,52 +27,54 @@
27 27
            <div class="demo-block">
28 28
                <div class="ui-category">
29 29
                    <a href="javascript:;" class="ui-category-item  ">
30
                            <span class="ui-category-icon ui-color-1">
30
                            <span class="ui-category-icon ui-bg-color-1">
31 31
                                <span class="ui-icon fa fa-calendar"></span>
32 32
                            </span>
33
                        流量专区
33
                        <span class="ui-category-label">流量专区</span>
34 34
                    </a>
35 35
                    <a href="javascript:;" class="ui-category-item">
36
                            <span class="ui-category-icon ui-color-2">
36
                            <span class="ui-category-icon ui-bg-color-2">
37 37
                                <span class="ui-icon fa fa-plus"></span>
38 38
                            </span>
39
                        话费服务
39
                        <span class="ui-category-label">话费服务</span>
40 40
                    </a>
41 41
                    <a href="javascript:;" class="ui-category-item">
42
                            <span class="ui-category-icon ui-color-3">
42
                            <span class="ui-category-icon ui-bg-color-3">
43 43
                                <span class="ui-icon fa fa-adjust"></span>
44 44
                            </span>
45
                        账单查询
45
                        <span class="ui-category-label">账单查询</span>
46 46
                    </a>
47 47
                    <a href="javascript:;" class="ui-category-item">
48
                            <span class="ui-category-icon ui-color-4">
48
                            <span class="ui-category-icon ui-bg-color-4">
49 49
                                <span class="ui-icon fa fa-address-book"></span>
50 50
                            </span>
51
                        手机充值
51
                        <span class="ui-category-label">手机充值</span>
52 52
                    </a>
53 53
                    <a href="javascript:;" class="ui-category-item">
54
                            <span class="ui-category-icon ui-color-5">
54
                            <span class="ui-category-icon ui-bg-color-5">
55 55
                                <span class="ui-icon fa fa-amazon"></span>
56 56
                            </span>
57
                        积分兑换
57
                        <span class="ui-category-label">积分兑换</span>
58
                        <div class="ui-badge-cornernum">2</div>
58 59
                    </a>
59 60
                    <a href="javascript:;" class="ui-category-item">
60
                            <span class="ui-category-icon ui-color-6">
61
                            <span class="ui-category-icon ui-bg-color-6">
61 62
                                <span class="ui-icon fa fa-anchor"></span>
62 63
                            </span>
63
                        营业厅查询
64
                        <span class="ui-category-label">营业厅查询</span>
65
                        <div class="ui-badge-cornernum">12</div>
64 66
                    </a>
65 67
                    <a href="javascript:;" class="ui-category-item">
66
                            <span class="ui-category-icon ui-color-7">
68
                            <span class="ui-category-icon ui-bg-color-7">
67 69
                                <span class="ui-icon fa fa-angle-right"></span>
68 70
                            </span>
69
                        业务大全
71
                        <span class="ui-category-label">业务大全业务大全业务大全</span>
70 72
                    </a>
71 73
                    <a href="javascript:;" class="ui-category-item">
72
                            <span class="ui-category-icon ui-color-8">
73
                                <span class="ui-icon fa fa-android"></span>
74
                            </span>
75
                        更多
74
                        <span class="ui-category-icon ui-bg-color-8">
75
                            <i class="ui-icon fa fa-android"></i>
76
                        </span>
77
                        <span class="ui-category-label">更多</span>
76 78
                    </a>
77 79
                </div>
78 80
            </div>

+ 22 - 16
demo/static/text.html

@ -14,8 +14,12 @@
14 14
<div class="ui-row-flex ui-row-flex-ver">
15 15
    <div class="ui-col ui-col-auto">
16 16
        <header class="ui-toolbar">
17
            <a class="ui-icon fa fa-chevron-left ui-fn-left" href="javascript:history.back(-1);"></a>
18
            <a class="ui-icon fa fa-home ui-fn-right" href="../index.html"></a>
17
            <a class="ui-fn-left" href="javascript:history.back(-1);">
18
                <i class="ui-icon fa fa-chevron-left"></i>
19
            </a>
20
            <a class="ui-fn-right" href="../index.html">
21
                <i class="ui-icon fa fa-home"></i>
22
            </a>
19 23
            <h1 class="ui-toolbar-title">文本</h1>
20 24
        </header>
21 25
    </div>
@ -47,20 +51,22 @@
47 51
            <div class="demo-item">
48 52
                <p class="demo-desc">文本颜色</p>
49 53
                <div class="demo-block">
50
                    <div class="ui-whitespace">
51
                        <p class="ui-txt-black">黑色 #000</p>
52
                        <p class="ui-txt-dark">深黑 #333</p>
53
                        <p class="ui-txt-default">默认文本色 #666,同body字体颜色</p>
54
                        <p class="ui-txt-gray">灰色 #999</p>
55
                        <p class="ui-txt-light">浅色 #ccc</p>
56
                        <p class="ui-txt-white" style="background-color: #000">白色 #fff</p>
57
58
                        <p class="ui-txt-primary">主题色</p>
59
                        <p class="ui-txt-highlight">高亮</p>
60
                        <p class="ui-txt-warning">警示</p>
61
                        <p class="ui-txt-success">成功</p>
62
                        <p><a href="javascript:;">默认链接颜色,同主题色</a></p>
63
                    </div>
54
                    <p class="ui-txt-black">黑色 #000</p>
55
                    <p class="ui-txt-dark">深黑 #333</p>
56
                    <p class="ui-txt-default">默认文本色 #666,同body字体颜色</p>
57
                    <p class="ui-txt-gray">灰色 #999</p>
58
                    <p class="ui-txt-light">浅色 #ccc</p>
59
                    <p class="ui-txt-white" style="background-color: #000">白色 #fff</p>
60
                </div>
61
             </div>
62
            <div class="demo-item">
63
                <p class="demo-desc">文本情景色</p>
64
                <div class="demo-block">
65
                    <p class="ui-txt-primary">主题色</p>
66
                    <p class="ui-txt-highlight">高亮</p>
67
                    <p class="ui-txt-warning">警示</p>
68
                    <p class="ui-txt-success">成功</p>
69
                    <p><a href="javascript:;">默认链接颜色,同主题色</a></p>
64 70
                </div>
65 71
            </div>
66 72
        </section>

+ 6 - 6
src/js/picker.js

@ -43,7 +43,7 @@
43 43
        this.hammer.on("panstart panmove panend pancancel", Hammer.bindFn(this._onPan, this));
44 44
45 45
        this.hammer.on("press pressup", function (e) {  // 如果用户点击了,是停止自动滚动
46
            console.log('press');
46
           // console.log('press');
47 47
            if(this.empty){
48 48
                return ;
49 49
            }
@ -125,7 +125,7 @@
125 125
            this.lastAngle = this.angle;
126 126
            this.wrap.addClass("ui-noanimate");    // 移除动画
127 127
            this.stopInertiaMove = true; //  停止自动减速滚动
128
            console.log('panstart');
128
           // console.log('panstart');
129 129
130 130
        } else if (ev.type == 'panmove') {
131 131
            var moveAngle = this.calcAngle(ev.deltaY);
@ -141,7 +141,7 @@
141 141
            this.setAngle(newAngle);
142 142
143 143
        } else { // end or cancel事件
144
            console.log('end or cancel:' + ev.type);
144
            // console.log('end or cancel:' + ev.type);
145 145
            var v = ev.overallVelocityY;    // 滑动的速度
146 146
            var dir = v > 0 ? -1 : 1; //加速度方向
147 147
            var deceleration = dir * 0.0006 * -1;
@ -150,7 +150,7 @@
150 150
151 151
            var startAngle = this.angle;
152 152
            var distAngle = -this.calcAngle(dist);
153
            console.log("dist=" + dist + ", distAngle" + distAngle);
153
           //  console.log("dist=" + dist + ", distAngle" + distAngle);
154 154
155 155
            //----
156 156
            var srcDistAngle = distAngle;
@ -192,9 +192,9 @@
192 192
            // 这个地方要判断下,数据更新或索引更新都要触发
193 193
            if (oldIndex != index || this.newData) {
194 194
                this.newData = false;
195
                console.log('change');
195
               // console.log('change');
196 196
                if (this.options.onChange && this.listen) {
197
                    console.log('changed call');
197
                    // console.log('changed call');
198 198
                    this.options.onChange(this.getSelectedItem(), this.index, oldIndex, this.newData);
199 199
                }
200 200
            }

+ 32 - 8
src/sass/ipu/base/function.scss

@ -40,28 +40,52 @@
40 40
    border: 1px solid $c-element-bd;
41 41
}
42 42
43
.ui-color-1{
43
.ui-bg-color-1{
44 44
    background: $txt-color-1;
45 45
}
46
.ui-color-2{
46
.ui-bg-color-2{
47 47
    background: $txt-color-2;
48 48
}
49
.ui-color-3{
49
.ui-bg-color-3{
50 50
    background: $txt-color-3;
51 51
}
52
.ui-color-4{
52
.ui-bg-color-4{
53 53
    background: $txt-color-4;
54 54
}
55
.ui-color-5{
55
.ui-bg-color-5{
56 56
    background: $txt-color-5;
57 57
}
58
.ui-color-6{
58
.ui-bg-color-6{
59 59
    background: $txt-color-6;
60 60
}
61
.ui-color-7{
61
.ui-bg-color-7{
62 62
    background: $txt-color-7;
63 63
}
64
.ui-color-8{
64
.ui-bg-color-8{
65 65
    background: $txt-color-8;
66 66
}
67 67
68
.ui-text-color-1{
69
    color: $txt-color-1;
70
}
71
.ui-text-color-2{
72
    color: $txt-color-2;
73
}
74
.ui-text-color-3{
75
    color: $txt-color-3;
76
}
77
.ui-text-color-4{
78
    color: $txt-color-4;
79
}
80
.ui-text-color-5{
81
    color: $txt-color-5;
82
}
83
.ui-text-color-6{
84
    color: $txt-color-6;
85
}
86
.ui-text-color-7{
87
    color: $txt-color-7;
88
}
89
.ui-text-color-8{
90
    color: $txt-color-8;
91
}

+ 1 - 0
src/sass/ipu/base/mixin.scss

@ -107,6 +107,7 @@
107 107
108 108
@mixin nowrap {
109 109
    //max-width: 100%; 看是否需要
110
    display: block;
110 111
    overflow: hidden;
111 112
    white-space: nowrap;
112 113
    text-overflow: ellipsis;

+ 3 - 1
src/sass/ipu/base/rem.scss

@ -4,4 +4,6 @@
4 4
@include queryWidth(375,384);
5 5
@include queryWidth(384,400);
6 6
@include queryWidth(400,414);
7
@include queryWidth(414,-1);
7
@include queryWidth(414,480);
8
@include queryWidth(480,640);
9
@include queryWidth(640,-1);

+ 0 - 1
src/sass/ipu/component/badge.scss

@ -44,7 +44,6 @@
44 44
    height: .19rem;
45 45
    line-height: .19rem;
46 46
    font-size: .12rem;
47
    min-width: .19rem;
48 47
    border-radius: .1rem;
49 48
    top: -.05rem;
50 49
    right: -.05rem;

+ 10 - 3
src/sass/ipu/component/category.scss

@ -28,12 +28,19 @@
28 28
    width: $s-category-icon;
29 29
    height: $s-category-icon;
30 30
    margin: .08rem auto;
31
    color: $c-category;
32 31
    position: relative;
33 32
}
34
35
.ui-category-icon .ui-icon{
33
.ui-category .ui-category-label {
34
    @include nowrap();
35
}
36
.ui-category-item .ui-icon{
36 37
    color: $c-primary-positive;
37 38
    display: block;
38 39
    line-height: $s-category-icon;
40
    font-size: .32rem;
41
}
42
.ui-category-item  .ui-badge-cornernum{
43
    top:10%;
44
    left:65%;
45
    right: auto;
39 46
}

+ 1 - 0
src/sass/ipu/component/navbar.scss

@ -1,6 +1,7 @@
1 1
.#{$g-prefix}navbar {
2 2
    position: relative;
3 3
    display: table;
4
    table-layout: fixed;
4 5
    width: 100%;
5 6
    box-sizing: border-box;
6 7
    padding: 0;

+ 1 - 0
src/sass/ipu/component/toolbar.scss

@ -70,6 +70,7 @@
70 70
.#{$g-prefix}mtab{
71 71
    position: relative;
72 72
    display: table;
73
    table-layout: fixed;
73 74
    overflow: hidden;
74 75
}
75 76
// 目前不支持超出时,自动忽略等