jiuyiUniapp/jiuyi2/pages/shop/order/afterSales.vue

236 lines
5.3 KiB
Vue
Raw Normal View History

2024-12-27 15:03:48 +08:00
<script setup>
// 售后详情
import {
2025-04-24 13:35:07 +08:00
ref,
reactive,
computed,
getCurrentInstance,
} from 'vue'
import {
onLoad,
onReady,
onPageScroll,
} from '@dcloudio/uni-app';
// 工具库
import util from '@/common/js/util';
//
import api from '@/api/index.js'
// 订单id
const orderId = ref('')
// 订单详情
const detail = reactive({})
2024-12-27 15:03:48 +08:00
// 流程
2025-04-25 11:06:41 +08:00
const flow = computed(() => {
let result = []
if (detail.id) result.push({
time: detail.dealTime,
2024-12-27 15:03:48 +08:00
name: '同意退款',
2025-04-25 11:06:41 +08:00
}, {
time: detail.dealTime,
2024-12-27 15:03:48 +08:00
name: '平台处理中',
2025-04-25 11:06:41 +08:00
}, {
time: detail.refundTime,
2024-12-27 15:03:48 +08:00
name: '到账成功',
2025-04-25 11:06:41 +08:00
})
return result
})
2025-04-24 13:35:07 +08:00
onLoad((option) => {
if (option.orderId) orderId.value = option.orderId
// 获取详情
getDetail()
})
// 获取详情
function getDetail() {
api.shop.getRefundOrder({
query: {
orderId: orderId.value,
}
}).then(rs => {
if (rs.code == 200) {
2025-04-25 11:06:41 +08:00
const result = rs.data
result.payment = util.config.payType[result.refundType]
Object.assign(detail, result)
2025-04-24 13:35:07 +08:00
return
}
util.alert({
2025-04-25 11:06:41 +08:00
content: rs.msg,
2025-04-24 13:35:07 +08:00
showCancel: false
})
})
}
2025-04-25 11:06:41 +08:00
// 复制文本
function handleCopy() {
util.copyText(detail.orderNo)
}
2024-12-27 15:03:48 +08:00
</script>
<template>
<view class="app">
<view class="container">
<!-- 退款状态 -->
<view class="statusText mtb30 f48">退款成功</view>
<!-- 退款金额 -->
<view class="result mtb30">
<view class="refundPrice ">
<text class="f48"></text>
2025-04-25 11:06:41 +08:00
<text class="value">{{detail.refundPrice}}</text>
2024-12-27 15:03:48 +08:00
</view>
<view class="c37B111">已退回至九亿钱包</view>
</view>
<!-- 退款流程 -->
<view class="flow mtb30">
<view class="item f1" v-for="(item,index) in flow" :key="index">
<view class="side">
<view class="line"></view>
<view class="circle mlr10 cir">
<view class="wh24 fmid" v-if="index == flow.length - 1">
<uni-icons type="checkmarkempty" color="#fff" />
</view>
</view>
<view class="line"></view>
</view>
<view class="main mt20 tac c999 f26">
<view class="name">{{item.name}}</view>
2025-04-25 11:06:41 +08:00
<view class="time mt10">{{item.time}}</view>
2024-12-27 15:03:48 +08:00
</view>
</view>
</view>
</view>
<!-- 退款金额 -->
2025-04-25 11:06:41 +08:00
<view class="container info c999 f28" v-if="detail.id">
2024-12-27 15:03:48 +08:00
<view class="title mtb20 c333 f32">钱款去向</view>
<view class="line rows mtb20">
<view class="key">九亿账号</view>
2025-04-25 11:06:41 +08:00
<view class="">{{detail.refundAccount}}</view>
2024-12-27 15:03:48 +08:00
</view>
<view class="line rows mtb20">
<view class="key">支付方式</view>
2025-04-25 11:06:41 +08:00
<view class="">{{detail.payment.name}}</view>
2024-12-27 15:03:48 +08:00
</view>
<view class="line rows mtb20">
<view class="key">退款账户</view>
2025-04-25 11:06:41 +08:00
<view class="">{{detail.refundAccount}}</view>
2024-12-27 15:03:48 +08:00
</view>
</view>
<view class="product container">
<view class="header line rows ptb20 f28">
<!-- 店铺 -->
<view class="store df aic thd f1">
2025-04-25 11:06:41 +08:00
<image class="wh50 br10" :src="detail.merchantAvatar" mode="aspectFill" />
<view class="name ml10 c333">{{detail.merchantName}}</view>
2024-12-27 15:03:48 +08:00
</view>
</view>
<!-- 商品信息 -->
2025-04-25 11:06:41 +08:00
<view class="product line df ptb20" v-if="detail.productInf">
2024-12-27 15:03:48 +08:00
<view class="poster wh160">
2025-04-25 11:06:41 +08:00
<image class="wh160 br10" :src="detail.productInfo.sliderImage.split(',')[0]" mode="aspectFill" />
2024-12-27 15:03:48 +08:00
</view>
<!-- 产品名称 购买的规格 -->
<view class="info mlr20 f1">
2025-04-25 11:06:41 +08:00
<view class="name c333 f28">{{detail.productInfo.name}}</view>
<view class="spec mt10 c999 f26">款式{{detail.style}}</view>
2024-12-27 15:03:48 +08:00
</view>
<!-- 单价 数量 -->
<view class="tar">
<view class="price c666">
<text class="f20"></text>
2025-04-25 11:06:41 +08:00
<text class="f26">{{detail.productInfo.price}}</text>
2024-12-27 15:03:48 +08:00
</view>
2025-04-25 11:06:41 +08:00
<view class="number f24 c999">x {{detail.totalNum}}</view>
2024-12-27 15:03:48 +08:00
</view>
</view>
<!-- 订单信息 -->
<view class="order mt30 f26 c999">
<view class="line mtb20 rows">
2025-04-24 13:35:07 +08:00
<text>订单编号{{detail.orderNo}}</text>
2025-04-25 11:06:41 +08:00
<view class="btn ti closeHollow plr20" @click="handleCopy">复制</view>
2024-12-27 15:03:48 +08:00
</view>
<view class="line mtb20">
2025-04-25 11:06:41 +08:00
<text>申请金额{{detail.refundPrice}}</text>
2024-12-27 15:03:48 +08:00
</view>
<view class="line mtb20">
2025-04-25 11:06:41 +08:00
<text>退款原因{{detail.refundReasonWap}}</text>
2024-12-27 15:03:48 +08:00
</view>
2025-04-25 11:06:41 +08:00
<!-- <view class="line mtb20">
2024-12-27 15:03:48 +08:00
<text>收货状态已收货</text>
2025-04-25 11:06:41 +08:00
</view> -->
2024-12-27 15:03:48 +08:00
<view class="line mtb20">
2025-04-25 11:06:41 +08:00
<text>申请时间{{detail.createTime}}</text>
2024-12-27 15:03:48 +08:00
</view>
</view>
</view>
<!-- 填充 -->
<view class="fill" style="height: 150rpx;"></view>
<!-- -->
2025-04-24 13:35:07 +08:00
<view class="footer df jcr plr30 bfff shadow" v-if="0">
2024-12-27 15:03:48 +08:00
<view class="btn sm bar closeHollow plr20">联系商家</view>
</view>
</view>
</template>
<style lang="scss" scoped>
//
.container {
overflow: hidden;
margin: 20rpx 0;
padding-left: 20rpx;
padding-right: 20rpx;
color: #333;
background-color: #fff;
}
//
.refundPrice {
.value {
font-size: 72rpx;
}
}
// 退款流程
.flow {
display: flex;
justify-content: center;
.item {
.side {
display: flex;
align-items: center;
height: 40rpx;
.line {
flex: 1;
border-top: 4rpx solid #37B111;
}
.circle {
padding: 10rpx;
background-color: #37B111;
}
}
//
&:nth-child(1) .line:nth-child(1) {
opacity: 0;
}
//
&:nth-last-child(1) .line:nth-last-child(1) {
opacity: 0;
}
}
}
</style>