feat(escort): 陪诊服务图标改为柔和双色调并三页共用
首页宫格、下单页与详情页原先各画一套图标,图形与风格不统一。 抽出 styles/service-icons.wxss 统一维护 8 枚服务图标(暖橙描边 + 浅橙块面), 首页按服务 id 取图,下单页与详情页同步引用;并加深表盘与半天半填充、 放大配送车厢,保证 30px 真实显示下仍可辨识。
This commit is contained in:
@@ -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 })
|
||||
},
|
||||
|
||||
@@ -95,11 +95,11 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="popup-body" scroll-y>
|
||||
<scroll-view class="popup-body" scroll-y scroll-into-view="{{popupScrollIntoView}}" scroll-with-animation>
|
||||
<!-- 服务信息 -->
|
||||
<view class="order-service-info">
|
||||
<view class="order-service-mark">
|
||||
<t-icon name="{{serviceIcon}}" size="48rpx" color="#9B4508" />
|
||||
<view class="assist-icon {{serviceIconClass}}"></view>
|
||||
</view>
|
||||
<view class="order-service-text">
|
||||
<text class="order-service-title">{{service.title}}</text>
|
||||
@@ -150,15 +150,20 @@
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<!-- 就诊医院:自定义搜索选择,支持中文/拼音搜索与手动输入 -->
|
||||
<hospital-select
|
||||
label="就诊医院"
|
||||
value="{{hospital}}"
|
||||
options="{{hospitalOptions}}"
|
||||
placeholder="请选择就诊医院"
|
||||
disabled="{{submitting}}"
|
||||
bindchange="onHospitalChange"
|
||||
/>
|
||||
<!-- 就诊医院:自定义搜索选择,支持中文/拼音搜索与手动输入。
|
||||
id 供弹窗滚动容器在展开下拉时定位,保证列表完整可见 -->
|
||||
<view id="hospital-select-anchor">
|
||||
<hospital-select
|
||||
label="就诊医院"
|
||||
value="{{hospital}}"
|
||||
options="{{hospitalOptions}}"
|
||||
placeholder="请选择就诊医院"
|
||||
disabled="{{submitting}}"
|
||||
auto-page-scroll="{{false}}"
|
||||
bindopen="onHospitalOpen"
|
||||
bindchange="onHospitalChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 陪诊师性别要求 -->
|
||||
<view class="order-row">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "../../styles/service-icons.wxss";
|
||||
|
||||
/* pages/escort/itemdetail.wxss
|
||||
设计方向:本页是"服务说明书",不是电商详情页。
|
||||
- 去掉了顶部 420rpx 大图:占位图在 8 条服务间复用,既无法区分服务,又抢走首屏
|
||||
@@ -91,7 +93,7 @@ page {
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-24);
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 700;
|
||||
letter-spacing: 1rpx;
|
||||
white-space: nowrap;
|
||||
@@ -207,7 +209,7 @@ page {
|
||||
background: var(--brand-soft);
|
||||
border: 2rpx solid var(--brand-line);
|
||||
color: var(--brand-ink);
|
||||
font-size: var(--fs-24);
|
||||
font-size: var(--fs-28);
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -246,7 +248,7 @@ page {
|
||||
.step-desc {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -310,7 +312,7 @@ page {
|
||||
|
||||
.total-label {
|
||||
margin-right: 8rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
@@ -443,7 +445,7 @@ page {
|
||||
border: 2rpx solid var(--brand-line);
|
||||
}
|
||||
|
||||
/* 服务标记:暖橙 t-icon 直接落在浅橙面板上(--brand-ink 5.96:1)。
|
||||
/* 服务标记:与首页宫格同一套双色调图标(styles/service-icons.wxss)。
|
||||
原占位图是全服务共用的白色线稿,白底白图等于隐形;
|
||||
保留 96×96 定宽让标题列与旧版对齐,只换内容不挪版 */
|
||||
.order-service-mark {
|
||||
@@ -455,6 +457,11 @@ page {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.order-service-mark .assist-icon {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.order-service-text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -578,14 +585,14 @@ page {
|
||||
.textarea-count {
|
||||
align-self: flex-end;
|
||||
margin-top: 10rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.address-tip {
|
||||
align-self: flex-start;
|
||||
margin-top: 10rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
@@ -673,7 +680,7 @@ page {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 8rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
font-weight: 700;
|
||||
color: var(--brand-ink);
|
||||
}
|
||||
@@ -698,7 +705,7 @@ page {
|
||||
|
||||
.popup-price-label {
|
||||
margin-right: 8rpx;
|
||||
font-size: var(--fs-26);
|
||||
font-size: var(--fs-30);
|
||||
color: var(--muted);
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
@@ -775,7 +782,7 @@ page {
|
||||
|
||||
.pay-channel-desc {
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-24);
|
||||
font-size: var(--fs-28);
|
||||
}
|
||||
|
||||
.pay-channel-radio {
|
||||
@@ -796,7 +803,7 @@ page {
|
||||
display: block;
|
||||
margin-top: 20rpx;
|
||||
color: var(--muted);
|
||||
font-size: var(--fs-24);
|
||||
font-size: var(--fs-28);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Page({
|
||||
services: [],
|
||||
serviceIndex: 0,
|
||||
service: {},
|
||||
serviceIcon: 'user-business',
|
||||
serviceIconClass: 'assist-icon-1',
|
||||
servicePanelOpen: false,
|
||||
serviceOptionsHeight: 0,
|
||||
totalPrice: '0.00',
|
||||
@@ -69,8 +69,8 @@ Page({
|
||||
const requestedIndex = services.findIndex((item) => item.id === this.requestedServiceId)
|
||||
const consultationIndex = services.findIndex((item) => item.title.includes('问诊'))
|
||||
const serviceIndex = requestedIndex >= 0 ? requestedIndex : (consultationIndex >= 0 ? consultationIndex : 0)
|
||||
// 每个项目带上展示图标,供下拉列表逐项渲染
|
||||
const serviceList = services.map((item) => ({ ...item, icon: this.getServiceIcon(item.title) }))
|
||||
// 每个项目带上图标类名,供下拉列表逐项渲染(与首页宫格同一套图形)
|
||||
const serviceList = services.map((item) => ({ ...item, iconClass: this.getServiceIconClass(item) }))
|
||||
this.setData({
|
||||
services: serviceList,
|
||||
serviceOptionsHeight: this.getServiceOptionsHeight(serviceList.length)
|
||||
@@ -117,7 +117,7 @@ Page({
|
||||
this.setData({
|
||||
service,
|
||||
serviceIndex,
|
||||
serviceIcon: service.icon || this.getServiceIcon(service.title),
|
||||
serviceIconClass: service.iconClass || this.getServiceIconClass(service),
|
||||
servicePanelOpen: false,
|
||||
totalPrice: service.price,
|
||||
minAppointmentDate: formatDate(minDate),
|
||||
@@ -174,10 +174,15 @@ Page({
|
||||
this.applyService(service, index)
|
||||
},
|
||||
|
||||
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() {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<view class="service-picker {{submitting ? 'is-disabled' : ''}}">
|
||||
<view class="order-service-info" bindtap="onToggleServicePanel">
|
||||
<view class="order-service-mark">
|
||||
<t-icon name="{{serviceIcon}}" size="48rpx" color="#9B4508" />
|
||||
<view class="assist-icon {{serviceIconClass}}"></view>
|
||||
</view>
|
||||
<view class="order-service-text">
|
||||
<text class="order-service-title">{{service.title}}</text>
|
||||
@@ -31,7 +31,7 @@
|
||||
<view class="service-option {{index === serviceIndex ? 'active' : ''}}" wx:for="{{services}}" wx:key="id"
|
||||
data-index="{{index}}" bindtap="onServiceOptionTap">
|
||||
<view class="service-option-mark">
|
||||
<t-icon name="{{item.icon}}" size="40rpx" color="#9B4508" />
|
||||
<view class="assist-icon {{item.iconClass}}"></view>
|
||||
</view>
|
||||
<text class="service-option-name">{{item.title}}</text>
|
||||
<text class="service-option-sub">¥{{item.price}}/次</text>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "../../styles/service-icons.wxss";
|
||||
|
||||
/* pages/escort/itemorder.wxss */
|
||||
page {
|
||||
--shadow-bar: 0 -2rpx 8rpx rgba(63, 43, 25, 0.07);
|
||||
@@ -83,6 +85,12 @@ page {
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
/* 项目图标与首页宫格同一套图形(styles/service-icons.wxss),这里只改尺寸 */
|
||||
.order-service-mark .assist-icon {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
|
||||
/* 项目名称与价格同一行,价格靠右,右侧留出更大间距 */
|
||||
.order-service-text {
|
||||
display: flex;
|
||||
@@ -167,6 +175,11 @@ page {
|
||||
height: 72rpx;
|
||||
}
|
||||
|
||||
.service-option-mark .assist-icon {
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
|
||||
/* 名称与价格同一行:名称左对齐并自适应截断,价格靠右 */
|
||||
.service-option-name {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user