diff --git a/assets/images/home/icon_2.png b/assets/images/home/icon_2.png new file mode 100644 index 0000000..7b31916 Binary files /dev/null and b/assets/images/home/icon_2.png differ diff --git a/assets/images/home/img_1.png b/assets/images/home/img_1.png new file mode 100644 index 0000000..8ddfa43 Binary files /dev/null and b/assets/images/home/img_1.png differ diff --git a/assets/images/home/img_2.png b/assets/images/home/img_2.png new file mode 100644 index 0000000..0492a25 Binary files /dev/null and b/assets/images/home/img_2.png differ diff --git a/assets/images/home/img_title_1.png b/assets/images/home/img_title_1.png new file mode 100644 index 0000000..2d7be3c Binary files /dev/null and b/assets/images/home/img_title_1.png differ diff --git a/assets/images/home/img_title_2.png b/assets/images/home/img_title_2.png new file mode 100644 index 0000000..1c7c9f6 Binary files /dev/null and b/assets/images/home/img_title_2.png differ diff --git a/pages/home/index.js b/pages/home/index.js index ffb5183..a12520a 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -150,7 +150,7 @@ Page({ activeIndex: 0, sfData:{}, sfListLength: 0, - article:{}, + articles:[], articlesLength: 0 }, @@ -181,15 +181,18 @@ Page({ } }) - const res2 = await request('patient/articles', 'get', { title: '', page: 1, page_size: 10 }); + const res2 = await request('patient/articles', 'get', { title: '', page: 1, page_size: 2 }); // Convert rich text content to plain text const plainTextContent = this.stripHtml(res2.list[0].content); + const articleList = res2.list.map(item => { + return { + ...item, + contentText: this.stripHtml(item.content) + } + }) this.setData({ articlesLength: res2.total, - article: { - ...res2.list[0], - contentText: plainTextContent - } + articles: articleList }) }, @@ -241,8 +244,9 @@ Page({ url: '/pages/articleList/index', }) }, - async toArticleDelit(){ - await wx.setStorageSync('article',JSON.stringify(this.data.article)); + async toArticleDelit(e){ + const index = e.currentTarget.dataset.index; + await wx.setStorageSync('article',JSON.stringify(this.data.articles[index])); wx.navigateTo({ url: '/pages/article/index', }) diff --git a/pages/home/index.less b/pages/home/index.less index 255ad9b..4b669b9 100644 --- a/pages/home/index.less +++ b/pages/home/index.less @@ -6,7 +6,7 @@ height: calc(100vh - @tab-bar-height); padding-top: 160rpx; position: relative; - image{ + .home-top-bg{ width: 100%; height: auto; position: absolute; @@ -14,34 +14,51 @@ left: 0; z-index: 0; } + .home-content { // height: calc(100% - @nav-bar-height); padding: 30rpx; position: relative; z-index: 1; - .item-content { - background-color: #fff; - border-radius: 12rpx; - padding: 30rpx; - margin-bottom: 30rpx; - - .item-title { - font-size: 32rpx; - font-weight: bold; - color: #323030; - image{ + .item-title-img{ + height: 36rpx; + // width: auto; + } + .item-title-img-2{ + height: 96rpx; + position: relative; + left: -24rpx; + margin-top: -28rpx; + } + .item-title { + font-family: Alibaba-PuHuiTi, Alibaba-PuHuiTi; + font-weight: normal; + font-size: 36rpx; + color: var(--td-text-color); + line-height: 36rpx; + font-style: normal; + text-transform: none; + margin-bottom: 28rpx; + .item-title-icon{ vertical-align: middle; width: 36rpx; height: 36rpx; - margin-right: 10rpx; - } - } - .item-title-icon{ - vertical-align: middle; - width: 36rpx; - height: 36rpx; - margin-right: 10rpx; + margin-right: 20rpx; + position: relative; + top: -4rpx; + left: 20rpx; } + + + } + .item-content { + background-color: #fff; + border-radius: 24rpx; + padding: 30rpx; + margin-bottom: 30rpx; + + + .echarts-canvas-container { width: 100%; height: 600rpx; @@ -79,13 +96,20 @@ position: absolute; right: 0; top: 0; - color: #0091cc; - font-size: 24rpx; + color: #606266; + font-size: 26rpx; } } - + .item-content-1-bg{ + position: absolute; + z-index: 0; + right: 0; + top: 0; + width: 240rpx; + height: 240rpx; + } .item-box { - background-color: #f5f5f5; + background-color: #fff; border-radius: 12rpx; padding: 26rpx; margin-top: 20rpx; @@ -109,8 +133,8 @@ } .drug-name { - font-size: 30rpx; - color: #323030; + font-size: 32rpx; + color: var(--td-text-color); margin-bottom: 8rpx; } @@ -121,12 +145,13 @@ } .follow-up-itme { - font-size: 24rpx; + font-size: 28rpx; + color: #909399; } .follow-itme-ed { - color: #0091cc; - font-size: 30rpx; + color: #00B095; + font-size: 32rpx; position: absolute; right: 30rpx; top: 50%; @@ -134,21 +159,50 @@ } .article-content { - margin-top: 10rpx; - font-size: 26rpx; - line-height: 36rpx; + margin-top: 20rpx; + font-size: 28rpx; + color: #606266; + line-height: 44rpx; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; word-break: break-word; + } } } + .item-content-3{ + padding-left: 0; + padding-right: 0; + background-color: transparent; + .item-box{ + // background-color: transparent; + box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(178,178,178,0.05); + border-radius: 24rpx; + } + .item-title-icon{ + margin-right: 18rpx; + } + } } - + .item-content-1{ + background: linear-gradient( 180deg, #EDF3F8 0%, #F7FAFC 100%); + box-shadow: 0rpx 2rpx 20rpx 0rpx #EDF3F8; + border-radius: 24rpx; + border: 2rpx solid #FFFFFF; + position: relative; + } + .item-content-2{ + background: linear-gradient( 180deg, #E7F2F2 0%, #F7FCFC 100%); + box-shadow: 0rpx 2rpx 20rpx 0rpx #E9F4F3; + border-radius: 24rpx; + border: 2rpx solid #FFFFFF; + position: relative; + } + } diff --git a/pages/home/index.wxml b/pages/home/index.wxml index cbd33c6..656d07c 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -3,7 +3,7 @@ - + 宝宝成长曲线 @@ -19,8 +19,10 @@ - - 每日用药提醒 + + + + 更多 @@ -47,9 +49,10 @@ 打卡 - - 随访提醒 - + + + + @@ -62,18 +65,19 @@ - - 健康推送 + + + 健康推送 更多 - + - {{article.title}} + {{item.title}} - {{article.contentText}} + {{item.contentText}}