feat(escort): 预约页取消指定陪诊师并默认线下支付
下单不再提供陪诊师选择,统一由平台安排;itemorder 移除选择入口、选择状态与 attendant 载荷。两个预约页的支付方式弹窗默认改为线下支付,仍可手动切换微信支付。
This commit is contained in:
@@ -35,10 +35,10 @@ Page({
|
||||
gender: '不限',
|
||||
genderIndex: 0,
|
||||
genderOptions: ['不限', '男', '女'],
|
||||
payChannel: 'online_wechat',
|
||||
payChannel: 'offline',
|
||||
// 医院下拉展开时,把医院行滚到弹窗滚动容器顶部,避免列表被裁掉
|
||||
popupScrollIntoView: '',
|
||||
// 点击「提交预约」后弹出支付方式选择,默认微信支付
|
||||
// 点击「提交预约」后弹出支付方式选择,默认线下支付
|
||||
showPayPopup: false
|
||||
},
|
||||
|
||||
@@ -308,7 +308,7 @@ Page({
|
||||
return
|
||||
}
|
||||
// 保留下单弹窗在下层,取消支付时可直接返回表单,已填信息不丢失
|
||||
this.setData({ showPayPopup: true, payChannel: 'online_wechat' })
|
||||
this.setData({ showPayPopup: true, payChannel: 'offline' })
|
||||
},
|
||||
|
||||
onClosePayPopup() {
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式选择弹窗:点击「提交预约」后出现,默认微信支付 -->
|
||||
<!-- 支付方式选择弹窗:点击「提交预约」后出现,默认线下支付 -->
|
||||
<view class="popup-mask {{showPayPopup ? 'show' : ''}}" bindtap="onClosePayPopup"></view>
|
||||
<view class="popup-content {{showPayPopup ? 'show' : ''}}">
|
||||
<view class="popup-header">
|
||||
|
||||
@@ -6,8 +6,6 @@ const { ensureLogin } = require('../../utils/auth.js')
|
||||
const SERVICE_OPTION_HEIGHT = 108
|
||||
// 下拉面板最多占用的屏高:扣掉底部固定操作栏与页面留白,项目再多也能整屏看到
|
||||
const SERVICE_PANEL_RESERVED = 200
|
||||
// 与陪诊师列表 / 详情页共用的选择结果 key
|
||||
const SELECTED_ATTENDANT_KEY = 'escort_selected_attendant'
|
||||
// 免责协议标题兜底:接口未返回时也能在勾选行展示协议名称
|
||||
const DEFAULT_DISCLAIMER_TITLE = '全程陪诊服务免责协议'
|
||||
|
||||
@@ -43,14 +41,12 @@ Page({
|
||||
remark: '',
|
||||
shippingAddress: '',
|
||||
requiresAddress: false,
|
||||
payChannel: 'online_wechat',
|
||||
// 点击「提交预约」后弹出支付方式选择,默认微信支付
|
||||
payChannel: 'offline',
|
||||
// 点击「提交预约」后弹出支付方式选择,默认线下支付
|
||||
showPayPopup: false,
|
||||
gender: '不限',
|
||||
genderIndex: 0,
|
||||
genderOptions: ['不限', '男', '女'],
|
||||
// 用户指定陪诊师(选填);为空则由平台抢单或管理端指派
|
||||
selectedAttendant: null,
|
||||
// 下单前必须勾选确认《全程陪诊服务免责协议》
|
||||
agreementAgreed: false,
|
||||
agreementHint: false,
|
||||
@@ -68,40 +64,10 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 从陪诊师列表返回时取回用户选择
|
||||
this.consumeSelectedAttendant()
|
||||
// 从新增/编辑就诊人页返回时刷新档案,首次进入由 initializePage 加载。
|
||||
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 })
|
||||
},
|
||||
|
||||
/**
|
||||
* 免责协议:与表单并行预加载,用户点开弹层或直接提交时都能立即展示
|
||||
*/
|
||||
@@ -423,7 +389,7 @@ Page({
|
||||
this.loadDisclaimer()
|
||||
return
|
||||
}
|
||||
this.setData({ showPayPopup: true, payChannel: 'online_wechat' })
|
||||
this.setData({ showPayPopup: true, payChannel: 'offline' })
|
||||
},
|
||||
|
||||
onClosePayPopup() {
|
||||
@@ -506,11 +472,7 @@ Page({
|
||||
notes: { patientNote: data.remark.trim() },
|
||||
payment: { payChannel: data.payChannel },
|
||||
// 协议确认快照:回传用户实际阅读的协议版本,服务端与当前版本比对,不一致则拒绝
|
||||
agreement: { accepted: true, version: data.disclaimer?.version || '' },
|
||||
// 只传 employeeId,姓名 / 电话由服务端按员工档案回填
|
||||
...(data.selectedAttendant
|
||||
? { attendant: { employeeId: data.selectedAttendant.id } }
|
||||
: {})
|
||||
agreement: { accepted: true, version: data.disclaimer?.version || '' }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -583,7 +545,6 @@ Page({
|
||||
genderIndex: 0,
|
||||
remark: '',
|
||||
shippingAddress: '',
|
||||
selectedAttendant: null,
|
||||
// 协议按单次服务确认,重置表单后需重新勾选
|
||||
agreementAgreed: false,
|
||||
agreementHint: false,
|
||||
|
||||
@@ -107,21 +107,6 @@
|
||||
</picker>
|
||||
</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">
|
||||
<text class="order-label">预约日期</text>
|
||||
<picker class="order-picker" mode="date" value="{{appointmentDate}}" start="{{minAppointmentDate}}" bindchange="onDateChange">
|
||||
@@ -191,7 +176,7 @@
|
||||
<button class="page-retry" bindtap="retryLoad">重新加载</button>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式选择弹窗:点击「提交预约」后出现,默认微信支付 -->
|
||||
<!-- 支付方式选择弹窗:点击「提交预约」后出现,默认线下支付 -->
|
||||
<view class="popup-mask {{showPayPopup ? 'show' : ''}}" bindtap="onClosePayPopup"></view>
|
||||
<view class="popup-content {{showPayPopup ? 'show' : ''}}">
|
||||
<view class="popup-header">
|
||||
|
||||
@@ -312,28 +312,6 @@ page {
|
||||
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 {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user