|
|
@ -18,14 +18,14 @@ |
|
|
|
v-for="(step, index) in processSteps" |
|
|
|
:key="index" |
|
|
|
class="step-item" |
|
|
|
:class="{ cancel: currentStep === 0 && index === 1 }" |
|
|
|
:class="{ cancel: state === 3 && index === status }" |
|
|
|
> |
|
|
|
<image :src="step.icon" mode="aspectFit" class="step-icon"></image> |
|
|
|
<view |
|
|
|
class="step-label" |
|
|
|
:class="{ |
|
|
|
active: currentStep === index + 1, |
|
|
|
cancel: currentStep === 0 && index === 1 |
|
|
|
active: status === index && state !== 3, |
|
|
|
cancel: state === 3 && index === status |
|
|
|
}" |
|
|
|
> |
|
|
|
<view class="step-label-inner"> |
|
|
@ -41,25 +41,25 @@ |
|
|
|
<view class="status-info" v-if="currentStatus"> |
|
|
|
<image class="status-icon" :src="currentStatus.icon" mode="aspectFit"></image> |
|
|
|
<view class="status-detail"> |
|
|
|
<text class="status-text" v-if="currentStep === 0">已取消本次预约</text> |
|
|
|
<text class="status-text" v-if="state === 3">已取消本次预约</text> |
|
|
|
<text class="status-text" v-else>{{ currentStatus.text }}</text> |
|
|
|
<text class="status-time">{{ currentStatus.time }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 取消后提示语 --> |
|
|
|
<view v-if="currentStep === 0" class="cancel-tip">期待您下次的支持,共同为地球减少碳排放出一份力!</view> |
|
|
|
<!-- 物流公司,仅currentStep为1、2时显示 --> |
|
|
|
<view class="express-info" v-if="currentStep !== 0 && currentStep < 3"> |
|
|
|
<view v-if="state === 3" class="cancel-tip">期待您下次的支持,共同为地球减少碳排放出一份力!</view> |
|
|
|
<!-- 物流公司,仅status为0、1时显示 --> |
|
|
|
<view class="express-info" v-if="state !== 3 && status <= 1"> |
|
|
|
<text class="express-label">物流公司</text> |
|
|
|
<view class="express-row"> |
|
|
|
<text class="express-value">{{ expressCompany }}{{ expressNo }}</text> |
|
|
|
<text class="express-copy" @tap="copyExpressNo">复制</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="info-divider" v-if="currentStep !== 0 && currentStep < 4"></view> |
|
|
|
<view class="info-divider" v-if="state !== 3 && status < 3"></view> |
|
|
|
<!-- 地址信息,仅非取消和非结款时显示 --> |
|
|
|
<view class="pickup-info" v-if="currentStep !== 0 && currentStep < 4"> |
|
|
|
<view class="pickup-info" v-if="state !== 3 && status < 3"> |
|
|
|
<view class="info-item" @tap="viewAddress"> |
|
|
|
<text class="label">取件地址</text> |
|
|
|
<view class="value"> |
|
|
@ -86,13 +86,13 @@ |
|
|
|
<text class="order-value">{{ orderDetail && orderDetail.ordeNo ? orderDetail.ordeNo : orderId }}</text> |
|
|
|
</view> |
|
|
|
<view class="order-divider"></view> |
|
|
|
<template v-if="currentStep < 3"> |
|
|
|
<template v-if="status < 2"> |
|
|
|
<view class="order-row"> |
|
|
|
<text class="order-label">预估回收</text> |
|
|
|
<text class="order-value order-highlight">¥ {{ estimatePrice }}</text> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<template v-else-if="currentStep === 4"> |
|
|
|
<template v-else-if="status === 3"> |
|
|
|
<view class="order-row"> |
|
|
|
<text class="order-label">合格结算</text> |
|
|
|
<text class="order-value order-highlight">¥ {{ finalPrice }}</text> |
|
|
@ -125,7 +125,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 质检结果卡片,仅结款状态显示 --> |
|
|
|
<view class="order-detail-card" v-if="currentStep === 4"> |
|
|
|
<view class="order-detail-card" v-if="status === 3"> |
|
|
|
<text class="order-title">质检结果</text> |
|
|
|
<view class="order-row"><text class="order-label">质检数量</text><text class="order-value">9 件</text></view> |
|
|
|
<view class="order-row"><text class="order-label">质检合格</text><text class="order-value">7 件</text></view> |
|
|
@ -137,7 +137,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 详细信息卡片,仅结款状态显示 --> |
|
|
|
<view class="order-detail-card detail-info-card" v-if="currentStep === 4"> |
|
|
|
<view class="order-detail-card detail-info-card" v-if="status === 3"> |
|
|
|
<text class="order-title">详细信息</text> |
|
|
|
<view class="order-row"> |
|
|
|
<text class="order-label">预约时间</text> |
|
|
@ -150,8 +150,8 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 底部按钮,仅待取件时显示 --> |
|
|
|
<view class="bottom-btns" v-if="currentStatus.text === '【待取件】快递员正在赶来'"> |
|
|
|
<!-- 底部按钮,仅在线预约时显示 --> |
|
|
|
<view class="bottom-btns" v-if="status === 0 && state !== 3"> |
|
|
|
<button class="btn cancel-btn" @tap="showCancelModal = true">取消订单</button> |
|
|
|
<button class="btn contact-btn" @tap="contactCourier">联系快递员</button> |
|
|
|
</view> |
|
|
@ -199,22 +199,24 @@ export default { |
|
|
|
expressNo: '', |
|
|
|
showCancelModal: false, |
|
|
|
statusBarHeight: 0, |
|
|
|
orderDetail: null |
|
|
|
orderDetail: null, |
|
|
|
status: null, // 订单状态:0:在线预约 1:快递上门 2:透明质检 3:现金打款 |
|
|
|
state: null // 订单状态:0待取件 1已取件 2已完成 3已取消 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
timeLabel() { |
|
|
|
// 根据状态返回不同的时间标签 |
|
|
|
if (this.currentStep === 4) { |
|
|
|
if (this.status === 3) { |
|
|
|
return '回收到账时间' |
|
|
|
} else if (this.currentStep === 3) { |
|
|
|
} else if (this.status === 2) { |
|
|
|
return '质检完成时间' |
|
|
|
} else { |
|
|
|
return '上门时间' |
|
|
|
} |
|
|
|
}, |
|
|
|
showEstimate() { |
|
|
|
return this.currentStep < 3 |
|
|
|
return this.status < 2 |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -328,6 +330,10 @@ export default { |
|
|
|
if (res && res.code === 200) { |
|
|
|
console.log('res', res) |
|
|
|
uni.showToast({ title: '订单已取消', icon: 'none' }); |
|
|
|
// 刷新页面数据 |
|
|
|
this.fetchOrderDetail(this.orderId); |
|
|
|
// 通知订单列表页面刷新数据 |
|
|
|
uni.$emit('orderStatusChanged'); |
|
|
|
} |
|
|
|
}) |
|
|
|
// uni.showToast({ title: '订单已取消', icon: 'none' }); |
|
|
@ -355,6 +361,9 @@ export default { |
|
|
|
this.$api && this.$api('getOrderDetail', { orderId }, res => { |
|
|
|
if (res && res.code === 200 && res.result) { |
|
|
|
this.orderDetail = res.result |
|
|
|
// 保存状态值 |
|
|
|
this.status = res.result.status |
|
|
|
this.state = res.result.state |
|
|
|
// 赋值页面字段 |
|
|
|
this.address = res.result.address + (res.result.addressDetail || '') |
|
|
|
this.appointmentTime = res.result.goTime || '' |
|
|
@ -634,15 +643,22 @@ letter-spacing: 0%; |
|
|
|
height: 60rpx; |
|
|
|
margin-right: 16rpx; |
|
|
|
} |
|
|
|
.status-detail { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
.status-text { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #222; |
|
|
|
font-weight: bold; |
|
|
|
display: block; |
|
|
|
} |
|
|
|
.status-time { |
|
|
|
font-size: 24rpx; |
|
|
|
color: #999; |
|
|
|
margin-top: 4rpx; |
|
|
|
display: block; |
|
|
|
} |
|
|
|
.pickup-info .info-item { |
|
|
|
display: flex; |
|
|
|