flat: 修改字体和添加图标
This commit is contained in:
@@ -113,10 +113,7 @@
|
||||
v-for="(item, index) in matchingDegree"
|
||||
:key="index"
|
||||
class="progress-item"
|
||||
:class="{
|
||||
active: index < currentStep - 1,
|
||||
half: index < currentStep && currentStep < index + 1, // 半条
|
||||
}"
|
||||
:class="getClass(index)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -263,6 +260,21 @@ function jobCollection() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getClass(index) {
|
||||
const current = currentStep.value;
|
||||
const floorIndex = Math.floor(current);
|
||||
|
||||
if (index < floorIndex) {
|
||||
return 'active';
|
||||
} else if (index === floorIndex) {
|
||||
const decimal = current % 1;
|
||||
const percent = Math.round(decimal * 100);
|
||||
return `half${percent}`;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@@ -313,17 +325,19 @@ image {
|
||||
}
|
||||
|
||||
/* 当前进度进行中的格子 */
|
||||
.progress-item.half::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%; /* 根据 currentStep 小数动态控制 */
|
||||
// background: linear-gradient(to right, #256bfa, #8c68ff);
|
||||
background: linear-gradient(to right, #256bfa 50%, #eaeaea 50%);
|
||||
border-radius: 24rpx;
|
||||
}
|
||||
for i in 0..100
|
||||
.progress-item.half{i}::before
|
||||
content ''
|
||||
position absolute
|
||||
left 0
|
||||
top 0
|
||||
bottom 0
|
||||
width 100%
|
||||
background linear-gradient(to right, #256bfa (i)%, #eaeaea (i)%)
|
||||
border-radius 24rpx
|
||||
|
||||
|
||||
|
||||
.card-footer{
|
||||
.footer-title{
|
||||
font-weight: 600;
|
||||
|
Reference in New Issue
Block a user