Browse Source

首页联调

dev
kola-web 2 days ago
parent
commit
8e242c2227
  1. 3
      public/images/arrow-right-blue.svg
  2. 9
      public/images/heart-line.svg
  3. 22
      src/components/popup/index.wxml
  4. BIN
      src/images/bg17.png
  5. BIN
      src/images/icon43.png
  6. 2
      src/pages/drugMap/index.wxml
  7. 65
      src/pages/index/index.scss
  8. 50
      src/pages/index/index.ts
  9. 37
      src/pages/index/index.wxml

3
public/images/arrow-right-blue.svg

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.14286 6.85714H0V5.14286H5.14286V0H6.85714V5.14286H12V6.85714H6.85714V12H5.14286V6.85714Z" fill="#2F82A9"/>
</svg>

After

Width:  |  Height:  |  Size: 222 B

9
public/images/heart-line.svg

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<svg width="97" height="25" viewBox="0 0 97 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.44" d="M0 13.5699H3.01554L5.02591 11.057L6.53368 15.0777L8.04145 13.5699L9.04663 16.5855L12.0622 0.502591L13.5699 24.1244L15.5803 11.057L16.5855 14.5751L17.0881 13.5699H18.0933L20.1036 10.5544L21.6114 13.5699H97" stroke="url(#paint0_linear_48838_377)" stroke-width="1.00518" stroke-linejoin="round"/>
<defs>
<linearGradient id="paint0_linear_48838_377" x1="0" y1="12.3135" x2="97" y2="12.3135" gradientUnits="userSpaceOnUse">
<stop stop-color="#2F82A9"/>
<stop offset="1" stop-color="#2F82A9" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 658 B

22
src/components/popup/index.wxml

@ -11,20 +11,20 @@ @@ -11,20 +11,20 @@
>
<!-- 心率提醒-引导关注公众号 -->
<view class="popup1" wx:if="{{type==='popup1'}}">
<view class="popup-container" style="background: url('/images/bg13.png') no-repeat top center/100%">
<view class="popup-container" style="background: url('{{imageUrl}}bg13.png?t={{Timestamp}}') no-repeat top center/100%">
<view class="title">关注“星动守护”</view>
<view class="content">我们将在每周五下午7点提醒您记录</view>
<image class="code" src="/images/bg1.png" show-menu-by-longpress></image>
<image class="code" src="{{imageUrl}}bg1.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view>
</view>
<!-- 保存复诊记录成功-引导关注公众号 -->
<view class="popup2" wx:if="{{type==='popup2'}}">
<view class="popup-container">
<image class="badge" src="/images/badge1.png"></image>
<view class="container" style="background: url('/images/bg15.png') no-repeat top center/100%">
<image class="badge" src="{{imageUrl}}badge1.png?t={{Timestamp}}"></image>
<view class="container" style="background: url('{{imageUrl}}bg15.png?t={{Timestamp}}') no-repeat top center/100%">
<view class="title">保存复诊记录成功!</view>
<view class="code-wrap" style="background: url('/images/bg14.png') no-repeat top center/100%">
<image class="code" src="/images/bg1.png" show-menu-by-longpress></image>
<view class="code-wrap" style="background: url('{{imageUrl}}bg14.png?t={{Timestamp}}') no-repeat top center/100%">
<image class="code" src="{{imageUrl}}bg1.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view>
<view class="content">
关注“心动守护”公众号
@ -37,11 +37,11 @@ @@ -37,11 +37,11 @@
<!-- 保持心率成功-引导关注公众号 -->
<view class="popup3" wx:if="{{type==='popup3'}}">
<view class="popup-container">
<image class="badge" src="/images/badge2.png"></image>
<view class="container" style="background: url('/images/bg15.png') no-repeat top center/100%">
<image class="badge" src="{{imageUrl}}badge2.png?t={{Timestamp}}"></image>
<view class="container" style="background: url('{{imageUrl}}bg15.png?t={{Timestamp}}') no-repeat top center/100%">
<view class="title">保存复诊记录成功!</view>
<view class="code-wrap" style="background: url('/images/bg14.png') no-repeat top center/100%">
<image class="code" src="/images/bg1.png" show-menu-by-longpress></image>
<view class="code-wrap" style="background: url('{{imageUrl}}bg14.png?t={{Timestamp}}') no-repeat top center/100%">
<image class="code" src="{{imageUrl}}bg1.png?t={{Timestamp}}" show-menu-by-longpress></image>
</view>
<view class="content">
关注“心动守护”公众号
@ -52,5 +52,5 @@ @@ -52,5 +52,5 @@
</view>
</view>
<image wx:if="{{params.close}}" class="close" src="/images/clsoe.png" bind:tap="handleCancel"></image>
<image wx:if="{{params.close}}" class="close" src="{{imageUrl}}clsoe.png?t={{Timestamp}}" bind:tap="handleCancel"></image>
</van-popup>

