1
1
<view class="step {{'step-'+direction}} l-class"
2
2
style="{{direction=='row'?'width:'+(1/length)*750+'rpx':''}}">
3
- <view class="step-icon ">
3
+ <view class="step-container l-step-class {{'step-container-'+direction}} ">
4
4
<view wx:if="{{custom}}" class="step-custom">
5
- <slot/>
5
+ <slot name="dot" />
6
6
</view>
7
7
<view wx:else
8
- class="l-step-class step-icon {{icon?'step-number':'step-'+type}} {{status?'step-number-'+status:''}} {{activeIndex==index+1 && !status?'step-'+type+'-on':''}} {{activeIndex>index+1 && !status?'step-'+type+'-over':''}}">
9
- <l-icon wx:if="{{icon || status}}"
10
- name="{{icon || status}}"
11
- size="{{iconSize}}"
12
- color="{{iconColor}}"/>
13
- <block wx:if="{{type=='number' && !icon &&!status}}">{{index+1}}</block>
8
+ class="l-step-class {{dot && !icon?'step-dot-'+currentStatus.setStatus(activeIndex,index,status)+' step-dot':'step-'+currentStatus.setStatus(activeIndex,index,status)+' step-icon'}}"
9
+ style="{{dot?currentStatus.dotStyle(activeIndex,index,color):currentStatus.statusStyle(activeIndex,index,color)}}">
10
+ <l-icon wx:if="{{icon}}" name="{{icon}}" size="{{iconSize}}" color="{{(currentStatus.setStatus(activeIndex,index,status))==='process'?'#3963BC':iconColor}}"/>
11
+ <block wx:if="{{!dot && !icon}}">
12
+ <view wx:if="{{currentStatus.setStatus(activeIndex,index,status)==='error' || currentStatus.setStatus(activeIndex,index,status)==='finish'}}"
13
+ class="iconfont icon-{{currentStatus.setStatus(activeIndex,index,status)}}"></view>
14
+ <block wx:else>{{index+1}}</block>
15
+ </block>
14
16
</view>
15
17
</view>
16
18
<view class="step-content {{'step-content-'+direction}}">
17
- <view class="l-title-class step-title {{'step-title-' + direction}} {{status?'step-title-' + status:''}} {{ activeIndex==index+1 ?'step-title-on ':''}}">
19
+ <view class="l-title-class {{'step-title-' + direction}} {{activeIndex=== index?'step-title-process ':'step-title '}}">
18
20
{{title}}
19
21
</view>
20
- <view class="l-describe-class step-describe {{activeIndex==index+1?'step-describe-on':''}} ">
22
+ <view class="l-describe-class step-describe">
21
23
{{describe}}
24
+ <slot name="describe"/>
22
25
</view>
23
26
</view>
24
- <view class="step-line {{'step-line-'+ direction}} {{'step-line-'+ direction + '-number'}} {{'step-line-'+type}} {{status?'step-line-'+ status:''}} {{activeIndex>index?'step-line-on':''}}"
27
+ <view class="step-line l-line-class {{'step-line-'+ direction}} {{activeIndex>index?'step-line-finish':'step-line-wait'}}"
28
+ style="{{activeIndex>index?('background-color:'+color):''}}"
25
29
wx:if="{{length !== index+1}}">
26
30
</view>
27
- </view>
31
+ </view>
32
+
33
+ <wxs module="currentStatus">
34
+ var setStatus = function(activeIndex,index,status){
35
+ if(activeIndex===index){
36
+ return status || 'process'
37
+ } else if(activeIndex>index){
38
+ return 'finish'
39
+ }else{
40
+ return 'wait'
41
+ }
42
+ }
43
+
44
+ var statusStyle = function(activeIndex,index,color){
45
+ if(activeIndex===index){
46
+ return ('background-color:' + color)
47
+ } else if(activeIndex>index){
48
+ return ('border-color:' + color + ';color:' + color)
49
+ }else{
50
+ return ''
51
+ }
52
+ }
53
+
54
+ var dotStyle = function(activeIndex,index,color){
55
+ if(activeIndex>=index){
56
+ return ('background-color:' + color)
57
+ } else{
58
+ return ''
59
+ }
60
+ }
61
+
62
+ module.exports = {
63
+ setStatus:setStatus,
64
+ statusStyle:statusStyle,
65
+ dotStyle:dotStyle
66
+ }
67
+ </wxs>
0 commit comments