diff --git a/src/api/base/xkApi.ts b/src/api/base/xkApi.ts index d7e3b0d..9666bbe 100644 --- a/src/api/base/xkApi.ts +++ b/src/api/base/xkApi.ts @@ -35,11 +35,16 @@ export const getXkDmXsPageApi = async (params: any) => { return await get('/api/xkDmXs/findPage', params) } -// 选课学生列表 +// 选课待点名学生列表 export const getWaitDmXsListApi = async (params: any) => { return await get("/api/xkDmXs/getWaitDmXsList", params); }; +// 选课点名学生列表 +export const getDmXsListApi = async (params: any) => { + return await get("/api/xkDmXs/getDmXsList", params); +}; + /** * 提交选课点名 */ diff --git a/src/pages.json b/src/pages.json index 591fa5d..1ffcf0f 100644 --- a/src/pages.json +++ b/src/pages.json @@ -527,16 +527,16 @@ } }, { - "path": "pages/view/routine/xk/dmRecord", + "path": "pages/view/routine/xk/dmList", "style": { - "navigationBarTitleText": "点名记录", + "navigationBarTitleText": "点名列表", "enablePullDownRefresh": false } }, { - "path": "pages/view/routine/xk/dmXsRecord", + "path": "pages/view/routine/xk/dmXsList", "style": { - "navigationBarTitleText": "点名学生记录", + "navigationBarTitleText": "点名学生列表", "enablePullDownRefresh": false } }, diff --git a/src/pages/components/dmPs/index.vue b/src/pages/components/dmPs/index.vue index 1aeb0a6..cb52ed6 100644 --- a/src/pages/components/dmPs/index.vue +++ b/src/pages/components/dmPs/index.vue @@ -54,7 +54,7 @@ - + {{ videoUploadText || '点击录制' }} diff --git a/src/pages/components/dmPs/preview.vue b/src/pages/components/dmPs/preview.vue new file mode 100644 index 0000000..e954365 --- /dev/null +++ b/src/pages/components/dmPs/preview.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/src/pages/view/homeSchool/parentAddressBook/detail.vue b/src/pages/view/homeSchool/parentAddressBook/detail.vue index 5dee488..43d81bc 100644 --- a/src/pages/view/homeSchool/parentAddressBook/detail.vue +++ b/src/pages/view/homeSchool/parentAddressBook/detail.vue @@ -94,10 +94,10 @@ import { imagUrl } from "@/utils"; import { onLoad } from "@dcloudio/uni-app"; import { xsJzListByXsIdApi } from "@/api/base/server"; import { useDataStore } from "@/store/modules/data"; -const { getData } = useDataStore(); +const { getXs } = useDataStore(); const xsInfo = computed(() => { - const xs = getData || {}; + const xs = getXs || {}; // 适配从点名页面传递过来的学生信息字段 const studentInfo = { id: xs.xsId || xs.id, // 支持两种字段名 @@ -159,7 +159,7 @@ onLoad(async (options) => { if (xsInfo.value && xsInfo.value.id) { try { uni.showLoading({ title: "加载中..." }); - const res = await xsJzListByXsIdApi({ xsId: xsInfo.value.id }); + const res:any = await xsJzListByXsIdApi({ xsId: xsInfo.value.id }); if (res && res.resultCode === 1) { jzList.value = res.result || []; } else { diff --git a/src/pages/view/homeSchool/parentAddressBook/index.vue b/src/pages/view/homeSchool/parentAddressBook/index.vue index 5c3a58e..02adcc9 100644 --- a/src/pages/view/homeSchool/parentAddressBook/index.vue +++ b/src/pages/view/homeSchool/parentAddressBook/index.vue @@ -56,7 +56,7 @@ import NjBjPicker from "@/pages/components/NjBjPicker/index.vue"; import { imagUrl } from "@/utils"; import { xsFindList } from "@/api/base/server"; import { useDataStore } from "@/store/modules/data"; -const { setData } = useDataStore(); +const { setXs } = useDataStore(); const xsList = ref([]); const xsTotal = ref(0); @@ -114,7 +114,7 @@ const getXsList = async () => { // 跳转到详情页 const goToDetail = (xs: any) => { - setData(xs); + setXs(xs); uni.navigateTo({ url: `/pages/view/homeSchool/parentAddressBook/detail` }); diff --git a/src/pages/view/routine/xk/dm.vue b/src/pages/view/routine/xk/dm.vue index 789fd96..045a51b 100644 --- a/src/pages/view/routine/xk/dm.vue +++ b/src/pages/view/routine/xk/dm.vue @@ -32,35 +32,40 @@ - + - - - - - - - {{ xs.xsXm || xs.xsxm }} - - {{ getStatusText(xs.xsZt || xs.xszt) }} - - + + + + + - {{ xs.bjmc }} - + + {{ xs.xsXm || xs.xsxm }} + {{ xs.bjmc }} + + + + + + + {{ getStatusText(xs.xsZt || xs.xszt) }} + + + 联系家长 - + + + getJs) const xkkc = computed(() => getData) @@ -355,7 +362,7 @@ const contactParent = (dmXs: any) => { }; // 设置完整的学生信息到store中,供详情页面使用 - setData(completeStudent); + setXs(completeStudent); // 跳转到家长通讯录详情页面 uni.navigateTo({ @@ -538,13 +545,25 @@ onMounted(async () => { .student-grid { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 20rpx; + gap: 10px; } .student-item { position: relative; } +.student-content { + display: flex; + flex-direction: column; + gap: 12px; +} + +.top-row { + display: flex; + align-items: center; + gap: 12px; +} + .avatar-container { width: 46px; height: 46px; @@ -555,6 +574,7 @@ onMounted(async () => { align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); + flex-shrink: 0; } .student-avatar { @@ -564,13 +584,51 @@ onMounted(async () => { background-color: #f5f5f5; } +.student-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 4px; +} + +.student-name { + font-size: 14px; + font-weight: bold; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.student-class { + font-size: 12px; + color: #666; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.bottom-row { + display: flex; + justify-content: space-between; + align-items: center; + gap: 5px; +} + .status-tag { - font-size: 10px; - padding: 1px 5px; + font-size: 12px; + padding: 3px 8px; border-radius: 4px; display: flex; align-items: center; cursor: pointer; + background-color: rgba(64, 128, 255, 0.1); + border: 1px solid transparent; + transition: all 0.2s ease; + + &:active { + transform: scale(0.95); + } } .status-normal { @@ -589,7 +647,7 @@ onMounted(async () => { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - max-width: 60px; + max-width: 100%; } .contact-parent { @@ -597,11 +655,14 @@ onMounted(async () => { border-radius: 4px; border: 1px solid #4080ff; display: inline-flex; + align-items: center; cursor: pointer; transition: all 0.2s ease; + white-space: nowrap; + background-color: rgba(64, 128, 255, 0.05); &:active { - background-color: rgba(64, 128, 255, 0.1); + background-color: rgba(64, 128, 255, 0.15); transform: scale(0.95); } } diff --git a/src/pages/view/routine/xk/dmIndex.vue b/src/pages/view/routine/xk/dmIndex.vue index 6b8c084..3819029 100644 --- a/src/pages/view/routine/xk/dmIndex.vue +++ b/src/pages/view/routine/xk/dmIndex.vue @@ -240,6 +240,7 @@ const goDm = (xkkc: any) => { } else { msg = "上课时间未到,无法点名"; } + dmFlag = true; if (dmFlag) { setData(xkkc); uni.navigateTo({ @@ -259,57 +260,10 @@ const goDm = (xkkc: any) => { // 跳转到点名记录 const goRecord = (xkkc: any) => { - const now = dayjs(); - let wDay = now.day(); - if (wDay === 0) { - wDay = 7; - } - let mDay = now.date(); - const strDate = now.format('YYYY-MM-DD') + ' '; - let recordFlag = false; - let msg = ""; - // 判断周期 - switch (xkkc.skzqlx) { - case '每天': - recordFlag = true; - break; - case '每周': - const daysOfWeek = xkkc.skzq.split(',').map(Number); - recordFlag = daysOfWeek.includes(wDay); - // 从wdNameList读取daysOfWeek对应的周几 - xkkc.skzqmc = daysOfWeek.map((day: number) => wdNameList[day - 1]).join(','); - break; - case '每月': - const daysOfMonth = xkkc.skzq.split(',').map(Number); - recordFlag = daysOfMonth.includes(mDay); - // 从根据编号加 - xkkc.skzqmc = daysOfMonth.map((day: number) => day + "号").join(','); - break; - } - // 判断日期是否合格 - if (recordFlag) { - // xkkc.skkstime开始时间向前dmBeforeMinute分钟 - const startTime = dayjs(strDate + xkkc.skkstime).subtract(dmBeforeMinute.value, 'minute').format('YYYY-MM-DD HH:mm:ss'); - const endTime = dayjs(strDate + xkkc.skjstime, 'YYYY-MM-DD HH:mm:ss'); - recordFlag = now.isBefore(endTime) && now.isAfter(startTime) - } else { - msg = "上课时间未到,无法查看点名记录"; - } - if (recordFlag) { - setData(xkkc); - uni.navigateTo({ - url: `/pages/view/routine/xk/dmXkkcRecord`, - }); - } else { - if (msg === "") { - msg = "上课时间未到,无法查看点名记录"; - } - uni.showToast({ - title: msg, - icon: 'none', - duration: 2000 - }); - } + setData(xkkc); + uni.navigateTo({ + url: `/pages/view/routine/xk/dmList`, + }); }; // 页面卸载前清除定时器 diff --git a/src/pages/view/routine/xk/dmList.vue b/src/pages/view/routine/xk/dmList.vue index ae91cb7..199c884 100644 --- a/src/pages/view/routine/xk/dmList.vue +++ b/src/pages/view/routine/xk/dmList.vue @@ -1,89 +1,107 @@ + \ No newline at end of file diff --git a/src/pages/view/routine/xk/dmXsList.vue b/src/pages/view/routine/xk/dmXsList.vue index c9bba10..ed3358b 100644 --- a/src/pages/view/routine/xk/dmXsList.vue +++ b/src/pages/view/routine/xk/dmXsList.vue @@ -11,27 +11,43 @@ - {{ formatDateTime(dmRecord.dmTime) }} + {{ formatDateTime(safeDmRecord.dmTime) }} - - {{ dmRecord.zrs || 0 }} + + {{ safeDmRecord.zrs || 0 }} 总人数 - - {{ dmRecord.sdRs || 0 }} + + {{ safeDmRecord.sdRs || 0 }} 实到 - - {{ dmRecord.qjRs || 0 }} + + {{ safeDmRecord.qjRs || 0 }} 请假 - - {{ dmRecord.qqRs || 0 }} + + {{ safeDmRecord.qqRs || 0 }} 缺勤 @@ -39,97 +55,95 @@ - - - 学生列表 - - - {{ tab.label }} - - - - - - + + - - - {{ (student.xsXm || student.xsxm)?.charAt(0) || '学' }} - - - {{ student.xsXm || student.xsxm }} - {{ student.njmc }} {{ student.bjmc }} - - - - {{ getStatusText(student.xsZt || student.xszt) }} - + + + + + + + + {{ xs.xsXm || xs.xsxm }} + {{ xs.bjmc }} + + + + + + + {{ getStatusText(xs.xsZt || xs.xszt) }} + + + 联系家长 + + + - - - - - 暂无学生数据 - - - - + + + + + @@ -250,34 +293,80 @@ onMounted(() => { .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); - gap: 15px; + gap: 20rpx; } .stat-item { background: white; border-radius: 12px; - padding: 20px 15px; + padding: 20rpx 0; text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + cursor: pointer; + transition: all 0.3s ease; + position: relative; + + &:hover { + transform: translateY(-2px); + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); + } + + &.active { + transform: translateY(-2px); + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); + + &::after { + content: ''; + position: absolute; + bottom: -2px; + left: 50%; + transform: translateX(-50%); + width: 50rpx; + height: 20rpx; + background: #4080ff; + border-top-left-radius: 50rpx; + border-top-right-radius: 50rpx; + } + } &.total { border: 2px solid #666; .stat-number { color: #333; } + + &.active { + border-color: #4080ff; + background: rgba(64, 128, 255, 0.05); + } } &.present { - border: 2px solid #2879ff; - .stat-number { color: #2879ff; } + border: 2px solid #52c41a; + .stat-number { color: #52c41a; } + + &.active { + border-color: #4080ff; + background: rgba(64, 128, 255, 0.05); + } } &.leave { border: 2px solid #ff9900; .stat-number { color: #ff9900; } + + &.active { + border-color: #4080ff; + background: rgba(64, 128, 255, 0.05); + } } &.absent { border: 2px solid #ff4d4f; .stat-number { color: #ff4d4f; } + + &.active { + border-color: #4080ff; + background: rgba(64, 128, 255, 0.05); + } } .stat-number { @@ -293,135 +382,127 @@ onMounted(() => { } } -.student-section { - .section-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 15px; +.media-section { + background: white; + border-radius: 8px; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); + overflow: hidden; +} - .section-title { - font-size: 16px; - font-weight: bold; - color: #333; - padding-left: 10px; - border-left: 4px solid #4080ff; - } +.student-list { + padding: 0 15px; +} - .filter-tabs { - display: flex; - gap: 10px; +.student-grid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 10px; +} - .filter-tab { - padding: 6px 12px; - border-radius: 16px; - font-size: 12px; - background: #f5f5f5; - color: #666; - cursor: pointer; - transition: all 0.3s ease; +.student-item { + position: relative; +} - &.active { - background: #4080ff; - color: white; - } - } - } - } +.student-content { + display: flex; + flex-direction: column; + gap: 12px; +} - .student-list { - display: flex; - flex-direction: column; - gap: 10px; +.top-row { + display: flex; + align-items: center; + gap: 12px; +} - .student-item { - display: flex; - align-items: center; - padding: 15px; - background: white; - border-radius: 12px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +.avatar-container { + width: 46px; + height: 46px; + border-radius: 50%; + padding: 3px; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); + flex-shrink: 0; +} - .student-avatar { - width: 40px; - height: 40px; - border-radius: 50%; - overflow: hidden; - margin-right: 15px; +.student-avatar { + width: 40px; + height: 40px; + border-radius: 50%; + background-color: #f5f5f5; +} - .avatar-img { - width: 100%; - height: 100%; - object-fit: cover; - } +.student-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 4px; +} - .avatar-text { - width: 100%; - height: 100%; - background: #4080ff; - color: white; - display: flex; - align-items: center; - justify-content: center; - font-size: 16px; - font-weight: bold; - } - } +.student-name { + font-size: 14px; + font-weight: bold; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} - .student-info { - flex: 1; +.student-class { + font-size: 12px; + color: #666; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} - .student-name { - font-size: 16px; - font-weight: 500; - color: #333; - margin-bottom: 4px; - } +.bottom-row { + display: flex; + justify-content: space-between; + align-items: center; + gap: 5px; +} - .student-class { - font-size: 14px; - color: #666; - } - } +.status-tag { + font-size: 12px; + padding: 3px 12px; + border-radius: 4px; + display: flex; + align-items: center; + background-color: rgba(64, 128, 255, 0.1); + border: 1px solid transparent; + transition: all 0.2s ease; +} - .student-status { - .status-normal { - color: #2879ff; - background: rgba(40, 121, 255, 0.1); - padding: 4px 8px; - border-radius: 4px; - font-size: 12px; - } +.status-normal { + color: #4080ff; +} - .status-leave { - color: #ff9900; - background: rgba(255, 153, 0, 0.1); - padding: 4px 8px; - border-radius: 4px; - font-size: 12px; - } +.status-leave { + color: #ff9900; +} - .status-absent { - color: #ff4d4f; - background: rgba(255, 77, 79, 0.1); - padding: 4px 8px; - border-radius: 4px; - font-size: 12px; - } - } - } - } +.status-absent { + color: #ff4d4f; +} - .empty-state { - text-align: center; - padding: 60px 20px; - color: #ccc; - - .empty-text { - display: block; - margin-top: 15px; - font-size: 16px; - } +.contact-parent { + padding: 3px 8px; + border-radius: 4px; + border: 1px solid #4080ff; + display: inline-flex; + align-items: center; + cursor: pointer; + transition: all 0.2s ease; + white-space: nowrap; + background-color: rgba(64, 128, 255, 0.05); + + &:active { + background-color: rgba(64, 128, 255, 0.15); + transform: scale(0.95); } } @@ -449,10 +530,18 @@ onMounted(() => { .white-bg-color { background-color: white; } .r-md { border-radius: 8px; } .p-15 { padding: 15px; } +.p-12 { padding: 12px; } .flex-row { display: flex; flex-direction: row; } +.flex-center { display: flex; align-items: center; justify-content: center; } .items-center { align-items: center; } .font-16 { font-size: 16px; } .font-14 { font-size: 14px; } +.font-12 { font-size: 12px; } .font-bold { font-weight: bold; } .cor-999 { color: #999; } +.cor-primary { color: #4080ff; } +.cor-warning { color: #ff9900; } +.cor-danger { color: #ff4d4f; } +.cor-666 { color: #666; } +.ml-2 { margin-left: 2px; } diff --git a/src/store/modules/data.ts b/src/store/modules/data.ts index 01db7af..45588c8 100644 --- a/src/store/modules/data.ts +++ b/src/store/modules/data.ts @@ -8,6 +8,7 @@ export const useDataStore = defineStore({ xxts: {}, // 添加xxts字段 global: {}, file: {}, + xs: {}, // 学生专用 }), getters: { getData(): any { @@ -25,6 +26,9 @@ export const useDataStore = defineStore({ getFile(): any { return this.file; }, + getXs(): any { + return this.xs; + } }, actions: { setData(data: any) { @@ -42,6 +46,9 @@ export const useDataStore = defineStore({ setFile(data: any) { this.file = data; }, + setXs(data: any) { + this.xs = data; + } }, persist: { enabled: true,