BIN
src/images/bg17.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/images/icon43.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

2
src/pages/drugMap/index.wxml

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
class="page"
style="background: url('{{imageUrl}}bg6.png?t={{Timestamp}}') no-repeat top center/100%;padding-top: {{pageTop}}rpx;"
>
<image class="logo" src="/images/bg12.png"></image>
<image class="logo" src="{{imageUrl}}bg12.png?t={{Timestamp}}"></image>
<view class="content">
我们正在全力打造购药地图服务
<view></view>

65
src/pages/index/index.scss

@ -64,7 +64,70 @@ page { @@ -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;

50
src/pages/index/index.ts

@ -28,6 +28,13 @@ Page({ @@ -28,6 +28,13 @@ Page({
'qiye-wx': true,
education: true,
} as Record<string, boolean>,
healthSummary: {
heartRate: 0,
heartRateDate: '',
revisitDays: 0,
revisitDate: '',
} as any,
},
onLoad() {
app.waitLogin({ type: 'any' }).then(() => {
@ -36,6 +43,7 @@ Page({ @@ -36,6 +43,7 @@ Page({
this.getList()
this.getVideoList()
this.getConfig()
this.getHealthSummary()
})
},
onShow() {
@ -43,6 +51,34 @@ Page({ @@ -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({ @@ -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({ @@ -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',

37
src/pages/index/index.wxml

@ -21,7 +21,42 @@ @@ -21,7 +21,42 @@
<!-- 动态模块:顺序由接口控制 -->
<block wx:for="{{sectionList}}" wx:key="code">
<!-- code: health 健康动态 -->
<view class="kkd" wx:if="{{item.code==='health' && item.visible}}"></view>
<view class="kkd" wx:if="{{item.code==='health' && item.visible}}">
<view
class="k-card"
bind:tap="handleHealthHeartTap"
style="background: url('{{imageUrl}}bg17.png?t={{Timestamp}}') no-repeat top 72rpx left 0/193rpx 47rpx"
>
<view class="k-main">
<image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}"></image>
<view class="k-num">
<text class="k-value">{{healthSummary.heartRate}}</text>
<text class="k-unit">次/分</text>
</view>
<view class="k-sub">
<text class="k-label">心率</text>
|
<text class="k-label">上次记录</text>
<text class="k-date">{{healthSummary.heartRateDate}}</text>
</view>
</view>
</view>
<view class="k-card" bind:tap="handleHealthRevisitTap">
<view class="k-main">
<image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}"></image>
<view class="k-num">
<text class="k-value">{{healthSummary.revisitDays}}</text>
<text class="k-unit">天</text>
</view>
<view class="k-sub">
<text class="k-label">复诊</text>
|
<text class="k-label">上次复诊</text>
<text class="k-date">{{healthSummary.revisitDate}}</text>
</view>
</view>
</view>
</view>
<!-- code: spread1 首页banner -->
<view class="banner" wx:if="{{item.code==='spread1' && item.visible}}">
<swiper class="swiper1">

Loading…
Cancel
Save