From 08c9c71221720b497f8291356580dbd11c6c32a4 Mon Sep 17 00:00:00 2001 From: kola-web Date: Fri, 10 Jul 2026 12:08:30 +0800 Subject: [PATCH] bugfix --- src/app.ts | 15 +++++++-------- src/pages/index/index.ts | 15 +++++++++++++-- src/pages/index/index.wxml | 2 +- src/pages/my/index.ts | 1 + src/pages/qaFormDetail/index.ts | 9 +++------ 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/app.ts b/src/app.ts index 2ab9759..a91c519 100644 --- a/src/app.ts +++ b/src/app.ts @@ -17,16 +17,15 @@ App({ globalData: { // dev // appid:wxc3cdb3c4d4f62cea - // url: 'https://m.igg4.hbraas.com', - // upFileUrl: 'https://m.igg4.hbraas.com/', - // imageUrl: 'https://m.igg4.hbraas.com/igg4/', - + url: 'https://m.igg4.hbraas.com', + upFileUrl: 'https://m.igg4.hbraas.com/', + imageUrl: 'https://m.igg4.hbraas.com/igg4/', // pro // appid:wx346254575bd711a7 - url: 'https://m.igg4.hbsaas.com', - upFileUrl: 'https://m.igg4.hbsaas.com/', - imageUrl: 'https://m.igg4.hbsaas.com/igg4/', + // url: 'https://m.igg4.hbsaas.com', + // upFileUrl: 'https://m.igg4.hbsaas.com/', + // imageUrl: 'https://m.igg4.hbsaas.com/igg4/', //login registrationSource: 0, registChannel: 0, @@ -249,7 +248,7 @@ App({ verifySys(pub = false) { // 1:患者 2:医生 const { loginType, isLogin, anyWhere } = this.globalData - console.log("DEBUGPRINT[229]: app.ts:246: loginType=", loginType) + console.log('DEBUGPRINT[229]: app.ts:246: loginType=', loginType) const pages = getCurrentPages() const currentPage = pages[pages.length - 1] const url = currentPage.route diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 484dd42..423f6f3 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -111,10 +111,21 @@ Page({ updateNextVisitDays(userInfo: any) { if (userInfo.NextVisitDate) { const date = dayjs(userInfo.NextVisitDate) - const diffMs = date.diff(dayjs()) + const diffMs = Math.ceil(date.diff(dayjs()) / (24 * 60 * 60 * 1000)) const weekNames = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] + let nextVisitDays = '' + if (diffMs < 0) { + nextVisitDays = '延期' + } else if (diffMs === 0) { + nextVisitDays = '0' + } else if (diffMs > 999) { + nextVisitDays = '999⁺' + } else { + nextVisitDays = String(diffMs) + } + this.setData({ - nextVisitDays: diffMs <= 0 ? 0 : Math.ceil(diffMs / (24 * 60 * 60 * 1000)), + nextVisitDays, nextVisitYearPrefix: date.format('YYYY').substring(0, 2), nextVisitYearSuffix: date.format('YYYY').substring(2), nextVisitMonth: date.format('MM'), diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index f6da6ea..b335f2f 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -22,7 +22,7 @@ style="background: url('{{imageUrl}}{{theme === 'DRUG' ? 'bg22' : 'bg15'}}.png?t={{Timestamp}}') no-repeat top center/100%" > {{nextVisitDays === 0 ? '今天' : nextVisitDays}} - + diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index b91b42b..dd41d72 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -89,6 +89,7 @@ Page({ url: '?r=igg4/health-question/get-patient-questionnaire', data: {}, showMsg: false, + loading: true, }).then((res: any) => { const answers = res.questions || [] if (answers.length) { diff --git a/src/pages/qaFormDetail/index.ts b/src/pages/qaFormDetail/index.ts index 74a626f..394c5d7 100644 --- a/src/pages/qaFormDetail/index.ts +++ b/src/pages/qaFormDetail/index.ts @@ -35,16 +35,13 @@ Page({ hasData: false, }, - onLoad() { + onLoad() {}, + onShow() { + this.setData({ questions: [], hasData: false }) app.waitLogin({}).then(() => { this.loadData() }) }, - onShow() { - if (this.data.questions.length) { - this.loadData() - } - }, loadData() { wx.ajax({