tmp
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
// pages/healthprofile/index.js
|
||||
const API = require('../../utils/api.js')
|
||||
const { calcAge } = require('../../utils/format.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
totalCount: 0,
|
||||
profileList: [],
|
||||
quickMenus: [
|
||||
{ icon: 'view-list', title: '全部档案' },
|
||||
{ icon: 'add', title: '新建档案' },
|
||||
{ icon: 'search', title: '患者查询' },
|
||||
{ icon: 'time', title: '就诊记录' }
|
||||
]
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载档案总数与最近更新的档案列表(按修改时间排序,最多20条)
|
||||
*/
|
||||
loadData() {
|
||||
API.healthProfile.getProfiles({ page: 1, pageSize: 20, sortBy: 'updatetime' })
|
||||
.then(res => {
|
||||
if (res.code !== 0) {
|
||||
wx.showToast({ title: res.msg || '获取档案失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const data = res.data || {}
|
||||
const list = (data.list || []).map(item => {
|
||||
const age = calcAge(item.profile.birth)
|
||||
const loc = item.location || {}
|
||||
return {
|
||||
id: item._id,
|
||||
name: item.profile.name || '',
|
||||
mobile: item.profile.mobile || '',
|
||||
sexLabel: item.profile.sex === 'male' ? '男' : (item.profile.sex === 'female' ? '女' : ''),
|
||||
ageText: age ? `${age}岁` : '',
|
||||
locationText: [loc.province, loc.city].filter(Boolean).join(' ')
|
||||
}
|
||||
})
|
||||
this.setData({ totalCount: data.total || 0, profileList: list })
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('获取健康档案失败', err)
|
||||
wx.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||||
})
|
||||
},
|
||||
|
||||
onMenuTap(e) {
|
||||
const { index } = e.currentTarget.dataset
|
||||
const item = this.data.quickMenus[index]
|
||||
if (item.title === '新建档案') {
|
||||
wx.navigateTo({ url: '/pages/healthprofile/profileInfo' })
|
||||
return
|
||||
}
|
||||
if (item.title === '全部档案') {
|
||||
// 列表已展示在本页,暂不跳转
|
||||
wx.showToast({ title: '档案列表见下方', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.showToast({
|
||||
title: `${item.title} 开发中`,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击档案 → 编辑/删除
|
||||
*/
|
||||
onProfileTap(e) {
|
||||
const { id } = e.currentTarget.dataset
|
||||
wx.navigateTo({ url: `/pages/healthprofile/profileInfo?id=${id}` })
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "健康档案",
|
||||
"usingComponents": {
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"patient-info": "../../components/patient-info/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
/* pages/healthprofile/index.less */
|
||||
page {
|
||||
background-color: #f5f6fa;
|
||||
color: #1a1a2e;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.profile-page {
|
||||
padding: 24rpx;
|
||||
padding-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* 头部统计卡 */
|
||||
.header-card {
|
||||
background: linear-gradient(135deg, #2dd36f, #17c3a5);
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
color: #ffffff;
|
||||
box-shadow: 0 8rpx 24rpx rgba(23, 195, 165, 0.25);
|
||||
}
|
||||
|
||||
.header-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stat-center {
|
||||
margin-top: 36rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 24rpx;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-top: 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stat-num {
|
||||
font-size: 64rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.stat-unit {
|
||||
font-size: 26rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
/* 常用功能 */
|
||||
.section {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #1a1a1a;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.quick-grid {
|
||||
margin-top: 16rpx;
|
||||
padding: 24rpx 0 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.quick-item {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.quick-item:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.quick-icon {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background-color: #e6f9f3;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.quick-label {
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 健康档案列表 */
|
||||
.profile-list {
|
||||
margin-top: 16rpx;
|
||||
padding: 0 24rpx;
|
||||
|
||||
patient-info {
|
||||
display: block;
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<!--pages/healthprofile/index.wxml-->
|
||||
<view class="profile-page">
|
||||
<!-- 头部统计卡 -->
|
||||
<view class="header-card">
|
||||
<view class="header-row">
|
||||
<text class="header-title">健康档案</text>
|
||||
</view>
|
||||
<view class="stat-center">
|
||||
<text class="stat-label">档案总数</text>
|
||||
<view class="stat-value">
|
||||
<text class="stat-num">{{totalCount}}</text>
|
||||
<text class="stat-unit">份</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 常用功能 -->
|
||||
<view class="section">
|
||||
<text class="section-title">常用功能</text>
|
||||
<view class="quick-grid card">
|
||||
<view class="quick-item" wx:for="{{quickMenus}}" wx:key="title" data-index="{{index}}" bindtap="onMenuTap">
|
||||
<view class="quick-icon">
|
||||
<t-icon name="{{item.icon}}" size="40rpx" color="#1abc9c" />
|
||||
</view>
|
||||
<text class="quick-label">{{item.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 健康档案列表 -->
|
||||
<view class="section" wx:if="{{profileList.length > 0}}">
|
||||
<text class="section-title">健康档案</text>
|
||||
<view class="profile-list card">
|
||||
<patient-info
|
||||
wx:for="{{profileList}}"
|
||||
wx:key="id"
|
||||
data-id="{{item.id}}"
|
||||
bindtap="onProfileTap"
|
||||
name="{{item.name}}"
|
||||
sex-label="{{item.sexLabel}}"
|
||||
age-text="{{item.ageText}}"
|
||||
mobile="{{item.mobile}}"
|
||||
location-text="{{item.locationText}}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,219 @@
|
||||
// pages/healthprofile/profileInfo.js
|
||||
const API = require('../../utils/api.js')
|
||||
const store = require('../../utils/store.js')
|
||||
|
||||
const SEX_MAP = [
|
||||
{ label: '男', value: 'male' },
|
||||
{ label: '女', value: 'female' }
|
||||
]
|
||||
const BLOOD_TYPES = ['A', 'B', 'O', 'AB']
|
||||
|
||||
Page({
|
||||
data: {
|
||||
isEdit: false,
|
||||
profileId: '',
|
||||
isSubmitting: false,
|
||||
form: {
|
||||
name: '',
|
||||
mobile: '',
|
||||
sexLabel: '',
|
||||
birth: '',
|
||||
idnumber: '',
|
||||
address: '',
|
||||
height: '',
|
||||
weight: '',
|
||||
bloodType: '',
|
||||
remark: ''
|
||||
},
|
||||
region: [],
|
||||
regionLabel: '',
|
||||
sexLabels: SEX_MAP.map(item => item.label),
|
||||
bloodTypes: BLOOD_TYPES
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const now = new Date()
|
||||
const today = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`
|
||||
this.setData({ today })
|
||||
if (options && options.id) {
|
||||
this.setData({ isEdit: true, profileId: options.id })
|
||||
wx.setNavigationBarTitle({ title: '档案详情' })
|
||||
this.loadProfile(options.id)
|
||||
} else {
|
||||
wx.setNavigationBarTitle({ title: '新建档案' })
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载档案详情
|
||||
*/
|
||||
loadProfile(id) {
|
||||
API.healthProfile.getProfileById(id)
|
||||
.then(res => {
|
||||
if (res.code !== 0 || !res.data || !res.data.profile) {
|
||||
wx.showToast({ title: res.msg || '获取档案失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const p = res.data.profile
|
||||
const sexItem = SEX_MAP.find(item => item.value === p.profile.sex)
|
||||
const loc = p.location || {}
|
||||
this.setData({
|
||||
form: {
|
||||
name: p.profile.name || '',
|
||||
mobile: p.profile.mobile || '',
|
||||
sex: p.profile.sex || '',
|
||||
sexLabel: sexItem ? sexItem.label : '',
|
||||
birth: p.profile.birth || '',
|
||||
idnumber: p.profile.idnumber || '',
|
||||
address: loc.address || '',
|
||||
height: p.health.height || '',
|
||||
weight: p.health.weight || '',
|
||||
bloodType: p.health.bloodType || '',
|
||||
remark: p.health.remark || ''
|
||||
},
|
||||
region: [loc.province, loc.city, loc.district].filter(Boolean),
|
||||
regionLabel: [loc.province, loc.city, loc.district].filter(Boolean).join(' ')
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 文本输入统一处理
|
||||
*/
|
||||
onFieldChange(e) {
|
||||
const { field } = e.currentTarget.dataset
|
||||
this.setData({ [`form.${field}`]: e.detail.value })
|
||||
},
|
||||
|
||||
onSexChange(e) {
|
||||
const item = SEX_MAP[e.detail.value]
|
||||
if (item) {
|
||||
this.setData({ 'form.sex': item.value, 'form.sexLabel': item.label })
|
||||
}
|
||||
},
|
||||
|
||||
onBloodChange(e) {
|
||||
this.setData({ 'form.bloodType': this.data.bloodTypes[e.detail.value] })
|
||||
},
|
||||
|
||||
onBirthChange(e) {
|
||||
this.setData({ 'form.birth': e.detail.value })
|
||||
},
|
||||
|
||||
onRegionChange(e) {
|
||||
const value = e.detail.value || []
|
||||
this.setData({ region: value, regionLabel: value.join(' ') })
|
||||
},
|
||||
|
||||
/**
|
||||
* 校验并提交
|
||||
*/
|
||||
onSave() {
|
||||
if (this.data.isSubmitting) return
|
||||
|
||||
const { form, isEdit, profileId } = this.data
|
||||
if (!form.name.trim()) {
|
||||
wx.showToast({ title: '请输入患者姓名', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (!form.mobile.trim()) {
|
||||
wx.showToast({ title: '请输入患者电话', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
const region = this.data.region
|
||||
const payload = {
|
||||
profile: {
|
||||
name: form.name.trim(),
|
||||
mobile: form.mobile.trim(),
|
||||
sex: form.sex || '',
|
||||
birth: form.birth || '',
|
||||
idnumber: form.idnumber.trim()
|
||||
},
|
||||
location: {
|
||||
province: region[0] || '',
|
||||
city: region[1] || '',
|
||||
district: region[2] || '',
|
||||
address: form.address.trim()
|
||||
},
|
||||
health: {
|
||||
height: parseFloat(form.height) || 0,
|
||||
weight: parseFloat(form.weight) || 0,
|
||||
bloodType: form.bloodType,
|
||||
remark: form.remark.trim()
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({ isSubmitting: true })
|
||||
|
||||
const request = isEdit
|
||||
? API.healthProfile.updateProfile(profileId, payload)
|
||||
: API.healthProfile.createProfile(payload)
|
||||
|
||||
request.then(res => {
|
||||
if (res.code !== 0) {
|
||||
wx.showToast({ title: res.msg || '保存失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.showToast({
|
||||
title: isEdit ? '保存成功' : '创建成功',
|
||||
icon: 'success'
|
||||
})
|
||||
setTimeout(() => wx.navigateBack(), 800)
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||||
})
|
||||
.finally(() => {
|
||||
this.setData({ isSubmitting: false })
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转陪诊预约(携带档案患者信息)
|
||||
*/
|
||||
onBooking() {
|
||||
const { profileId, form } = this.data
|
||||
const params = [
|
||||
`id=${profileId}`,
|
||||
`name=${encodeURIComponent(form.name)}`,
|
||||
`mobile=${form.mobile}`,
|
||||
`sex=${form.sex || ''}`,
|
||||
`birth=${form.birth || ''}`
|
||||
].join('&')
|
||||
wx.navigateTo({ url: `/pages/order/orderEdit?${params}` })
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除档案(仅编辑模式)
|
||||
*/
|
||||
onDelete() {
|
||||
const { profileId } = this.data
|
||||
wx.showModal({
|
||||
title: '删除确认',
|
||||
content: '确定要删除该健康档案吗?删除后不可恢复。',
|
||||
confirmColor: '#ff4d4f',
|
||||
success: res => {
|
||||
if (!res.confirm) return
|
||||
API.healthProfile.deleteProfile(profileId)
|
||||
.then(res2 => {
|
||||
if (res2.code !== 0) {
|
||||
wx.showToast({ title: res2.msg || '删除失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
// 清除缓存并通知列表页刷新
|
||||
store.removeProfile(profileId)
|
||||
store.notifyProfileChange('remove', profileId)
|
||||
wx.showToast({ title: '删除成功', icon: 'success' })
|
||||
setTimeout(() => wx.navigateBack(), 800)
|
||||
})
|
||||
.catch(() => {
|
||||
wx.showToast({ title: '网络错误,请重试', icon: 'none' })
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "新建档案",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/* pages/healthprofile/profileInfo.less */
|
||||
page {
|
||||
background-color: #f5f6fa;
|
||||
color: #1a1a2e;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
|
||||
.info-page {
|
||||
padding: 24rpx;
|
||||
padding-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #1a1a1a;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
|
||||
.form-card {
|
||||
margin-top: 16rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
width: 170rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.form-input,
|
||||
.form-textarea,
|
||||
.picker-value {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #1a1a1a;
|
||||
}
|
||||
|
||||
.form-textarea {
|
||||
min-height: 100rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #b8b8c4;
|
||||
}
|
||||
|
||||
.form-divider {
|
||||
height: 1rpx;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
border-radius: 44rpx;
|
||||
padding: 24rpx 0;
|
||||
text-align: center;
|
||||
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
&:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, #2dd36f, #17c3a5);
|
||||
box-shadow: 0 8rpx 24rpx rgba(23, 195, 165, 0.25);
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background-color: #ff4d4f;
|
||||
}
|
||||
|
||||
.btn-outline {
|
||||
background-color: #ffffff;
|
||||
border: 2rpx solid #1abc9c;
|
||||
|
||||
text {
|
||||
color: #1abc9c;
|
||||
}
|
||||
}
|
||||
|
||||
.booking-btn {
|
||||
margin-top: 48rpx;
|
||||
}
|
||||
|
||||
.btn-group + .btn-group,
|
||||
.booking-btn + .btn-group {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<!--pages/healthprofile/profileInfo.wxml-->
|
||||
<view class="info-page">
|
||||
<!-- 患者信息 -->
|
||||
<view class="section">
|
||||
<text class="section-title">患者信息</text>
|
||||
<view class="form-card card">
|
||||
<view class="form-item">
|
||||
<text class="form-label">姓名</text>
|
||||
<input class="form-input" placeholder="请输入患者姓名" value="{{form.name}}" bindinput="onFieldChange" data-field="name" />
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">电话</text>
|
||||
<input class="form-input" type="number" placeholder="请输入患者电话" value="{{form.mobile}}" bindinput="onFieldChange" data-field="mobile" />
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">性别</text>
|
||||
<picker mode="selector" range="{{sexLabels}}" bindchange="onSexChange">
|
||||
<view class="picker-value {{form.sex ? '' : 'placeholder'}}">{{form.sexLabel || '请选择性别'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">出生年月</text>
|
||||
<picker mode="date" value="{{form.birth}}" end="{{today}}" bindchange="onBirthChange">
|
||||
<view class="picker-value {{form.birth ? '' : 'placeholder'}}">{{form.birth || '请选择出生日期'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">身份证号</text>
|
||||
<input class="form-input" placeholder="请输入身份证号(选填)" value="{{form.idnumber}}" bindinput="onFieldChange" data-field="idnumber" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 所在地 -->
|
||||
<view class="section">
|
||||
<text class="section-title">所在地</text>
|
||||
<view class="form-card card">
|
||||
<view class="form-item">
|
||||
<text class="form-label">省市区</text>
|
||||
<picker mode="region" value="{{region}}" bindchange="onRegionChange">
|
||||
<view class="picker-value {{regionLabel ? '' : 'placeholder'}}">{{regionLabel || '请选择省市区(选填)'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">详细地址</text>
|
||||
<input class="form-input" placeholder="街道、门牌号等(选填)" value="{{form.address}}" bindinput="onFieldChange" data-field="address" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 健康信息 -->
|
||||
<view class="section">
|
||||
<text class="section-title">健康信息</text>
|
||||
<view class="form-card card">
|
||||
<view class="form-item">
|
||||
<text class="form-label">身高(cm)</text>
|
||||
<input class="form-input" type="digit" placeholder="选填" value="{{form.height}}" bindinput="onFieldChange" data-field="height" />
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">体重(kg)</text>
|
||||
<input class="form-input" type="digit" placeholder="选填" value="{{form.weight}}" bindinput="onFieldChange" data-field="weight" />
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">血型</text>
|
||||
<picker mode="selector" range="{{bloodTypes}}" value="{{form.bloodIndex}}" bindchange="onBloodChange">
|
||||
<view class="picker-value {{form.bloodType ? '' : 'placeholder'}}">{{form.bloodType || '请选择血型'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-divider"></view>
|
||||
<view class="form-item">
|
||||
<text class="form-label">备注</text>
|
||||
<textarea class="form-textarea" placeholder="病史、过敏史等(选填)" value="{{form.remark}}" bindinput="onFieldChange" data-field="remark" auto-height maxlength="200" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊预约(仅编辑已有档案时显示) -->
|
||||
<view wx:if="{{isEdit}}" class="btn btn-outline booking-btn" bindtap="onBooking">
|
||||
<text>陪诊预约</text>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="btn-group">
|
||||
<view class="btn btn-primary {{isSubmitting ? 'disabled' : ''}}" bindtap="onSave">
|
||||
<text>{{isEdit ? '保存修改' : '创建档案'}}</text>
|
||||
</view>
|
||||
<view wx:if="{{isEdit}}" class="btn btn-danger" bindtap="onDelete">
|
||||
<text>删除档案</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user