From 946e10f493d090b415a4b5f4468798697243713f Mon Sep 17 00:00:00 2001 From: kola-web Date: Mon, 21 Jul 2025 14:42:08 +0800 Subject: [PATCH] =?UTF-8?q?1.0=20=E9=A6=96=E9=A1=B5&=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/pages/home/index.scss | 468 ++++++++++++++++++++++--------------------- src/pages/home/index.ts | 92 +++++++-- src/pages/home/index.wxml | 250 ++++++++++++----------- src/pages/message/index.scss | 1 + src/pages/message/index.ts | 31 ++- src/pages/message/index.wxml | 72 +++---- 7 files changed, 497 insertions(+), 419 deletions(-) diff --git a/README.md b/README.md index 5d0a7de..5888b3c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c images svn 地址 svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt -(/images/)(\S\*(?=["|'])) +(/images/)(\S*(?=["|'])) {{imageUrl}}$2?t={{Timestamp}} ui问题 diff --git a/src/pages/home/index.scss b/src/pages/home/index.scss index 716e074..f701eb1 100644 --- a/src/pages/home/index.scss +++ b/src/pages/home/index.scss @@ -69,267 +69,269 @@ page { height: 100%; } } - .v-swiper { + .notice { position: relative; - height: 384rpx; - border-radius: 32rpx; - .swiper-item { + .v-swiper { + height: 384rpx; border-radius: 32rpx; - background-color: #fff; - .item1 { - padding: 32rpx; - .i-header { - display: flex; - align-items: center; - justify-content: space-between; - .date { - .year { - font-size: 24rpx; - color: rgba(173, 172, 178, 1); - line-height: 32rpx; - } - .day { - display: flex; - align-items: baseline; - font-size: 36rpx; - color: rgba(173, 172, 178, 1); - line-height: 40rpx; - .sub { - font-size: 22rpx; + .swiper-item { + border-radius: 32rpx; + background-color: #fff; + .item1 { + padding: 32rpx; + .i-header { + display: flex; + align-items: center; + justify-content: space-between; + .date { + .year { + font-size: 24rpx; + color: rgba(173, 172, 178, 1); + line-height: 32rpx; } + .day { + display: flex; + align-items: baseline; + font-size: 36rpx; + color: rgba(173, 172, 178, 1); + line-height: 40rpx; + .sub { + font-size: 22rpx; + } + } + } + .icon { + width: 68rpx; + height: 68rpx; } } - .icon { - width: 68rpx; - height: 68rpx; + .content { + margin-top: 28rpx; + font-size: 30rpx; + color: rgba(33, 29, 46, 1); + line-height: 56rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; } } - .content { - margin-top: 28rpx; - font-size: 30rpx; - color: rgba(33, 29, 46, 1); - line-height: 56rpx; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - } - } - .item2 { - padding: 32rpx; - .i-header { - display: flex; - align-items: center; - justify-content: space-between; - .date { - .year { - font-size: 24rpx; - color: rgba(173, 172, 178, 1); - line-height: 32rpx; - } - .day { - display: flex; - align-items: baseline; - font-size: 36rpx; - color: rgba(173, 172, 178, 1); - line-height: 40rpx; - .sub { - font-size: 22rpx; + .item2 { + padding: 32rpx; + .i-header { + display: flex; + align-items: center; + justify-content: space-between; + .date { + .year { + font-size: 24rpx; + color: rgba(173, 172, 178, 1); + line-height: 32rpx; + } + .day { + display: flex; + align-items: baseline; + font-size: 36rpx; + color: rgba(173, 172, 178, 1); + line-height: 40rpx; + .sub { + font-size: 22rpx; + } } } + .icon { + width: 68rpx; + height: 68rpx; + } } - .icon { - width: 68rpx; - height: 68rpx; + .status1 { + margin-top: 38rpx; + font-size: 40rpx; + color: rgba(195, 49, 0, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 12rpx; + .s-icon { + width: 36rpx; + height: 36rpx; + } } - } - .status1 { - margin-top: 38rpx; - font-size: 40rpx; - color: rgba(195, 49, 0, 1); - font-weight: bold; - display: flex; - align-items: center; - gap: 12rpx; - .s-icon { - width: 36rpx; - height: 36rpx; + .status2 { + margin-top: 38rpx; + font-size: 40rpx; + color: rgba(69, 163, 83, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 12rpx; + .s-icon { + width: 36rpx; + height: 36rpx; + } } - } - .status2 { - margin-top: 38rpx; - font-size: 40rpx; - color: rgba(69, 163, 83, 1); - font-weight: bold; - display: flex; - align-items: center; - gap: 12rpx; - .s-icon { - width: 36rpx; - height: 36rpx; + .status3 { + margin-top: 38rpx; + font-size: 40rpx; + color: rgba(185, 130, 255, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 12rpx; + .s-icon { + width: 36rpx; + height: 36rpx; + } } - } - .status3 { - margin-top: 38rpx; - font-size: 40rpx; - color: rgba(185, 130, 255, 1); - font-weight: bold; - display: flex; - align-items: center; - gap: 12rpx; - .s-icon { - width: 36rpx; - height: 36rpx; + .name { + margin-top: 44rpx; + font-size: 28rpx; + color: rgba(105, 104, 110, 1); + line-height: 44rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } } - .name { - margin-top: 44rpx; - font-size: 28rpx; - color: rgba(105, 104, 110, 1); - line-height: 44rpx; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - } - } - .item3 { - padding: 32rpx; - .i-header { - display: flex; - align-items: center; - justify-content: space-between; - .date { - .year { - font-size: 24rpx; - color: rgba(173, 172, 178, 1); - line-height: 32rpx; - } - .day { - display: flex; - align-items: baseline; - font-size: 36rpx; - color: rgba(173, 172, 178, 1); - line-height: 40rpx; - .sub { - font-size: 22rpx; + .item3 { + padding: 32rpx; + .i-header { + display: flex; + align-items: center; + justify-content: space-between; + .date { + .year { + font-size: 24rpx; + color: rgba(173, 172, 178, 1); + line-height: 32rpx; + } + .day { + display: flex; + align-items: baseline; + font-size: 36rpx; + color: rgba(173, 172, 178, 1); + line-height: 40rpx; + .sub { + font-size: 22rpx; + } } } + .icon { + width: 68rpx; + height: 68rpx; + } } - .icon { - width: 68rpx; - height: 68rpx; + .status4 { + margin-top: 38rpx; + font-size: 40rpx; + color: rgba(185, 130, 255, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 12rpx; + .s-icon { + width: 36rpx; + height: 36rpx; + } } - } - .status4 { - margin-top: 38rpx; - font-size: 40rpx; - color: rgba(185, 130, 255, 1); - font-weight: bold; - display: flex; - align-items: center; - gap: 12rpx; - .s-icon { - width: 36rpx; - height: 36rpx; + .status2 { + margin-top: 38rpx; + font-size: 40rpx; + color: rgba(69, 163, 83, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 12rpx; + .s-icon { + width: 36rpx; + height: 36rpx; + } } - } - .status2 { - margin-top: 38rpx; - font-size: 40rpx; - color: rgba(69, 163, 83, 1); - font-weight: bold; - display: flex; - align-items: center; - gap: 12rpx; - .s-icon { - width: 36rpx; - height: 36rpx; + .name { + margin-top: 44rpx; + font-size: 28rpx; + color: rgba(105, 104, 110, 1); + line-height: 44rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } } - .name { - margin-top: 44rpx; - font-size: 28rpx; - color: rgba(105, 104, 110, 1); - line-height: 44rpx; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - } - } - .item4 { - padding: 32rpx; - .i-header { - display: flex; - align-items: center; - justify-content: space-between; - .date { - .year { - font-size: 24rpx; - color: rgba(173, 172, 178, 1); - line-height: 32rpx; - } - .day { - display: flex; - align-items: baseline; - font-size: 36rpx; - color: rgba(173, 172, 178, 1); - line-height: 40rpx; - .sub { - font-size: 22rpx; + .item4 { + padding: 32rpx; + .i-header { + display: flex; + align-items: center; + justify-content: space-between; + .date { + .year { + font-size: 24rpx; + color: rgba(173, 172, 178, 1); + line-height: 32rpx; + } + .day { + display: flex; + align-items: baseline; + font-size: 36rpx; + color: rgba(173, 172, 178, 1); + line-height: 40rpx; + .sub { + font-size: 22rpx; + } } } + .icon { + width: 68rpx; + height: 68rpx; + } } - .icon { - width: 68rpx; - height: 68rpx; + .num-line { + display: flex; + align-items: baseline; + font-size: 72rpx; + color: rgba(185, 130, 255, 1); + font-weight: bold; + .sub { + font-size: 32rpx; + color: rgba(33, 29, 46, 1); + } } - } - .num-line { - display: flex; - align-items: baseline; - font-size: 72rpx; - color: rgba(185, 130, 255, 1); - font-weight: bold; - .sub { - font-size: 32rpx; - color: rgba(33, 29, 46, 1); + .name { + margin-top: 44rpx; + font-size: 28rpx; + color: rgba(105, 104, 110, 1); + line-height: 44rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } } - .name { - margin-top: 44rpx; - font-size: 28rpx; - color: rgba(105, 104, 110, 1); - line-height: 44rpx; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - } - } - .item5 { - padding: 96rpx 22rpx 0; - .icon1 { - width: 276rpx; - height: 214rpx; - } - .title { - margin-top: -60rpx; - font-size: 32rpx; - color: rgba(173, 172, 178, 1); - display: flex; - align-items: center; - justify-content: center; - gap: 8rpx; - .icon2 { - width: 36rpx; - height: 36rpx; + .item5 { + padding: 96rpx 22rpx 0; + .icon1 { + width: 276rpx; + height: 214rpx; + } + .title { + margin-top: -60rpx; + font-size: 32rpx; + color: rgba(173, 172, 178, 1); + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + .icon2 { + width: 36rpx; + height: 36rpx; + } } } } @@ -337,6 +339,8 @@ page { .dots { position: absolute; bottom: 16rpx; + left: 50%; + transform: translateX(-50%); width: 100%; display: flex; align-items: center; diff --git a/src/pages/home/index.ts b/src/pages/home/index.ts index 06586c2..1083a58 100644 --- a/src/pages/home/index.ts +++ b/src/pages/home/index.ts @@ -14,23 +14,23 @@ Page({ } as any, userInfo: {}, - unReadMsgCount: 0, current: 0, + notice: [], + bannerList: [], + briefingList: [], + sopList: [], + list: [] as any[], - total: 0, - pagination: { - page: 1, - pages: 1, - count: 1, - }, }, onShow() { app.waitLogin({ type: 2 }).then(() => { - // this.getNotice(); + this.getNotice(); this.getBanner(); + this.getBriefingList(); + this.getSopList(); this.getList(); app.getUserInfo(2).then((userInfo) => { this.setData({ @@ -67,11 +67,16 @@ Page({ getNotice() { wx.ajax({ method: 'GET', - url: '?r=xd/doctor/index/get-unread-msg-count', + url: '?r=xd/doctor/index/get-latest-mini-msg', data: {}, }).then((res) => { this.setData({ - unReadMsgCount: res.unReadMsgCount, + notice: res.list.map((item) => { + item.year = dayjs(item.PublishDate).format('YYYY'); + item.month = dayjs(item.PublishDate).format('MM'); + item.day = dayjs(item.PublishDate).format('DD'); + return item; + }), }); }); }, @@ -80,8 +85,25 @@ Page({ url: '/pages/message/index', }); }, + handleNoticeDetail(e) { + const { index } = e.currentTarget.dataset; + const { Id, Url } = this.data.notice[index]; + app.mpBehavior({ PositionId: '4', OperateType: '1', OperateId: Id }); + if (Url) { + wx.navigateTo({ + url: Url, + fail() { + wx.reLaunch({ + url: Url, + }); + }, + }); + } + }, handleSwiperChange(e) { - console.log('DEBUGPRINT[89]: index.ts:83: e=', e); + const current = e.detail.current; + const { Id } = this.data.bannerList[current]; + app.mpBehavior({ PositionId: '4', OperateType: '4', OperateId: Id }); this.setData({ current: e.detail.current, }); @@ -111,24 +133,54 @@ Page({ }, }); }, + getBriefingList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/doctor/index/get-latest-material', + data: { + count: 10, + ContentType: 1, + }, + }).then((res) => { + res.list.forEach((item) => { + item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD'); + }); + this.setData({ + briefingList: res.list, + }); + }); + }, + getSopList() { + wx.ajax({ + method: 'GET', + url: '?r=xd/doctor/index/get-latest-material', + data: { + count: 10, + ContentType: 2, + }, + }).then((res) => { + res.list.forEach((item) => { + item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD'); + }); + this.setData({ + sopList: res.list, + }); + }); + }, getList() { wx.ajax({ method: 'GET', url: '?r=xd/doctor/index/get-latest-material', - data: {}, + data: { + ContentType: 3, + count: 10, + }, }).then((res) => { res.list.forEach((item) => { item.PublishTime = dayjs(item.PublishTime).format('YYYY-MM-DD'); }); - const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]; this.setData({ - total: res.count, - list, - pagination: { - page: res.page, - pages: res.pages, - count: res.count, - }, + list: res.list, }); }); }, diff --git a/src/pages/home/index.wxml b/src/pages/home/index.wxml index 0160c39..c851859 100644 --- a/src/pages/home/index.wxml +++ b/src/pages/home/index.wxml @@ -20,122 +20,121 @@ - - - - - 查看更多 - - - + + - + - + - + - - - 查看全部 - - + + + + + - - + + 更多内容 @@ -182,22 +183,19 @@ - + - + - - + + - 替妥尤单抗的作用机制、适用场景、使用方式 + {{item.Title}} - - + + 更多内容 @@ -234,12 +232,12 @@ - + 建设中 敬请期待... - + (); +const dayjs = require('dayjs'); Page({ data: { @@ -12,15 +13,27 @@ Page({ onLoad() { app.waitLogin().then(() => { this.getList(); - wx.setNavigationBarTitle({ - title: '消息(20)', - }); }); }, + handleDetail(e) { + const { index } = e.currentTarget.dataset; + const { Id, Url } = this.data.list[index]; + app.mpBehavior({ PositionId: '4', OperateType: '1', OperateId: Id }); + if (Url) { + wx.navigateTo({ + url: Url, + fail() { + wx.reLaunch({ + url: Url, + }); + }, + }); + } + }, getList(newPage = 1) { wx.ajax({ method: 'GET', - url: '?r=xd/doctor/index/get-msg-list', + url: '?r=xd/doctor/index/get-mini-msg-list', data: { page: newPage, }, @@ -28,13 +41,21 @@ Page({ const list = res.page === 1 ? res.list : [...this.data.list, ...res.list]; this.setData({ total: res.count, - list, + list: list.map((item) => { + item.year = dayjs(item.PublishDate).format('YYYY'); + item.month = dayjs(item.PublishDate).format('MM'); + item.day = dayjs(item.PublishDate).format('DD'); + return item; + }), pagination: { page: res.page, pages: res.pages, count: res.count, }, }); + wx.setNavigationBarTitle({ + title: `消息(${res.count})`, + }); }); }, onReachBottom() { diff --git a/src/pages/message/index.wxml b/src/pages/message/index.wxml index 86d93b8..287750a 100644 --- a/src/pages/message/index.wxml +++ b/src/pages/message/index.wxml @@ -1,52 +1,54 @@ - - - - - 2025年 6月1日 - - 您有一份甲状腺登记研究简报(2025.06第一期),该请查收 + + + + + + {{item.year}}年 {{item.month}}月{{item.day}}日 + + + {{item.Content}} - - - 未通过 - - - - 未通过 - - - - 未通过 - + + + + 7 + 例入组 - 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 - 中国医科大学附属第一医院 + {{item.Content}} - - - 未通过 - + + + + 通过 + - + 未通过 - + + + + 已上会 + - 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 - 中国医科大学附属第一医院 + {{item.Content}} - - - 7 - 例入组 + + + + 未申请 + + + + 已申请 + - 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 中国医科大学附属第一医院 - 中国医科大学附属第一医院 + {{item.Content}}