From 957454fa409560343d58df652c69b71e1b149569 Mon Sep 17 00:00:00 2001 From: kola-web Date: Sat, 25 Jul 2026 18:55:28 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fix=20+=20=E6=B4=BB=E5=8A=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/popup/index.scss | 31 ++---------------- src/images/icon47.png | Bin 0 -> 660 bytes src/images/icon48.png | Bin 0 -> 841 bytes src/pages/health/index.ts | 16 +++++++--- src/pages/heartForm/index.ts | 4 ++- src/pages/hotTopicDetail/index.scss | 26 +++++++++++++-- src/pages/hotTopicDetail/index.wxml | 44 ++++++++++++++++++++------ src/pages/index/index.ts | 4 +-- src/pages/login/index.scss | 15 ++++++--- src/pages/login/index.ts | 4 +-- src/pages/login/index.wxml | 43 +++++++++++++------------ src/pages/my/index.ts | 4 +-- src/pages/myWall/index.wxml | 2 +- src/pages/wall/index.scss | 36 ++++++++++++++++----- src/pages/wall/index.wxml | 8 ++--- src/pages/wallDetail/index.scss | 16 ++++++++-- src/pages/wallDetail/index.wxml | 3 +- src/pages/wallForm/index.scss | 13 ++++++++ src/pages/wallForm/index.ts | 56 ++++++++++++++++++--------------- src/pages/wallForm/index.wxml | 61 +++++++++++++++++++++++++++++++----- src/utils/tools.wxs | 11 +++++++ 21 files changed, 274 insertions(+), 123 deletions(-) create mode 100644 src/images/icon47.png create mode 100644 src/images/icon48.png diff --git a/src/components/popup/index.scss b/src/components/popup/index.scss index 2940fa7..0b8d5b4 100644 --- a/src/components/popup/index.scss +++ b/src/components/popup/index.scss @@ -15,6 +15,7 @@ font-size: 36rpx; color: rgba(100, 116, 139, 1); line-height: 52rpx; + white-space: nowrap; } .code { margin: 70rpx auto 0; @@ -148,35 +149,9 @@ text-align: center; } .code { - margin: 52rpx auto 0; display: block; - width: 348rpx; - height: 348rpx; - } - } - } -} - -.popup5 { - .popup-container { - .container { - padding-top: 572rpx; - width: 690rpx; - height: 720rpx; - border-radius: 42rpx; - box-sizing: border-box; - .btn { - display: block; - margin: 0 auto; - width: 626rpx; - height: 96rpx; - font-size: 40rpx; - color: rgba(255, 255, 255, 1); - display: flex; - align-items: center; - justify-content: center; - background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); - border-radius: 24rpx 24rpx 24rpx 24rpx; + width: 100%; + height: 100%; } } } diff --git a/src/images/icon47.png b/src/images/icon47.png new file mode 100644 index 0000000000000000000000000000000000000000..62b1e021a7c1824aa4ee13b996eebad26cb86e13 GIT binary patch literal 660 zcmV;F0&D$=P)Nkl7)K0}Bwu$e0?#CZ9B=PfUw*R>&_vZfl&f%S8c+VZlFOMC*SALc)R@Mlg zEmU+zP^=i&TDDMraB$((i1Ti{QNZixQN``y)|;*@!L6aJEAW^J*TP{ zOklJx3L&YgaBssV6t?=B+l98M^cv6`Dmt&w>j65|Vb8L`W-S|78wa_T2~PykCZtV> zzCCcrm8y5-Vb8L`W-S|7r@wDJSKu9hPC{(=G1_+2M-@^hLNp;>B-X|A zjjIytXhOV5tc&LxS0&cbgm{ry7tc4YO01&^@uJN-Nke6}{#mch6w326#id+;PIcI` zY_M6&2G-4ed#?&`3P6j$Rj|2>xa1U11oBi=7Xx&v!=7b>&003FhS$gBI#0CtTLqg@ z;wNtgA9++>RlttWQPu=Ak%dTJZ@{0fYW-N%*N;Q}EFj+y@rf$*gLXcGPpu-K_e8U) zsrNiuFHmQb_-{lN`sLC1P|IK34jF5xHGg~kq>xA!Mim-#$eftYFJ(fZDeTWU=S~WA zFzofpCbZFO;P1O(KyPKBXO3QeIWSGZvDDC6f#mppi0B?7{CTm-e=}A%)w;*9?iN$( zWTi1N`ZewJiz?m#I?-+TUtc}%U1jHdCa1s)zE~$%^0RAbn!A`3V3H$gqE{H#x_W&$ u;P>4A0{{U3|Cm^ASpWb421!IgR09AaS3!P@brz8T0000M{lZ literal 0 HcmV?d00001 diff --git a/src/images/icon48.png b/src/images/icon48.png new file mode 100644 index 0000000000000000000000000000000000000000..f8265e1018414035206d55eface8084447db45be GIT binary patch literal 841 zcmV-P1GfB$P)sF6ciK`^dNZ9L&1ZB9tyUlhaLs* zp&%k{?T6=F{1@~j+d>r;dXS=7-^$yjdx;9!#h%n}U_3^boGX6TZt>|ABk*~+$k2Yp76 z!~lSiF~@lzgp{|`fEJ2H3s+?_B=5wUX_i9tu~ex6WewvgX2>CRj{Hx<2m{*b7b>R$ z^wu;_;Og8CjfhI_dDoXqrBlcz9;pCv!+4?01YiK?Q%au*V`4ySj&lWLjUuTB!0Bb% zzNU7Pt%(3png8;q{1#E3CV3rL(zoCiMS7;$A6fH@IMwgfahAcY8HwtWlL zCy}}v0LQD2b3+$I3FwXE6gH=YY05k**Nz^*;Mwfljv(Jd0j)aDWqguLvb(Ht8x8ip zRue?L>>+D#<5m^DF8s z>-6=@z}RqDyBh$cXiNREddW-eZU9g=x-IP`2!AZ8-E9M+GRN~OtS$8ikod37Ci^fw zEr@u@L8ItwciVutt}TrSOdvka%rGM2Biy3ZxD5d3?LP$q&|?*CV7sod?76=1T8xRToKz#@3Hvj+t|Nk;2_dNgr00v1!K~w_(O?u2p T?lotA00000NkvXXu0mjfzMX>E literal 0 HcmV?d00001 diff --git a/src/pages/health/index.ts b/src/pages/health/index.ts index 3be3827..8801bb7 100644 --- a/src/pages/health/index.ts +++ b/src/pages/health/index.ts @@ -437,10 +437,18 @@ Page({ }, }).then(() => { if (!userInfo.isHeartRateTips) { - this.setData({ - popupShow: true, - popupType: 'popup1', - }) + if (userInfo.isFollow == 1) { + wx.showToast({ + icon: 'none', + title: '设置成功,我们将在每周五下午7点提醒您记录', + duration: 3000, + }) + } else { + this.setData({ + popupShow: true, + popupType: 'popup1', + }) + } } this.setData({ ['userInfo.isHeartRateTips']: !userInfo.isHeartRateTips, diff --git a/src/pages/heartForm/index.ts b/src/pages/heartForm/index.ts index 3d3b3d2..3798de8 100644 --- a/src/pages/heartForm/index.ts +++ b/src/pages/heartForm/index.ts @@ -1,3 +1,5 @@ +import dayjs from "dayjs" + const app = getApp() Page({ @@ -11,7 +13,7 @@ Page({ id: '', heartRate: '', - recordDateTime: '', + recordDateTime: dayjs().format("YYYY-MM-DD HH:mm"), datetimePickerShow: false, datetimeValue: Date.now(), maxDate: Date.now(), diff --git a/src/pages/hotTopicDetail/index.scss b/src/pages/hotTopicDetail/index.scss index 477664b..dc11269 100644 --- a/src/pages/hotTopicDetail/index.scss +++ b/src/pages/hotTopicDetail/index.scss @@ -113,23 +113,45 @@ page { line-height: 32rpx; box-sizing: border-box; } - .content { + .title { margin-top: 32rpx; font-size: 32rpx; color: rgba(24, 28, 30, 1); + font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .content { + margin-top: 12rpx; + font-size: 32rpx; + color: rgba(24, 28, 30, 1); line-height: 52rpx; .c-topic { display: inline; font-size: 32rpx; color: rgba(47, 130, 169, 1); } + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; } .tags { margin-top: 24rpx; display: flex; - flex-wrap: wrap; + flex-wrap: nowrap; gap: 16rpx; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } .tag { + flex-shrink: 0; padding: 0 24rpx; height: 48rpx; font-size: 24rpx; diff --git a/src/pages/hotTopicDetail/index.wxml b/src/pages/hotTopicDetail/index.wxml index 03a5080..864e693 100644 --- a/src/pages/hotTopicDetail/index.wxml +++ b/src/pages/hotTopicDetail/index.wxml @@ -29,13 +29,24 @@ {{item.publishTime}} - 热门推荐 + + 热门推荐 + + {{item.title}} - #{{topic.topicName}} + + #{{topic.topicName}} + {{item.content}} - {{cate.categoryName}} + + {{cate.categoryName}} + - - - - + + + + diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 86aea8c..1271a7a 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -10,7 +10,7 @@ Page({ } as any, userInfo: {} as any, - days: 0, + days: 1, cateList: [] as Array<{ CateId: string; CateName: string }>, activeCateId: '', picTextList: [] as Array, @@ -125,7 +125,7 @@ Page({ method: 'GET', url: '?r=psvt/patient/my-info', }).then((res: any) => { - let days = 0 + let days = 1 if (res.firstOpenTime) { const first = new Date(res.firstOpenTime.replace(/-/g, '/')) const now = new Date() diff --git a/src/pages/login/index.scss b/src/pages/login/index.scss index 0dea4ab..5f80e6b 100644 --- a/src/pages/login/index.scss +++ b/src/pages/login/index.scss @@ -6,7 +6,7 @@ } .container { margin-top: 440rpx; - padding: 74rpx 40rpx; + padding: 54rpx 40rpx; background-color: #fff; border-radius: 32rpx 32rpx 0 0; .tip { @@ -21,7 +21,7 @@ height: 390rpx; } .phone-btn { - margin: 124rpx 0 0; + margin: 144rpx 0 0; height: 96rpx; line-height: 96rpx; text-align: center; @@ -46,7 +46,14 @@ margin-top: 56rpx; font-size: 32rpx; color: rgba(47, 130, 169, 1); - text-align: center; + display: flex; + align-items: center; + justify-content: center; + gap: 16rpx; + .icon { + width: 24rpx; + height: 40rpx; + } } .form { margin-top: 32rpx; @@ -70,8 +77,8 @@ } .code { margin-left: 24rpx; + padding: 0 32rpx; flex-shrink: 0; - width: 212rpx; height: 68rpx; border-radius: 24rpx; font-size: 28rpx; diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts index 3638359..3361317 100644 --- a/src/pages/login/index.ts +++ b/src/pages/login/index.ts @@ -6,7 +6,7 @@ Page({ menuTop: 0, checked: false, - codeText: '发送验证码', + codeText: '验证码', showTel: false, mobile: '', @@ -58,7 +58,7 @@ Page({ clearInterval(timer as number) timer = null this.setData({ - codeText: '发送验证码', + codeText: '验证码', }) } }, 1000) diff --git a/src/pages/login/index.wxml b/src/pages/login/index.wxml index 574483d..67be565 100644 --- a/src/pages/login/index.wxml +++ b/src/pages/login/index.wxml @@ -1,19 +1,23 @@ - + 请先阅读并同意相关协议。立即加入后,我们将为您提供更匹配的科普内容与服务支持。 - - - 或输入手机号 + + + + - + @@ -22,22 +26,21 @@ 立即加入 立即加入 + + + 手机号一键注册 + + 或输入手机号 我已阅读并同意 - - 《用户协议》 - + 《用户协议》 以及 - - 《隐私政策》 - + 《隐私政策》 、 - - 《法律声明》 - + 《法律声明》 并同意平台基于服务需要收集和使用我的必要个人信息。 diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index 22d8421..5a529d5 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -3,7 +3,7 @@ const app = getApp() Page({ data: { userInfo: {} as any, - days: 0, + days: 1, }, onShow() { app.waitLogin({ type: 1 }).then(() => { @@ -15,7 +15,7 @@ Page({ method: 'GET', url: '?r=psvt/patient/my-info', }).then((res) => { - let days = 0 + let days = 1 if (res.firstOpenTime) { const first = new Date(res.firstOpenTime.replace(/-/g, '/')) const now = new Date() diff --git a/src/pages/myWall/index.wxml b/src/pages/myWall/index.wxml index f7cb6d7..f005ef6 100644 --- a/src/pages/myWall/index.wxml +++ b/src/pages/myWall/index.wxml @@ -45,7 +45,7 @@ {{item.dateText}} - + 驳回原因: {{item.rejectReason}} diff --git a/src/pages/wall/index.scss b/src/pages/wall/index.scss index f3b6806..9778848 100644 --- a/src/pages/wall/index.scss +++ b/src/pages/wall/index.scss @@ -106,7 +106,7 @@ page { padding: 36rpx 32rpx 12rpx; border-radius: 32rpx; border: 2rpx solid #f1f5f9; - background: rgba(255, 255, 255, 0.70); + background: rgba(255, 255, 255, 0.7); box-shadow: 0 16rpx 48rpx -8rpx rgba(0, 99, 132, 0.06); box-sizing: border-box; .user { @@ -133,33 +133,55 @@ page { } .hot { position: absolute; - top: 0; - right: 0; + top: -12rpx; + right: 36rpx; padding: 8rpx 0 0 44rpx; font-size: 28rpx; color: rgba(255, 255, 255, 1); - width: 180rpx; - height: 68rpx; + width: 104rpx; + height: 48rpx; line-height: 32rpx; box-sizing: border-box; } - .content { + .title { margin-top: 32rpx; font-size: 32rpx; color: rgba(24, 28, 30, 1); + font-weight: bold; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + .content { + margin-top: 12rpx; + font-size: 32rpx; + color: rgba(24, 28, 30, 1); line-height: 52rpx; .c-topic { display: inline; font-size: 32rpx; color: rgba(47, 130, 169, 1); } + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; } .tags { margin-top: 24rpx; display: flex; - flex-wrap: wrap; + flex-wrap: nowrap; gap: 16rpx; + overflow-x: auto; + overflow-y: hidden; + &::-webkit-scrollbar { + display: none; + } .tag { + flex-shrink: 0; padding: 0 24rpx; height: 48rpx; font-size: 24rpx; diff --git a/src/pages/wall/index.wxml b/src/pages/wall/index.wxml index 11b5fee..744ac93 100644 --- a/src/pages/wall/index.wxml +++ b/src/pages/wall/index.wxml @@ -48,13 +48,13 @@ {{item.publishTime}} + - 热门推荐 - + style="background: url('{{imageUrl}}bg16.png?t={{Timestamp}}') no-repeat top center/100%" + > + {{item.title}} {{post.publishTime}} + {{post.title}} {{item.likeCount || 0}} diff --git a/src/pages/wallForm/index.scss b/src/pages/wallForm/index.scss index 80368bf..b4cfb4b 100644 --- a/src/pages/wallForm/index.scss +++ b/src/pages/wallForm/index.scss @@ -68,6 +68,19 @@ page { .txa-place { color: rgba(148, 163, 184, 1); } + .limit { + margin-bottom: 30rpx; + margin-top: 32rpx; + display: flex; + align-items: center; + gap: 12rpx; + font-size: 28rpx; + color: rgba(186, 26, 26, 1); + .icon { + width: 32rpx; + height: 32rpx; + } + } .topic-list { display: flex; flex-wrap: nowrap; diff --git a/src/pages/wallForm/index.ts b/src/pages/wallForm/index.ts index fa6c813..a11b2c1 100644 --- a/src/pages/wallForm/index.ts +++ b/src/pages/wallForm/index.ts @@ -29,26 +29,26 @@ Page({ this.setData({ isEdit: true, editPostId: options.id }) } app.waitLogin({ type: 1 }).then(() => { - this.getTopicList() - this.getCategoryList() + const listReady = Promise.all([this.getTopicList(), this.getCategoryList()]) if (this.data.isEdit) { - this.getPostDetail() + listReady.then(() => { + this.getPostDetail() + }) } }) }, getTopicList() { - wx.ajax({ + return wx.ajax({ method: 'GET', url: '?r=psvt/topic/top-list', }).then((res: any) => { this.setData({ topicList: res.list || [], - selectedTopics: this.computeSelectedTopics(this.data.selectedTopicIds, res.list || []), }) }) }, getCategoryList() { - wx.ajax({ + return wx.ajax({ method: 'GET', url: '?r=psvt/wall/index-category', }).then((res: any) => { @@ -80,16 +80,20 @@ Page({ url: item.attachmentUrl || '', } }) + // Build selectedTopics directly from the post detail, which already carries + // topicName. We must NOT rely on topicList.find() here because topic/top-list + // only returns the top-10 by weight, so a post's topics may not be in it. + const selectedTopics = (res.topics || []).map((t: any) => ({ + id: Number(t.topicId), + topicName: t.topicName || '', + })) this.setData({ title: res.title || '', content: res.content || '', visibility: res.visibility || 1, - selectedTopicIds: (res.topics || []).map((t: any) => t.topicId), - selectedTopics: this.computeSelectedTopics( - (res.topics || []).map((t: any) => t.topicId), - this.data.topicList, - ), - selectedCategoryIds: (res.categories || []).map((c: any) => c.categoryId), + selectedTopicIds: selectedTopics.map((t: any) => t.id), + selectedTopics, + selectedCategoryIds: (res.categories || []).map((c: any) => Number(c.categoryId)), fileList, }) }) @@ -103,27 +107,29 @@ Page({ handleTopicTap(e: any) { const id = Number(e.currentTarget.dataset.id) const selectedTopicIds = [...this.data.selectedTopicIds] + const selectedTopics = [...this.data.selectedTopics] const index = selectedTopicIds.indexOf(id) if (index > -1) { selectedTopicIds.splice(index, 1) + selectedTopics.splice(index, 1) } else { - selectedTopicIds.push(id) + const topic = this.data.topicList.find((t: any) => Number(t.id) === id) + if (topic) { + selectedTopicIds.push(id) + selectedTopics.push({ id: Number(topic.id), topicName: topic.topicName }) + } } - this.setData({ - selectedTopicIds, - selectedTopics: this.computeSelectedTopics(selectedTopicIds, this.data.topicList), - }) + this.setData({ selectedTopicIds, selectedTopics }) }, handleRemoveTopic(e: any) { const id = Number(e.currentTarget.dataset.id) - const selectedTopicIds = this.data.selectedTopicIds.filter((tid) => tid !== id) - this.setData({ - selectedTopicIds, - selectedTopics: this.computeSelectedTopics(selectedTopicIds, this.data.topicList), - }) - }, - computeSelectedTopics(ids: number[], list: any[]) { - return ids.map((id) => list.find((t) => String(t.id) === String(id))).filter((t) => t) + const index = this.data.selectedTopicIds.indexOf(id) + if (index === -1) return + const selectedTopicIds = [...this.data.selectedTopicIds] + const selectedTopics = [...this.data.selectedTopics] + selectedTopicIds.splice(index, 1) + selectedTopics.splice(index, 1) + this.setData({ selectedTopicIds, selectedTopics }) }, showTopicPopup() { this.setData({ topicShow: true }) diff --git a/src/pages/wallForm/index.wxml b/src/pages/wallForm/index.wxml index a890ec8..aadc977 100644 --- a/src/pages/wallForm/index.wxml +++ b/src/pages/wallForm/index.wxml @@ -13,9 +13,23 @@ > - + - + #{{item.topicName}} @@ -28,9 +42,20 @@ placeholder="分享你的经历、心得或问题,帮助更多病友..." value="{{content}}" bindinput="onContentInput" + maxlength="{{500}}" > + + + 最多可输入500字 + - + {{item.topicName}} @@ -40,7 +65,7 @@ 话题 - {{content.length || 0}}/2000 + {{content.length || 0}}/500 @@ -49,7 +74,15 @@ 内容标签 - {{item.categoryName}} + + {{item.categoryName}} + @@ -59,14 +92,20 @@ - + 公开 所有用户可见 - + 私密 仅自己可见 @@ -93,7 +132,13 @@ - + {{index+1}} # {{item.topicName}} {{item.postCount}}篇帖子 diff --git a/src/utils/tools.wxs b/src/utils/tools.wxs index e230699..b5aa3ba 100644 --- a/src/utils/tools.wxs +++ b/src/utils/tools.wxs @@ -7,7 +7,18 @@ function include(value, arr) { return false } +function excludeByIds(list, ids) { + var result = [] + for (var i = 0; i < list.length; i++) { + if (!include(list[i].id, ids)) { + result.push(list[i]) + } + } + return result +} + module.exports = { include: include, inArray: include, + excludeByIds: excludeByIds, }