代码提交
This commit is contained in:
@ -4,14 +4,14 @@
|
||||
:fixed="false"
|
||||
title="订单详情"
|
||||
left-arrow
|
||||
@leftClick="goBack"
|
||||
@leftClick="goList"
|
||||
/>
|
||||
<view v-if="orderInfoData">
|
||||
<view class="orderInfo-header background-warp">
|
||||
<view class="background">
|
||||
<image
|
||||
class="image"
|
||||
src="https://b2c-pro-static-dev.zkthink.com/static/images/order-info-bg.png"
|
||||
:src="orderDetailsBg"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
@ -21,10 +21,6 @@
|
||||
class="order-status"
|
||||
:class="'order-status-'+ orderInfoData.status"
|
||||
>
|
||||
<!-- <image
|
||||
class="image"
|
||||
src="https://b2c-pro-static-dev.zkthink.com/static/images/kjzq.png"
|
||||
/> -->
|
||||
<view>{{ orderInfoData._status._title }}</view>
|
||||
</view>
|
||||
<view class="order-date">
|
||||
@ -36,7 +32,7 @@
|
||||
|
||||
<image
|
||||
class="image"
|
||||
src="https://b2c-pro-static-dev.zkthink.com/static/images/icon-location.png"
|
||||
:src="orderAddressIcon"
|
||||
/>
|
||||
</view>
|
||||
<view class="address-main">
|
||||
@ -202,156 +198,54 @@
|
||||
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status == 0"
|
||||
|
||||
>
|
||||
<!-- 未支付 -->
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<!--待付款-->
|
||||
<view
|
||||
v-if="orderInfoData._status._type === '0'"
|
||||
class="order-actions-delete"
|
||||
@tap="showModal(1)"
|
||||
>
|
||||
取消订单
|
||||
</view>
|
||||
<view
|
||||
v-if="orderInfoData._status._type === '0'"
|
||||
class="order-actions-primary"
|
||||
@tap="handlePay"
|
||||
>
|
||||
立即付款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status === 99"
|
||||
>
|
||||
<!-- 待发货 -->
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<!-- 除了待付款和已取消 -->
|
||||
<view
|
||||
v-if="!['0','5','-1','-2'].includes(orderInfoData._status._type)"
|
||||
class="order-actions-delete"
|
||||
@tap="toSelectRefundGood(orderInfoData)"
|
||||
>
|
||||
申请退款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status === 1"
|
||||
>
|
||||
<!-- 已发货 待收货 -->
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<!-- 已完成 -->
|
||||
<view
|
||||
class="order-actions-delete"
|
||||
@tap="toSelectRefundGood(orderInfoData)"
|
||||
v-if="['4'].includes(orderInfoData._status._type)"
|
||||
class="order-actions-primary"
|
||||
@tap="showModal(0)"
|
||||
>
|
||||
申请退款
|
||||
删除订单
|
||||
</view>
|
||||
<!-- 已发货 待收货 -->
|
||||
<view
|
||||
v-if="orderInfoData._status._type === '2'"
|
||||
class="order-actions-primary"
|
||||
@tap="showModal(2)"
|
||||
>
|
||||
确认收货
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status === 2"
|
||||
>
|
||||
<!-- 待评价 -->
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<view
|
||||
class="order-actions-primary"
|
||||
@tap="toSelectRefundGood(orderInfoData)"
|
||||
>
|
||||
申请售后
|
||||
</view>
|
||||
<!-- <view-->
|
||||
<!-- class="order-actions-primary"-->
|
||||
<!-- @tap="toEvaluate(orderInfoData.cartInfo[0])"-->
|
||||
<!-- >-->
|
||||
<!-- 去评价-->
|
||||
<!-- </view>-->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status === 3"
|
||||
>
|
||||
<!-- 已完成 -->
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<view
|
||||
class="order-actions-delete"
|
||||
@tap="showModal(0)"
|
||||
>
|
||||
删除订单
|
||||
</view>
|
||||
<view
|
||||
class="order-actions-primary"
|
||||
@tap="toSelectRefundGood(orderInfoData)"
|
||||
>
|
||||
申请售后
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款中 -->
|
||||
<view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status === 5"
|
||||
>
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<view class="order-actions-primary">
|
||||
查看订单
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 已退款 -->
|
||||
<!-- <view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status == 6"
|
||||
>
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<view class="order-actions-primary">
|
||||
查看订单
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 退款 -->
|
||||
<!-- <view
|
||||
class="order-actions bottom-bar"
|
||||
v-if="orderInfoData.status == 7"
|
||||
>
|
||||
<view class="order-actions-left">
|
||||
</view>
|
||||
<view class="order-actions-btns">
|
||||
<view class="order-actions-primary">
|
||||
查看订单
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
|
||||
</view>
|
||||
</layout>
|
||||
<!-- 支付弹窗 -->
|
||||
@ -366,6 +260,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { orderDetailsBg, orderAddressIcon } from "@/utils/images";
|
||||
import { computed, ref, unref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { orderCancel, orderDelete, orderExpress, orderInfo, orderTake } from '@/api/order'
|
||||
@ -402,12 +297,17 @@ const handleOrderInfo = async (option) => {
|
||||
if(parseInt(res._status._type) === 2){
|
||||
remainTimeStr.value = formatRemainTime(res._status._payRemainTime)
|
||||
}
|
||||
const express = await orderExpress({
|
||||
await orderExpress({
|
||||
orderCode: orderInfoData.value.orderId,
|
||||
shipperCode: orderInfoData.value.deliverySn,
|
||||
logisticCode: orderInfoData.value.deliveryId,
|
||||
}).then(res=>{
|
||||
expressData.value = res.traces.reverse()
|
||||
}).catch(err=>{
|
||||
console.log(err,'err')
|
||||
})
|
||||
expressData.value = express.traces.reverse()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,6 +328,9 @@ const goList = ()=>{
|
||||
case 0:
|
||||
status = 0
|
||||
break
|
||||
case 4:
|
||||
status = -1
|
||||
break
|
||||
case 99:
|
||||
status = 1
|
||||
break
|
||||
@ -437,8 +340,7 @@ const goList = ()=>{
|
||||
push({url: '/pages/orderList/orderList'}, {
|
||||
data: {
|
||||
type: status
|
||||
},
|
||||
timeout:2000
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -447,6 +349,7 @@ const toEvaluate = (item) => {
|
||||
push({url: '/pages/evaluate/evaluate'}, {
|
||||
data: {
|
||||
unique: item.unique,
|
||||
orderId: item.orderId
|
||||
},
|
||||
type:'redirectTo'
|
||||
})
|
||||
@ -455,9 +358,7 @@ const toEvaluate = (item) => {
|
||||
const toSelectRefundGood = () => {
|
||||
push({url: '/pages/selectRefundGood/selectRefundGood'}, {
|
||||
data: {
|
||||
orderId: orderInfoData.value.orderId,
|
||||
id: orderInfoData.value.id,
|
||||
status: orderInfoData.value.status === 99?0:orderInfoData.value.status
|
||||
id: orderInfoData.value.id
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -497,7 +398,9 @@ async function doDeleteRequest(){
|
||||
uni: orderInfoData.value.orderId
|
||||
})
|
||||
toast({title: '删除成功'});
|
||||
goList()
|
||||
setTimeout(()=>{
|
||||
goList()
|
||||
},2000)
|
||||
}
|
||||
|
||||
async function doCancelRequest(){
|
||||
@ -505,7 +408,9 @@ async function doCancelRequest(){
|
||||
id: orderInfoData.value.orderId
|
||||
})
|
||||
toast({title: '取消成功'});
|
||||
goList()
|
||||
setTimeout(()=>{
|
||||
goList()
|
||||
},2000)
|
||||
}
|
||||
|
||||
async function doTakeRequest(){
|
||||
@ -544,6 +449,7 @@ onLoad((options) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../style/images";
|
||||
.orderList {
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
@ -574,15 +480,15 @@ onLoad((options) => {
|
||||
}
|
||||
|
||||
&.order-status-0,&.order-status--1,&.order-status-4,&.order-status-5,&.order-status-6,&.order-status-7 {
|
||||
background-image: url("https://b2c-pro-static-dev.zkthink.com/static/images/icon-order-info-1.png");
|
||||
background-image: $orderStateMoney;
|
||||
}
|
||||
|
||||
&.order-status-1, &.order-status-99 {
|
||||
background-image: url("https://b2c-pro-static-dev.zkthink.com/static/images/icon-order-info-2.png");
|
||||
background-image: $orderStateReturn;
|
||||
}
|
||||
|
||||
&.order-status-2, &.order-status-3 {
|
||||
background-image: url("https://b2c-pro-static-dev.zkthink.com/static/images/icon-order-info-4.png");
|
||||
background-image: $orderStateFinish;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user