区分预约完成和取消状态标识
This commit is contained in:
@@ -14,12 +14,14 @@ function formatClock(value) {
|
||||
}
|
||||
|
||||
function formatAppointment(item) {
|
||||
const orderStatus = Number(item.orderStatus)
|
||||
return {
|
||||
...item,
|
||||
dayText: String(item.appointmentStartTime || '').slice(5, 10),
|
||||
timeText: `${formatClock(item.appointmentStartTime)}-${formatClock(item.appointmentEndTime)}`,
|
||||
amountText: `¥${formatPrice(item.actualAmount || item.totalAmount)}`,
|
||||
dateTimeText: formatDateTime(item.appointmentStartTime)
|
||||
dateTimeText: formatDateTime(item.appointmentStartTime),
|
||||
statusClass: orderStatus === 2 ? 'is-completed' : (orderStatus === 3 ? 'is-cancelled' : '')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</view>
|
||||
|
||||
<view wx:elif="{{appointments.length}}">
|
||||
<view wx:for="{{appointments}}" wx:key="orderItemId" class="page-card appointment-card">
|
||||
<view wx:for="{{appointments}}" wx:key="orderItemId" class="page-card appointment-card {{item.statusClass}}">
|
||||
<view class="day-box">
|
||||
<text>{{item.dayText}}</text>
|
||||
<text>{{item.timeText}}</text>
|
||||
|
||||
@@ -1,10 +1,43 @@
|
||||
.appointment-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
gap: 18rpx;
|
||||
overflow: hidden;
|
||||
margin-top: 22rpx;
|
||||
padding: 24rpx;
|
||||
}
|
||||
|
||||
.appointment-card.is-completed {
|
||||
background: #f5fff7;
|
||||
border-color: #c8ead1;
|
||||
}
|
||||
|
||||
.appointment-card.is-cancelled {
|
||||
background: #fff5f6;
|
||||
border-color: #e8c7cc;
|
||||
}
|
||||
|
||||
.appointment-card.is-completed::after,
|
||||
.appointment-card.is-cancelled::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 20rpx;
|
||||
left: 20rpx;
|
||||
border-top: 5rpx solid;
|
||||
transform: rotate(-10deg);
|
||||
transform-origin: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.appointment-card.is-completed::after {
|
||||
border-color: rgba(69, 130, 91, 0.78);
|
||||
}
|
||||
|
||||
.appointment-card.is-cancelled::after {
|
||||
border-color: rgba(198, 78, 91, 0.8);
|
||||
}
|
||||
|
||||
.day-box {
|
||||
width: 136rpx;
|
||||
flex: 0 0 auto;
|
||||
|
||||
Reference in New Issue
Block a user