|
@ -22,17 +22,23 @@ |
|
|
|
|
|
|
|
|
<!-- 底部按钮区域 --> |
|
|
<!-- 底部按钮区域 --> |
|
|
<view class="order-detail-footer"> |
|
|
<view class="order-detail-footer"> |
|
|
<view class="footer-btn cancel-btn" v-if="orderDetail.status === '1'" @click="$refs.cancelOrderPopup.open()"> |
|
|
|
|
|
|
|
|
<view class="footer-btn cancel-btn" v-if="orderDetail.status == '0'" @click="$refs.cancelOrderPopup.open()"> |
|
|
<text>取消订单</text> |
|
|
<text>取消订单</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="footer-btn pay-btn" v-if="orderDetail.status === '1'" @click="goToPay"> |
|
|
|
|
|
|
|
|
<view class="footer-btn pay-btn" v-if="orderDetail.status == '0'" @click="goToPay"> |
|
|
<text>去付款</text> |
|
|
<text>去付款</text> |
|
|
</view> |
|
|
</view> |
|
|
<!-- <view class="footer-btn modify-btn" v-if="orderDetail.status != 0 && orderDetail.status != 3" @click="modifyOrder"> |
|
|
|
|
|
|
|
|
<!-- <view class="footer-btn modify-btn" v-if="orderDetail.status == '1' || orderDetail.status == '2'" @click="modifyOrder"> |
|
|
<text>修改订单</text> |
|
|
<text>修改订单</text> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<view class="footer-btn review-btn" v-if="orderDetail.status === 4" @click="goToReview"> |
|
|
|
|
|
<text>评价订单</text> |
|
|
|
|
|
|
|
|
<view class="footer-btn pay-btn" v-if="orderDetail.status == '3'" @click="goToReview"> |
|
|
|
|
|
<text>去评价</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="footer-btn pay-btn" v-if="orderDetail.status == '3'" @click="handleReorder"> |
|
|
|
|
|
<text>再来一单</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="footer-btn pay-btn" v-if="orderDetail.status == '2'" @click="handleReorder"> |
|
|
|
|
|
<text>查看服务记录</text> |
|
|
</view> |
|
|
</view> |
|
|
<view class="footer-btn contact-btn"> |
|
|
<view class="footer-btn contact-btn"> |
|
|
<text>联系客服</text> |
|
|
<text>联系客服</text> |
|
@ -85,6 +91,8 @@ |
|
|
orderId: null, |
|
|
orderId: null, |
|
|
orderDetail: {},//格式化后的数据 |
|
|
orderDetail: {},//格式化后的数据 |
|
|
detail : {},//未格式化的数据 |
|
|
detail : {},//未格式化的数据 |
|
|
|
|
|
isPaying: false, |
|
|
|
|
|
loading: false |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(options) { |
|
|
onLoad(options) { |
|
@ -105,6 +113,7 @@ |
|
|
if (res) { |
|
|
if (res) { |
|
|
// 处理接口返回的数据 |
|
|
// 处理接口返回的数据 |
|
|
const data = res; |
|
|
const data = res; |
|
|
|
|
|
this.detail = data; // 保存原始数据 |
|
|
|
|
|
|
|
|
data.petVOList.forEach(pet => { |
|
|
data.petVOList.forEach(pet => { |
|
|
pet.orderServiceText = getOrderServiceText(pet.id, data.orderServiceList) // 日期 |
|
|
pet.orderServiceText = getOrderServiceText(pet.id, data.orderServiceList) // 日期 |
|
@ -147,7 +156,7 @@ |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
itemList.forEach(p => { |
|
|
itemList.forEach(p => { |
|
|
price += p.salePrice |
|
|
|
|
|
|
|
|
price += p.salePrice * p.quantity |
|
|
|
|
|
|
|
|
itemsText = [...new Set([...itemsText, p.productName])] |
|
|
itemsText = [...new Set([...itemsText, p.productName])] |
|
|
}) |
|
|
}) |
|
@ -245,21 +254,71 @@ |
|
|
|
|
|
|
|
|
// 去付款 |
|
|
// 去付款 |
|
|
goToPay() { |
|
|
goToPay() { |
|
|
uni.navigateTo({ |
|
|
|
|
|
url: `/pages/details/order?id=${this.orderId}` |
|
|
|
|
|
|
|
|
const { orderPay } = require('@/api/order/order.js'); |
|
|
|
|
|
orderPay({ |
|
|
|
|
|
orderId: this.orderId |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.pay(res.data) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
pay(params) { |
|
|
|
|
|
if (this.isPaying) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.isPaying = true |
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
provider: 'wxpay', |
|
|
|
|
|
timeStamp: params.timeStamp, |
|
|
|
|
|
nonceStr: params.nonceStr, |
|
|
|
|
|
package: params.package_, |
|
|
|
|
|
signType: params.signType, |
|
|
|
|
|
paySign: params.paySign, |
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
this.$modal.showToast('支付成功') |
|
|
|
|
|
this.getOrderDetail() |
|
|
|
|
|
}, |
|
|
|
|
|
fail: (err) => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
console.log('支付失败', err) |
|
|
|
|
|
this.$modal.showToast('支付失败') |
|
|
|
|
|
}, |
|
|
|
|
|
complete: () => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
this.isPaying = false |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 去评价 |
|
|
// 去评价 |
|
|
goToReview() { |
|
|
goToReview() { |
|
|
|
|
|
const order = this.detail; |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url: `/pages_order/order/orderReview?id=${this.orderId}` |
|
|
|
|
|
|
|
|
url: `/pages_order/order/orderReview?id=${order.teacherId}&orderId=${order.orderId}` |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 处理取消订单 |
|
|
// 处理取消订单 |
|
|
handleCancelOrder() { |
|
|
handleCancelOrder() { |
|
|
// 待实现取消订单逻辑 |
|
|
|
|
|
|
|
|
this.getOrderDetail(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 处理再来一单/查看服务记录 |
|
|
|
|
|
handleReorder() { |
|
|
|
|
|
if (this.orderDetail.status == '3') { |
|
|
|
|
|
// 再来一单 - 可以添加伴宠师选择弹窗 |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '再来一单功能开发中', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
} else if (this.orderDetail.status == '2') { |
|
|
|
|
|
// 查看服务记录 |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: `/pages_order/order/serviceRecord?orderId=${this.orderId}` |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 修改订单 |
|
|
// 修改订单 |
|
|