From b1e82d0ba3f56759cc5531c90c904fdb690313ba Mon Sep 17 00:00:00 2001 From: "962704835@qq.com" Date: Sat, 25 Oct 2025 03:20:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E4=BD=8F=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=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 @@ @@ -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); }