Files
shoot-miniprograms/src/components/training/WeekCheckinBar.vue

98 lines
1.9 KiB
Vue

<template>
<view class="week-bar">
<view
v-for="item in items"
:key="item.key"
class="day-card"
:class="[`status-${item.status}`]"
>
<view class="icon-wrap">
<image
v-if="item.status === 'done'"
class="state-icon"
src="/static/training-home/icons/check.svg"
mode="aspectFit"
/>
<image
v-else-if="item.status === 'failed'"
class="state-icon"
src="/static/training-home/icons/close.svg"
mode="aspectFit"
/>
</view>
<text class="day-text">{{ item.label }}</text>
</view>
</view>
</template>
<script setup>
defineProps({
items: {
type: Array,
default: () => []
}
})
</script>
<style scoped>
.week-bar {
display: flex;
justify-content: space-between;
gap: 10rpx;
}
.day-card {
flex: 1;
min-width: 0;
height: 96rpx;
padding: 14rpx 0 10rpx;
border-radius: 16rpx;
background: linear-gradient(180deg, rgba(47, 45, 43, 0.9) 0%, rgba(37, 40, 49, 0.92) 100%);
box-shadow: inset 0 2rpx 6rpx rgba(255, 255, 255, 0.08);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.icon-wrap {
width: 34rpx;
height: 34rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.status-done .icon-wrap {
background: linear-gradient(180deg, rgba(255, 217, 71, 1) 0%, rgba(231, 186, 128, 1) 100%);
}
.status-failed .icon-wrap {
background: rgba(202, 202, 202, 0.92);
}
.status-current .icon-wrap {
border: 2rpx solid rgba(255, 217, 71, 0.45);
background: rgba(255, 255, 255, 0.02);
}
.state-icon {
width: 20rpx;
height: 20rpx;
}
.day-text {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.88);
}
.status-done .day-text {
color: rgba(231, 186, 128, 1);
}
.status-current .day-text {
color: rgba(255, 217, 71, 1);
}
</style>