Compare commits
1
Commits
6238f01346
...
d6d5cc732d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6d5cc732d |
@@ -4,6 +4,8 @@
|
|||||||
"pages/ai/aichat",
|
"pages/ai/aichat",
|
||||||
"pages/escort/itemdetail",
|
"pages/escort/itemdetail",
|
||||||
"pages/escort/itemlist",
|
"pages/escort/itemlist",
|
||||||
|
"pages/escort/attendants",
|
||||||
|
"pages/escort/attendantdetail",
|
||||||
"pages/escort/recordlist",
|
"pages/escort/recordlist",
|
||||||
"pages/escort/agreement",
|
"pages/escort/agreement",
|
||||||
"pages/escort/recorddetail",
|
"pages/escort/recorddetail",
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
const API = require('../../utils/api.js')
|
||||||
|
|
||||||
|
const SELECTED_ATTENDANT_KEY = 'escort_selected_attendant'
|
||||||
|
|
||||||
|
function calcAge(birthday) {
|
||||||
|
if (!birthday) return ''
|
||||||
|
const birth = new Date(String(birthday).replace(/-/g, '/'))
|
||||||
|
if (Number.isNaN(birth.getTime())) return ''
|
||||||
|
const now = new Date()
|
||||||
|
let age = now.getFullYear() - birth.getFullYear()
|
||||||
|
const monthDiff = now.getMonth() - birth.getMonth()
|
||||||
|
if (monthDiff < 0 || (monthDiff === 0 && now.getDate() < birth.getDate())) age -= 1
|
||||||
|
return age > 0 ? `${age} 岁` : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
attendant: null,
|
||||||
|
loading: true,
|
||||||
|
loadError: '',
|
||||||
|
selectMode: false
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(options) {
|
||||||
|
this.id = options.id
|
||||||
|
const selectMode = String(options.select) === '1'
|
||||||
|
this.setData({ selectMode })
|
||||||
|
if (!this.id) {
|
||||||
|
this.setData({ loading: false, loadError: '缺少陪诊师ID' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loadAttendant()
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadAttendant() {
|
||||||
|
this.setData({ loading: true, loadError: '' })
|
||||||
|
try {
|
||||||
|
const res = await API.escort.getAttendantById(this.id)
|
||||||
|
if (!res || res.code !== 0) throw new Error((res && res.msg) || '加载失败')
|
||||||
|
const attendant = this.decorate(res.data && res.data.attendant)
|
||||||
|
this.setData({ attendant })
|
||||||
|
wx.setNavigationBarTitle({ title: attendant.name || '陪诊师详情' })
|
||||||
|
} catch (err) {
|
||||||
|
this.setData({ loadError: err.message || '加载失败,请稍后重试' })
|
||||||
|
} finally {
|
||||||
|
this.setData({ loading: false })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
decorate(attendant) {
|
||||||
|
if (!attendant) return null
|
||||||
|
const name = attendant.name || ''
|
||||||
|
const sexMap = { male: '男', female: '女' }
|
||||||
|
const meta = [
|
||||||
|
sexMap[attendant.sex] || '',
|
||||||
|
calcAge(attendant.birthday),
|
||||||
|
attendant.workYears ? `从业 ${attendant.workYears} 年` : ''
|
||||||
|
].filter(Boolean)
|
||||||
|
return {
|
||||||
|
...attendant,
|
||||||
|
initial: name.replace(/[**]/g, '').slice(0, 1) || '陪',
|
||||||
|
metaText: meta.join(' · '),
|
||||||
|
areaText: (attendant.serviceAreas || []).join('、'),
|
||||||
|
languageText: (attendant.languages || []).join('、'),
|
||||||
|
trainings: attendant.trainings || [],
|
||||||
|
specialties: attendant.specialties || []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRetry() {
|
||||||
|
if (this.id) this.loadAttendant()
|
||||||
|
},
|
||||||
|
|
||||||
|
onSelect() {
|
||||||
|
const attendant = this.data.attendant
|
||||||
|
if (!attendant || !attendant.id) return
|
||||||
|
wx.setStorageSync(SELECTED_ATTENDANT_KEY, {
|
||||||
|
id: attendant.id,
|
||||||
|
name: attendant.name,
|
||||||
|
workYears: attendant.workYears || 0,
|
||||||
|
orderCount: attendant.orderCount || 0
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this.data.selectMode) {
|
||||||
|
// 下单页 → 列表 → 详情,选人后直接回到下单页
|
||||||
|
const pages = getCurrentPages()
|
||||||
|
wx.navigateBack({ delta: pages.length >= 3 ? 2 : 1 })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wx.redirectTo({ url: '/pages/escort/itemorder' })
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "陪诊师详情"
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<view class="page-bg">
|
||||||
|
<view class="container">
|
||||||
|
<view wx:if="{{loading}}" class="state-card">加载中...</view>
|
||||||
|
|
||||||
|
<view wx:elif="{{loadError}}" class="state-card" bindtap="onRetry">
|
||||||
|
{{ loadError }},点击重试
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<block wx:elif="{{attendant}}">
|
||||||
|
<view class="profile-card">
|
||||||
|
<view class="avatar">{{ attendant.initial }}</view>
|
||||||
|
<view class="profile-info">
|
||||||
|
<view class="name-row">
|
||||||
|
<text class="attendant-name">{{ attendant.name }}</text>
|
||||||
|
<text class="order-count">已接 {{ attendant.orderCount }} 单</text>
|
||||||
|
</view>
|
||||||
|
<text class="profile-meta">{{ attendant.metaText }}</text>
|
||||||
|
<view class="tag-row" wx:if="{{attendant.specialties.length}}">
|
||||||
|
<text class="tag" wx:for="{{attendant.specialties}}" wx:for-item="tag" wx:key="*this">{{ tag }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="info-card">
|
||||||
|
<view class="info-row" wx:if="{{attendant.areaText}}">
|
||||||
|
<text class="info-label">服务区域</text>
|
||||||
|
<text class="info-value">{{ attendant.areaText }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row" wx:if="{{attendant.languageText}}">
|
||||||
|
<text class="info-label">服务语言</text>
|
||||||
|
<text class="info-value">{{ attendant.languageText }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row">
|
||||||
|
<text class="info-label">资质核验</text>
|
||||||
|
<text class="info-value {{ attendant.qualificationVerified ? 'ok' : '' }}">{{ attendant.qualificationVerified ? '已核验' : '核验中' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="info-row">
|
||||||
|
<text class="info-label">健康证明</text>
|
||||||
|
<text class="info-value {{ attendant.healthCertificate.valid ? 'ok' : '' }}">
|
||||||
|
{{ attendant.healthCertificate.valid ? '有效' : '待更新' }}{{ attendant.healthCertificate.expireDate ? '(至 ' + attendant.healthCertificate.expireDate + ')' : '' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section-card" wx:if="{{attendant.introduction}}">
|
||||||
|
<text class="section-title">个人介绍</text>
|
||||||
|
<text class="section-text">{{ attendant.introduction }}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section-card" wx:if="{{attendant.trainings.length}}">
|
||||||
|
<text class="section-title">培训与资质</text>
|
||||||
|
<view class="training-item" wx:for="{{attendant.trainings}}" wx:key="title">
|
||||||
|
<text class="training-title">{{ item.title }}</text>
|
||||||
|
<text class="training-meta">{{ item.org }}{{ item.date ? ' · ' + item.date : '' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section-card">
|
||||||
|
<text class="section-title">服务评价</text>
|
||||||
|
<view wx:if="{{attendant.review.count}}" class="review-row">
|
||||||
|
<text class="review-score">{{ attendant.review.score ? attendant.review.score + ' 分' : '评价较少' }}</text>
|
||||||
|
<text class="review-count">共 {{ attendant.review.count }} 条评价</text>
|
||||||
|
</view>
|
||||||
|
<text wx:else class="section-text muted">暂无评价,期待您的服务反馈</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="bottom-space"></view>
|
||||||
|
<view class="bottom-bar">
|
||||||
|
<button class="cta-btn" bindtap="onSelect">{{ selectMode ? '选择 TA' : '预约 TA' }}</button>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
@@ -0,0 +1,230 @@
|
|||||||
|
page {
|
||||||
|
background: var(--paper);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-bg {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: var(--paper);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 32rpx 32rpx calc(40rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
.state-card {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding: 80rpx 32rpx;
|
||||||
|
border: 2rpx solid var(--line);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: var(--white);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
border: 2rpx solid var(--brand-line);
|
||||||
|
border-radius: 28rpx;
|
||||||
|
background: var(--brand-soft);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 112rpx;
|
||||||
|
height: 112rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--white);
|
||||||
|
border: 3rpx solid var(--brand-line);
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: 46rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-info {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin-left: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-name {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: 42rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-count {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile-meta {
|
||||||
|
display: block;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
color: var(--ink-2);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10rpx;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
padding: 4rpx 14rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: var(--white);
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-card,
|
||||||
|
.section-card {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
border: 2rpx solid var(--line);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: var(--white);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 24rpx;
|
||||||
|
padding: 12rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-row + .info-row {
|
||||||
|
border-top: 2rpx dashed var(--line-soft, #E9DECB);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value.ok {
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
display: block;
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: var(--fs-30);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-text {
|
||||||
|
display: block;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
color: var(--ink-2);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
line-height: 1.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-text.muted {
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.training-item {
|
||||||
|
margin-top: 18rpx;
|
||||||
|
padding-top: 18rpx;
|
||||||
|
border-top: 2rpx dashed var(--line-soft, #E9DECB);
|
||||||
|
}
|
||||||
|
|
||||||
|
.training-title {
|
||||||
|
display: block;
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.training-meta {
|
||||||
|
display: block;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-top: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-score {
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.review-count {
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-space {
|
||||||
|
height: 140rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-bar {
|
||||||
|
position: fixed;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
padding: 18rpx 32rpx calc(18rpx + env(safe-area-inset-bottom));
|
||||||
|
background: rgba(255, 252, 246, 0.96);
|
||||||
|
border-top: 2rpx solid var(--line);
|
||||||
|
backdrop-filter: blur(12rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 92rpx;
|
||||||
|
border: none;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
background: var(--brand-strong);
|
||||||
|
color: var(--white);
|
||||||
|
font-size: var(--fs-30);
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 92rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-btn::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
const API = require('../../utils/api.js')
|
||||||
|
|
||||||
|
const PAGE_SIZE = 20
|
||||||
|
// 下单页与陪诊师列表共用的选择结果 key
|
||||||
|
const SELECTED_ATTENDANT_KEY = 'escort_selected_attendant'
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
attendants: [],
|
||||||
|
loading: false,
|
||||||
|
loadError: '',
|
||||||
|
hasMore: true,
|
||||||
|
selectMode: false
|
||||||
|
},
|
||||||
|
|
||||||
|
onLoad(options) {
|
||||||
|
const selectMode = String(options.select) === '1'
|
||||||
|
this.page = 1
|
||||||
|
this.setData({ selectMode })
|
||||||
|
wx.setNavigationBarTitle({ title: selectMode ? '选择陪诊师' : '陪诊师团队' })
|
||||||
|
this.loadAttendants(true)
|
||||||
|
},
|
||||||
|
|
||||||
|
async onPullDownRefresh() {
|
||||||
|
await this.loadAttendants(true)
|
||||||
|
wx.stopPullDownRefresh()
|
||||||
|
},
|
||||||
|
|
||||||
|
onReachBottom() {
|
||||||
|
if (this.data.hasMore && !this.data.loading) this.loadAttendants(false)
|
||||||
|
},
|
||||||
|
|
||||||
|
onRetry() {
|
||||||
|
this.loadAttendants(true)
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadAttendants(reset) {
|
||||||
|
if (this.data.loading) return
|
||||||
|
if (reset) {
|
||||||
|
this.page = 1
|
||||||
|
this.setData({ attendants: [], hasMore: true, loadError: '' })
|
||||||
|
}
|
||||||
|
this.setData({ loading: true })
|
||||||
|
try {
|
||||||
|
const res = await API.escort.getAttendants({ page: this.page, pageSize: PAGE_SIZE })
|
||||||
|
if (!res || res.code !== 0) throw new Error((res && res.msg) || '加载失败')
|
||||||
|
const list = (res.data && res.data.attendants ? res.data.attendants : []).map(this.decorate)
|
||||||
|
this.setData({
|
||||||
|
attendants: reset ? list : this.data.attendants.concat(list),
|
||||||
|
hasMore: list.length >= PAGE_SIZE,
|
||||||
|
loadError: ''
|
||||||
|
})
|
||||||
|
this.page += 1
|
||||||
|
} catch (err) {
|
||||||
|
this.setData({ loadError: err.message || '加载失败,请稍后重试' })
|
||||||
|
} finally {
|
||||||
|
this.setData({ loading: false })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 公示接口已脱敏,这里只补展示用字段,不再加工姓名
|
||||||
|
decorate(item) {
|
||||||
|
const name = item.name || ''
|
||||||
|
const specialties = item.specialties || []
|
||||||
|
const serviceAreas = item.serviceAreas || []
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
initial: name.replace(/[**]/g, '').slice(0, 1) || '陪',
|
||||||
|
specialties: specialties.slice(0, 3),
|
||||||
|
areaText: serviceAreas.join('、')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
goToDetail(e) {
|
||||||
|
const id = e.currentTarget.dataset.id
|
||||||
|
if (!id) return
|
||||||
|
const select = this.data.selectMode ? '&select=1' : ''
|
||||||
|
wx.navigateTo({ url: `/pages/escort/attendantdetail?id=${id}${select}` })
|
||||||
|
},
|
||||||
|
|
||||||
|
onSelect(e) {
|
||||||
|
const item = e.currentTarget.dataset.item
|
||||||
|
if (!item || !item.id) return
|
||||||
|
wx.setStorageSync(SELECTED_ATTENDANT_KEY, {
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
workYears: item.workYears || 0,
|
||||||
|
orderCount: item.orderCount || 0
|
||||||
|
})
|
||||||
|
wx.navigateBack()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择模式下允许明确不指定,由平台抢单 / 指派
|
||||||
|
onSkip() {
|
||||||
|
wx.setStorageSync(SELECTED_ATTENDANT_KEY, { cleared: true })
|
||||||
|
wx.navigateBack()
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "陪诊师团队",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<view class="page-bg">
|
||||||
|
<view class="container">
|
||||||
|
<view class="page-header">
|
||||||
|
<view class="header-accent"></view>
|
||||||
|
<text class="header-title">{{ selectMode ? '选择陪诊师' : '陪诊师团队' }}</text>
|
||||||
|
<text class="header-subtitle">{{ selectMode ? '可按擅长与服务区域挑选;不选则由平台安排' : '仅展示在岗且已转正的陪诊师' }}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:if="{{loading && !attendants.length}}" class="state-card">加载中...</view>
|
||||||
|
|
||||||
|
<view wx:elif="{{loadError && !attendants.length}}" class="state-card" bindtap="onRetry">
|
||||||
|
{{ loadError }},点击重试
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:elif="{{!attendants.length}}" class="state-card">暂无在岗陪诊师,平台会尽快为您安排</view>
|
||||||
|
|
||||||
|
<view class="attendant-list" wx:else>
|
||||||
|
<view
|
||||||
|
class="attendant-card"
|
||||||
|
wx:for="{{attendants}}"
|
||||||
|
wx:key="id"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
bindtap="goToDetail"
|
||||||
|
>
|
||||||
|
<view class="card-main">
|
||||||
|
<view class="avatar">{{ item.initial }}</view>
|
||||||
|
<view class="card-info">
|
||||||
|
<view class="name-row">
|
||||||
|
<text class="attendant-name">{{ item.name }}</text>
|
||||||
|
<text class="order-count">已接 {{ item.orderCount }} 单</text>
|
||||||
|
</view>
|
||||||
|
<text class="attendant-meta">从业 {{ item.workYears }} 年{{ item.areaText ? ' · ' + item.areaText : '' }}</text>
|
||||||
|
<view class="tag-row" wx:if="{{item.specialties.length}}">
|
||||||
|
<text class="tag" wx:for="{{item.specialties}}" wx:for-item="tag" wx:key="*this">{{ tag }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="card-footer">
|
||||||
|
<view class="badges">
|
||||||
|
<text class="badge {{ item.qualificationVerified ? 'ok' : '' }}">{{ item.qualificationVerified ? '资质已核验' : '资质待核验' }}</text>
|
||||||
|
<text class="badge {{ item.healthCertificate.valid ? 'ok' : '' }}">{{ item.healthCertificate.valid ? '健康证有效' : '健康证待更新' }}</text>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
wx:if="{{selectMode}}"
|
||||||
|
class="select-btn"
|
||||||
|
data-item="{{item}}"
|
||||||
|
catchtap="onSelect"
|
||||||
|
>选择 TA</view>
|
||||||
|
<text wx:else class="detail-link">查看详情 ›</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:if="{{loading}}" class="list-tip">加载更多...</view>
|
||||||
|
<view wx:elif="{{!hasMore && attendants.length > 3}}" class="list-tip">已经到底了</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view wx:if="{{selectMode && attendants.length}}" class="skip-entry" bindtap="onSkip">
|
||||||
|
不指定,平台安排
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
page {
|
||||||
|
background: var(--paper);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-bg {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: var(--paper);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 0 32rpx calc(48rpx + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header {
|
||||||
|
padding: 32rpx 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-accent {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
background: var(--brand-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-title {
|
||||||
|
display: block;
|
||||||
|
margin-top: 22rpx;
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: 48rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-subtitle {
|
||||||
|
display: block;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state-card {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
padding: 80rpx 32rpx;
|
||||||
|
border: 2rpx solid var(--line);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: var(--white);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-list {
|
||||||
|
margin-top: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-card {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 26rpx 28rpx 22rpx;
|
||||||
|
border: 2rpx solid var(--line);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: var(--white);
|
||||||
|
box-shadow: var(--shadow-card);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-main {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
display: flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 92rpx;
|
||||||
|
height: 92rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--brand-soft);
|
||||||
|
border: 2rpx solid var(--brand-line);
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: 38rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-info {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
margin-left: 22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-name {
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
color: var(--ink);
|
||||||
|
font-size: var(--fs-34);
|
||||||
|
font-weight: 700;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-count {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-meta {
|
||||||
|
display: block;
|
||||||
|
margin-top: 8rpx;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10rpx;
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
padding: 4rpx 14rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: var(--brand-soft);
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding-top: 18rpx;
|
||||||
|
border-top: 2rpx dashed var(--line-soft, #E9DECB);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badges {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12rpx;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge.ok {
|
||||||
|
color: var(--brand-ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 12rpx 28rpx;
|
||||||
|
border: 3rpx solid var(--brand-strong);
|
||||||
|
border-radius: 999rpx;
|
||||||
|
background: var(--brand-soft);
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-link {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-26);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-tip {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip-entry {
|
||||||
|
margin-top: 28rpx;
|
||||||
|
padding: 26rpx 0;
|
||||||
|
border: 2rpx solid var(--line);
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: var(--white);
|
||||||
|
color: var(--ink-2);
|
||||||
|
font-size: var(--fs-28);
|
||||||
|
font-weight: 600;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@@ -6,6 +6,8 @@ const { ensureLogin } = require('../../utils/auth.js')
|
|||||||
const SERVICE_OPTION_HEIGHT = 108
|
const SERVICE_OPTION_HEIGHT = 108
|
||||||
// 下拉面板最多占用的屏高:扣掉底部固定操作栏与页面留白,项目再多也能整屏看到
|
// 下拉面板最多占用的屏高:扣掉底部固定操作栏与页面留白,项目再多也能整屏看到
|
||||||
const SERVICE_PANEL_RESERVED = 200
|
const SERVICE_PANEL_RESERVED = 200
|
||||||
|
// 与陪诊师列表 / 详情页共用的选择结果 key
|
||||||
|
const SELECTED_ATTENDANT_KEY = 'escort_selected_attendant'
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
@@ -44,7 +46,9 @@ Page({
|
|||||||
showPayPopup: false,
|
showPayPopup: false,
|
||||||
gender: '不限',
|
gender: '不限',
|
||||||
genderIndex: 0,
|
genderIndex: 0,
|
||||||
genderOptions: ['不限', '男', '女']
|
genderOptions: ['不限', '男', '女'],
|
||||||
|
// 用户指定陪诊师(选填);为空则由平台抢单或管理端指派
|
||||||
|
selectedAttendant: null
|
||||||
},
|
},
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@@ -54,10 +58,40 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
// 从陪诊师列表返回时取回用户选择
|
||||||
|
this.consumeSelectedAttendant()
|
||||||
// 从新增/编辑就诊人页返回时刷新档案,首次进入由 initializePage 加载。
|
// 从新增/编辑就诊人页返回时刷新档案,首次进入由 initializePage 加载。
|
||||||
if (this.pageReady && getApp().globalData.user?._id) this.loadProfiles()
|
if (this.pageReady && getApp().globalData.user?._id) this.loadProfiles()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
consumeSelectedAttendant() {
|
||||||
|
const selected = wx.getStorageSync(SELECTED_ATTENDANT_KEY)
|
||||||
|
if (!selected) return
|
||||||
|
wx.removeStorageSync(SELECTED_ATTENDANT_KEY)
|
||||||
|
if (selected.cleared) {
|
||||||
|
this.setData({ selectedAttendant: null })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!selected.id) return
|
||||||
|
this.setData({
|
||||||
|
selectedAttendant: {
|
||||||
|
id: selected.id,
|
||||||
|
name: selected.name || '',
|
||||||
|
workYears: selected.workYears || 0,
|
||||||
|
orderCount: selected.orderCount || 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
wx.showToast({ title: `已选择 ${selected.name || '陪诊师'}`, icon: 'none' })
|
||||||
|
},
|
||||||
|
|
||||||
|
goToAttendants() {
|
||||||
|
wx.navigateTo({ url: '/pages/escort/attendants?select=1' })
|
||||||
|
},
|
||||||
|
|
||||||
|
onClearAttendant() {
|
||||||
|
this.setData({ selectedAttendant: null })
|
||||||
|
},
|
||||||
|
|
||||||
async initializePage() {
|
async initializePage() {
|
||||||
this.pageReady = false
|
this.pageReady = false
|
||||||
this.setData({ pageLoading: true, pageError: '' })
|
this.setData({ pageLoading: true, pageError: '' })
|
||||||
@@ -401,7 +435,11 @@ Page({
|
|||||||
},
|
},
|
||||||
shippingAddress: { address: data.shippingAddress.trim() },
|
shippingAddress: { address: data.shippingAddress.trim() },
|
||||||
notes: { patientNote: data.remark.trim() },
|
notes: { patientNote: data.remark.trim() },
|
||||||
payment: { payChannel: data.payChannel }
|
payment: { payChannel: data.payChannel },
|
||||||
|
// 只传 employeeId,姓名 / 电话由服务端按员工档案回填
|
||||||
|
...(data.selectedAttendant
|
||||||
|
? { attendant: { employeeId: data.selectedAttendant.id } }
|
||||||
|
: {})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -473,7 +511,8 @@ Page({
|
|||||||
gender: '不限',
|
gender: '不限',
|
||||||
genderIndex: 0,
|
genderIndex: 0,
|
||||||
remark: '',
|
remark: '',
|
||||||
shippingAddress: ''
|
shippingAddress: '',
|
||||||
|
selectedAttendant: null
|
||||||
}, () => this.refreshHospitalOptions(provinces[0] || ''))
|
}, () => this.refreshHospitalOptions(provinces[0] || ''))
|
||||||
// 重置后仍默认选中第一个就诊人,方便连续预约
|
// 重置后仍默认选中第一个就诊人,方便连续预约
|
||||||
const first = this.data.profiles[0]
|
const first = this.data.profiles[0]
|
||||||
|
|||||||
@@ -107,6 +107,21 @@
|
|||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 指定陪诊师:不选则进入订单池,由平台抢单或管理端指派 -->
|
||||||
|
<view class="order-row" bindtap="goToAttendants">
|
||||||
|
<text class="order-label">指定陪诊师</text>
|
||||||
|
<view class="order-picker">
|
||||||
|
<view class="picker-value-wrap">
|
||||||
|
<text class="picker-value {{selectedAttendant ? '' : 'placeholder'}}">{{selectedAttendant ? selectedAttendant.name : '平台安排(可选)'}}</text>
|
||||||
|
<view class="picker-chevron"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="attendant-choice" wx:if="{{selectedAttendant}}">
|
||||||
|
<text class="attendant-choice-text">从业 {{selectedAttendant.workYears}} 年 · 已接 {{selectedAttendant.orderCount}} 单</text>
|
||||||
|
<text class="attendant-choice-clear" catchtap="onClearAttendant">清除</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="order-row">
|
<view class="order-row">
|
||||||
<text class="order-label">预约日期</text>
|
<text class="order-label">预约日期</text>
|
||||||
<picker class="order-picker" mode="date" value="{{appointmentDate}}" start="{{minAppointmentDate}}" bindchange="onDateChange">
|
<picker class="order-picker" mode="date" value="{{appointmentDate}}" start="{{minAppointmentDate}}" bindchange="onDateChange">
|
||||||
|
|||||||
@@ -312,6 +312,28 @@ page {
|
|||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 已选陪诊师:展示从业与接单数,支持清除后回到平台安排 */
|
||||||
|
.attendant-choice {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin: -6rpx 0 6rpx;
|
||||||
|
padding: 10rpx 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-choice-text {
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
}
|
||||||
|
|
||||||
|
.attendant-choice-clear {
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: var(--brand-ink);
|
||||||
|
font-size: var(--fs-24);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
.order-textarea {
|
.order-textarea {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -56,6 +56,13 @@ Page({
|
|||||||
// 就诊人是个人健康信息,点击时需登录
|
// 就诊人是个人健康信息,点击时需登录
|
||||||
needLogin: true
|
needLogin: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'attendants',
|
||||||
|
name: '找陪诊师',
|
||||||
|
desc: '查看团队',
|
||||||
|
icon: 'user',
|
||||||
|
url: '/pages/escort/attendants'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'contact',
|
id: 'contact',
|
||||||
name: '联系我们',
|
name: '联系我们',
|
||||||
|
|||||||
Reference in New Issue
Block a user