From 63b2b587f676e23198ac583bcc715406e4d6ccf3 Mon Sep 17 00:00:00 2001 From: liutong <836164388@qq.com> Date: Thu, 17 Apr 2025 18:31:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(my=5Fattendance):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=87=BA=E5=8B=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 根据用户类型动态显示不同内容- 使用 v-for 循环渲染列表项 - 绑定实际数据到模板中 -调整页面布局和样式 --- pages/common/my_attendance.vue | 229 ++++++++++----------------------- 1 file changed, 66 insertions(+), 163 deletions(-) diff --git a/pages/common/my_attendance.vue b/pages/common/my_attendance.vue index bbb8dec..fe56e8d 100644 --- a/pages/common/my_attendance.vue +++ b/pages/common/my_attendance.vue @@ -12,7 +12,7 @@ - + - + - + - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - + {{v.courses.name}} + + {{v.status == 1 ? '考勤正常':'请假'}} - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 + + {{v.add_time}} - {{v.end_time}} @@ -66,39 +50,23 @@ scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData" - style="height: 100vh;" + style="height: 80vh;" > - + - + - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - + {{v.courses.name}} + + {{v.status == 1 ? '考勤正常':'请假'}} - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 + + {{v.add_time}} - {{v.end_time}} @@ -111,39 +79,23 @@ scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData" - style="height: 100vh;" + style="height: 80vh;" > - + - + - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - + {{v.courses.name}} + + {{v.status == 1 ? '考勤正常':'请假'}} - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 篮球课 - 考勤正常 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 + + {{v.add_time}} - {{v.end_time}} @@ -151,8 +103,7 @@ - - + - - - - - - 普通考勤 - 迟到 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - + - + 普通考勤 - 早退 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 普通记录 - 本周考勤情况:周一到周五均按时打卡,未请假,综合表现良好。 + + {{v.status == 1 ? '考勤正常':'请假'}} + {{v.add_time}} - {{v.end_time}} @@ -206,39 +140,22 @@ scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData" - style="height: 100vh;" + style="height: 80vh;" > - - - - - - 普通考勤 - 迟到 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - + - + 普通考勤 - 早退 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 普通记录 - 本周考勤情况:周一到周五均按时打卡,未请假,综合表现良好。 + + {{v.status == 1 ? '考勤正常':'请假'}} + {{v.add_time}} - {{v.end_time}} @@ -252,39 +169,22 @@ scroll-y="true" :lower-threshold="lowerThreshold" @scrolltolower="loadMoreData" - style="height: 100vh;" + style="height: 80vh;" > - + - + 普通考勤 - 迟到 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 普通考勤 - 早退 - 2025-01-01 00:00:00 - 2025-01-01 00:00:00 - - - - - - - - - 普通记录 - 本周考勤情况:周一到周五均按时打卡,未请假,综合表现良好。 + + {{v.status == 1 ? '考勤正常':'请假'}} + {{v.add_time}} - {{v.end_time}} @@ -316,6 +216,7 @@ export default { }, data() { return { + userType: '', //用户类型|1=教练,2=销售 //tab切换 optionTable: [ { @@ -363,6 +264,8 @@ export default { methods: { //初始化 async init(){ + this.userType = uni.getStorageSync('userType') + // this.userType = 2 this.getCurrentDate()//获取并格式化当前日期 await this.getList(); }, @@ -444,7 +347,7 @@ export default { this.tableList = this.tableList.concat(res.data.data); // 使用 concat 方法 将新数据追加到数组中 console.log('列表',this.tableList) - this.filteredData.total = res.data.data.total + this.filteredData.total = res.data.total this.filteredData.page++ },