InspectionCleaning/pages/index/planList.vue

252 lines
5.9 KiB
Vue
Raw Normal View History

2025-04-07 09:30:11 +08:00
<template>
<view class="content">
<u-navbar
:is-back="false"
title="计划列表"
2025-04-08 13:33:16 +08:00
title-color="black"
2025-04-07 09:30:11 +08:00
:background="{ backgroundColor: '#F7F8FC' }"
:border-bottom="false"
>
2025-04-08 13:33:16 +08:00
<view slot="right">
<image
src="/static/images/icon-date.png"
mode="scaleToFill"
style="width: 40rpx; height: 40rpx; margin-right: 32rpx"
2025-04-08 15:56:13 +08:00
@click="toggleDate"
2025-04-08 13:33:16 +08:00
/>
</view>
2025-04-08 15:56:13 +08:00
<u-calendar v-model="showCalendar" mode="range" :max-date="maxDate" @change="changeDate"></u-calendar>
2025-04-07 09:30:11 +08:00
</u-navbar>
2025-04-08 15:06:27 +08:00
<view
class="selectTab"
2025-04-08 15:11:01 +08:00
:class="{
'tab-completed': activeTab === 'completed',
'tab-incomplete': activeTab === 'incomplete',
2025-04-08 15:06:27 +08:00
}"
>
2025-04-08 13:33:16 +08:00
<view
class="tab-item"
:class="{ active: activeTab === 'completed' }"
@click="switchTab('completed')"
>
2025-04-07 09:30:11 +08:00
<view class="label">已完成计划</view>
<view class="count">12</view>
</view>
2025-04-08 13:33:16 +08:00
<view
class="tab-item"
:class="{ active: activeTab === 'incomplete' }"
@click="switchTab('incomplete')"
>
2025-04-07 09:30:11 +08:00
<view class="label">未完成计划</view>
2025-04-08 13:33:16 +08:00
<view class="count">12</view>
2025-04-07 09:30:11 +08:00
</view>
</view>
2025-04-08 13:33:16 +08:00
<view class="planList" :class="{ activeList: activeTab === 'incomplete' }">
2025-04-07 09:30:11 +08:00
<view class="plan-item">
2025-04-08 13:33:16 +08:00
<view class="plan-header">
2025-04-08 15:56:13 +08:00
<image
src="/static/images/icon-date.png"
mode="scaleToFill"
style="width: 40rpx; height: 40rpx"
/>
2025-04-07 09:30:11 +08:00
<view class="date">05-21</view>
2025-04-08 13:33:16 +08:00
<view>1天前</view>
2025-04-07 09:30:11 +08:00
</view>
2025-04-08 13:33:16 +08:00
<view class="plan-content">
<view class="plan-content-top">
<view class="place">校门A区教学楼</view>
<u-tag text="9:00~12:00" type="info" border-color="transparent" />
</view>
<view class="plan-content-main">
北大门右侧操场跑道/南广场升旗台/A区第二食堂3楼
</view>
2025-04-07 09:30:11 +08:00
</view>
2025-04-08 13:33:16 +08:00
</view>
<view class="plan-item">
<view class="plan-header">
2025-04-08 15:56:13 +08:00
<image
src="/static/images/icon-date.png"
mode="scaleToFill"
style="width: 40rpx; height: 40rpx"
/>
2025-04-08 13:33:16 +08:00
<view class="date">05-21</view>
<view>1天前</view>
</view>
<view class="plan-content">
<view class="plan-content-top">
<view class="place">校门A区教学楼</view>
<u-tag text="9:00~12:00" type="info" border-color="transparent" />
</view>
<view class="plan-content-main">
北大门右侧操场跑道/南广场升旗台/A区第二食堂3楼
</view>
2025-04-07 09:30:11 +08:00
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
2025-04-08 13:33:16 +08:00
return {
activeTab: "completed",
2025-04-08 15:56:13 +08:00
maxDate: "2049-12-31",
showCalendar: false,
dateRange: "",
2025-04-08 13:33:16 +08:00
};
2025-04-07 09:30:11 +08:00
},
created() {},
2025-04-08 13:33:16 +08:00
methods: {
2025-04-08 15:56:13 +08:00
toggleDate() {
this.showCalendar = !this.showCalendar;
},
2025-04-08 13:33:16 +08:00
switchTab(tab) {
this.activeTab = tab;
},
2025-04-08 15:56:13 +08:00
changeDate(e) {
console.log('333',e);
this.dateRange = e;
},
2025-04-08 13:33:16 +08:00
},
2025-04-07 09:30:11 +08:00
};
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
background: #f7f8fc;
2025-04-08 13:33:16 +08:00
.selectTab {
2025-04-07 09:30:11 +08:00
display: flex;
2025-04-08 15:06:27 +08:00
// background: url("@/static/images/plan-tab2.png") no-repeat 0 0;
background-size: 100% 100%;
2025-04-08 15:11:01 +08:00
background-repeat: no-repeat;
background-position: 0 0;
transition: opacity 0.3s ease;
2025-04-08 13:33:16 +08:00
border-radius: 16rpx;
2025-04-08 15:06:27 +08:00
padding: 32rpx 0;
2025-04-08 13:33:16 +08:00
margin: 0 32rpx 32rpx;
.tab-item {
flex: 1;
text-align: center;
position: relative;
transition: all 0.3s;
position: relative;
2025-04-08 15:56:13 +08:00
z-index: 1;
2025-04-08 13:33:16 +08:00
.label {
2025-04-07 09:30:11 +08:00
font-size: 28rpx;
2025-04-08 13:33:16 +08:00
color: rgba(255, 255, 255, 0.8);
margin-bottom: 8rpx;
2025-04-07 09:30:11 +08:00
}
2025-04-08 13:33:16 +08:00
.count {
font-size: 36rpx;
color: #ffffff;
font-weight: 500;
}
&.active {
.label {
color: #ffffff;
font-weight: 500;
}
2025-04-08 15:06:27 +08:00
// &::after {
// content: "";
// position: absolute;
// bottom: -46rpx;
// left: 50%;
// transform: translateX(-50%) rotate(45deg);
// width: 32rpx;
// height: 32rpx;
// background: #383edd;
// border-radius: 10rpx;
// z-index: 1;
// }
2025-04-08 13:33:16 +08:00
2025-04-08 15:06:27 +08:00
// &::before {
// content: "";
// position: absolute;
// bottom: -34rpx;
// left: 50%;
// transform: translateX(-50%);
// width: 8rpx;
// height: 8rpx;
// background: #ffffff;
// border-radius: 4rpx;
// z-index: 2;
// }
2025-04-07 09:30:11 +08:00
}
}
}
2025-04-08 15:11:01 +08:00
.tab-completed {
background-image: url("/static/images/plan-tab1.png");
}
.tab-incomplete {
background-image: url("/static/images/plan-tab2.png");
}
2025-04-07 09:30:11 +08:00
.planList {
padding: 0 32rpx;
.plan-item {
2025-04-08 13:33:16 +08:00
border-radius: 16rpx;
2025-04-07 09:30:11 +08:00
margin-top: 32rpx;
2025-04-08 13:33:16 +08:00
background: linear-gradient(
to bottom,
#edf2ff 0%,
#fafcff 30%,
#ffffff 100%
);
.plan-header {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 20rpx;
padding: 20rpx;
border-bottom: 1px solid #f2f2f2;
}
.plan-content {
padding: 20rpx;
padding-bottom: 32rpx;
&-top {
display: flex;
justify-content: space-between;
align-items: center;
.place {
font-size: 32rpx;
color: #333;
}
}
&-main {
margin-top: 32rpx;
background-color: #f3f3f3;
padding: 32rpx;
border-radius: 16rpx;
}
}
}
&.activeList {
.plan-item {
background: linear-gradient(
to bottom,
#fef7ec 0%,
#fffdfa 30%,
#ffffff 100%
);
}
2025-04-07 09:30:11 +08:00
}
}
}
</style>