Files

513 lines
14 KiB
Vue
Raw Normal View History

2023-10-11 11:27:47 +08:00
<template>
<layout class="orderInfo">
<uv-navbar
2023-11-14 17:21:03 +08:00
:fixed="false"
title="售后订单详情"
left-arrow
2023-11-22 18:55:55 +08:00
@leftClick="goBackList"
2023-10-11 11:27:47 +08:00
/>
<view v-if="orderInfoData">
2023-11-14 17:21:03 +08:00
<view class="orderInfo-header background-warp" :class="orderInfoData.state === 0 && 'mb-100'">
2023-10-11 11:27:47 +08:00
<view class="background">
2023-11-14 17:21:03 +08:00
<image
class="image"
2023-11-22 18:55:55 +08:00
:src="afterSalesBg"
2023-11-14 17:21:03 +08:00
mode="widthFix"
2023-10-11 11:27:47 +08:00
/>
</view>
<view class="background-content page-space">
<view class="order-status-info">
2023-11-14 17:21:03 +08:00
<view class="order-status" :class="'order-status-'+ orderInfoData.state">
<view>
<!-- {{ orderInfoStatusMsg }}-->
{{refundOrderStatus[orderInfoData.state]}}
</view>
2023-10-11 11:27:47 +08:00
</view>
2023-11-17 20:55:32 +08:00
<view class="order-date" v-if="parseInt(orderInfoData.remainTime) > 0 && ![3,4].includes(orderInfoData.state)">
2023-11-22 18:55:55 +08:00
{{remainTimeStr}}
2023-10-11 11:27:47 +08:00
</view>
</view>
2023-11-14 17:21:03 +08:00
<!-- <view class="address noBorder">-->
<!-- <view class="address-icon">-->
<!-- <image-->
<!-- class="image"-->
2023-11-17 20:55:32 +08:00
<!-- src="https://b2c-pro-static-dev.zkthink.com/static/images/icon-location.png"-->
2023-11-14 17:21:03 +08:00
<!-- />-->
<!-- </view>-->
<!-- <view class="address-main">-->
<!-- <view class="address-header">-->
<!-- <view class="address-name">{{ orderInfoData.realName }}</view>-->
<!-- <view class="address-phone">{{ orderInfoData.userPhone }}</view>-->
<!-- </view>-->
<!-- <view class="address-content">-->
<!-- <view class="address-desc">{{ orderInfoData.userAddress }}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
2023-10-11 11:27:47 +08:00
</view>
</view>
<view class="page-space">
2023-11-14 17:21:03 +08:00
<view class="mb-20 card" v-if="orderInfoData.realName">
<view class="card-head">
<view class="card-title">
商家收货信息
</view>
</view>
<view class="card-content">
<view class="infos">
<view class="info-cell">
<view class="info-cell-label">
收货人
</view>
<view class="info-cell-value">
<view class="address-name">{{ orderInfoData.realName }}</view>
<view class="address-phone">{{ orderInfoData.userPhone }}</view>
</view>
2023-10-11 11:27:47 +08:00
2023-11-14 17:21:03 +08:00
</view>
<view class="info-cell">
<view class="info-cell-label">
<text class="wem1"></text>
</view>
<view class="info-cell-value">
{{ orderInfoData.userAddress }}
</view>
</view>
2023-10-11 11:27:47 +08:00
</view>
</view>
2023-11-14 17:21:03 +08:00
</view>
<view class="mb-20 card" v-if="orderInfoData.deliverySn">
<view class="card-head">
<view class="card-title">
物流信息
</view>
</view>
<view class="card-content">
<view class="infos">
<view class="info-cell">
<view class="info-cell-label">
物流单号
</view>
<view class="info-cell-value">
{{ orderInfoData.deliverySn }}
</view>
</view>
<view class="info-cell">
<view class="info-cell-label">
物流公司
</view>
<view class="info-cell-value">
{{ orderInfoData.deliveryName }}
</view>
</view>
</view>
</view>
</view>
<view class="order-goods page-card mb-20">
2023-10-11 11:27:47 +08:00
<goods
2023-11-14 17:21:03 +08:00
list
2023-11-22 18:55:55 +08:00
link
2023-11-14 17:21:03 +08:00
interval
desc="3"
showAction
model
:purchase="item.cartNum"
:data="item.productInfo"
2023-11-15 19:59:37 +08:00
:price="item.truePrice"
2023-11-14 17:21:03 +08:00
v-for="(item, index) in orderInfoData.cartInfo"
2023-10-11 11:27:47 +08:00
>
</goods>
<view class="order-infos infos mb-20 infos-right border-top">
<view class="info-cell">
2023-11-14 17:21:03 +08:00
<view class="info-cell-label">商品总价</view>
<view class="info-cell-value">¥{{ orderInfoData.totalPrice }}</view>
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell ">
<view class="info-cell-label">优惠</view>
2023-11-14 17:21:03 +08:00
<view class="info-cell-value">¥{{ orderInfoData.couponPrice }}</view>
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell ">
<view class="info-cell-label">运费</view>
2023-11-14 17:21:03 +08:00
<view class="info-cell-value">¥{{ orderInfoData.totalPostage }}</view>
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell ">
<view class="info-cell-label">总计</view>
2023-11-15 19:59:37 +08:00
<view class="info-cell-value">¥{{ orderInfoData.payPrice.toFixed(2) }}</view>
2023-10-11 11:27:47 +08:00
</view>
</view>
</view>
<view class="mb-20 card">
<view class="card-head">
<view class="card-title">
2023-11-14 17:21:03 +08:00
售后信息
2023-10-11 11:27:47 +08:00
</view>
</view>
<view class="card-content">
<view class="infos">
<view class="info-cell">
<view class="info-cell-label">
2023-11-14 17:21:03 +08:00
退款金额
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell-value">
2023-11-17 20:55:32 +08:00
¥{{ orderInfoData.refundAmount.toFixed(2) }}
2023-10-11 11:27:47 +08:00
</view>
</view>
<view class="info-cell">
<view class="info-cell-label">
2023-11-14 17:21:03 +08:00
服务类型
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell-value">
2023-11-15 19:59:37 +08:00
{{ orderInfoData.serviceType===0?'仅退款':'退货退款' }}
2023-10-11 11:27:47 +08:00
</view>
</view>
2023-11-22 18:55:55 +08:00
<view class="info-cell">
2023-10-11 11:27:47 +08:00
<view class="info-cell-label">
2023-11-14 17:21:03 +08:00
订单编号
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell-value">
2023-11-14 17:21:03 +08:00
{{ orderInfoData.orderId }}
</view>
2023-11-22 18:55:55 +08:00
<view
class="info-cell-operation"
@click="setData(orderInfoData.orderId,'复制成功')"
>
复制
</view>
2023-11-14 17:21:03 +08:00
</view>
<view
class="info-cell"
>
<view class="info-cell-label">
退款原因
</view>
<view class="info-cell-value">
{{ orderInfoData.reasons }}
2023-10-11 11:27:47 +08:00
</view>
</view>
<view
2023-11-14 17:21:03 +08:00
class="info-cell"
2023-10-11 11:27:47 +08:00
>
<view class="info-cell-label">
2023-11-14 17:21:03 +08:00
详细说明
2023-10-11 11:27:47 +08:00
</view>
<view class="info-cell-value">
2023-11-14 17:21:03 +08:00
<view>{{ orderInfoData.explains }}</view>
<view>
<view></view>
</view>
2023-10-11 11:27:47 +08:00
</view>
</view>
</view>
</view>
</view>
2023-11-14 17:21:03 +08:00
<view
class="mb-20 card"
v-if="orderInfoData.status > 1"
>
2023-10-11 11:27:47 +08:00
<view class="card-head">
<view class="card-title">
物流信息
</view>
</view>
<view
2023-11-14 17:21:03 +08:00
class="card-content "
v-if="expressData"
2023-10-11 11:27:47 +08:00
>
2023-11-14 17:21:03 +08:00
<view class="paddingH-10">
<uv-steps
current="0"
direction="column"
activeColor="#EE6D46"
inactiveColor="#E5E5E5"
>
<uv-steps-item
v-for="(item, index) in expressData"
:key="index"
:title="item.acceptStation"
:desc="item.acceptTime"
></uv-steps-item>
</uv-steps>
</view>
2023-10-11 11:27:47 +08:00
</view>
</view>
</view>
2023-11-14 17:21:03 +08:00
<view class="bottom-bar-bg"></view>
2023-10-11 11:27:47 +08:00
<view
2023-11-14 17:21:03 +08:00
class="order-actions bottom-bar"
2023-10-11 11:27:47 +08:00
>
<!-- 已发货 待收货 -->
<view class="order-actions-left">
</view>
<view class="order-actions-btns">
<view
2023-11-14 17:21:03 +08:00
class="order-actions-default"
2023-11-17 20:55:32 +08:00
@tap="showModal(0)"
2023-11-14 17:21:03 +08:00
v-if="[3,4].includes(orderInfoData.state)"
2023-10-11 11:27:47 +08:00
>
2023-11-14 17:21:03 +08:00
删除记录
2023-10-11 11:27:47 +08:00
</view>
<view
2023-11-14 17:21:03 +08:00
class="order-actions-default"
2023-11-17 20:55:32 +08:00
@tap="showModal(1)"
2023-11-14 17:21:03 +08:00
v-if="[0,1].includes(orderInfoData.state)"
2023-10-11 11:27:47 +08:00
>
2023-11-14 17:21:03 +08:00
撤销申请
2023-10-11 11:27:47 +08:00
</view>
<view
2023-11-14 17:21:03 +08:00
class="order-actions-default"
@tap="toRefund"
v-if="orderInfoData.state === 5"
2023-10-11 11:27:47 +08:00
>
2023-11-14 17:21:03 +08:00
再次申请
2023-10-11 11:27:47 +08:00
</view>
<view
2023-11-14 17:21:03 +08:00
class="order-actions-default"
@tap="toAddLogistics"
v-if="orderInfoData.state === 1"
2023-10-11 11:27:47 +08:00
>
2023-11-14 17:21:03 +08:00
填写物流
2023-10-11 11:27:47 +08:00
</view>
</view>
</view>
</view>
</layout>
2023-11-17 20:55:32 +08:00
<Modal ref="modalRef" :content="modalTitle" @confirm="confirmModal" />
2023-10-11 11:27:47 +08:00
</template>
<script setup>
2023-11-17 20:55:32 +08:00
import { computed, ref, unref } from 'vue'
2023-10-11 11:27:47 +08:00
import { onLoad } from '@dcloudio/uni-app'
import { useMainStore } from '@/store/store'
2023-11-17 20:55:32 +08:00
import { formatDate } from '@/utils/utils'
2023-11-14 17:21:03 +08:00
import {
orderCancel,
checkForAfterSalesInfo,
orderTake,
orderDelete,
orderExpress,
afterSalesOrderDelete, afterSalesOrderRevoke
} from '@/api/order'
2023-10-11 11:27:47 +08:00
import { orderReStatus } from '@/config'
2023-11-14 17:21:03 +08:00
import { useRouter } from "@/hooks/useRouter";
import {useGlobalProperties} from "@/hooks";
2023-11-22 18:55:55 +08:00
import { useShearPlate } from "@/hooks/useShearPlate";
2023-11-17 20:55:32 +08:00
import { formatRemainTime } from '@/utils/utils'
import Modal from "@/components/Modal/index.vue";
2023-11-22 18:55:55 +08:00
import { afterSalesBg } from "@/utils/images";
import config from "@/uni_modules/uv-ui-tools/libs/config/config";
2023-11-14 17:21:03 +08:00
const {$timeFormat} = useGlobalProperties()
2023-10-11 11:27:47 +08:00
2023-11-22 18:55:55 +08:00
const {getParams,push} = useRouter()
const {setData} = useShearPlate();
2023-10-11 11:27:47 +08:00
const orderInfoData = ref(null)
const orderInfoStatusMsg = ref('')
2023-11-14 17:21:03 +08:00
const expressData = ref(null)
2023-11-17 20:55:32 +08:00
const id = ref(0)
2023-11-14 17:21:03 +08:00
const orderId = ref(0)
2023-11-17 20:55:32 +08:00
const remainTimeStr = ref('')
2023-11-14 17:21:03 +08:00
const refundOrderStatus = ref({
0: '请耐心等待平台审核',
1: '平台已同意退货申请,请尽早退货',
2: '请耐心等待平台确认收货',
3: '退款成功',
4: '用户已取消',
5: '商家已拒绝',
})
2023-10-11 11:27:47 +08:00
const handleOrderInfo = async (option) => {
2023-11-14 17:21:03 +08:00
const res = await checkForAfterSalesInfo(option)
2023-10-11 11:27:47 +08:00
orderInfoData.value = res
2023-11-17 20:55:32 +08:00
remainTimeStr.value = formatRemainTime(orderInfoData.value.remainTime)
2023-10-11 11:27:47 +08:00
}
2023-11-17 20:55:32 +08:00
const modalRef = ref()
const modalType = ref(0) // 0删除记录 1撤销申请
const modalTitle = computed(()=>{
const tipsArr = ['确认删除记录吗?','确认撤销申请吗?']
return tipsArr[modalType.value]
})
/**
* 打开弹窗
* @param {number} type 0删除记录 1撤销申请
*/
function showModal(type){
modalType.value = type
unref(modalRef).show()
}
/**
* 确认弹窗
*/
function confirmModal(){
const funcArr = [doDeleteRequest,doRevoke]
funcArr[modalType.value]()
}
/**
* 确认删除
* @returns {Promise<void>}
*/
async function doDeleteRequest(){
await afterSalesOrderDelete({
id: id.value,
orderCode: orderInfoData.value.orderId
})
uni.showToast({
title: '已删除',
duration: 2000
2023-11-14 17:21:03 +08:00
});
2023-11-17 20:55:32 +08:00
setTimeout(()=>{
toRefundList()
},2000)
2023-10-11 11:27:47 +08:00
}
2023-11-17 20:55:32 +08:00
/**
* 确认撤销
* @returns {Promise<void>}
*/
async function doRevoke(){
await afterSalesOrderRevoke({
id: id.value,
key: orderInfoData.value.orderId
})
uni.showToast({
title: '已撤销',
duration: 2000
2023-11-14 17:21:03 +08:00
});
2023-11-17 20:55:32 +08:00
setTimeout(()=>{
toRefundList()
},2000)
2023-10-11 11:27:47 +08:00
}
2023-11-14 17:21:03 +08:00
// 跳转列表
const toRefundList = () => {
push({url: '/pages/refundList/refundList'})
2023-10-11 11:27:47 +08:00
}
2023-11-14 17:21:03 +08:00
// 填写物流
const toAddLogistics = () => {
push({url: '/pages/addLogistics/addLogistics'}, {
data: {
2023-10-11 11:27:47 +08:00
id: orderInfoData.value.id,
2023-11-14 17:21:03 +08:00
orderCode: orderInfoData.value.orderCode
2023-10-11 11:27:47 +08:00
}
})
}
2023-11-14 17:21:03 +08:00
// 再次申请
const toRefund = () => {
push({url: '/pages/refund/refund'}, {
data: {
refundType: orderInfoData.value.serviceType,
goods: orderInfoData.value.cartInfo.map(v=>{
return v.productAttrUnique
}).toString(),
2023-11-17 20:55:32 +08:00
id: orderId.value
2023-11-14 17:21:03 +08:00
}
2023-10-11 11:27:47 +08:00
})
}
2023-11-22 18:55:55 +08:00
// 返回列表
const goBackList = () => {
push({url: '/pages/refundList/refundList'}, {
type:"redirectTo"
})
}
2023-11-14 17:21:03 +08:00
onLoad((options) => {
const params = getParams(options)
2023-11-17 20:55:32 +08:00
id.value = params.id
orderId.value = params.orderId
2023-10-11 11:27:47 +08:00
handleOrderInfo({
2023-11-14 17:21:03 +08:00
key: params.id
2023-10-11 11:27:47 +08:00
})
})
</script>
2023-11-14 17:21:03 +08:00
<style lang="scss">
2023-11-22 18:55:55 +08:00
@import "../../style/images";
2023-10-11 11:27:47 +08:00
.orderList {
padding: 20rpx 0;
}
2023-11-14 17:21:03 +08:00
.page-space{
position: relative;
z-index: 2;
}
2023-10-11 11:27:47 +08:00
.order-header {}
.order-status-info {
padding: 50rpx 0;
.order-status {
display: flex;
align-items: center;
height: 42rpx;
font-size: 30rpx;
color: #FFFFFF;
margin-bottom: 20rpx;
2023-11-14 17:21:03 +08:00
padding-left: 50rpx;
background-size: 40rpx 40rpx;
background-position: left center;
background-repeat: no-repeat;
&.order-status-0,&.order-status-1,&.order-status-2,&.order-status-5{
2023-11-22 18:55:55 +08:00
background-image: $orderStateClock;
2023-11-14 17:21:03 +08:00
}
&.order-status-3,&.order-status-4{
2023-11-22 18:55:55 +08:00
background-image: $orderStateFinish;
2023-11-14 17:21:03 +08:00
}
2023-10-11 11:27:47 +08:00
.image {
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
}
.order-date {
height: 33rpx;
font-size: 24rpx;
color: #FFFFFF;
}
2023-11-14 17:21:03 +08:00
2023-10-11 11:27:47 +08:00
}
.order-infos {
margin: 0 40rpx;
padding: 40rpx 0 20rpx;
&:after {
content: '';
}
}
2023-11-14 17:21:03 +08:00
.infos{
.info-cell-label{
.wem1{
width: 1em;
display: inline-block;
}
}
.info-cell-value{
display: flex;
}
}
2023-10-11 11:27:47 +08:00
</style>