Browse Source

feat(patient): 添加患者身份切换功能及优化患者列表

- 在登录页面添加患者身份切换按钮
- 修改患者列表页面的时间筛选逻辑
- 优化图表数据显示和样式
- 修复患者列表页面上传材料类型判断问题
master
kola-web 4 days ago
parent
commit
7cb43cf37f
  1. 6
      src/doctor/pages/home/index.scss
  2. 17
      src/doctor/pages/home/index.ts
  3. 2
      src/doctor/pages/invite/index.wxml
  4. 16
      src/doctor/pages/login/index.scss
  5. 10
      src/doctor/pages/login/index.ts
  6. 4
      src/doctor/pages/login/index.wxml
  7. 14
      src/doctor/pages/loginForm/index.ts
  8. 12
      src/doctor/pages/my/index.ts
  9. 319
      src/doctor/pages/patientList/index.scss
  10. 40
      src/doctor/pages/patientList/index.ts
  11. 69
      src/doctor/pages/patientList/index.wxml
  12. 15
      src/doctor/pages/stat/index.scss
  13. 16
      src/doctor/pages/stat/index.wxml
  14. 5
      src/ground/pages/home/index.scss
  15. 44
      src/ground/pages/home/index.ts
  16. 12
      src/ground/pages/login/index.scss
  17. 4
      src/ground/pages/login/index.ts
  18. 4
      src/ground/pages/login/index.wxml
  19. 4
      src/pages/start/index.ts
  20. 1
      typings/index.d.ts

6
src/doctor/pages/home/index.scss

