From 15e1a31e7b652a37a4d74a2cddccabb375115a7d Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Thu, 17 Apr 2025 14:49:28 +0800 Subject: [PATCH 1/2] 0417-3 --- newPages/my/index.vue | 733 +++++++++++++++---------------- newPages/newIndex/index.vue | 20 +- pages/my/my.vue | 13 +- pagesA/examinationList/index.vue | 713 +++++++++++++++--------------- 4 files changed, 753 insertions(+), 726 deletions(-) diff --git a/newPages/my/index.vue b/newPages/my/index.vue index 3163a2e..f7af5ab 100644 --- a/newPages/my/index.vue +++ b/newPages/my/index.vue @@ -1,396 +1,389 @@ + @import '../common/common.scss'; + @import './assets/style/index.rpx.scss'; + \ No newline at end of file diff --git a/newPages/newIndex/index.vue b/newPages/newIndex/index.vue index 01812a7..8a763e9 100644 --- a/newPages/newIndex/index.vue +++ b/newPages/newIndex/index.vue @@ -37,7 +37,7 @@ - + @@ -103,12 +103,15 @@ noticeList: [], qTenantId: null, qCoachId: null, + scrollHeight: 0, }; }, onLoad(query) { console.log('query', query) // setInviteId('JLPXF1') // this.getTenantIdByInviteId() + console.log('userInfo', getLocalUserInfo()) + console.log('token', getToken()) this.getSwiperList() this.getTextList() @@ -132,6 +135,10 @@ }) */ } }, + onReady() { + // 动态计算滚动区域高度 + this.calculateScrollHeight(); + }, methods: { getTenantIdByInviteId() { console.log('1122', getInviteId()) @@ -296,6 +303,15 @@ }); }, + calculateScrollHeight() { + // 获取屏幕高度 + const screenHeight = uni.getSystemInfoSync().windowHeight; + // 获取顶部区域高度 + const topHeight = 490; + // 计算滚动区域高度 + this.scrollHeight = screenHeight - topHeight; + }, + handleItemClick(item) { // 根据 item.text 判断点击的是哪一项 switch (item.text) { @@ -408,7 +424,7 @@ display: flex; flex-direction: column; row-gap: 20rpx; - margin-bottom: 200rpx; + /* margin-bottom: 200rpx; */ } .top_ { diff --git a/pages/my/my.vue b/pages/my/my.vue index 0749fa9..48caf10 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -94,9 +94,18 @@ status: 'loading', selfInfo: {} } + }, + onLoad() { + if (getToken()) { + console.log('myToken', getToken()) + this.findSelfInfo() + } + + }, onShow() { if (getToken()) { + console.log('myToken', getToken()) this.findSelfInfo() } @@ -143,7 +152,7 @@ }, async findSelfInfo() { let res = await request({ - url: `/app-api/driving/findSelfInfo`, + url: `/app-api/small/driving/findSelfInfo`, method: 'get', }) console.log(res, 138); @@ -331,4 +340,4 @@ margin-right: 10px; } } - + \ No newline at end of file diff --git a/pagesA/examinationList/index.vue b/pagesA/examinationList/index.vue index 503b74a..9cbfd00 100644 --- a/pagesA/examinationList/index.vue +++ b/pagesA/examinationList/index.vue @@ -1,384 +1,393 @@ + @import '../common/common.scss'; + @import './assets/style/index.rpx.scss'; + \ No newline at end of file From d40c61efd2a2dc7085214f4bee6c09a6c973fc69 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Thu, 17 Apr 2025 15:38:34 +0800 Subject: [PATCH 2/2] 0417-3 --- newPages/newIndex/assets/style/index.rpx.scss | 2 +- newPages/newIndex/index.vue | 37 +++++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/newPages/newIndex/assets/style/index.rpx.scss b/newPages/newIndex/assets/style/index.rpx.scss index bee2027..89995ad 100644 --- a/newPages/newIndex/assets/style/index.rpx.scss +++ b/newPages/newIndex/assets/style/index.rpx.scss @@ -103,7 +103,7 @@ } .section_2 { width: 750rpx; - height: 1020rpx; + // height: 1020rpx; .list_1 { width: 618rpx; height: 112rpx; diff --git a/newPages/newIndex/index.vue b/newPages/newIndex/index.vue index 8a763e9..4301937 100644 --- a/newPages/newIndex/index.vue +++ b/newPages/newIndex/index.vue @@ -35,9 +35,10 @@ src="/static/lanhu_shouye2gai/FigmaDDSSlicePNGc8586e4d9e76802e4b93ae8fb3654b38.png" /> + - + @@ -304,13 +305,34 @@ }, calculateScrollHeight() { - // 获取屏幕高度 + /* // 获取屏幕高度 const screenHeight = uni.getSystemInfoSync().windowHeight; // 获取顶部区域高度 const topHeight = 490; // 计算滚动区域高度 - this.scrollHeight = screenHeight - topHeight; + this.scrollHeight = screenHeight - topHeight; */ + const systemInfo = uni.getSystemInfoSync(); + const windowHeight = systemInfo.windowHeight; + const rpxToPx = systemInfo.windowWidth / 750; + + const topOccupiedHeight = 960 * rpxToPx; + + this.scrollHeight = windowHeight - topOccupiedHeight; }, + /* calculateScrollHeight() { + // 获取屏幕高度 + const screenHeight = uni.getSystemInfoSync().windowHeight; + // 使用选择器获取顶部区域实际高度 + const query = uni.createSelectorQuery().in(this); + query.select('.top_').boundingClientRect(data => { + const topHeight = data ? data.height : 0; + query.select('.section_2').boundingClientRect(data => { + const sectionHeight = data ? data.height : 0; + // 转换为 rpx (假设 1px = 2rpx,根据实际情况调整) + this.scrollHeight = (screenHeight - topHeight - sectionHeight) * 2; + }).exec(); + }).exec(); + }, */ handleItemClick(item) { // 根据 item.text 判断点击的是哪一项 @@ -414,17 +436,18 @@ // 新增 scroll-view 样式 .school-scroll-view { - height: 500rpx; // 设置一个固定高度,根据需要调整 + /* height: 500rpx; // 设置一个固定高度,根据需要调整 */ overflow-y: auto; margin-left: 22rpx; } .itemContent { - padding: 30rpx 0; + margin-top: 20rpx; + /* padding: 10rpx 0; */ display: flex; flex-direction: column; - row-gap: 20rpx; - /* margin-bottom: 200rpx; */ + /* row-gap: 10rpx; */ + margin-bottom: 200rpx; } .top_ {