fix: 保洁空状态

This commit is contained in:
yangzhe 2025-05-08 13:47:54 +08:00
parent be579b08c6
commit aa6e761bf6
2 changed files with 59 additions and 35 deletions

View File

@ -18,37 +18,44 @@
<u-tag text="9:00~12:00" type="info" border-color="transparent" /> <u-tag text="9:00~12:00" type="info" border-color="transparent" />
</view> </view>
</view> --> </view> -->
<view v-if="!isLoading && planList.length != 0">
<view
class="task-item"
v-for="item in planList"
:key="item.id"
@click="handleTaskClick(item)"
>
<view class="name-state">
<view class="name">{{ item.name }}</view>
<u-tag
v-if="item.isCompleted == 0"
text="待保洁"
type="info"
border-color="transparent"
/>
<u-tag
v-else
text="已完成"
type="success"
border-color="transparent"
/>
</view>
<view <view class="time">
class="task-item" <u-tag
v-for="item in planList" :text="item.beginTime + '~' + item.endTime"
:key="item.id" type="info"
@click="handleTaskClick(item)" border-color="transparent"
> />
<view class="name-state"> </view>
<view class="name">{{ item.name }}</view>
<u-tag
v-if="item.isCompleted == 0"
text="待保洁"
type="info"
border-color="transparent"
/>
<u-tag
v-else
text="已完成"
type="success"
border-color="transparent"
/>
</view>
<view class="time">
<u-tag
:text="item.beginTime + '~' + item.endTime"
type="info"
border-color="transparent"
/>
</view> </view>
</view> </view>
<u-empty
v-if="!isLoading && planList.length == 0"
text="暂无计划"
mode="list"
></u-empty>
</view> </view>
</view> </view>
<view v-if="isToday" class="area-schedule"> <view v-if="isToday" class="area-schedule">
@ -95,13 +102,27 @@
<view class="bottom">23:59:00</view> <view class="bottom">23:59:00</view>
</view> </view>
</view> --> </view> -->
<view class="cleaning-plan" v-for="item in planList" :key="item.id">
<view class="title">{{ item.name }}</view> <view v-if="!isLoading && planList.length != 0">
<view class="time"> <view class="cleaning-plan" v-for="item in planList" :key="item.id">
<view class="top">{{ item.beginTime }}</view> <view class="title">{{ item.name }}</view>
<view class="bottom">{{ item.endTime }}</view> <view class="time">
<view class="top">{{ item.beginTime }}</view>
<view class="bottom">{{ item.endTime }}</view>
</view>
</view> </view>
</view> </view>
<view
v-if="!isLoading && planList.length == 0"
style="display: flex; justify-content: center"
>
<image
src="/static/images/empty-image.png"
mode="scaleToFill"
style="width: 592rpx; height: 678rpx"
/>
</view>
</view> </view>
<u-tabbar :list="vuex_tabbar" :border-top="false"></u-tabbar> <u-tabbar :list="vuex_tabbar" :border-top="false"></u-tabbar>
</view> </view>
@ -128,6 +149,7 @@ export default {
completed: 0, completed: 0,
notCompleted: 0, notCompleted: 0,
}, },
isLoading: false,
}; };
}, },
@ -209,10 +231,12 @@ export default {
// //
async getPlanByDate() { async getPlanByDate() {
this.planList = []; // this.planList = [];
this.isLoading = true;
const res = await GetPlanByDate({ Date: this.currentDate }); const res = await GetPlanByDate({ Date: this.currentDate });
if (res.succeed) { if (res.succeed) {
this.planList = res.data; this.planList = res.data;
this.isLoading = false;
} }
}, },

View File

@ -96,7 +96,7 @@
((activeTab === 'completed' && completedPlanList.length === 0) || ((activeTab === 'completed' && completedPlanList.length === 0) ||
(activeTab === 'incomplete' && incompletePlanList.length === 0)) (activeTab === 'incomplete' && incompletePlanList.length === 0))
" "
text="暂无内容" text="暂无计划"
mode="list" mode="list"
></u-empty> ></u-empty>
</view> </view>