progressBox.vue 3.96 KB
<template>
    <view class="progressBox">
        <view class="titleBox">
            <view v-if="stepActive == 'ONE'" class="conductDot">
                <view class="conductDot-line"></view>
            </view>
            <view v-if="stepActive == 'TWO' || stepActive == 'THREE'" class="successDot">
                <uni-icons type="checkbox-filled" size="20" color="#347BFF"
                    style="float: left; margin: 3px;"></uni-icons>
            </view>
            <view class="title color-292d33" :class="{ 'm-t-8': stepActive == 'TWO' || stepActive == 'THREE' }">经营信息
            </view>
        </view>
        <view class="lineBox">
            <view :class="stepActive == 'TWO' || stepActive == 'THREE' ? 'line2' : 'line1'"></view>
        </view>
        <view class="titleBox">
            <view v-if="stepActive == 'ONE'" class="defaultDot">2</view>
            <view v-if="stepActive == 'TWO'" class="conductDot">
                <view class="conductDot-line"></view>
            </view>
            <view v-if="stepActive == 'THREE'" class="successDot">
                <uni-icons type="checkbox-filled" size="20" color="#347BFF"
                    style="float: left; margin: 3px;"></uni-icons>
            </view>
            <view class="title"
                :class="{ 'm-t-8': stepActive == 'THREE', 'color-292d33': stepActive == 'TWO' || stepActive == 'THREE', 'color-999ea8': stepActive == 'ONE' }">
                收车偏好
            </view>
        </view>
        <view class="lineBox">
            <view :class="stepActive == 'THREE' ? 'line2' : 'line1'"></view>
        </view>
        <view class="titleBox">
            <view v-if="stepActive == 'ONE' || stepActive == 'TWO'" class="defaultDot">3</view>
            <view v-if="stepActive == 'THREE'" class="conductDot">
                <view class="conductDot-line"></view>
            </view>
            <view class="title" :class="stepActive == 'THREE' ? 'color-292d33' : 'color-999ea8'">品牌偏好</view>
        </view>
    </view>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-facing-decorator';

@Component({})
export default class progressBox extends Vue {
    stepActive = 'ONE';//ONE,TWO,THREE
    initData(data: any) {
        this.stepActive = data.stepActive || 'ONE';
    }
}
</script>

<style scoped lang="scss">
.progressBox {
    background: #f7f9fc;
    display: table;
    margin: 0 auto;
}

.titleBox {
    width: 48px;
    margin-top: 8px;
    float: left;
}

.defaultDot {
    width: 20px;
    height: 20px;
    float: left;
    margin: 0 14px;
    line-height: 20px;
    border-radius: 10px;
    background: #dee0e3;
    color: #ffffff;
    font-size: 12px;
    font-weight: 中黑体;
    font-family: "苹方-简";
    text-align: center;
}

.conductDot {
    width: 20px;
    height: 20px;
    float: left;
    background: rgba(52, 123, 255, 0.1);
    border-radius: 20px;
    margin: 0 14px;
}

.conductDot-line {
    width: 8px;
    height: 8px;
    border-radius: 10px;
    border: 3px solid #347bff;
    background: #ffffff;
    float: left;
    margin: 3px;
}

.successDot {
    width: 26px;
    height: 26px;
    float: left;
    border-radius: 20px;
    background: rgba(52, 123, 255, 0.1);
    margin: 0 8px;
    margin-top: -1px;
}

.title {
    width: 48px;
    height: 18px;
    float: left;
    line-height: 18px;
    font-size: 12px;
    font-weight: 中黑体;
    font-family: "苹方-简";
    text-align: center;
    margin-top: 12px;
}

.lineBox {
    width: 90px;
    height: 57px;
    float: left;
}

.line1 {
    width: 80px;
    height: 3px;
    float: left;
    border-radius: 2px;
    background: #dee0e3;
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 17px;
}

.line2 {
    width: 80px;
    height: 3px;
    float: left;
    border-radius: 2px;
    background: #dde9fb;
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 17px;
}

.color-292d33 {
    color: #292d33;
}

.color-999ea8 {
    color: #999ea8;
}

.m-t-8 {
    margin-top: 8px;
}
</style>