zhangwei
2025-01-16 e3f6581c48b1dfb65c55e8a1a6ce1761a7dc26b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
    <view class="step-bar">
        <view class="step_item" v-for="(item,index) in stepInfo.list" :key="item.id">
            <!-- <view :class="stepInfo.step >= index+1 ? 'circle circle-active':'circle'"></view> -->
            <view class="chuany-flex chuany-justify-between chuany-flex-direction">
                <up-icon name="checkmark-circle-fill" color="#2979ff" size="22"></up-icon>
                <view :class="stepInfo.step >= index+2 ? 'line line-active':'line'"
                    v-if="index!==stepInfo.list.length-1">
                </view>
            </view>
            <view class="middle-box chuany-align-center">
                <text
                    :class="stepInfo.step < index+1 ? 'text1-actived':stepInfo.step == index+1?'text1-active':text1">{{item.name}}</text>
                <text class="text2">{{item.time}}</text>
            </view>
            <view class="status_text"
                :class="stepInfo.step < index+1 ? 'text1-actived':stepInfo.step == index+1?'text1-active':text1">
                <up-avatar shape="square" size="38" src="https://uview-plus.jiangruyi.com/album/1.jpg"
                    @click="previewImage"></up-avatar>
            </view>
        </view>
 
    </view>
</template>
 
<script>
    export default {
        props: {
            // 传递步骤参数
            stepInfo: {
                type: Object,
                default: function() {
                    return {
                        list: [],
                        step: 0
                    }
                }
            }
 
        },
        data() {
            return {
                stepInfo: {
                    step: 3,
                    list: [{
                        id: 1,
                        name: '已打卡',
                        time: '12:47',
                        status: '已完成'
                    }, {
                        id: 2,
                        name: '已打卡',
                        time: '12:47',
                        status: '进行中'
                    }, {
                        id: 3,
                        name: '已打卡',
                        time: '12:47',
                        status: '未开始'
                    }]
                }
            }
        },
        methods: {
            previewImage() {
                uni.previewImage({
                    urls: ['https://uview-plus.jiangruyi.com/album/1.jpg']
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .step_item {
        position: relative;
        height: 144rpx;
        display: flex;
 
        .line {
            position: absolute;
            top: 40rpx;
            left: 18rpx;
            content: "";
            width: 4rpx;
            height: 100rpx;
            background-color: #E6E8EF;
        }
 
        .line-active {
            background-color: #2979ff;
        }
    }
 
    .icon {
        position: absolute;
        top: 40rpx;
        left: 8rpx;
        content: "";
    }
 
    .circle {
        width: 20rpx;
        height: 20rpx;
        margin-right: 40rpx;
        margin-top: 10rpx;
        border-radius: 50%;
        background-color: #E6E8EF;
    }
 
    .circle-active {
        background-color:#2979ff;
    }
 
    .middle-box {
        display: flex;
        flex-direction: column;
 
        .text2 {
            color: #999999;
            font-size: 24rpx;
        }
    }
 
 
    .text1 {
        color: #666666;
        font-size: 28rpx;
    }
 
    .text1-active {
        color: #FF2B46;
    }
 
    .text1-actived {
        color: #333333;
    }
 
    .status_text {
        flex-grow: 1;
        display: flex;
        justify-content: flex-end;
        font-size: 28rpx;
    }
 
 
    .status_text_active {
        // color: #FF2B46;
    }
</style>