@ -16,6 +16,7 @@ page { @@ -16,6 +16,7 @@ page {
.page {
min-height: 60vh;
padding-bottom: 40rpx;
.user {
margin: 48rpx 0 0 32rpx;
display: flex;
@ -383,10 +384,12 @@ page { @@ -383,10 +384,12 @@ page {
align-items: center;
justify-content: space-between;
.picker {
flex: 1;
.p-content {
padding: 8rpx 38rpx;
padding: 8rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 18rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 1px solid #f2f6f8;
@ -401,6 +404,7 @@ page { @@ -401,6 +404,7 @@ page {
}
}
.line {
margin: 0 20rpx;
width: 24rpx;
height: 1px;
background-color: #f2f6f8;

17
src/doctor/pages/home/index.ts

@ -507,6 +507,22 @@ Page({ @@ -507,6 +507,22 @@ Page({
})
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
formatter (params) {
let result = `${params[0].axisValue }\n`
params.forEach((item, index) => {
result += `${item.marker } ${ item.seriesName }: ${ item.value }`
if (index < params.length - 1) {
result += '\n'
}
})
return result
},
},
legend: {
top: 0,
right: 0,
@ -598,6 +614,7 @@ Page({ @@ -598,6 +614,7 @@ Page({
}
chart.setOption(option)
reslove(chart)
return chart
})

2
src/doctor/pages/invite/index.wxml

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
<view class="title">邀请您加入健康管理项目</view>
<view class="brand">
<view class="name">
{{projectName || '特诺雅'}}
{{projectName}}
<text style="font-size: 0.5em; vertical-align: top">®</text>
</view>
<view class="bg"></view>

16
src/doctor/pages/login/index.scss

@ -15,9 +15,9 @@ page { @@ -15,9 +15,9 @@ page {
justify-content: center;
background: #ffffff;
border-radius: 50%;
&.active{
&.active {
color: #fff;
background-color: #FF8A4C;
background-color: #ff8a4c;
}
}
}
@ -129,11 +129,17 @@ page { @@ -129,11 +129,17 @@ page {
}
}
.partient {
margin-top: 58rpx;
font-size: 32rpx;
color: rgba(161, 164, 172, 1);
margin-top: 52rpx;
padding-bottom: 100rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #94a3a3;
.icon {
width: 40rpx;
height: 40rpx;
}
}
}

10
src/doctor/pages/login/index.ts

@ -145,11 +145,6 @@ Page({ @@ -145,11 +145,6 @@ Page({
})
}
},
handlePatient() {
wx.redirectTo({
url: '/pages/login/index',
})
},
handleTelCode() {
this.setData({
showForm: !this.data.showForm,
@ -165,6 +160,11 @@ Page({ @@ -165,6 +160,11 @@ Page({
check: !this.data.check,
})
},
handlePatient() {
wx.restartMiniProgram({
path: '/pages/start/index',
})
},
handleBack() {
wx.navigateBack()
},

4
src/doctor/pages/login/index.wxml

@ -57,4 +57,8 @@ @@ -57,4 +57,8 @@
规定收集我的个人敏感信息
</view>
</view>
<view class="partient" bind:tap="handlePatient">
我是患者
<image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image>
</view>
</view>

14
src/doctor/pages/loginForm/index.ts

@ -274,25 +274,17 @@ Page({ @@ -274,25 +274,17 @@ Page({
projectId,
},
})
.then((res: any) => {
.then(() => {
wx.hideLoading()
// 保存登录信息
app.globalData.initLoginInfo = {
...app.globalData.initLoginInfo,
isLogin: 1,
loginIdentity: 4,
loginIdentityId: res.pharmacistId,
}
wx.showToast({
title: '注册成功',
icon: 'success',
})
// 跳转到药店端首页
setTimeout(() => {
app.startLogin(() => {
wx.reLaunch({
url: '/doctor/pages/home/index',
})
}, 1500)
})
})
.catch(() => {
wx.hideLoading()

12
src/doctor/pages/my/index.ts

@ -76,11 +76,13 @@ Page({ @@ -76,11 +76,13 @@ Page({
// 过滤出当前项目的邀约人
const filteredList = list.filter((item: any) => item.projectName === currentProjectName)
const inviterList = filteredList.map((item: any) => ({
promoterName: item.promoterName || '',
promoterPhone: item.promoterPhone || '',
projectName: item.projectName || '',
}))
const inviterList = filteredList
.map((item: any) => ({
promoterName: item.promoterName || '',
promoterPhone: item.promoterPhone || '',
projectName: item.projectName || '',
}))
.filter((item: any) => item.promoterName || item.promoterPhone)
this.setData({ inviterList })
})
},

319
src/doctor/pages/patientList/index.scss

@ -76,15 +76,6 @@ page { @@ -76,15 +76,6 @@ page {
height: 44rpx;
}
}
.total {
padding: 10rpx 0;
font-size: 32rpx;
color: #342317;
text-align: right;
.num {
color: #ff8a4c;
}
}
}
.range {
margin: 22rpx 32rpx 0;
@ -121,184 +112,196 @@ page { @@ -121,184 +112,196 @@ page {
}
}
}
.card {
margin: 32rpx;
padding: 32rpx;
background: linear-gradient(180deg, #fff6ed 0%, #ffffff 21.63%, #ffffff 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2rpx solid #ffffff;
.user {
display: flex;
.avatar {
flex-shrink: 0;
width: 116rpx;
height: 116rpx;
border-radius: 50%;
.page-container {
.total {
padding: 20rpx 32rpx 0;
font-size: 32rpx;
color: #342317;
text-align: right;
.num {
color: #ff8a4c;
}
.wrap {
padding-top: 8rpx;
padding-left: 24rpx;
.info {
.name {
padding-right: 12rpx;
font-size: 32rpx;
color: #342317;
}
.card {
margin: 32rpx;
padding: 32rpx;
background: linear-gradient(180deg, #fff6ed 0%, #ffffff 21.63%, #ffffff 100%);
border-radius: 24rpx 24rpx 24rpx 24rpx;
border: 2rpx solid #ffffff;
.user {
display: flex;
.avatar {
flex-shrink: 0;
width: 116rpx;
height: 116rpx;
border-radius: 50%;
}
.wrap {
padding-top: 8rpx;
padding-left: 24rpx;
.info {
.name {
padding-right: 12rpx;
font-size: 32rpx;
color: #342317;
}
.tel {
font-size: 28rpx;
color: #342317;
}
}
.tel {
.site {
margin-top: 8rpx;
font-size: 28rpx;
color: #342317;
}
}
.site {
margin-top: 8rpx;
font-size: 28rpx;
color: #342317;
}
.date {
margin-top: 8rpx;
font-size: 28rpx;
color: #b7b7b7;
.date {
margin-top: 8rpx;
font-size: 28rpx;
color: #b7b7b7;
}
}
}
}
.container {
margin-top: 32rpx;
padding-top: 12rpx;
padding-bottom: 32rpx;
border-radius: 12rpx;
background-color: rgba(247, 247, 247, 0.6);
.c-item {
display: flex;
.aside {
.container {
margin-top: 32rpx;
padding-top: 12rpx;
padding-bottom: 32rpx;
border-radius: 12rpx;
background-color: rgba(247, 247, 247, 0.6);
.c-item {
display: flex;
flex-direction: column;
align-items: flex-end;
.line-top {
flex-shrink: 0;
margin-right: 9rpx;
height: 32rpx;
border-right: 1px dashed #d9d9d9;
}
.step {
margin: -6rpx 0;
.aside {
display: flex;
align-items: center;
gap: 12rpx;
.name {
padding: 0 0 0 12rpx;
font-size: 28rpx;
color: #b7b7b7;
}
.order {
flex-direction: column;
align-items: flex-end;
.line-top {
flex-shrink: 0;
width: 20rpx;
height: 20rpx;
background: rgba(217, 217, 217, 0.26);
border-radius: 50%;
&::after {
margin: 4rpx auto;
content: '';
display: block;
width: 12rpx;
height: 12rpx;
margin-right: 9rpx;
height: 32rpx;
border-right: 1px dashed #d9d9d9;
}
.step {
margin: -6rpx 0;
display: flex;
align-items: center;
gap: 12rpx;
.name {
padding: 0 0 0 12rpx;
font-size: 28rpx;
color: #b7b7b7;
}
.order {
flex-shrink: 0;
width: 20rpx;
height: 20rpx;
background: rgba(217, 217, 217, 0.26);
border-radius: 50%;
background: #d9d9d9;
&::after {
margin: 4rpx auto;
content: '';
display: block;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #d9d9d9;
}
}
}
.line-bottom {
flex: 1;
margin-right: 9rpx;
height: 32rpx;
border-right: 1px dashed #d9d9d9;
}
}
.line-bottom {
.wrap {
flex: 1;
margin-right: 9rpx;
height: 32rpx;
border-right: 1px dashed #d9d9d9;
}
}
.wrap {
flex: 1;
margin: 0 16rpx;
padding-bottom: 32rpx;
border-bottom: 1px solid #efefef;
.none {
color: #b7b7b7;
}
.date {
padding-top: 24rpx;
font-size: 32rpx;
color: #342317;
}
.status {
margin-top: 18rpx;
display: flex;
align-items: center;
gap: 32rpx;
font-size: 32rpx;
.s1 {
color: #4a8dff;
margin: 0 16rpx;
padding-bottom: 32rpx;
border-bottom: 1px solid #efefef;
.none {
color: #b7b7b7;
}
.s2 {
color: #e86854;
.date {
padding-top: 24rpx;
font-size: 32rpx;
color: #342317;
}
.btn1 {
color: #ff8a4c;
text-decoration: underline;
text-underline-offset: 4rpx;
.status {
margin-top: 18rpx;
display: flex;
align-items: center;
gap: 32rpx;
font-size: 32rpx;
.s1 {
color: #4a8dff;
}
.s2 {
color: #e86854;
}
.btn1 {
color: #ff8a4c;
text-decoration: underline;
text-underline-offset: 4rpx;
}
.btn2 {
width: 160rpx;
height: 48rpx;
background: #ff8a4c;
border-radius: 88rpx 88rpx 88rpx 88rpx;
text-align: center;
line-height: 48rpx;
font-size: 28rpx;
color: #ffffff;
}
}
.btn2 {
width: 160rpx;
height: 48rpx;
background: #ff8a4c;
border-radius: 88rpx 88rpx 88rpx 88rpx;
text-align: center;
line-height: 48rpx;
font-size: 28rpx;
color: #ffffff;
.remark {
margin-top: 16rpx;
font-size: 32rpx;
color: #e86854;
}
}
.remark {
margin-top: 16rpx;
.none {
padding: 20rpx 0 0 16rpx;
font-size: 32rpx;
color: #e86854;
color: rgba(183, 183, 183, 0.8);
}
}
.none {
padding: 20rpx 0 0 16rpx;
font-size: 32rpx;
color: rgba(183, 183, 183, 0.8);
}
&.active {
.aside {
.line-top,
.line-bottom {
border-color: #ff8a4c;
}
.step {
.name {
color: #ff8a4c;
background: linear-gradient(to right, rgba(255, 138, 76, 0.16) 0%, transparent 100%);
&.active {
.aside {
.line-top,
.line-bottom {
border-color: #ff8a4c;
}
.order {
background: rgba(255, 138, 76, 0.18);
&::after {
background: #ff8a4c;
.step {
.name {
color: #ff8a4c;
background: linear-gradient(to right, rgba(255, 138, 76, 0.16) 0%, transparent 100%);
}
.order {
background: rgba(255, 138, 76, 0.18);
&::after {
background: #ff8a4c;
}
}
}
}
}
}
&:first-of-type {
.line-top {
border-right: none;
}
}
&:last-of-type {
.aside {
.line-bottom {
// border: none;
&:first-of-type {
.line-top {
border-right: none;
}
}
.wrap {
padding-bottom: 0;
border-bottom: none;
&:last-of-type {
.aside {
.line-bottom {
// border: none;
}
}
.wrap {
padding-bottom: 0;
border-bottom: none;
}
}
}
}

40
src/doctor/pages/patientList/index.ts

@ -29,7 +29,7 @@ Page({ @@ -29,7 +29,7 @@ Page({
{ value: 0, label: '未入组' },
{ value: 1, label: '已入组' },
] as Array<{ value: string | number; label: string }>,
timeType: 0, // 0-跳转时间,1-入组时间
jumpStartTime: '',
jumpEndTime: '',
enrollStartTime: '',
@ -128,8 +128,8 @@ Page({ @@ -128,8 +128,8 @@ Page({
this.setData({ loading: true })
// 根据时间类型判断传递哪个时间参数
const { timeType, jumpStartTime, jumpEndTime, enrollStartTime, enrollEndTime, jumpStatus, enrollStatus } = this.data
// 同时传递跳转时间和入组时间(如果有值)
const { jumpStartTime, jumpEndTime, enrollStartTime, enrollEndTime, jumpStatus, enrollStatus } = this.data
const params: any = {
keyword: this.data.keyword,
page: this.data.page,
@ -146,16 +146,13 @@ Page({ @@ -146,16 +146,13 @@ Page({
params.enrollStatus = enrollStatus
}
// 时间类型:0-跳转时间,1-入组时间
if (timeType === 0) {
// 跳转时间
if (jumpStartTime) params.jumpStartTime = jumpStartTime
if (jumpEndTime) params.jumpEndTime = jumpEndTime
} else {
// 入组时间
if (enrollStartTime) params.enrollStartTime = enrollStartTime
if (enrollEndTime) params.enrollEndTime = enrollEndTime
}
// 跳转时间
if (jumpStartTime) params.jumpStartTime = jumpStartTime
if (jumpEndTime) params.jumpEndTime = jumpEndTime
// 入组时间
if (enrollStartTime) params.enrollStartTime = enrollStartTime
if (enrollEndTime) params.enrollEndTime = enrollEndTime
wx.ajax({
method: 'GET',
@ -250,17 +247,6 @@ Page({ @@ -250,17 +247,6 @@ Page({
})
this.getPatientList()
},
// 时间类型切换
handleTimeTypeChange(e: WechatMiniprogram.CustomEvent) {
const timeType = e.detail.value === '1' ? 1 : 0
this.setData({
timeType,
page: 1,
patientList: [],
hasMore: true,
})
this.getPatientList()
},
// 跳转开始时间选择
handleJumpStartTimeChange(e: WechatMiniprogram.CustomEvent) {
const jumpStartTime = e.detail.value
@ -357,13 +343,13 @@ Page({ @@ -357,13 +343,13 @@ Page({
},
// 上传材料
handleUpload(e: WechatMiniprogram.CustomEvent) {
const { id } = e.currentTarget.dataset
const { id, type } = e.currentTarget.dataset
// 查找患者信息
const patient = this.data.patientList.find((p: any) => p.id === id)
if (!patient) return
// 判断是跳转材料还是入组材料
const isJumpMaterial = patient.jumpAuditStatus === 0 || patient.jumpAuditStatus === 3
// 根据点击的按钮判断是跳转材料还是入组材料
const isJumpMaterial = type === 'jump'
const auditType = isJumpMaterial ? 1 : 2
const title = isJumpMaterial ? '上传跳转证明材料' : '上传入组证明材料'

69
src/doctor/pages/patientList/index.wxml

@ -54,44 +54,55 @@ @@ -54,44 +54,55 @@
</view>
</picker>
</view>
<!-- 跳转时间筛选 -->
<view class="range">
<view class="label">时间筛选:</view>
<view class="label">跳转时间:</view>
<picker
class="picker"
mode="date"
end="{{today}}"
bindchange="{{timeType === 0 ? 'handleJumpStartTimeChange' : 'handleEnrollStartTimeChange'}}"
value="{{timeType === 0 ? jumpStartTime : enrollStartTime}}"
bindchange="handleJumpStartTimeChange"
value="{{jumpStartTime}}"
>
<view class="date">{{(timeType === 0 ? jumpStartTime : enrollStartTime) || '开始时间'}}</view>
<view class="date">{{jumpStartTime || '开始时间'}}</view>
</picker>
<view class="line"></view>
<picker class="picker" mode="date" end="{{today}}" bindchange="handleJumpEndTimeChange" value="{{jumpEndTime}}">
<view class="date">{{jumpEndTime || '结束时间'}}</view>
</picker>
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
</view>
<!-- 入组时间筛选 -->
<view class="range">
<view class="label">入组时间:</view>
<picker
class="picker"
mode="date"
end="{{today}}"
bindchange="{{timeType === 0 ? 'handleJumpEndTimeChange' : 'handleEnrollEndTimeChange'}}"
value="{{timeType === 0 ? jumpEndTime : enrollEndTime}}"
bindchange="handleEnrollStartTimeChange"
value="{{enrollStartTime}}"
>
<view class="date">{{(timeType === 0 ? jumpEndTime : enrollEndTime) || '结束时间'}}</view>
<view class="date">{{enrollStartTime || '开始时间'}}</view>
</picker>
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
</view>
<view class="row">
<picker bindchange="handleTimeTypeChange" value="{{timeType}}" range="{{['跳转', '入组']}}">
<view class="col">
<view class="label">时间类型:</view>
<view class="content">{{timeType === 0 ? '跳转' : '入组'}}</view>
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
</view>
<view class="line"></view>
<picker
class="picker"
mode="date"
end="{{today}}"
bindchange="handleEnrollEndTimeChange"
value="{{enrollEndTime}}"
>
<view class="date">{{enrollEndTime || '结束时间'}}</view>
</picker>
<view class="total">
已邀约总人数:
<text class="num">{{totalCount}}人</text>
</view>
<image class="icon" src="{{imageUrl}}icon2.png?t={{Timestamp}}"></image>
</view>
</view>
<view class="page-container">
<view class="total">
已邀约总人数:
<text class="num">{{totalCount}}人</text>
</view>
<view class="card" wx:for="{{patientList}}" wx:key="id">
<view class="user">
<image class="avatar" src="{{item.patientAvatar}}" mode="aspectFill"></image>
@ -126,7 +137,13 @@ @@ -126,7 +137,13 @@
{{item.jumpAuditStatusText}}
</view>
<!-- 未审核:提交 -->
<view class="btn2" wx:if="{{item.jumpAuditStatus === 0}}" catch:tap="handleUpload" data-id="{{item.id}}">
<view
class="btn2"
wx:if="{{item.jumpAuditStatus === 0}}"
catch:tap="handleUpload"
data-id="{{item.id}}"
data-type="jump"
>
提交
</view>
<!-- 审核中/已通过:查看提交材料(预览图片) -->
@ -139,7 +156,13 @@ @@ -139,7 +156,13 @@
查看提交材料
</view>
<!-- 已驳回:重新提交 -->
<view class="btn2" wx:if="{{item.jumpAuditStatus === 3}}" catch:tap="handleUpload" data-id="{{item.id}}">
<view
class="btn2"
wx:if="{{item.jumpAuditStatus === 3}}"
catch:tap="handleUpload"
data-id="{{item.id}}"
data-type="jump"
>
重新提交
</view>
</view>
@ -174,6 +197,7 @@ @@ -174,6 +197,7 @@
wx:if="{{item.enrollAuditStatus === 0}}"
catch:tap="handleUpload"
data-id="{{item.id}}"
data-type="enroll"
>
提交
</view>
@ -192,6 +216,7 @@ @@ -192,6 +216,7 @@
wx:if="{{item.enrollAuditStatus === 3}}"
catch:tap="handleUpload"
data-id="{{item.id}}"
data-type="enroll"
>
重新提交
</view>

15
src/doctor/pages/stat/index.scss

@ -6,7 +6,7 @@ page { @@ -6,7 +6,7 @@ page {
align-items: center;
gap: 22rpx;
font-size: 36rpx;
color: #1A2020;
color: #1a2020;
}
.page {
@ -60,7 +60,7 @@ page { @@ -60,7 +60,7 @@ page {
text-align: center;
.num {
font-size: 48rpx;
color: #FF8A4C;
color: #ff8a4c;
font-weight: bold;
line-height: 56rpx;
.sub {
@ -91,13 +91,13 @@ page { @@ -91,13 +91,13 @@ page {
flex-shrink: 0;
height: 40rpx;
width: 0;
border-right: 1px dashed #FF8A4C;
border-right: 1px dashed #ff8a4c;
}
.dot {
flex-shrink: 0;
width: 24rpx;
height: 24rpx;
background: rgba(255,138,76,0.18);
background: rgba(255, 138, 76, 0.18);
border-radius: 50%;
&::after {
margin: 4rpx auto;
@ -106,17 +106,18 @@ page { @@ -106,17 +106,18 @@ page {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #FF8A4C;
background-color: #ff8a4c;
}
}
.line-bottom {
flex: 1;
height: 40rpx;
width: 0;
border-right: 1px dashed #FF8A4C;
border-right: 1px dashed #ff8a4c;
}
}
.m-container {
flex: 1;
padding-top: 44rpx;
.date {
font-size: 32rpx;
@ -129,7 +130,7 @@ page { @@ -129,7 +130,7 @@ page {
overflow: hidden;
.row2 {
display: flex;
background: linear-gradient( 90deg, #FF8A4C 0%, #FECE55 100%);
background: linear-gradient(90deg, #ff8a4c 0%, #fece55 100%);
border-radius: 16rpx 16rpx 0 0;
.col {
flex: 1;

16
src/doctor/pages/stat/index.wxml

@ -72,6 +72,22 @@ @@ -72,6 +72,22 @@
<view class="num">{{item.enrollPatientCount}}</view>
</view>
</view>
<view class="row3" wx:for="{{item.indicationStats}}" wx:key="indicationId" wx:for-item="indItem">
<view class="col">
<view class="name">{{indItem.indicationName}}</view>
<view class="num">{{indItem.invitePatientCount}}</view>
<view class="line"></view>
</view>
<view class="col">
<view class="name">{{indItem.indicationName}}</view>
<view class="num">{{indItem.jumpPatientCount}}</view>
</view>
<view class="col">
<view class="name">{{indItem.indicationName}}</view>
<view class="num">{{indItem.enrollPatientCount}}</view>
<view class="line"></view>
</view>
</view>
</view>
</view>
</view>

5
src/ground/pages/home/index.scss

@ -338,10 +338,12 @@ page { @@ -338,10 +338,12 @@ page {
align-items: center;
justify-content: space-between;
.picker {
flex: 1;
.p-content {
padding: 8rpx 38rpx;
padding: 8rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 18rpx;
border-radius: 12rpx 12rpx 12rpx 12rpx;
border: 1px solid #f2f6f8;
@ -356,6 +358,7 @@ page { @@ -356,6 +358,7 @@ page {
}
}
.line {
margin: 0 20rpx;
width: 24rpx;
height: 1px;
background-color: #f2f6f8;

44
src/ground/pages/home/index.ts

@ -631,13 +631,33 @@ Page({ @@ -631,13 +631,33 @@ Page({
})
canvas.setChart(chart)
const x: string[] = []
const y1: string[] = []
const y1: number[] = []
const y2: number[] = []
const y3: number[] = []
list.forEach((item) => {
x.push(item.date || item.StatMonth)
y1.push(item.count || item.MonthInvitePCount)
y1.push(item.inviteCount || item.count || item.MonthInvitePCount || 0)
y2.push(item.jumpCount || 0)
y3.push(item.enrollCount || 0)
})
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
formatter (params) {
let result = `${params[0].axisValue }\n`
params.forEach((item, index) => {
result += `${item.marker } ${ item.seriesName }: ${ item.value}`
if (index < params.length - 1) {
result += '\n'
}
})
return result
},
},
legend: {
top: 0,
right: 0,
@ -709,7 +729,7 @@ Page({ @@ -709,7 +729,7 @@ Page({
stack: 'a',
color: '#4A8DFF',
barWidth: 12,
data: y1,
data: y2,
},
{
name: '入组患者数',
@ -717,7 +737,7 @@ Page({ @@ -717,7 +737,7 @@ Page({
stack: 'a',
color: '#3ADDC8',
barWidth: 12,
data: y1,
data: y3,
},
],
dataZoom: {
@ -753,6 +773,22 @@ Page({ @@ -753,6 +773,22 @@ Page({
})
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'line',
},
formatter (params) {
let result = `${params[0].axisValue }\n`
params.forEach((item, index) => {
result += `${item.marker } ${ item.seriesName }: ${ item.value}`
if (index < params.length - 1) {
result += '\n'
}
})
return result
},
},
legend: {
top: 0,
right: 0,

12
src/ground/pages/login/index.scss

@ -109,11 +109,17 @@ page { @@ -109,11 +109,17 @@ page {
}
}
.partient {
margin-top: 58rpx;
font-size: 32rpx;
color: rgba(161, 164, 172, 1);
margin-top: 52rpx;
padding-bottom: 100rpx;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #94a3a3;
.icon {
width: 40rpx;
height: 40rpx;
}
}
}

4
src/ground/pages/login/index.ts

@ -131,8 +131,8 @@ Page({ @@ -131,8 +131,8 @@ Page({
})
},
handlePatient() {
wx.redirectTo({
url: '/pages/login/index',
wx.restartMiniProgram({
path: '/pages/start/index',
})
},
handleTelCode() {

4
src/ground/pages/login/index.wxml

@ -52,4 +52,8 @@ @@ -52,4 +52,8 @@
规定收集我的个人敏感信息
</view>
</view>
<view class="partient" bind:tap="handlePatient">
我是患者
<image class="icon" src="{{imageUrl}}icon9.png?t={{Timestamp}}"></image>
</view>
</view>

4
src/pages/start/index.ts

@ -35,7 +35,7 @@ Page({ @@ -35,7 +35,7 @@ Page({
}
app.waitLogin().then(() => {
const { isLogin, isRegister, loginIdentity } = app.globalData.initLoginInfo
const { isLogin, isRegister, loginIdentity, patientId } = app.globalData.initLoginInfo
// 扫码进入用户处理
// t=1: 地推人员码,t=2: 药店人员码
@ -61,7 +61,7 @@ Page({ @@ -61,7 +61,7 @@ Page({
// 未注册,根据身份跳转到对应注册页面
if (!isLogin) {
if (loginIdentity === 2) {
if (loginIdentity === 2 || (patientId && patientId > 0)) {
wx.reLaunch({
url: '/pages/index/index',
})

1
typings/index.d.ts vendored

@ -53,6 +53,7 @@ interface IAppOption { @@ -53,6 +53,7 @@ interface IAppOption {
openid: string
unionid: string
userId: number
patientId: number
}>
[propName: string]: any

Loading…
Cancel
Save