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X>BUURqOE
zTw@Y&N0}^zniCnJp_A8>1KHz)#1!6B$to1q1xw9vIMR<$Ct|lkr2Ys0e~k(w|{M2@d`CB
zs!cQ**c<4Y5aa_Navm*LGbnyfy#kC$&AH6?$f|&U*x^!%{b~YCm%h5K>nR=zTD+Q>
zdNJJSfq8SEUQ_G;x0cv6114jy)!kkl4ToRXVp!x!jRKO#^ZW~&$L-N-T^C?7`pV|3
zKli}*XRQuIKI;?+W8j(fbyNPL$D(e)Wc=mY)(S84{)s_eqQ{xYYfJ%-$dM2aJ-cz+
zw4^=eMAi)fCPRT2E)|U(>))-`yEYb*xN1lNw!gEpYi;1QvJNAv7zP}7_Pe^aicrY&
z3}<{910FO|2yx9Y1sJ;wj#H8({e#K!yU*7ao;Rb9X~4sszZ&Q$4~N6$lEljxXLshW
zMN(HlmOYo4)PFQ*;)F9*RqXE3tm@Zk$zdsAEe=H0g<0NXCPy$=5m?4NMr@X>SV00000NkvXXu0mjfJy*6c
literal 0
HcmV?d00001
From b1e82d0ba3f56759cc5531c90c904fdb690313ba Mon Sep 17 00:00:00 2001
From: "962704835@qq.com"
Date: Sat, 25 Oct 2025 03:20:44 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=90=9C=E7=B4=A2=E5=8C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/dms/studentDormInfo/index.js | 20 +-
pages/dormitory/studentDormInfo/index.vue | 409 ++++++++++++++++--
.../studentDormInfo/informationCollection.vue | 56 ++-
3 files changed, 432 insertions(+), 53 deletions(-)
diff --git a/api/dms/studentDormInfo/index.js b/api/dms/studentDormInfo/index.js
index 70d6498..f7df997 100644
--- a/api/dms/studentDormInfo/index.js
+++ b/api/dms/studentDormInfo/index.js
@@ -56,4 +56,22 @@ export function listAllRoomByFloor(id) {
url: '/dormitory/dms-dormitory/listAllRoomByFloor/' + id,
method: 'get'
})
-}
\ No newline at end of file
+}
+
+// 修改证件照
+export function submitOwnInfo(data){
+ return request({
+ url:'/comprehensive/extraInfo/submitOwnInfo',
+ method:'POST',
+ data
+ })
+}
+
+// 查询年级列表
+export function listGrade(query = null) {
+ return request({
+ url: '/cph/grade/list',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue
index e64a85f..5168be0 100644
--- a/pages/dormitory/studentDormInfo/index.vue
+++ b/pages/dormitory/studentDormInfo/index.vue
@@ -1,11 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 年级
+
+
+
+ {{ gradeList[gradeIndex] ? gradeList[gradeIndex].gradeName : '全部' }}
+
+
+
+
+
+
+
+ 宿舍区
+
+
+ {{ dormAreaList[dormAreaIndex] ? dormAreaList[dormAreaIndex].name : '全部' }}
+
+
+
+
+
+
+
+ 园区
+
+
+ {{ parkList[parkIndex] ? parkList[parkIndex].name : '全部' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
学号: {{ item.stuNo }}
班级: {{ item.className }}
院系: {{ item.deptName }}
- 宿舍: {{ item.parkName }} {{ item.buildingName }} {{ item.floorName }}楼{{ item.roomNo }}室
+ 宿舍: {{ item.parkName }} {{ item.buildingName }}
+ {{ item.floorName }}楼{{ item.roomNo }}室
入住时间: {{ item.checkinTime }}
状态: {{ item.inStatus === '1' ? '已入住' : '未入住' }}
@@ -38,12 +114,16 @@
@@ -169,20 +373,63 @@
.page-container {
position: relative;
height: 100vh;
+ padding-top: 44px;
+ /* 预留原生title高度 */
background-color: #f5f7fa;
- }
-
- /* 滚动容器 */
- .scroll-container {
- height: 100%;
- /* 必须设置高度才能滚动 */
- width: 100%;
- padding-bottom: 120rpx;
- /* 预留底部按钮空间 */
box-sizing: border-box;
}
- /* 添加按钮 */
+ /* 固定搜索区:收缩时无空白 */
+ .fixed-search-wrap {
+ position: fixed;
+ top: 44px;
+ left: 0;
+ right: 0;
+ z-index: 90;
+ background-color: #fff;
+ /* 背景改为白色,与页面融合 */
+ border-bottom: 1px solid #eee;
+ padding: 14px;
+ }
+
+ /* 触发器:样式简洁,点击区域大 */
+ .search-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20rpx;
+ cursor: pointer;
+ border-bottom: 1px solid #f5f5f5;
+ }
+
+ .search-header-title {
+ font-size: 28rpx;
+ font-weight: 500;
+ color: #333;
+ }
+
+ /* 搜索内容*/
+ .search-content {
+ transition: all 0.3s ease;
+ /* 动画过渡更自然 */
+ }
+
+ .search-card {
+ padding: 20rpx;
+ box-shadow: none;
+ /* 收缩时去掉阴影,更简洁 */
+ }
+
+ /* 滚动容器:调整顶部内边距,适应搜索区高度变化 */
+ .scroll-container {
+ height: 100%;
+ width: 100%;
+ padding-top: 290rpx;
+ padding-bottom: 120rpx;
+ box-sizing: border-box;
+ }
+
+ /* 以下为原有样式,无需修改 */
.add {
position: fixed;
bottom: 50rpx;
@@ -200,12 +447,10 @@
z-index: 99;
}
- /* 列表容器 */
.dorm-list {
padding: 20rpx;
}
- /* 列表项 */
.dorm-item {
background-color: #fff;
border-radius: 16rpx;
@@ -217,10 +462,8 @@
.dorm-item:active {
transform: scale(0.99);
- /* 点击反馈 */
}
- /* 列表项头部 */
.item-header {
display: flex;
justify-content: space-between;
@@ -247,7 +490,6 @@
background-color: #28a745;
}
- /* 列表项内容 */
.item-content {
font-size: 28rpx;
color: #666;
@@ -262,7 +504,6 @@
margin-bottom: 0;
}
- /* 加载状态 */
.loading,
.no-more,
.no-data {
@@ -275,4 +516,94 @@
.no-data {
padding: 100rpx 0;
}
+
+ .search-row {
+ display: flex;
+ align-items: center;
+ background-color: #f5f7fa;
+ border-radius: 60rpx;
+ padding: 14rpx 20rpx;
+ margin-bottom: 24rpx;
+ }
+
+ .search-icon {
+ margin-right: 12rpx;
+ }
+
+ .search-input {
+ flex: 1;
+ font-size: 28rpx;
+ color: #333;
+ }
+
+ .filter-row {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16rpx;
+ margin-bottom: 24rpx;
+ }
+
+ .filter-item {
+ flex: 1;
+ min-width: 120rpx;
+ display: flex;
+ flex-direction: column;
+ gap: 8rpx;
+ }
+
+ .filter-label {
+ font-size: 24rpx;
+ color: #666;
+ padding-left: 4rpx;
+ }
+
+ .picker-content,
+ .filter-input {
+ display: flex;
+ align-items: center;
+ font-size: 26rpx;
+ color: #333;
+ padding: 14rpx 16rpx;
+ background-color: #f5f7fa;
+ border-radius: 12rpx;
+ height: 60rpx;
+ box-sizing: border-box;
+ }
+
+ .filter-input::placeholder {
+ color: #999;
+ }
+
+ .action-row {
+ display: flex;
+ gap: 16rpx;
+ }
+
+ .reset-btn,
+ .search-btn {
+ flex: 1;
+ height: 72rpx;
+ line-height: 72rpx;
+ border-radius: 36rpx;
+ font-size: 28rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+
+ .reset-btn {
+ background-color: #fff;
+ color: #1890FF;
+ border: 1px solid #1890FF;
+ }
+
+ .search-btn {
+ background-color: #1890FF;
+ color: #fff;
+ border: none;
+ }
+
+ .btn-icon {
+ margin-right: 6rpx;
+ }
\ No newline at end of file
diff --git a/pages/dormitory/studentDormInfo/informationCollection.vue b/pages/dormitory/studentDormInfo/informationCollection.vue
index 3931898..20f5afa 100644
--- a/pages/dormitory/studentDormInfo/informationCollection.vue
+++ b/pages/dormitory/studentDormInfo/informationCollection.vue
@@ -92,13 +92,13 @@
上传图片
当前设置:最多上传1张图片,单个图片10MB以内
-
-
+
+
-
+
@@ -109,11 +109,19 @@
listBuildingByPark,
listFloorByBuilding,
listAllRoomByFloor,
- addStudent
+ addStudent,
+ submitOwnInfo as submitExtraInfo
} from "@/api/dms/studentDormInfo/index.js"
import {
getUserProfile
} from '@/api/system/user'
+ import {
+ previewImg
+ } from "@/utils/uploadImg.js"
+ import {
+ checkPic
+ } from "@/utils/checkPic.js"
+ import uploadFile from "@/plugins/upload.js";
export default {
data() {
return {
@@ -135,6 +143,7 @@
stuName: '',
displayText: '',
isInStudentsleep: '是',
+ photoData: ''
},
// 校区选项
campusOptions: [],
@@ -292,13 +301,25 @@
// 证件照上传
handleUpload() {
uni.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['album', 'camera'],
- success: (res) => {
- this.form.photo = res.tempFilePaths[0];
+ count: 3,
+ success: async (img) => {
+ let bool = await checkPic(img.tempFiles[0]);
+ if (bool) {
+ uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
+ // if (this.form.photo !== "") {
+ // this.form.photo = this.form.photo + "," + JSON.parse(res)
+ // .fileName;
+ // } else {
+ // this.form.photo = JSON.parse(res).fileName;
+ // }
+ this.form.photoData = img.tempFilePaths[0];
+ this.form.photo = JSON.parse(res).fileName;
+ })
+ }
+
}
- });
+ })
+
},
// 提交表单
async handleSubmit() {
@@ -325,7 +346,7 @@
// 模拟提交
uni.showLoading({
title: '提交中...'
- });
+ });
// 添加入住信息
let res = await addStudent(this.form);
if (res.code == 200) {
@@ -334,7 +355,16 @@
title: '提交成功',
icon: 'success'
});
- setTimeout(() => {
+ // 上次图片头像
+ let data = submitExtraInfo({
+ userId: this.user.data.userId,
+ whitePhoto: this.form.photo
+ })
+ // if (data.code == 200) {
+ // console.log(data);
+ // }
+
+ setTimeout(() => {
// 重置表单
this.form = {
campusName: '',
@@ -348,7 +378,7 @@
photo: ''
};
uni.navigateTo({
- url: `/pages/dormitory/studentDormInfo/index`
+ url: `/pages/dormitory/studentDormInfo/index`
})
}, 1000);
}
From 07e7a65ae5929df910f52375efd7d50a31a643d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=99=88=E6=81=92=E6=88=90?= <962704835@qq.com>
Date: Mon, 27 Oct 2025 17:50:50 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/dormitory/studentDormInfo/index.vue | 475 +++++++++++++++++++---
1 file changed, 429 insertions(+), 46 deletions(-)
diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue
index 5168be0..327479e 100644
--- a/pages/dormitory/studentDormInfo/index.vue
+++ b/pages/dormitory/studentDormInfo/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -42,23 +42,72 @@
-
+
园区
-
+
- {{ parkList[parkIndex] ? parkList[parkIndex].name : '全部' }}
+ {{ parkList[parkIndex] ? parkList[parkIndex].name : '全部' }}
-
+
+ {{ dormOptions[dormIndex] ? dormOptions[dormIndex].roomNo : '请输入'}}
+
+
+
@@ -80,34 +129,38 @@
+
-
-
-
-
-
@@ -116,6 +169,9 @@
import {
listAllCampus,
listParkByCampus,
+ listBuildingByPark,
+ listFloorByBuilding,
+ listAllRoomByFloor,
listStudent
} from "@/api/dms/studentDormInfo/index.js"
import {
@@ -140,23 +196,39 @@
stuName: null,
gradeId: null,
campusId: null,
- parkId:null,
+ parkId: null,
+ buildingId: null,
+ floorId: null,
+ dormitoryId: null,
dormArea: null, // 宿舍区筛选参数
parkName: null // 园区筛选参数
},
dormInfo: [],
isLoading: false,
hasMore: true,
+ total: 0, // 存储接口返回的总数据条数
// 筛选下拉选项数据
gradeList: [],
dormAreaList: [],
parkList: [],
+ // 楼栋选项(按园区联动)
+ buildingOptions: [],
+ // 楼层选项(下拉框)
+ floorOptions: [],
+ // 宿舍号选项(下拉框)
+ dormOptions: [],
// 筛选选中索引
gradeIndex: 0,
dormAreaIndex: 0,
parkIndex: 0,
+ buildingIndex: 0,
+ floorIndex: 0,
+ dormIndex: 0,
searchTimer: null,
- roleGroup: null
+ roleGroup: null,
+ // 存储搜索区高度(非学生有搜索区,学生无)
+ searchAreaHeight: 0,
+
}
},
onShow() {
@@ -165,6 +237,21 @@
this.getUserProfile()
this.listGrade()
this.listAllCampus()
+ this.scrollToTop()
+ // 页面渲染完成后,计算搜索区高度并设置内边距
+ this.$nextTick(() => {
+ this.calcSearchAreaHeight()
+ this.setScrollContentPadding()
+ })
+ },
+ watch: {
+ // 监听角色变化,重新设置内边距(防止角色切换导致适配问题)
+ roleGroup() {
+ this.$nextTick(() => {
+ this.calcSearchAreaHeight()
+ this.setScrollContentPadding()
+ })
+ }
},
methods: {
// 重置分页数据(用于刷新或重新加载)
@@ -172,8 +259,57 @@
this.queryParams.pageNum = 1
this.dormInfo = []
this.hasMore = true
+ this.total = 0 // 重置总条数
},
+ // 计算搜索区高度
+ calcSearchAreaHeight() {
+ if (this.roleGroup !== '学生') {
+ const query = uni.createSelectorQuery().in(this)
+ query.select('.fixed-search-wrap')
+ .boundingClientRect(rect => {
+ // 转换rpx为px(1rpx≈0.5px,根据实际设备像素比调整)
+ this.searchAreaHeight = rect ? Math.ceil(rect.height) : 145 // 145px≈290rpx
+ })
+ .exec()
+ } else {
+ this.searchAreaHeight = 0
+ }
+ console.log(this.searchAreaHeight);
+ },
+
+ // 动态设置滚动内容的顶部内边距
+ setScrollContentPadding() {
+ const scrollContent = document.querySelector('.scroll-content')
+ if (scrollContent) {
+ if (this.roleGroup !== '学生') {
+ // 非学生:内边距=搜索区高度 - 60rpx(额外间距)
+ const paddingTop = this.searchAreaHeight - 30 // 10px≈20rpx
+ scrollContent.style.paddingTop = `${paddingTop}px`
+ } else {
+ // 学生:内边距=20rpx(仅基础间距)
+ scrollContent.style.paddingTop = '10px' // 10px≈20rpx
+ }
+ }
+ },
+
+ // 滚动条回到顶部的方法
+ scrollToTop() {
+ // 1. scroll-view 自身回顶
+ if (this.$refs.scrollRef) {
+ this.$refs.scrollRef.scrollTo({
+ scrollTop: 0,
+ duration: 300
+ })
+ }
+ // 2. 页面级回顶(兜底)
+ uni.pageScrollTo({
+ scrollTop: 0,
+ duration: 300
+ })
+ },
+
+
// 查询列表数据
async getList() {
if (this.isLoading || !this.hasMore) {
@@ -187,13 +323,17 @@
const res = await listStudent(this.queryParams)
if (res.code === 200) {
const newData = res.rows || []
+ this.total = res.total || 0 // 从接口获取总数据条数(需确保接口返回 total)
+ // 第一页覆盖数据,后续页追加
this.dormInfo = this.queryParams.pageNum === 1 ? newData : [...this.dormInfo, ...newData]
- this.hasMore = newData.length === this.queryParams.pageSize
+ // 关键判断:当前已加载条数 >= 总条数 → 无更多数据
+ this.hasMore = this.dormInfo.length < this.total
} else {
uni.showToast({
title: '加载失败',
icon: 'none'
})
+ this.hasMore = false // 加载失败时停止后续请求
}
} catch (err) {
console.error('加载数据出错:', err)
@@ -201,6 +341,7 @@
title: '网络错误',
icon: 'none'
})
+ this.hasMore = false // 异常时停止后续请求
} finally {
this.isLoading = false
// 最终兜底:无论如何都停止刷新
@@ -309,6 +450,8 @@
this.queryParams.gradeId = selectedGrade.gradeId || null
this.resetData()
this.getList()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
},
// 宿舍区筛选
@@ -318,7 +461,9 @@
this.queryParams.campusId = selectedArea.id || null
this.resetData()
this.getList()
-
+ this.resetDorm()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
if (this.queryParams.campusId) {
// 根据校区id获取园区
let res = await listParkByCampus(this.queryParams.campusId)
@@ -330,13 +475,119 @@
}
},
+ // 宿舍区选择,重置园区等其他选择
+ resetDorm() {
+ this.parkList = []
+ this.parkIndex = 0
+ this.buildingOptions = []
+ this.buildingIndex = 0
+ this.floorIndex = 0
+ this.floorOptions = []
+ this.dormIndex = 0
+ this.dormOptions = []
+ },
+
+ // 判断是否选择上一个选项
+ isDorm(data) {
+ if (data == '楼层') {
+ if (this.queryParams.buildingId == null) {
+ uni.showToast({
+ title: '请先选择楼栋',
+ icon: 'none'
+ });
+ return
+ }
+ } else if (data == '宿舍号') {
+ if (this.queryParams.floorId == null) {
+ uni.showToast({
+ title: '请先选择楼层',
+ icon: 'none'
+ });
+ return
+ }
+ } else {
+ if (this.queryParams.campusId == null) {
+ uni.showToast({
+ title: '请先选择宿舍区',
+ icon: 'none'
+ });
+ return
+ }
+ }
+ },
+
// 园区筛选
- handleParkChange(e) {
+ async handleParkChange(e) {
+
this.parkIndex = e.detail.value
const selectedPark = this.parkList[this.parkIndex]
this.queryParams.parkId = selectedPark.id || null
this.resetData()
this.getList()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
+ this.buildingOptions = []
+ this.buildingIndex = 0
+ this.floorIndex = 0
+ this.floorOptions = []
+ this.dormIndex = 0
+ this.dormOptions = []
+
+ if (this.queryParams.parkId) {
+ // 根据园区id获取楼栋
+ let res = await listBuildingByPark(this.queryParams.parkId)
+ if (res.code == 200) {
+ this.buildingOptions = [{
+ name: '全部'
+ }, ...res.data]
+ }
+ }
+ },
+
+ // 楼栋筛选
+ async handleBuildingChange(e) {
+ this.buildingIndex = e.detail.value
+ const selectedBuilding = this.buildingOptions[this.buildingIndex]
+ this.queryParams.buildingId = selectedBuilding.id || null
+ this.floorIndex = 0
+ this.floorOptions = []
+ this.dormIndex = 0
+ this.dormOptions = []
+ if (this.queryParams.buildingId) {
+ // 根据楼栋id获取楼层
+ let res = await listFloorByBuilding(this.queryParams.buildingId)
+ if (res.code == 200) {
+ this.floorOptions = [{
+ floor: '全部'
+ }, ...res.data]
+
+ }
+ }
+ },
+
+ // 楼层筛选
+ async handleFloorChange(e) {
+ this.floorIndex = e.detail.value
+ const selectedFloor = this.floorOptions[this.floorIndex]
+ this.queryParams.floorId = selectedFloor.id || null
+ this.dormIndex = 0
+ this.dormOptions = []
+ if (this.queryParams.floorId) {
+ // 根据楼栋id获取楼层
+ let res = await listAllRoomByFloor(this.queryParams.floorId)
+ if (res.code == 200) {
+ this.dormOptions = [{
+ roomNo: '全部'
+ }, ...res.data]
+ }
+ }
+ },
+
+ // 宿舍号筛选
+ handleDormChange(e) {
+ this.dormIndex = e.detail.value
+ const selectedDorm = this.dormOptions[this.dormIndex]
+ this.queryParams.dormitoryId = selectedDorm.id || null
},
// 重置筛选
@@ -344,6 +595,9 @@
this.gradeIndex = 0
this.dormAreaIndex = 0
this.parkIndex = 0
+ this.buildingIndex = 0
+ this.floorIndex = 0
+ this.dormIndex = 0
// 重置筛选参数,保留分页基础参数
this.queryParams = {
...this.queryParams,
@@ -351,17 +605,48 @@
dormArea: null,
parkName: null,
roomNo: null,
- stuName: null
+ stuName: null,
+ campusId: null,
+ parkId: null,
+ buildingId: null,
+ floorId: null,
+ dormitoryId: null,
+ dormArea: null, // 宿舍区筛选参数
+ parkName: null // 园区筛选参数
}
this.resetData()
this.getList()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
},
// 手动搜索
handleSearch() {
this.resetData()
this.getList()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
},
+ addRecordsPopup() {
+ if (this.queryParams.parkId == null) {
+ uni.showToast({
+ title: '请先选择园区',
+ icon: 'none'
+ });
+ return
+ }
+ this.$refs.popupTime.open('center');
+ },
+ onCancel() {
+ this.$refs.popupTime.close();
+ },
+ topersonalReporting() {
+ this.resetData()
+ this.getList()
+ this.scrollToTop()
+ this.$nextTick(() => this.setScrollContentPadding())
+ this.$refs.popupTime.close();
+ }
},
destroyed() {
clearTimeout(this.searchTimer)
@@ -373,23 +658,24 @@
.page-container {
position: relative;
height: 100vh;
- padding-top: 44px;
- /* 预留原生title高度 */
background-color: #f5f7fa;
box-sizing: border-box;
+ /* 禁止页面滚动 */
+ overflow: hidden;
}
- /* 固定搜索区:收缩时无空白 */
+ /* 固定搜索区*/
.fixed-search-wrap {
position: fixed;
top: 44px;
+ /* 原生title高度 */
left: 0;
right: 0;
z-index: 90;
background-color: #fff;
- /* 背景改为白色,与页面融合 */
border-bottom: 1px solid #eee;
padding: 14px;
+ box-sizing: border-box;
}
/* 触发器:样式简洁,点击区域大 */
@@ -422,10 +708,25 @@
/* 滚动容器:调整顶部内边距,适应搜索区高度变化 */
.scroll-container {
- height: 100%;
+ position: absolute;
+ top: 44px;
+ /* 与原生title对齐 */
+ left: 0;
+ right: 0;
+ bottom: 60px;
+ /* 预留添加按钮高度 */
width: 100%;
- padding-top: 290rpx;
- padding-bottom: 120rpx;
+ overflow-y: auto;
+ overflow-x: hidden;
+ }
+
+ /* 滚动内容容器:处理内边距,避免内容被遮挡 */
+ .scroll-content {
+ /* 底部预留加载状态高度 */
+ padding-bottom: 40rpx;
+ /* 左右内边距 */
+ padding-left: 20rpx;
+ padding-right: 20rpx;
box-sizing: border-box;
}
@@ -448,7 +749,8 @@
}
.dorm-list {
- padding: 20rpx;
+ // padding: 20rpx;
+ padding: 0;
}
.dorm-item {
@@ -606,4 +908,85 @@
.btn-icon {
margin-right: 6rpx;
}
+
+ .popup-time,
+ .popup-audit {
+ width: 80%;
+
+ .popup-content {
+ width: 600rpx;
+ height: 750rpx;
+ padding: 40rpx 50rpx 40rpx;
+
+ .title {
+ text-align: center;
+ padding-bottom: 20rpx;
+ font-weight: bold;
+ font-size: 32rpx;
+ color: #3D3D3D;
+ border-bottom: 1px solid #F5F5F7;
+ }
+
+ .form-item {
+ width: 100%;
+ margin-top: 40rpx;
+ padding: 0 50rpx;
+
+ label {
+ font-weight: bold;
+ color: #202020;
+ }
+
+ picker {
+ margin-top: 20rpx;
+ border: 1px solid darkgray;
+ height: 72rpx;
+ line-height: 72rpx;
+ padding-left: 8px;
+ border-radius: 10rpx;
+
+ .uni-input {
+ display: flex;
+ color: #202020;
+
+ .val {
+ flex: 1;
+ }
+
+ .uni-icons {
+ margin: 0 20rpx;
+ opacity: 0.5;
+ }
+ }
+ }
+ }
+
+ .btns {
+ display: flex;
+ margin-top: 50rpx;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+
+ button {
+ flex: 1;
+ border-radius: 0;
+ height: 80rpx;
+ line-height: 80rpx;
+
+ &:first-child {
+ background-color: #ffffff;
+ border-top: 1px solid #F5F5F7;
+ }
+
+ &:last-child {
+ background-color: #258FE4;
+ border-top: 1px solid #258FE4;
+ }
+ }
+ }
+
+ }
+ }
\ No newline at end of file
From 1d61d6a2bdba073804c343d3d275c73e9fdc5a4b Mon Sep 17 00:00:00 2001
From: "962704835@qq.com"
Date: Mon, 27 Oct 2025 18:49:02 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8C=BA=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/dormitory/studentDormInfo/index.vue | 30 +++++++++++++++++++----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/pages/dormitory/studentDormInfo/index.vue b/pages/dormitory/studentDormInfo/index.vue
index 327479e..4c97977 100644
--- a/pages/dormitory/studentDormInfo/index.vue
+++ b/pages/dormitory/studentDormInfo/index.vue
@@ -55,11 +55,11 @@
-
+
- 宿舍号
+ 宿舍
- {{ dormOptions[dormIndex] ? dormOptions[dormIndex].roomNo : '请输入'}}
+ {{ dormValue || '请输入'}}