mes_mobile/components/progressBar.vue

95 lines
1.6 KiB
Vue

<template>
<!-- style="height: 3.5rem; margin: 0 1em;" -->
<view>
<view class="line-total" :style="'width: ' + (val / total * 100) + '%'">
<text class="line-data">
{{val}}%
</text>
</view>
<view style="position: relative;bottom: 10px;">
<view class="line-base"></view>
<view class="line-blue" :style="'width: ' + (val / total * 100) + '%'"></view>
</view>
<!-- <view class="line-val">
<text>{{title}}</text>
<text>{{total}}</text>
</view> -->
</view>
</template>
<script>
export default {
name: 'progressBar',
data() {
return {
}
},
props: {
// 标题
title: {
type: [String, Number],
default: ''
},
total: {
type: [Number],
default: 0
},
val: {
type: [Number],
default: 0
}
},
computed: {
},
methods: {
}
}
</script>
<style scoped>
.line-total {
color: #67C23A;
text-align: right;
font-size: 25rpx;
font-style: normal;
font-weight: 700;
line-height: normal;
position: relative;
z-index: 99;
}
.line-data{
color: #fff;
padding: 1px 3px;
border-radius: 9px;
border: 1px solid #FFF;
background: var(--color-warning, #67C23A);
width: 30px;
font-size: 11px;
}
.line-base {
position: absolute;
width: 100%;
height: 6px;
border-radius: 8px;
background: rgba(128, 136, 142, 0.40);
}
.line-blue {
position: absolute;
width: 50%;
height: 6px;
border-radius: 10px;
background: #67C23A;
}
.line-val {
display: flex;
justify-content: space-between;
color: #7e7e7e;
font-size: 25rpx;
font-weight: 50px;
margin-top: 12rpx;
}
</style>