feat(escort): 陪诊服务图标改为柔和双色调并三页共用

首页宫格、下单页与详情页原先各画一套图标,图形与风格不统一。
抽出 styles/service-icons.wxss 统一维护 8 枚服务图标(暖橙描边 + 浅橙块面),
首页按服务 id 取图,下单页与详情页同步引用;并加深表盘与半天半填充、
放大配送车厢,保证 30px 真实显示下仍可辨识。
This commit is contained in:
lik
2026-11-06 17:15:08 +08:00
parent 3e61d18f70
commit 3f7adbda80
10 changed files with 143 additions and 98 deletions
+19 -6
View File
@@ -7,7 +7,7 @@ Page({
pageLoading: true,
pageError: '',
totalPrice: '0.00',
serviceIcon: 'user-business',
serviceIconClass: 'assist-icon-1',
activeTab: 'detail',
showOrderPopup: false,
submitting: false,
@@ -35,6 +35,8 @@ Page({
genderIndex: 0,
genderOptions: ['不限', '男', '女'],
payChannel: 'online_wechat',
// 医院下拉展开时,把医院行滚到弹窗滚动容器顶部,避免列表被裁掉
popupScrollIntoView: '',
// 点击「提交预约」后弹出支付方式选择,默认微信支付
showPayPopup: false
},
@@ -78,7 +80,7 @@ Page({
}
this.setData({
service: serviceView,
serviceIcon: this.getServiceIcon(service.title),
serviceIconClass: this.getServiceIconClass(service),
totalPrice: service.price,
pageLoading: false
})
@@ -124,10 +126,15 @@ Page({
}, () => this.refreshHospitalOptions(provinces[0] || ''))
},
getServiceIcon(title) {
if (title.includes('夜间')) return 'moon'
if (title.includes('陪诊')) return 'time'
return 'user-business'
// 图标与首页宫格共用 styles/service-icons.wxss,按后端服务 id 取图;
// id 超出 1~8 时按名称兜底,避免新增服务落到没有图形的空类名上
getServiceIconClass(service) {
const id = Number(service && service.id)
if (Number.isInteger(id) && id >= 1 && id <= 8) return 'assist-icon-' + id
const title = (service && service.title) || ''
if (title.includes('夜间')) return 'assist-icon-7'
if (title.includes('陪诊')) return 'assist-icon-1'
return 'assist-icon-3'
},
async ensureLogin() {
@@ -268,6 +275,12 @@ 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 })
},