This commit is contained in:
13713575202 2025-06-10 18:18:52 +08:00
parent 83c17616c4
commit 57d5c25d27
6 changed files with 84 additions and 33 deletions

View File

@ -120,7 +120,21 @@ export function orderInfoGetById(params = {}) {
}
//申请退款
export function refundApprove(params = {}) {
return request('/user-center/refund/refundApprove', {
return request('/user-center/refund/approve', {
method: 'POST',
data: params,
});
}
//确认收货
export function sureToReceive(params = {}) {
return request('/user-center/orderInfo/sureToReceive', {
method: 'POST',
data: params,
});
}
//付款
export function payOrder(params = {}) {
return request('/user-center/orderInfo/payOrder', {
method: 'POST',
data: params,
});

View File

@ -10,7 +10,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="refundVs = false">取消</el-button>
<el-button type="primary" @click="upRefund()"> 确认 </el-button>
<el-button type="primary" @click="upRefund"> 确认 </el-button>
</div>
</template>
</el-dialog>
@ -39,22 +39,26 @@
<el-icon style="cursor: pointer" size="30" @click="back()"><ArrowLeftBold /></el-icon>
<span style="font-weight: bold; color: #25bf82; font-size: 20px">
{{
JSON.parse(route.query.page).orderStatus == '1'
detailsData.orderStatus == '1'
? '待支付'
: JSON.parse(route.query.page).orderStatus == '2' || JSON.parse(route.query.page).orderStatus == '3'
: detailsData.orderStatus == '2' || detailsData.orderStatus == '3'
? '待发货'
: JSON.parse(route.query.page).orderStatus == '4' || JSON.parse(route.query.page).orderStatus == '5'
: detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
? '已发货'
: JSON.parse(route.query.page).orderStatus == '6'
: detailsData.orderStatus == '6'
? '已收货'
: JSON.parse(route.query.page).orderStatus == '7'
: detailsData.orderStatus == '7'
? '已取消'
: JSON.parse(route.query.page).orderStatus == '8'
: detailsData.orderStatus == '8'
? '已完成'
: detailsData.orderStatus == '10'
? '退款中'
: detailsData.orderStatus == '11'
? '已退款'
: ''
}}</span
>
<span v-if="JSON.parse(route.query.page).orderStatus == '1'" style="font-size: 15px">在71小时59分59秒之前发货</span>
<span v-if="detailsData.orderStatus == '1'" style="font-size: 15px">在71小时59分59秒之前发货</span>
</div>
</div>
@ -105,6 +109,14 @@
<div>付款时间</div>
<div style="color: #999999">{{ detailsData.paymentTime }}</div>
</div>
<div v-if="detailsData.orderStatus == '11'" class="order-list-warp-right-list">
<div>退款时间</div>
<div style="color: #999999">{{ detailsData.refundTime }}</div>
</div>
<div v-if="detailsData.orderStatus == '11'" class="order-list-warp-right-list">
<div>退款金额</div>
<div style="color: red">{{ detailsData.refundAmount }}</div>
</div>
</div>
<div v-if="detailsData.totalAmount" style="margin-top: 30px">
<div style="width: 100%; text-align: left; font-size: 18px; font-weight: bold">付款信息</div>
@ -127,7 +139,7 @@
</div>
</div>
</div>
<div style="display: flex; align-items: center; justify-content: start">
<div style="display: flex; align-items: center; justify-content: center; width: 100%">
<div v-if="detailsData.orderStatus == '1'" class="button-bottom" @click="doPay(1)">立即付款</div>
<div
v-if="
@ -138,7 +150,7 @@
>
确认收货
</div>
<div class="button-bottoms" @click="reAddress()">修改地址</div>
<div v-if="detailsData.orderStatus == '2' || detailsData.orderStatus == '3'" class="button-bottoms" @click="reAddress()">修改地址</div>
<div
v-if="
detailsData.orderStatus == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
@ -158,12 +170,12 @@
</div>
</template>
<script setup>
import { userPostAddress, upOrderInfoList, confirmOrder } from '../../apis/user';
import { userPostAddress, upOrderInfoList, confirmOrder, refundApprove } from '../../apis/user';
import common from './components/common.vue';
import { ref, reactive, computed, onMounted } from 'vue';
import userHeader from './components/userHeader.vue';
import { useRoute, useRouter } from 'vue-router';
import { cancelOrder, updateOrderReceiveAddress, orderInfoGetById, refundApprove } from '../../apis/user';
import { cancelOrder, updateOrderReceiveAddress, orderInfoGetById } from '../../apis/user';
import { useGetUserOrder } from '../../store/modules/userOrder';
let store = useGetUserOrder();
let dialogVisible = ref(false);
@ -180,23 +192,23 @@ let page = reactive({
current: 1,
size: 10,
});
let optionsValue = ref('不想要了');
let optionsValue = ref('1');
const options = [
{
value: '不想要了',
value: '1',
label: '不想要了',
},
{
value: '与卖家协商一致',
value: '2',
label: '与卖家协商一致',
},
{
value: '货物损坏',
value: '3',
label: '货物损坏',
},
{
value: '实物与宣传不符',
value: '4',
label: '实物与宣传不符',
},
];
@ -239,10 +251,10 @@ const refund = () => {
const upRefund = () => {
refundApprove({
orderId: 0,
orderId: route.query.id,
refundCategory: '1',
refundType: 1,
refundReason: input,
refundType: optionsValue.value,
refundReason: input.value,
}).then((res) => {
getDetails();
refundVs.value = false;

View File

@ -34,7 +34,13 @@
</div>
<div class="pay-style-warp">
<div class="title" @click="paySuccess">支付方式</div>
<div class="title">支付方式</div>
<div
style="background-color: #25bf82; padding: 5px 10px; font-size: 20px; font-weight: bold; color: #fff; cursor: pointer"
@click="paySuccess"
>
点击模拟支付
</div>
<div class="pay-list">
<div class="pay-list-pos">
<div
@ -88,7 +94,7 @@ import { useRoute, useRouter } from 'vue-router';
import userHeader from './components/userHeader.vue';
import costomImg from '@/components/costomImg.vue';
import { qrImg } from '@/layouts/component/Header/base64img.js';
import { userPostAddress, upOrderInfoList, confirmOrder } from '../../apis/user';
import { userPostAddress, upOrderInfoList, confirmOrder, payOrder } from '../../apis/user';
const route = useRoute();
const router = useRouter();
// let totalAmout = ref(196);
@ -153,7 +159,9 @@ let payAmout = ref(147);
//
let paySuccess = () => {
payOrder({ orderId: route.query.id }).then((res) => {
router.push('/sub-operation-service/paySuccess');
});
};
</script>
<style lang="scss" scoped>

View File

@ -19,7 +19,7 @@
<el-button @click="toLink('/sub-operation-service/userOrders')">查看订单</el-button>
</div>
<div class="do-item">
<el-button type="primary" @click="toLink('/sub-operation-service/home')">返回首页</el-button>
<el-button type="primary" @click="toLink('/sub-operation-service/smartFarm/main')">返回首页</el-button>
</div>
</div>
</div>

View File

@ -68,7 +68,7 @@
<div v-if="n.orderItemInfos && n.orderItemInfos.length > 0" class="good-list">
<div v-for="(g, indexg) in n.orderItemInfos" :key="indexg" class="good-item">
<div class="good-img">
<img class="good-img" :url="g.productImage" />
<img class="good-img" :src="g.productImage" />
</div>
<!-- :preview-list="[getAssetsFile('images/ecommerce/' + 'pic.png')]" -->
<div class="good-info">

View File

@ -68,12 +68,15 @@
<div v-if="o.orderStatus == '1'" class="right-item do-btn">
<el-button type="primary" @click="doPay(o.id)">立即付款</el-button>
</div>
<div v-if="o.orderStatus == '4' || o.orderStatus == '5'" class="right-item do-btn">
<el-button type="primary" @click="sureToReceives(o.id)">确认收货</el-button>
</div>
<div v-if="o.orderStatus == '1'" class="right-item do-btn">
<el-button @click="doCancel(o.id)">取消订单</el-button>
</div>
<div v-if="o.orderStatus == '5'" class="right-item">已发货</div>
<div v-if="o.orderStatus == '5'" class="right-item text-link">快递单号</div>
<div class="right-item text-link" @click="goInfo(o.id)">订单详情</div>
<!-- <div v-if="o.orderStatus == '5'" class="right-item">已发货</div> -->
<!-- <div v-if="o.orderStatus == '5'" class="right-item text-link">快递单号</div> -->
<el-button type="primary" class="right-item do-btn" @click="goInfo(o.id)">订单详情</el-button>
<div class="right-item text-link">
{{
o.orderStatus == '7'
@ -86,6 +89,10 @@
? '待收货'
: o.orderStatus == '6'
? '已收货'
: o.orderStatus == '10'
? '退款中'
: o.orderStatus == '11'
? '已退款'
: ''
}}
</div>
@ -107,7 +114,7 @@ import { ref, reactive, onMounted } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router';
import userHeader from './components/userHeader.vue';
import { cancelOrder } from '../../apis/user';
import { cancelOrder, sureToReceive } from '../../apis/user';
import { useGetUserOrder } from '../../store/modules/userOrder';
let store = useGetUserOrder();
const route = useRoute();
@ -118,6 +125,7 @@ let page = reactive({
});
let show = ref(false);
let handleClick = (value) => {
activeCurrent.value = value;
page.orderStatus = value;
store.getData(page).then((res) => {
console.log(res);
@ -141,8 +149,11 @@ let bottomList = reactive([
{ title: '全部', name: 'all' },
{ title: '待付款', name: '1' },
{ title: '待发货', name: '3' },
{ title: '已发货', name: '6' },
// { title: '', name: '6' },
{ title: '待收货', name: '5' },
{ title: '已收货', name: '6' },
{ title: '退款中', name: '10' },
{ title: '已退款', name: '11' },
]);
onMounted(() => {
@ -156,6 +167,12 @@ onMounted(() => {
});
});
const sureToReceives = (id) => {
sureToReceive({ orderId: id }).then((res) => {
store.getData(page);
});
};
let activeCurrent = ref('all');
let orderList = reactive([