This commit is contained in:
李彪 2025-04-15 10:07:21 +08:00
commit 5def8e859a
3 changed files with 66 additions and 20 deletions

View File

@ -31,7 +31,6 @@
class="image"
v-for="(v, i) in dataInfo.pictures"
:key="i"
mode="aspectFill"
:src="BASE_URL + '/uploads/' + v.path"
@click="previewImage(i)"
></image>
@ -72,7 +71,9 @@ export default {
//
previewImage(index) {
uni.previewImage({
urls: this.dataInfo.pictures.map((v) => BASE_URL + "/uploads/" + v.path),
urls: this.dataInfo.pictures.map(
(v) => BASE_URL + "/uploads/" + v.path
),
current: index,
});
},

View File

@ -78,7 +78,7 @@
</view>
</view>
</view>
<!-- <button @click="nfcResFn(true)">刷卡成功</button> -->
<!-- <button @click="successShow = true">刷卡成功</button> -->
<!-- <button @click="nfcResFn(false)">刷卡失败</button> -->
<!-- nfc刷卡成功弹窗 -->
<u-popup v-model="successShow" mode="center" :round="30">
@ -115,7 +115,8 @@
</view>
<view class="btn-box">
<view class="btn-cancel" @click="errorShow = false">暂不</view>
<view class="btn-success" @click="exceptionReportFn">异常上报</view>
<view class="btn-success" @click="errorShow = false">异常上报</view>
<!-- <view class="btn-success" @click="exceptionReportFn">异常上报</view> -->
</view>
</view>
</view>

View File

@ -30,7 +30,7 @@
@click="switchTab('completed')"
>
<view class="label">已完成计划</view>
<view class="count">12</view>
<view class="count">{{ completedPlanList.length }}</view>
</view>
<view
class="tab-item"
@ -38,7 +38,7 @@
@click="switchTab('incomplete')"
>
<view class="label">未完成计划</view>
<view class="count">12</view>
<view class="count">{{ incompletePlanList.length }}</view>
</view>
</view>
@ -63,7 +63,13 @@
</view>
</view>
</view> -->
<view class="plan-item" v-for="(item, index) in planList" :key="index">
<view
class="plan-item"
v-for="(item, index) in activeTab === 'completed'
? completedPlanList
: incompletePlanList"
:key="index"
>
<view class="plan-header">
<image
src="/static/images/icon-date.png"
@ -83,12 +89,20 @@
</view>
</view>
</view>
<u-empty
v-if="
!loading &&
((activeTab === 'completed' && completedPlanList.length === 0) ||
(activeTab === 'incomplete' && incompletePlanList.length === 0))
"
mode="list"
></u-empty>
</view>
<!-- :max-date="maxDate" -->
<u-calendar
v-model="showCalendar"
mode="range"
:max-date="maxDate"
@change="changeDate"
></u-calendar>
<u-tabbar :list="vuex_tabbar"></u-tabbar>
@ -103,27 +117,31 @@ import { getDateDiff } from "@/utils/utils";
export default {
data() {
const todayStr = GetNowTime(new Date());
return {
activeTab: "completed",
maxDate: "2049-12-31",
// maxDate: "2049-12-31", //
showCalendar: false,
//
params: {
// '0 1 2'
"Item1.IsCompleted": 0,
dateBegin: GetNowTime(new Date()),
dateEnd: GetNowTime(new Date()),
// "Item1.IsCompleted": 1, // '0 1 2' 0 1 2
dateBegin: todayStr,
dateEnd: todayStr,
},
//
planList: [],
completedPlanList: [],
incompletePlanList: [],
loading: false, //
};
},
onShow() {
this.getPlanList();
//
this.fetchAllPlanLists();
},
methods: {
getDateDiff,
@ -138,15 +156,38 @@ export default {
changeDate(e) {
this.params.dateBegin = e.startDate;
this.params.dateEnd = e.endDate;
this.getPlanList();
//
this.fetchAllPlanLists();
},
//
async getPlanList() {
const res = await GetPlanList(this.params);
//
async fetchAllPlanLists() {
if (this.loading) return; //
this.loading = true;
uni.showLoading({ title: "加载中..." }); //
try {
await Promise.all([this.fetchListData(1), this.fetchListData(0)]);
} catch (error) {
console.error("获取所有列表时出错:", error);
} finally {
this.loading = false;
uni.hideLoading(); //
}
},
async fetchListData(status) {
const requestParams = {
...this.params,
"Item1.IsCompleted": status, // 0 1 2
};
const res = await GetPlanList(requestParams);
if (res.succeed) {
this.planList = res.data;
if (status === 1) {
this.completedPlanList = res.data || [];
} else {
this.incompletePlanList = res.data || [];
}
}
},
},
@ -154,6 +195,9 @@ export default {
</script>
<style lang="scss" scoped>
page {
background: #f7f8fc !important;
}
.content {
// height: 100vh;
padding-bottom: 100rpx;