|
|
|
@ -114,7 +114,7 @@ |
|
|
|
<text v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2">待消费</text> |
|
|
|
<text v-if="orderDetail.status == 4 && orderDetail.deliveryType == 1">配送员已取货</text> |
|
|
|
<text v-if="orderDetail.status == 5">订单已完成</text> |
|
|
|
<text v-if="orderDetail.status == 7">等待商家同意退款</text> |
|
|
|
<text v-if="orderDetail.status == 7">等待同意退款</text> |
|
|
|
<text v-if="orderDetail.status == 6">订单已取消</text> |
|
|
|
<text v-if="orderDetail.status == 8">订单已退款</text> |
|
|
|
<text v-if="orderDetail.status == 11">售后中</text> |
|
|
|
@ -264,7 +264,7 @@ |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
配送员 |
|
|
|
</view> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo && orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
{{orderDetail.deliveryInfo.workerName != null ? orderDetail.deliveryInfo.workerName : ''}} |
|
|
|
<img @tap="makeCall(orderDetail.deliveryInfo.workerPhone)" |
|
|
|
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/869a7af6a1c24bf3a0d523c4a18b55c6.png" |
|
|
|
@ -274,7 +274,7 @@ |
|
|
|
未指定等待接单中 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId"> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId"> |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
配送员接单时间 |
|
|
|
</view> |
|
|
|
@ -286,19 +286,19 @@ |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
商家出餐时间 |
|
|
|
</view> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo && orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
{{orderDetail.shopMakeTime ? orderDetail.shopMakeTime : '' | formatTime}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
配送员到店时间 |
|
|
|
</view> |
|
|
|
<view style="color: #000;font-weight: 700;"> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo"> |
|
|
|
{{orderDetail.deliveryInfo.arriveTime ? orderDetail.deliveryInfo.arriveTime : '' | formatTime}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;display: flex;" v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''"> |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
配送员取货时间 |
|
|
|
</view> |
|
|
|
@ -310,7 +310,7 @@ |
|
|
|
<view style="flex: 1;color: #777;font-weight: 700;"> |
|
|
|
送达时间 |
|
|
|
</view> |
|
|
|
<view style="color: #000;font-weight: 700;"> |
|
|
|
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo"> |
|
|
|
{{orderDetail.deliveryInfo.finishTime ? orderDetail.deliveryInfo.finishTime : '尽快送达' | formatTime}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -327,11 +327,36 @@ |
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
<uni-popup ref="returnPopup" background-color="#fff" style="height: 1600rpx !important;"> |
|
|
|
<view class="car-content" v-if="orderDetail.deliveryType == 1 && orderDetail.status != 10"> |
|
|
|
<view class="car-close"> |
|
|
|
<uni-icons type="close" size="30" color="#fff"></uni-icons> |
|
|
|
</view> |
|
|
|
<view class="car-title"> |
|
|
|
选择退款原因 |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
<view class=""> |
|
|
|
全额退款(商家原因) |
|
|
|
<radio :checked="sellTime==2" name="sellTime" @click="checkSellTime(2)" /> |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
全额退款(配送员原因) |
|
|
|
<radio :checked="sellTime==3" name="sellTime" @click="checkSellTime(3)" /> |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
全额退款(商家+配送员原因) |
|
|
|
<radio :checked="sellTime==4" name="sellTime" @click="checkSellTime(4)" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="guize-list"> |
|
|
|
<view style="height: 80rpx;line-height: 80rpx;font-size: 36rpx;font-weight: 700;text-align: center;"> |
|
|
|
确定要取消订单吗 |
|
|
|
<text v-if="((payData.orderType == 2 || payData.orderType == 3) && payData.status == 2) || payData.status == 3 || payData.status == 4">取消订单需要商家同意</text> |
|
|
|
<text v-if="(payData.status == 3 && payData.deliveryType ==1) || payData.status == 4">本单商家备餐时长共计{{payData | shopTime}} 配送员配送时长共计{{payData | peisongTime}}</text> |
|
|
|
<text v-if="((payData.orderType == 2 || payData.orderType == 3) && payData.status == 2) || ((payData.orderType == 2 || payData.orderType == 3) && payData.status == 3) || (payData.deliveryType == 1 && payData.status == 3) || payData.status == 4">取消订单需要商家同意</text> |
|
|
|
<view v-if="(payData.status == 3 && payData.deliveryType ==1) || payData.status == 4"> |
|
|
|
<text v-if="payData.shopMakeTime == null">商家还未出餐</text> |
|
|
|
<text v-else>本单商家备餐时长共计{{shopTime}} 配送员配送时长共计{{peisongTime}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="btn" @tap="returnOrder()"> |
|
|
|
确认取消 |
|
|
|
@ -346,7 +371,12 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pintuan:false, |
|
|
|
sellTime:2, |
|
|
|
menuButtonInfo: {}, |
|
|
|
refundType:3, |
|
|
|
refundTypeStatus:4, |
|
|
|
shopTime:'', |
|
|
|
peisongTime:'', |
|
|
|
orderId:'', |
|
|
|
payData:{}, |
|
|
|
orderDetail:{}, |
|
|
|
@ -399,52 +429,6 @@ |
|
|
|
|
|
|
|
// 拼接格式:年-月-日 时:分:秒 |
|
|
|
return `${year}-${month}-${day} ${hour}:${minute}:${second}`; |
|
|
|
}, |
|
|
|
shopTime(item){ |
|
|
|
if(item.shopMakeTime == null){ |
|
|
|
return '商家还未出餐'; |
|
|
|
} |
|
|
|
const date1 = new Date(item.deliveryInfo.acceptTime); |
|
|
|
const date2 = new Date(item.shopMakeTime); |
|
|
|
|
|
|
|
// 2. 计算毫秒差值 (取绝对值,防止结果为负数) |
|
|
|
let diffMs = Math.abs(date2 - date1); |
|
|
|
|
|
|
|
// 3. 数学换算 |
|
|
|
// 1秒 = 1000毫秒 |
|
|
|
// 1分 = 60秒 |
|
|
|
// 1时 = 60分 |
|
|
|
const seconds = Math.floor((diffMs / 1000) % 60); |
|
|
|
const minutes = Math.floor((diffMs / (1000 * 60)) % 60); |
|
|
|
const hours = Math.floor(diffMs / (1000 * 60 * 60)); |
|
|
|
|
|
|
|
// 4. 格式化输出 (可选:补零操作,例如 9秒 -> 09秒) |
|
|
|
const fmt = (num) => num.toString().padStart(2, '0'); |
|
|
|
|
|
|
|
return `${fmt(hours)}时${fmt(minutes)}分${fmt(seconds)}秒`; |
|
|
|
}, |
|
|
|
peisongTime(item){ |
|
|
|
if(item.shopMakeTime == null){ |
|
|
|
return '商家还未出餐'; |
|
|
|
} |
|
|
|
const date1 = new Date(item.shopMakeTime); |
|
|
|
const date2 = new Date(); |
|
|
|
|
|
|
|
// 2. 计算毫秒差值 (取绝对值,防止结果为负数) |
|
|
|
let diffMs = Math.abs(date2 - date1); |
|
|
|
|
|
|
|
// 3. 数学换算 |
|
|
|
// 1秒 = 1000毫秒 |
|
|
|
// 1分 = 60秒 |
|
|
|
// 1时 = 60分 |
|
|
|
const seconds = Math.floor((diffMs / 1000) % 60); |
|
|
|
const minutes = Math.floor((diffMs / (1000 * 60)) % 60); |
|
|
|
const hours = Math.floor(diffMs / (1000 * 60 * 60)); |
|
|
|
|
|
|
|
// 4. 格式化输出 (可选:补零操作,例如 9秒 -> 09秒) |
|
|
|
const fmt = (num) => num.toString().padStart(2, '0'); |
|
|
|
|
|
|
|
return `${fmt(hours)}时${fmt(minutes)}分${fmt(seconds)}秒`; |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
@ -460,6 +444,22 @@ |
|
|
|
openCode(){ |
|
|
|
this.$refs.imgPopup.open() |
|
|
|
}, |
|
|
|
checkSellTime(type){ |
|
|
|
this.sellTime = type; |
|
|
|
if(this.sellTime == 2){ |
|
|
|
//this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
this.refundType = 3 |
|
|
|
this.refundTypeStatus = 1 |
|
|
|
}else if(this.sellTime == 3){ |
|
|
|
//this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
this.refundType = 3 |
|
|
|
this.refundTypeStatus = 2 |
|
|
|
}else{ |
|
|
|
//this.returnData.refundAmount = this.orderDetail.totalAmount |
|
|
|
this.refundType = 3 |
|
|
|
this.refundTypeStatus = 3 |
|
|
|
} |
|
|
|
}, |
|
|
|
makeCall(phone){ |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: phone |
|
|
|
@ -473,13 +473,48 @@ |
|
|
|
}, |
|
|
|
returnPopupProp(item){ |
|
|
|
this.payData = item; |
|
|
|
if(this.payData.shopMakeTime != null){ |
|
|
|
const date1 = new Date(this.payData.deliveryInfo.acceptTime); |
|
|
|
const date2 = new Date(this.payData.shopMakeTime); |
|
|
|
|
|
|
|
// 2. 计算毫秒差值 (取绝对值,防止结果为负数) |
|
|
|
let diffMs = Math.abs(date2 - date1); |
|
|
|
|
|
|
|
// 3. 数学换算 |
|
|
|
// 1秒 = 1000毫秒 |
|
|
|
// 1分 = 60秒 |
|
|
|
// 1时 = 60分 |
|
|
|
const seconds = Math.floor((diffMs / 1000) % 60); |
|
|
|
const minutes = Math.floor((diffMs / (1000 * 60)) % 60); |
|
|
|
const hours = Math.floor(diffMs / (1000 * 60 * 60)); |
|
|
|
|
|
|
|
// 4. 格式化输出 (可选:补零操作,例如 9秒 -> 09秒) |
|
|
|
const fmt = (num) => num.toString().padStart(2, '0'); |
|
|
|
|
|
|
|
this.shopTime = `${fmt(hours)}时${fmt(minutes)}分${fmt(seconds)}秒`; |
|
|
|
|
|
|
|
const date3 = new Date(); |
|
|
|
|
|
|
|
// 2. 计算毫秒差值 (取绝对值,防止结果为负数) |
|
|
|
let diffMs1 = Math.abs(date3 - date2); |
|
|
|
|
|
|
|
// 3. 数学换算 |
|
|
|
// 1秒 = 1000毫秒 |
|
|
|
// 1分 = 60秒 |
|
|
|
// 1时 = 60分 |
|
|
|
const seconds1 = Math.floor((diffMs1 / 1000) % 60); |
|
|
|
const minutes1 = Math.floor((diffMs1 / (1000 * 60)) % 60); |
|
|
|
const hours1 = Math.floor(diffMs1 / (1000 * 60 * 60)); |
|
|
|
|
|
|
|
this.peisongTime = `${fmt(hours1)}时${fmt(minutes1)}分${fmt(seconds1)}秒`; |
|
|
|
} |
|
|
|
this.$refs.returnPopup.open('bottom'); |
|
|
|
}, |
|
|
|
returnOrder(){ |
|
|
|
this.$refs.returnPopup.close(); |
|
|
|
let item = this.payData |
|
|
|
let that = this |
|
|
|
that.tui.request("/mall/order/cancel", "POST", {orderId:item.id,userId:uni.getStorageSync('id')}, false, true).then((res) => { |
|
|
|
that.tui.request("/mall/order/cancel", "POST", {refundType:this.refundType,refundTypeStatus:this.refundTypeStatus,orderId:item.id,userId:uni.getStorageSync('id')}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
that.tui.toast("取消订单成功"); |
|
|
|
that.getOrderDetail(item.id) |
|
|
|
@ -501,6 +536,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
getOrderDetail(id){ |
|
|
|
this.pintuan = false; |
|
|
|
let that = this |
|
|
|
that.tui.request("/mall/order/detail/"+id, "GET", {}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
|