mes_mobile/components/progressBar.vue

92 lines
1.5 KiB
Vue
Raw Permalink Normal View History

2024-02-19 16:53:38 +08:00
<template>
<view>
<view class="line-total" :style="'width: ' + (val / total * 100) + '%'">
<text class="line-data">
{{val}}%
</text>
</view>
2024-04-23 11:48:55 +08:00
<view style="position: relative;bottom: 13px;">
2024-02-19 16:53:38 +08:00
<view class="line-base"></view>
<view class="line-blue" :style="'width: ' + (val / total * 100) + '%'"></view>
</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>
2024-04-23 11:48:55 +08:00
<style scoped lang="scss">
2024-02-19 16:53:38 +08:00
.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{
2024-04-23 11:48:55 +08:00
color: $uni-text-color-inverse;
padding: 1px 5px;
2024-02-19 16:53:38 +08:00
border-radius: 9px;
2024-04-23 11:48:55 +08:00
border: 1px solid $uni-text-color-inverse;
2024-02-19 16:53:38 +08:00
background: var(--color-warning, #67C23A);
2024-04-23 11:48:55 +08:00
width: 30px;
display: inline-block;
text-align: center;
2024-02-19 16:53:38 +08:00
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>