From 9701889b3e6551ea576b45486ddbb7cf68bc1067 Mon Sep 17 00:00:00 2001 From: lik Date: Mon, 16 Nov 2026 19:30:38 +0800 Subject: [PATCH] =?UTF-8?q?style(escort):=20=E6=9C=8D=E5=8A=A1=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E7=BB=9F=E4=B8=80=E5=AF=BC=E8=88=AA=E4=B8=8E?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 导航栏改浅色纸面并补 t-loading,页首样式收口到新版字号与圆角档位; 医院选择改由组件弹层承载,删除页面内的锚点滚动;就诊人胶囊补同名提示, 免责协议、医院列表与登录状态失败各自兜底,不再整页空白。 --- pages/escort/itemdetail.js | 31 +++-- pages/escort/itemdetail.json | 5 +- pages/escort/itemdetail.wxml | 244 ++++++++++++++++++---------------- pages/escort/itemdetail.wxss | 247 +++++++++++++++++++++++------------ 4 files changed, 324 insertions(+), 203 deletions(-) diff --git a/pages/escort/itemdetail.js b/pages/escort/itemdetail.js index d21b864..b9ae192 100644 --- a/pages/escort/itemdetail.js +++ b/pages/escort/itemdetail.js @@ -1,4 +1,6 @@ const API = require('../../utils/api.js') +const { restoreLightNavigation } = require('../../utils/navigation.js') +const { withDuplicateNameHints } = require('../../utils/booking-profiles.js') const { formatDate, LATEST_APPOINTMENT_TIME, buildTimeSlots } = require('../../utils/date.js') const { ensureLogin } = require('../../utils/auth.js') @@ -39,8 +41,6 @@ Page({ genderIndex: 0, genderOptions: ['不限', '男', '女'], payChannel: 'offline', - // 医院下拉展开时,把医院行滚到弹窗滚动容器顶部,避免列表被裁掉 - popupScrollIntoView: '', // 点击「提交预约」后弹出支付方式选择,默认线下支付 showPayPopup: false, // 下单前必须勾选确认《陪诊服务免责协议》 @@ -64,11 +64,23 @@ Page({ }, onShow() { + restoreLightNavigation() if (this.data.showOrderPopup) this.loadProfiles() }, async initializePage() { this.setData({ pageLoading: true, pageError: '' }) + try { + await this.loadPageContent() + } catch (err) { + console.error('服务详情初始化失败', err) + this.setData({ pageError: '服务加载失败,请重试' }) + } finally { + this.setData({ pageLoading: false }) + } + }, + + async loadPageContent() { // 免责协议与表单并行预加载,避免用户点开协议时再空等 this.loadDisclaimer() const services = await getApp().loadServices() @@ -87,6 +99,8 @@ Page({ // 列表为空时组件内的「其他医院」入口仍可手填 getApp().loadHospitals().then(() => { this.refreshHospitalOptions() + }).catch((err) => { + console.error('医院列表加载失败', err) }) const serviceView = { ...service, @@ -122,6 +136,9 @@ Page({ disclaimerLoading: false, disclaimerError: !disclaimer }) + }).catch((err) => { + console.error('免责协议加载失败', err) + this.setData({ disclaimerLoading: false, disclaimerError: true }) }) }, @@ -220,13 +237,13 @@ Page({ return API.healthProfile.getMyProfiles({ page: 1, pageSize: 50 }) .then((res) => { if (res.code !== 0) throw new Error(res.msg || '就诊人加载失败') - const profiles = (res.data?.list || []).map((item) => ({ + const profiles = withDuplicateNameHints((res.data?.list || []).map((item) => ({ _id: item._id, name: item.profile?.name || '', mobile: item.profile?.mobile || '', sex: item.profile?.sex || '', birth: item.profile?.birth || '' - })) + }))) // 默认选中第一个就诊人,信息随档案一键带入 const first = profiles[0] if (first && !this.data.selectedProfileId) { @@ -308,12 +325,6 @@ Page({ this.setData({ hospital: name, hospitalCustom: manual }) }, - // 展开医院下拉:先清空再下一帧设值,保证重复展开也能触发 scroll-into-view - onHospitalOpen() { - this.setData({ popupScrollIntoView: '' }) - wx.nextTick(() => this.setData({ popupScrollIntoView: 'hospital-select-anchor' })) - }, - onDateChange(e) { this.setData({ appointmentDate: e.detail.value }) }, diff --git a/pages/escort/itemdetail.json b/pages/escort/itemdetail.json index 6d34ea6..efdd5dc 100644 --- a/pages/escort/itemdetail.json +++ b/pages/escort/itemdetail.json @@ -1,7 +1,10 @@ { "usingComponents": { "t-icon": "tdesign-miniprogram/icon/icon", + "t-loading": "tdesign-miniprogram/loading/loading", "hospital-select": "/components/hospital-select/index" }, - "navigationBarTitleText": "服务详情" + "navigationBarTitleText": "服务详情", + "navigationBarTextStyle": "black", + "navigationBarBackgroundColor": "#FAF8F5" } diff --git a/pages/escort/itemdetail.wxml b/pages/escort/itemdetail.wxml index a1ea8b1..cf954b5 100644 --- a/pages/escort/itemdetail.wxml +++ b/pages/escort/itemdetail.wxml @@ -1,10 +1,9 @@ - + - {{ service.title }} {{ service.tag }} @@ -26,7 +25,6 @@ - 服务详情 {{ service.description }} @@ -35,7 +33,6 @@ - 注意事项 @@ -52,7 +49,6 @@ - 服务流程 @@ -87,7 +83,7 @@ - + 确认预约信息 @@ -95,126 +91,148 @@ - - - - - + + + + + 01 + 陪诊项目 - - {{service.title}} - ¥{{service.price}}/次 + + + + + + {{service.title}} + ¥{{service.price}}/次 + + 费用仅含人工服务费,不含就医、药品及快递费用。 - - - 选择就诊人 - - - - {{item.name}} - - - - 增加 + + + + 02 + 就诊人信息 + + + 选择就诊人 + + + + + + {{item.name}} + {{item.nameHint}} + + + + + 增加 + + + + 还没有就诊人,去添加后可一键带入 + - - - 还没有就诊人,去添加后可一键带入 - + + + + 联系电话 + {{patientPhone || '请先选择就诊人'}} - - - 就诊人姓名 - {{patientName || '请先选择就诊人'}} + + + + 03 + 就诊安排 + + + 就诊省份 + + + {{province || '请选择省份'}} + + + + + + + + + + + + + + 预约日期 + + + {{appointmentDate || '请选择预约日期'}} + + + + + + + + 预约时间 + + + {{appointmentTime || '请选择预约时间'}} + + + + - - - 联系电话 - {{patientPhone || '请先选择就诊人'}} - + + + + 04 + 补充信息 + 选填 + + + 收货地址(选填) +