diff --git a/public/images/arrow-right-blue.svg b/public/images/arrow-right-blue.svg new file mode 100644 index 0000000..d9f852f --- /dev/null +++ b/public/images/arrow-right-blue.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/heart-line.svg b/public/images/heart-line.svg new file mode 100644 index 0000000..5505351 --- /dev/null +++ b/public/images/heart-line.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index 6bdc8e7..cf6ac54 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -11,20 +11,20 @@ > - + 关注“星动守护” 我们将在每周五下午7点提醒您记录 - + - - + + 保存复诊记录成功! - - + + 关注“心动守护”公众号 @@ -37,11 +37,11 @@ - - + + 保存复诊记录成功! - - + + 关注“心动守护”公众号 @@ -52,5 +52,5 @@ - + diff --git a/src/images/bg17.png b/src/images/bg17.png new file mode 100644 index 0000000..f3c520e Binary files /dev/null and b/src/images/bg17.png differ diff --git a/src/images/icon43.png b/src/images/icon43.png new file mode 100644 index 0000000..16cb791 Binary files /dev/null and b/src/images/icon43.png differ diff --git a/src/pages/drugMap/index.wxml b/src/pages/drugMap/index.wxml index bb89b13..0a33422 100644 --- a/src/pages/drugMap/index.wxml +++ b/src/pages/drugMap/index.wxml @@ -8,7 +8,7 @@ class="page" style="background: url('{{imageUrl}}bg6.png?t={{Timestamp}}') no-repeat top center/100%;padding-top: {{pageTop}}rpx;" > - + 我们正在全力打造购药地图服务 diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index d96e71e..13b3113 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -64,7 +64,70 @@ page { } .kkd { margin: 32rpx 30rpx 0; - height: 176rpx; + display: flex; + gap: 24rpx; + .k-card { + flex: 1; + position: relative; + padding: 32rpx; + border-radius: 32rpx; + background: linear-gradient( + 208deg, + rgba(234, 248, 255, 1) 0%, + rgba(246, 252, 255, 1) 41%, + rgba(255, 255, 255, 1) 100% + ); + border: 2rpx solid #fff; + box-shadow: 0 8rpx 40rpx 0 rgba(47, 130, 169, 0.05); + box-sizing: border-box; + overflow: hidden; + .k-main { + z-index: 1; + display: flex; + flex-direction: column; + gap: 17rpx; + .k-add { + position: absolute; + top: 32rpx; + right: 32rpx; + width: 48rpx; + height: 48rpx; + } + .k-num { + display: flex; + align-items: baseline; + gap: 16rpx; + .k-value { + font-family: Manrope, sans-serif; + font-size: 56rpx; + font-weight: 700; + color: #2f82a9; + line-height: 64rpx; + } + .k-unit { + font-size: 24rpx; + font-weight: 500; + color: #64748b; + line-height: 32rpx; + letter-spacing: 0.05em; + } + } + .k-sub { + font-size: 24rpx; + font-weight: 400; + color: #64748b; + line-height: 32rpx; + letter-spacing: 0.05em; + .k-label { + font-weight: 600; + } + .k-date { + font-family: Manrope, sans-serif; + font-weight: 400; + } + } + } + } } .swiper1 { margin: 32rpx 30rpx 0; diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 0a9c1dc..5999a58 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -28,6 +28,13 @@ Page({ 'qiye-wx': true, education: true, } as Record, + + healthSummary: { + heartRate: 0, + heartRateDate: '', + revisitDays: 0, + revisitDate: '', + } as any, }, onLoad() { app.waitLogin({ type: 'any' }).then(() => { @@ -36,6 +43,7 @@ Page({ this.getList() this.getVideoList() this.getConfig() + this.getHealthSummary() }) }, onShow() { @@ -43,6 +51,34 @@ Page({ this.getMyInfo() } }, + getHealthSummary() { + const summary: any = { + heartRate: 0, + heartRateDate: '', + revisitDays: 0, + revisitDate: '', + } + wx.ajax({ + method: 'GET', + url: '?r=psvt/heart-rate-record/last-heart-rate', + }).then((res: any) => { + if (res) { + summary.heartRate = res.heartRate || 0 + const date = res.recordDate || '' + summary.heartRateDate = date ? date.substring(5) : '' + } + this.setData({ healthSummary: { ...this.data.healthSummary, ...summary } }) + }) + wx.ajax({ + method: 'GET', + url: '?r=psvt/revisit-record/last-revisit', + }).then((res: any) => { + summary.revisitDays = res?.daysSinceLastRevisit ?? 0 + const visitDate = res?.visitDate || '' + summary.revisitDate = visitDate ? visitDate.substring(5) : '' + this.setData({ healthSummary: { ...this.data.healthSummary, ...summary } }) + }) + }, getConfig() { wx.ajax({ method: 'GET', @@ -68,7 +104,7 @@ Page({ return { code, subList: conf?.subList || [], - visible: conf ? (conf.showStatus == 1 && (conf.subList || []).length > 0) : false, + visible: conf ? (conf.showStatus == 1 && (code === 'spread1' || code === 'spread2' ? (conf.subList || []).length > 0 : true)) : false, } }) .sort((a, b) => { @@ -213,6 +249,18 @@ Page({ }) } }, + handleHealthHeartTap() { + const tabBarParams = app.globalData.tabBarParams || {} + tabBarParams['pages/health/index'] = 'tab=1' + app.globalData.tabBarParams = tabBarParams + wx.switchTab({ url: '/pages/health/index' }) + }, + handleHealthRevisitTap() { + const tabBarParams = app.globalData.tabBarParams || {} + tabBarParams['pages/health/index'] = 'tab=2' + app.globalData.tabBarParams = tabBarParams + wx.switchTab({ url: '/pages/health/index' }) + }, handleWechatWork() { wx.navigateTo({ url: '/pages/wechatWork/index', diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index d5ef668..eacae8b 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -21,7 +21,42 @@ - + + + + + + {{healthSummary.heartRate}} + 次/分 + + + 心率 + | + 上次记录 + {{healthSummary.heartRateDate}} + + + + + + + + {{healthSummary.revisitDays}} + + + + 复诊 + | + 上次复诊 + {{healthSummary.revisitDate}} + + + +