diff --git a/src/assets/charge.png b/src/assets/charge.png new file mode 100644 index 0000000..e06bf8f Binary files /dev/null and b/src/assets/charge.png differ diff --git a/src/assets/css/SelfInfo.css b/src/assets/css/SelfInfo.css index 55c8330..ddd58e8 100644 --- a/src/assets/css/SelfInfo.css +++ b/src/assets/css/SelfInfo.css @@ -37,4 +37,57 @@ width: 80px; height: 80px; margin: 40px auto; +} + + +/* 添加到你的 SelfInfo.css 文件中 */ +.avatar-container { + padding: 20px; + text-align: center; + background: #f8f9ff; + border-radius: 15px; + width: fit-content; +} + +.edit-avatar { + margin-top: 10px; + font-size: 14px; +} + +.el-descriptions { + background: #ffffff; + border-radius: 15px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); +} + +/* 标签列的样式 */ +:deep(.el-descriptions__label) { + font-size: 16px; + color: #303133; + font-weight: bold; + padding: 30px; + background-color: #f8f9ff; +} + +/* 内容列的样式 */ +:deep(.el-descriptions__content) { + font-size: 16px; + color: #606266; + padding: 30px; +} + +/* 修改表格边框和分隔线的颜色 */ +:deep(.el-descriptions__body) { + border: 1px solid #ebeef5; +} + +:deep(.el-descriptions__cell) { + border-bottom: 1px solid #ebeef5; +} + +/* 修改按钮样式 */ +.el-button { + padding: 12px 20px; + font-size: 14px; + margin-top: 20px; } \ No newline at end of file diff --git a/src/assets/js/Home.js b/src/assets/js/Home.js index bbcf08d..9b05e87 100644 --- a/src/assets/js/Home.js +++ b/src/assets/js/Home.js @@ -1,33 +1,87 @@ import weather from "@/components/weather"; import Calender from "@/components/Calendar"; import request from "@/utils/request"; -import home_echarts from "@/components/home_echarts"; export default { name: "Home", components: { weather, Calender, - home_echarts, }, data() { return { + waterFee: 0, + electricityFee: 0, studentNum: "", + identity: null, haveRoomStudentNum: "", detailDialog: false, repairOrderNum: "", noFullRoomNum: "", activities: [], + myName:"龚嘉伟", + mateName:[ + '令狐新锐', + '令狐新锐', + '', + '公家为', + ], + price: 100000000, }; }, + mounted() { + this.loadIdentity(); + }, created() { this.getHomePageNotice(); this.getStuNum(); this.getHaveRoomNum(); this.getOrderNum(); this.getNoFullRoom(); + this.getNameInfo(); }, methods: { + loadIdentity() { + // 从 sessionStorage 中获取 identity + const identity = window.sessionStorage.getItem("identity"); + if (identity) { + // 将字符串转换为 JavaScript 对象 + this.identity = JSON.parse(identity); + } else { + // 如果没有 identity,可能需要处理用户未登录的情况 + } + }, + async updateFees() { + // 当滑动条值改变时,调用此方法 + const feesData = { + waterFee: this.waterFee, + electricityFee: this.electricityFee + }; + + // 发送请求到后端 + request.post('/api/update-fees', feesData) + .then(response => { + // 处理响应 + console.log('Fees updated successfully:', response.data); + }) + .catch(error => { + // 处理错误 + console.error('Error updating fees:', error); + }); + }, + async getNameInfo() { + request.get("").then((res) => { + if (res.code === "0") { + this.myName = res.data.name; + this.mateName = res.data.mateName; + } else { + ElMessage({ + message: res.msg, + type: "error", + }); + } + }); + }, async getStuNum() { request.get("/stu/stuNum").then((res) => { if (res.code === "0") { diff --git a/src/assets/school.png b/src/assets/school.png new file mode 100644 index 0000000..1d4a5c8 Binary files /dev/null and b/src/assets/school.png differ diff --git a/src/components/Aside.vue b/src/components/Aside.vue index e849a3a..62d0ede 100644 --- a/src/components/Aside.vue +++ b/src/components/Aside.vue @@ -6,7 +6,7 @@ unique-opened >
- +
@@ -33,6 +33,7 @@ 楼宇信息 房间信息 + 晚点情况 公告信息 报修信息 + 缴费信息