InspectionCleaning/pages/index/index.vue

218 lines
5.1 KiB
Vue
Raw Normal View History

2025-04-07 09:30:11 +08:00
<template>
<view class="content">
2025-04-08 16:34:34 +08:00
<daySelect @dateChange="onDateChange" />
<view v-show="isToday" class="task-info">
2025-04-07 09:30:11 +08:00
<view class="title">今日任务</view>
2025-04-08 16:34:34 +08:00
<!-- 当日计划 点击跳转 -->
2025-04-07 09:30:11 +08:00
<view class="task-list">
2025-04-09 09:15:03 +08:00
<view class="task-item" @click="handleTaskClick">
<view class="name-state">
<view class="name">足球场休息室</view>
<u-tag text="已完成" type="success" border-color="transparent" />
</view>
<view class="time">
<u-tag text="9:00~12:00" type="info" border-color="transparent" />
</view>
</view>
2025-04-07 09:30:11 +08:00
<view class="task-item">
<view class="name-state">
<view class="name">足球场休息室</view>
<u-tag text="已完成" type="success" border-color="transparent" />
</view>
2025-04-08 16:34:34 +08:00
2025-04-07 09:30:11 +08:00
<view class="time">
<u-tag text="9:00~12:00" type="info" border-color="transparent" />
</view>
</view>
</view>
</view>
2025-04-08 16:34:34 +08:00
<view v-show="isToday" class="area-schedule">
2025-04-07 09:30:11 +08:00
<view class="finish">
<view class="point"></view>
<view class="title">已保洁区域</view>
<view class="count-rate">26 <view class="total">/50</view> </view>
<u-line-progress
height="10"
class="schedule-line"
:show-percent="false"
active-color="#2979ff"
:percent="70"
></u-line-progress>
</view>
<view class="unfinish">
<view class="point"></view>
<view class="title">已保洁区域</view>
<view class="count-rate">26 <view class="total">/50</view> </view>
<u-line-progress
height="10"
class="schedule-line"
:show-percent="false"
active-color="#FC873D"
:percent="70"
></u-line-progress>
</view>
</view>
2025-04-08 16:34:34 +08:00
<!-- 非当日计划 仅展示 -->
<view v-show="!isToday" class="cleaning-plan-box">
<view class="cleaning-plan">
<view class="title">今日保洁计划名称</view>
<view class="time">
<view class="top">00:00:00</view>
<view class="bottom">23:59:00</view>
</view>
</view>
<view class="cleaning-plan">
<view class="title">今日保洁计划名称</view>
<view class="time">
<view class="top">00:00:00</view>
<view class="bottom">23:59:00</view>
</view>
2025-04-07 09:30:11 +08:00
</view>
</view>
</view>
</template>
<script>
2025-04-09 09:15:03 +08:00
import { useRouter } from "@/utils/utils.js";
2025-04-07 09:30:11 +08:00
import daySelect from "@/components/daySelect/index.vue";
export default {
components: {
daySelect,
},
2025-04-08 16:34:34 +08:00
data() {
return {
isToday: true,
currentDate: "",
};
},
methods: {
onDateChange({ date, isToday }) {
this.isToday = isToday;
this.currentDate = date;
},
2025-04-09 09:15:03 +08:00
handleTaskClick() {
useRouter("/pages/index/cleanPlan", {}, "navigateTo");
},
2025-04-08 16:34:34 +08:00
},
2025-04-07 09:30:11 +08:00
};
</script>
<style lang="scss" scoped>
.content {
height: 100vh; // 确保容器有明确高度
overflow: hidden;
}
.task-info {
margin: 0 32rpx;
padding: 18rpx;
background: #f5f6fa;
border-radius: 24rpx;
.title {
font-weight: bold;
font-size: 34rpx;
color: #282828;
}
.task-list {
margin-top: 36rpx;
display: flex;
flex-direction: column;
.task-item {
2025-04-09 09:15:03 +08:00
margin-bottom: 20rpx;
2025-04-07 09:30:11 +08:00
padding: 44rpx 30rpx;
background: #ffffff;
border-radius: 16rpx;
.name-state {
display: flex;
justify-content: space-between;
.name {
position: relative;
}
.name::before {
content: "";
position: absolute;
top: 10%;
left: -6%;
display: inline-block;
width: 5rpx;
height: 30rpx;
background: #3d6af0;
}
}
.time {
margin-top: 20rpx;
}
}
}
}
.area-schedule {
margin: 0 32rpx;
margin-top: 26rpx;
display: flex;
justify-content: space-between;
> view {
padding: 22rpx;
width: 48%;
background: #f5f6fa;
border-radius: 10rpx;
.point {
width: 12rpx;
height: 12rpx;
background: #4473fe;
border-radius: 50%;
}
.title {
margin-top: 28rpx;
font-size: 32rpx;
color: #292929;
}
.count-rate {
margin-left: 12rpx;
margin-top: 40rpx;
display: flex;
font-size: 50rpx;
color: #4473fe;
.total {
font-size: 50rpx;
color: #dbdee9;
}
}
.schedule-line {
margin-top: 32rpx;
}
}
.unfinish .point {
background: #fc873d;
}
.unfinish .count-rate {
color: #fc873d;
}
}
2025-04-08 16:34:34 +08:00
.cleaning-plan-box {
.cleaning-plan {
margin: 0 32rpx;
margin-bottom: 36rpx;
padding: 42rpx 52rpx;
display: flex;
justify-content: space-between;
align-items: center;
background: url("@/static/images/plan-bg.png") no-repeat 100% 100%;
background-size: 100% 100%;
.title {
font-weight: 500;
font-size: 36rpx;
color: #334a65;
}
.time {
font-weight: 500;
font-size: 36rpx;
color: #334a65;
}
2025-04-07 09:30:11 +08:00
}
}
</style>