From f608ac68ae6c0f98648abf30d7295c5f12261157 Mon Sep 17 00:00:00 2001 From: pangxie1991 Date: Wed, 11 Jan 2017 15:50:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?steps=20=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/steps/index.wxml | 3 +- dist/steps/wxss/step.wxss | 37 ++++++++++++++++------- dist/steps/wxss/vstep.wxss | 5 ++++ example/steps/index.js | 60 ++++++++++++++++++++++++++++++++------ example/steps/index.wxml | 46 ++++++++++++++++++++++++++++- 5 files changed, 129 insertions(+), 22 deletions(-) diff --git a/dist/steps/index.wxml b/dist/steps/index.wxml index 8438c603..d609b1a2 100644 --- a/dist/steps/index.wxml +++ b/dist/steps/index.wxml @@ -2,9 +2,10 @@ {{ step.text }} + {{ step.desc }} diff --git a/dist/steps/wxss/step.wxss b/dist/steps/wxss/step.wxss index e6d79ed0..1cea7149 100644 --- a/dist/steps/wxss/step.wxss +++ b/dist/steps/wxss/step.wxss @@ -13,21 +13,20 @@ .zui-steps--steps .zui-steps__step { position: relative; float: left; - padding-bottom: 20px; + padding-bottom: 25px; color: #b1b1b1; } .zui-steps--steps .zui-steps__title { - display: inline-block; transform: translateX(-50%); - margin-left: 2px; font-size: 10px; + text-align: center; } .zui-steps--steps .zui-steps__icons { position: absolute; - top: 28px; - left: -8px; + top: 30px; + left: -10px; padding: 0 8px; background-color: #fff; z-index: 10; @@ -45,7 +44,7 @@ .zui-steps--steps .zui-steps__line { position: absolute; left: 0px; - top: 30px; + top: 32px; width: 100%; height: 1px; background-color: #e5e5e5; @@ -69,7 +68,8 @@ /* 正在进行中的steps */ .zui-steps--steps .zui-steps__step--cur .zui-steps__icons { - top: 24px; + top: 25px; + left: -14px; } .zui-steps--steps .zui-steps__step--cur .zui-steps__circle { @@ -79,10 +79,6 @@ background-size: 13px 13px; } -.zui-steps--steps .zui-steps__step--cur .zui-steps__title { - margin-left: 6px; -} - .zui-steps--steps .zui-steps__step--cur .zui-steps__line { background-color: #e5e5e5; } @@ -91,6 +87,11 @@ .zui-steps--steps .zui-steps__step--first-child .zui-steps__title { margin-left: 0; transform: none; + text-align: left; +} + +.zui-steps--steps .zui-steps__step--first-child .zui-steps__icons { + left: -7px; } .zui-steps--steps .zui-steps__step--last-child { @@ -103,6 +104,7 @@ .zui-steps--steps .zui-steps__step--last-child .zui-steps__title { transform: none; + text-align: right; } .zui-steps--steps .zui-steps__step--last-child .zui-steps__icons { @@ -113,3 +115,16 @@ .zui-steps--steps .zui-steps__step--last-child .zui-steps__line { display: none; } + +/* 有描述的step */ +.zui-steps--steps .zui-steps__step--db-title .zui-steps__line { + top: 46px; +} + +.zui-steps--steps .zui-steps__step--db-title .zui-steps__icons { + top: 44px; +} + +.zui-steps--steps .zui-steps__step--db-title.zui-steps__step--cur .zui-steps__icons { + top: 40px; +} diff --git a/dist/steps/wxss/vstep.wxss b/dist/steps/wxss/vstep.wxss index 06f4104d..fdb39cee 100644 --- a/dist/steps/wxss/vstep.wxss +++ b/dist/steps/wxss/vstep.wxss @@ -22,10 +22,15 @@ } .zui-steps--vsteps .zui-steps__title { + display: inline-block; line-height: 20px; padding-left: 27px; } +.zui-steps--vsteps .zui-steps__title--desc { + padding-left: 3px; +} + .zui-steps--vsteps .zui-steps__icons { position: absolute; left: 7px; diff --git a/example/steps/index.js b/example/steps/index.js index 789e2d02..e55cb0a9 100644 --- a/example/steps/index.js +++ b/example/steps/index.js @@ -1,30 +1,72 @@ -var app = getApp() +// var app = getApp(); Page({ data: { steps: [ { - current: false, + current: true, done: true, - text: '步骤一' + text: '步骤一', + desc: '10.01' }, { - done: true, - current: true, - text: '步骤二' + done: false, + current: false, + text: '步骤二', + desc: '10.02' }, { done: false, current: false, text: '步骤三' } + ], + steps2: [ + { + current: false, + done: true, + text: '步骤一', + desc: '10.01' + }, + { + done: true, + current: true, + text: '步骤二', + desc: '10.02' + }, + { + done: false, + current: false, + text: '步骤三', + desc: '10.03' + } + ], + steps3: [ + { + current: false, + done: true, + text: '步骤一', + desc: '10.01' + }, + { + done: true, + current: false, + text: '步骤二', + desc: '10.02' + }, + { + done: true, + current: true, + text: '步骤三', + desc: '10.03' + } ] }, - onLoad: function () { + onLoad() { }, - onShow: function() { + onShow() { }, -}) +}); diff --git a/example/steps/index.wxml b/example/steps/index.wxml index b047bff8..86426207 100644 --- a/example/steps/index.wxml +++ b/example/steps/index.wxml @@ -4,7 +4,51 @@ - + + + + + + + + + + + + + + + + + + + + 有描述的steps + + + + + + + + + + + + + + + + + + + + + + + + + From 8a124cfdc452d439266848ba68f0a27a2889f7d2 Mon Sep 17 00:00:00 2001 From: pangxie1991 Date: Wed, 11 Jan 2017 16:26:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/steps/wxss/step.wxss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/steps/wxss/step.wxss b/dist/steps/wxss/step.wxss index 1cea7149..17fdc548 100644 --- a/dist/steps/wxss/step.wxss +++ b/dist/steps/wxss/step.wxss @@ -98,7 +98,6 @@ position: absolute; right: 0; top: 0; - bottom: 0; text-align: right; } @@ -117,6 +116,10 @@ } /* 有描述的step */ +.zui-steps--steps .zui-steps__step--db-title { + min-height: 28px; +} + .zui-steps--steps .zui-steps__step--db-title .zui-steps__line { top: 46px; } From 8d22d8abbb4b5e4fd0f9eb99a389e4a23ee22d40 Mon Sep 17 00:00:00 2001 From: pangxie1991 Date: Wed, 11 Jan 2017 16:42:17 +0800 Subject: [PATCH 3/4] steps 29px --- dist/steps/wxss/step.wxss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/steps/wxss/step.wxss b/dist/steps/wxss/step.wxss index 17fdc548..ff1f5241 100644 --- a/dist/steps/wxss/step.wxss +++ b/dist/steps/wxss/step.wxss @@ -117,7 +117,7 @@ /* 有描述的step */ .zui-steps--steps .zui-steps__step--db-title { - min-height: 28px; + min-height: 29px; } .zui-steps--steps .zui-steps__step--db-title .zui-steps__line { From fc9b1fca693db149d0a95a6b89a7dab697386e6e Mon Sep 17 00:00:00 2001 From: pangxie1991 Date: Wed, 11 Jan 2017 17:27:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?steps=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/steps/wxss/step.wxss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/steps/wxss/step.wxss b/dist/steps/wxss/step.wxss index ff1f5241..bad8cd10 100644 --- a/dist/steps/wxss/step.wxss +++ b/dist/steps/wxss/step.wxss @@ -121,13 +121,13 @@ } .zui-steps--steps .zui-steps__step--db-title .zui-steps__line { - top: 46px; + top: 45px; } .zui-steps--steps .zui-steps__step--db-title .zui-steps__icons { - top: 44px; + top: 43px; } .zui-steps--steps .zui-steps__step--db-title.zui-steps__step--cur .zui-steps__icons { - top: 40px; + top: 39px; }