From a4173dc213290dc285bf04c85cb2700fcd258d48 Mon Sep 17 00:00:00 2001 From: kola-web Date: Fri, 22 May 2026 09:58:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E9=A1=B9?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E9=97=AE=E9=A2=98=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复多个页面定时器未清理的内存泄漏问题 2. 调整就诊相关页面标题、文案与样式细节 3. 优化问诊表单输入与音频播放逻辑 4. 完善弹窗与选择器组件的适配逻辑 --- src/components/freeAudio/index.js | 9 +++++-- src/components/pickerArea/index.ts | 8 +++--- src/components/toast/index.wxml | 3 ++- src/doctor/pages/d_changeDoctor/index.ts | 14 ++++++++++- src/doctor/pages/d_changePhone/index.ts | 11 +++++++++ src/doctor/pages/d_login/index.ts | 11 +++++++++ src/pages/changePhone/index.ts | 14 ++++++++++- src/pages/changeUser/index.ts | 14 ++++++++++- src/pages/doctor/index.json | 2 +- src/pages/doctorDetail/index.scss | 1 + src/pages/hospital/index.scss | 9 ++++--- src/pages/hospital/index.wxml | 2 +- src/pages/login/index.ts | 11 +++++++++ src/pages/qaForm/index.scss | 18 ++++++++++++-- src/pages/qaForm/index.wxml | 42 +++++++++++++------------------- src/pages/qaFormDetail/index.wxml | 2 +- 16 files changed, 128 insertions(+), 43 deletions(-) diff --git a/src/components/freeAudio/index.js b/src/components/freeAudio/index.js index d5af7db..822f0e6 100644 --- a/src/components/freeAudio/index.js +++ b/src/components/freeAudio/index.js @@ -66,11 +66,16 @@ Component({ }, }, pageLifetimes: { - // 组件所在页面的生命周期函数 - show: function () {}, + show: function () { + if (this.data._pausedByHide && this.audioContext) { + this.data._pausedByHide = false + this.audioContext.play() + } + }, hide: function () { const { play } = this.data if (play) { + this.data._pausedByHide = true this.audioContext.pause() } }, diff --git a/src/components/pickerArea/index.ts b/src/components/pickerArea/index.ts index 534f919..d6aba75 100644 --- a/src/components/pickerArea/index.ts +++ b/src/components/pickerArea/index.ts @@ -238,7 +238,7 @@ Component({ }, getArea() { if (this.data.area.length) { - this.getRangeList() + this.getRangeList(0) return } wx.ajax({ @@ -249,7 +249,7 @@ Component({ this.setData({ area: res, }) - this.getRangeList() + this.getRangeList(0) }) }, handleItem(e: any) { @@ -287,13 +287,13 @@ Component({ scrollIntoView0: id, }) }, - getRangeList() { + getRangeList(active = 1) { const { area, ProvinceId } = this.data if (!ProvinceId) return const range = area.filter((item: any) => item.value == ProvinceId)[0].children this.setData({ range, - active: 1, + active, scrollIntoView0: '', scrollIntoView1: `id${this.data.CityId}`, }) diff --git a/src/components/toast/index.wxml b/src/components/toast/index.wxml index b4a54b3..0a9312a 100644 --- a/src/components/toast/index.wxml +++ b/src/components/toast/index.wxml @@ -918,7 +918,8 @@ 取消 - + + diff --git a/src/doctor/pages/d_changeDoctor/index.ts b/src/doctor/pages/d_changeDoctor/index.ts index 0dd1521..b1e4ffc 100644 --- a/src/doctor/pages/d_changeDoctor/index.ts +++ b/src/doctor/pages/d_changeDoctor/index.ts @@ -8,7 +8,19 @@ Page({ codeText: '发送验证码', check: false, }, - onLoad() {}, + onLoad() { + if (timer) { + clearInterval(timer) + timer = null + this.setData({ codeText: '发送验证码' }) + } + }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getCode() { if (timer) return const mobile = this.data.mobile diff --git a/src/doctor/pages/d_changePhone/index.ts b/src/doctor/pages/d_changePhone/index.ts index 6ea7958..305439b 100644 --- a/src/doctor/pages/d_changePhone/index.ts +++ b/src/doctor/pages/d_changePhone/index.ts @@ -8,10 +8,21 @@ Page({ codeText: '发送验证码', }, onLoad() { + if (timer) { + clearInterval(timer) + timer = null + this.setData({ codeText: '发送验证码' }) + } app.waitLogin().then((_res) => { this.getDetail() }) }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getDetail() { wx.ajax({ method: 'GET', diff --git a/src/doctor/pages/d_login/index.ts b/src/doctor/pages/d_login/index.ts index e1e650f..b23c44d 100644 --- a/src/doctor/pages/d_login/index.ts +++ b/src/doctor/pages/d_login/index.ts @@ -18,12 +18,23 @@ Page({ check: false, }, onLoad(option) { + if (timer) { + clearInterval(timer) + timer = null + this.setData({ codeText: '发送验证码' }) + } if (option.back) { this.setData({ back: true, }) } }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getCode() { if (timer) return const mobile = this.data.mobile diff --git a/src/pages/changePhone/index.ts b/src/pages/changePhone/index.ts index 1481c02..257c1b2 100644 --- a/src/pages/changePhone/index.ts +++ b/src/pages/changePhone/index.ts @@ -8,7 +8,19 @@ Page({ codeText: '发送验证码', }, - onLoad() {}, + onLoad() { + if (timer) { + clearInterval(timer) + timer = null + this.setData({ codeText: '发送验证码' }) + } + }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getCode() { if (timer) return const mobile = this.data.mobile diff --git a/src/pages/changeUser/index.ts b/src/pages/changeUser/index.ts index 9f4a416..9cc43a1 100644 --- a/src/pages/changeUser/index.ts +++ b/src/pages/changeUser/index.ts @@ -8,7 +8,19 @@ Page({ codeText: "发送验证码", }, - onLoad() {}, + onLoad() { + if (timer) { + clearInterval(timer) + timer = null + this.setData({ codeText: '发送验证码' }) + } + }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getCode() { if (timer) return; const mobile = this.data.mobile; diff --git a/src/pages/doctor/index.json b/src/pages/doctor/index.json index 5ac9727..a44665d 100644 --- a/src/pages/doctor/index.json +++ b/src/pages/doctor/index.json @@ -1,5 +1,5 @@ { - "navigationBarTitleText": "寻找一个专家", + "navigationBarTitleText": "就诊地图", "usingComponents": { "navBar": "/components/navBar/navBar", "van-icon": "@vant/weapp/icon/index", diff --git a/src/pages/doctorDetail/index.scss b/src/pages/doctorDetail/index.scss index 3673df2..2a6e1a0 100644 --- a/src/pages/doctorDetail/index.scss +++ b/src/pages/doctorDetail/index.scss @@ -31,6 +31,7 @@ page { line-height: 1; display: flex; align-items: baseline; + flex-wrap: wrap; gap: 20rpx; .label { font-weight: normal; diff --git a/src/pages/hospital/index.scss b/src/pages/hospital/index.scss index fa8499f..404692b 100644 --- a/src/pages/hospital/index.scss +++ b/src/pages/hospital/index.scss @@ -52,14 +52,15 @@ page { padding-bottom: 32rpx; } .content { - margin-top: 28rpx; .row { + margin-top: 28rpx; display: flex; + align-items: flex-start; font-size: 32rpx; color: #222222; line-height: 48rpx; .icon { - margin-top: 10rpx; + margin-top: 6rpx; flex-shrink: 0; width: 36rpx; height: 36rpx; @@ -200,6 +201,7 @@ page { display: flex; align-items: center; justify-content: center; + font-size: 40rpx; gap: 16rpx; border: 1px solid #0eb66d; border-radius: 16rpx; @@ -216,6 +218,7 @@ page { display: flex; align-items: center; justify-content: center; + gap: 16rpx; border-radius: 16rpx; background: linear-gradient(94deg, #0eb66d 0%, #00d277 100%); .icon { @@ -251,7 +254,7 @@ page { .site { background: linear-gradient(270deg, #b384f4 0%, #5956e9 100%); } - .week-name{ + .week-name { background-color: rgba(245, 244, 255, 1); } } diff --git a/src/pages/hospital/index.wxml b/src/pages/hospital/index.wxml index 776b5c2..7e7cd94 100644 --- a/src/pages/hospital/index.wxml +++ b/src/pages/hospital/index.wxml @@ -25,7 +25,7 @@ - 就诊医生 + 门诊医生 { }) }, + onUnload() { + if (timer) { + clearInterval(timer) + timer = null + } + }, getCode() { if (timer) return const mobile = this.data.mobile diff --git a/src/pages/qaForm/index.scss b/src/pages/qaForm/index.scss index 5902bcd..3691591 100644 --- a/src/pages/qaForm/index.scss +++ b/src/pages/qaForm/index.scss @@ -41,7 +41,7 @@ page { } .content { font-size: 36rpx; - color: rgba(34, 34, 34, 0.70); + color: rgba(34, 34, 34, 0.7); } &.active { .radio { @@ -98,7 +98,7 @@ page { } .content { font-size: 36rpx; - color: rgba(34, 34, 34, 0.70); + color: rgba(34, 34, 34, 0.7); } &.active { .check { @@ -147,6 +147,20 @@ page { font-size: 32rpx; color: rgba(34, 34, 34, 1); } + .num-wrap { + margin-top: 32rpx; + display: flex; + align-items: center; + gap: 10rpx; + .input { + flex: 1; + margin-top: 0; + } + .dight { + font-size: 32rpx; + color: rgba(34, 34, 34, 0.7); + } + } .input { margin-top: 32rpx; padding: 26rpx 32rpx; diff --git a/src/pages/qaForm/index.wxml b/src/pages/qaForm/index.wxml index bad1398..c4ba2eb 100644 --- a/src/pages/qaForm/index.wxml +++ b/src/pages/qaForm/index.wxml @@ -72,39 +72,31 @@ - - + + + + mg/天 + - + - + 添加图片 diff --git a/src/pages/qaFormDetail/index.wxml b/src/pages/qaFormDetail/index.wxml index bb70da2..50aba2f 100644 --- a/src/pages/qaFormDetail/index.wxml +++ b/src/pages/qaFormDetail/index.wxml @@ -21,7 +21,7 @@ - {{item.TextValue}} + {{item.TextValue}}mg/天