This commit is contained in:
13713575202 2025-06-11 13:53:06 +08:00
parent f97b473d31
commit 85882c9a68
5 changed files with 123 additions and 29 deletions

View File

@ -9,8 +9,8 @@ export function shoppingCart(params = {}) {
//删除购物车 //删除购物车
export function deleteChooseGoods(params = {}) { export function deleteChooseGoods(params = {}) {
return request('user-center/shoppingCart/deleteChooseGoods', { return request('user-center/shoppingCart/deleteChooseGoods', {
method: 'GET', method: 'POST',
params, data: params,
}); });
} }
//商品添加数量 //商品添加数量

View File

@ -109,14 +109,22 @@
<div>付款时间</div> <div>付款时间</div>
<div style="color: #999999">{{ detailsData.paymentTime }}</div> <div style="color: #999999">{{ detailsData.paymentTime }}</div>
</div> </div>
<div v-if="detailsData.orderStatus == '11'" class="order-list-warp-right-list"> <div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
<div>退款时间</div> <div>申请退款原因</div>
<div style="color: #999999">{{ detailsData.refundReason }}</div>
</div>
<div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
<div>申请退款时间</div>
<div style="color: #999999">{{ detailsData.refundTime }}</div> <div style="color: #999999">{{ detailsData.refundTime }}</div>
</div> </div>
<div v-if="detailsData.orderStatus == '11'" class="order-list-warp-right-list"> <div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
<div>退款金额</div> <div style="color: red">申请退款金额</div>
<div style="color: red">{{ detailsData.refundAmount }}</div> <div style="color: red">{{ detailsData.refundAmount }}</div>
</div> </div>
<div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
<div>申请退款结果</div>
<div>{{ detailsData.refundAuditResult }}</div>
</div>
</div> </div>
<div v-if="detailsData.totalAmount" style="margin-top: 30px"> <div v-if="detailsData.totalAmount" style="margin-top: 30px">
<div style="width: 100%; text-align: left; font-size: 18px; font-weight: bold">付款信息</div> <div style="width: 100%; text-align: left; font-size: 18px; font-weight: bold">付款信息</div>
@ -141,19 +149,17 @@
</div> </div>
<div style="display: flex; align-items: center; justify-content: center; width: 100%"> <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="detailsData.orderStatus == '1'" class="button-bottom" @click="doPay(1)">立即付款</div>
<div <div v-if="detailsData.orderStatus == '4' || detailsData.orderStatus == '5'" class="button-bottom" @click="confirmReceipt()">
v-if="
detailsData.orderStatus == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
"
class="button-bottom"
@click="confirmReceipt()"
>
确认收货 确认收货
</div> </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'" class="button-bottoms" @click="reAddress()">修改地址</div>
<div <div
v-if=" v-if="
detailsData.orderStatus == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5' detailsData.orderStatus == '2' ||
detailsData.orderStatus == '3' ||
detailsData.orderStatus == '4' ||
detailsData.orderStatus == '5' ||
detailsData.orderStatus == '6'
" "
class="button-bottoms" class="button-bottoms"
@click="refund()" @click="refund()"
@ -170,7 +176,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { userPostAddress, upOrderInfoList, confirmOrder, refundApprove } from '../../apis/user'; import { ElMessage } from 'element-plus';
import { userPostAddress, upOrderInfoList, confirmOrder, refundApprove, sureToReceive } from '../../apis/user';
import common from './components/common.vue'; import common from './components/common.vue';
import { ref, reactive, computed, onMounted } from 'vue'; import { ref, reactive, computed, onMounted } from 'vue';
import userHeader from './components/userHeader.vue'; import userHeader from './components/userHeader.vue';
@ -219,7 +226,14 @@ onMounted(() => {
}); });
const confirmReceipt = () => { const confirmReceipt = () => {
sureToReceive({ orderId: detailsData.value.id }).then((res) => {
ElMessage({
message: '确认收货成功',
type: 'success',
plain: true,
});
getDetails(); getDetails();
});
}; };
const change = (value) => { const change = (value) => {
@ -240,6 +254,11 @@ const changeAddress = (value) => {
const doCancel = () => { const doCancel = () => {
cancelOrder({ id: route.query.id }).then((res) => { cancelOrder({ id: route.query.id }).then((res) => {
store.getData(JSON.parse(route.query.page)).then((res) => { store.getData(JSON.parse(route.query.page)).then((res) => {
ElMessage({
message: '取消订单成功',
type: 'success',
plain: true,
});
router.back(); router.back();
}); });
}); });
@ -256,6 +275,11 @@ const upRefund = () => {
refundType: optionsValue.value, refundType: optionsValue.value,
refundReason: input.value, refundReason: input.value,
}).then((res) => { }).then((res) => {
ElMessage({
message: '退货/退款成功',
type: 'success',
plain: true,
});
getDetails(); getDetails();
refundVs.value = false; refundVs.value = false;
}); });
@ -263,6 +287,11 @@ const upRefund = () => {
const upAddress = () => { const upAddress = () => {
updateOrderReceiveAddress({ orderId: route.query.id, addressId: addressId.value }).then((res) => { updateOrderReceiveAddress({ orderId: route.query.id, addressId: addressId.value }).then((res) => {
ElMessage({
message: '修改地址成功',
type: 'success',
plain: true,
});
getDetails(); getDetails();
dialogVisible.value = false; dialogVisible.value = false;
}); });

View File

@ -113,7 +113,7 @@ let isAll = ref(false);
let data = ref([]); let data = ref([]);
let page = reactive({ let page = reactive({
current: 1, current: 1,
size: 10, size: 100,
}); });
let ids = ref([]); let ids = ref([]);
@ -260,6 +260,7 @@ const toCheckGood = (indexP, index) => {
// //
ids.value.push(data.value[indexP].cartDetails[index].id); ids.value.push(data.value[indexP].cartDetails[index].id);
} }
console.log(ids.value);
if (indexP > -1 && index > -1) { if (indexP > -1 && index > -1) {
let list = data.value[indexP].cartDetails; let list = data.value[indexP].cartDetails;
list[index].ischeck = !list[index].ischeck; list[index].ischeck = !list[index].ischeck;
@ -295,6 +296,8 @@ const setIsAll = () => {
}; };
const doSingleDel = (indexP, index) => { const doSingleDel = (indexP, index) => {
let list = [];
list.push(data.value[indexP].cartDetails[index].id);
if (indexP > -1 && index > -1) { if (indexP > -1 && index > -1) {
app app
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', { .$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
@ -303,10 +306,12 @@ const doSingleDel = (indexP, index) => {
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
deleteChooseGoods({ goodsIds: [data.value[indexP].cartDetails[index].id] }); deleteChooseGoods({ goodsIds: list.join(',') });
data.value[indexP].cartDetails.splice(index, 1); data.value[indexP].cartDetails.splice(index, 1);
}) })
.catch(() => {}); .catch((err) => {
console.log(err);
});
} }
}; };
// //
@ -327,9 +332,9 @@ const doBatchDel = () => {
}) })
.then(() => { .then(() => {
// //
const filteredData = removeCheckedItems(data); // const filteredData = removeCheckedItems(data);
// console.log(filteredData); // console.log(filteredData);
data.value = filteredData; // data.value = filteredData;
deleteChooseGoods(ids.value); deleteChooseGoods(ids.value);
}) })
.catch(() => {}); .catch(() => {});

View File

@ -7,7 +7,7 @@
<div class="addr-list"> <div class="addr-list">
<div class="addr-list-top"> <div class="addr-list-top">
<div class="back"> <div class="back">
<el-icon><ArrowLeftBold /></el-icon> <el-icon @click="goBack()"><ArrowLeftBold /></el-icon>
<span>确认收货地址</span> <span>确认收货地址</span>
</div> </div>
<div class="addr-manage" @click="goAddressList()">管理地址</div> <div class="addr-manage" @click="goAddressList()">管理地址</div>
@ -184,6 +184,10 @@ const getAddressList = () => {
}); });
}; };
const goBack = () => {
router.back();
};
const getOrderInfo = () => { const getOrderInfo = () => {
upOrderInfoList({ id: route.query.id }).then((res) => { upOrderInfoList({ id: route.query.id }).then((res) => {
datalist.value = res.data.records; datalist.value = res.data.records;

View File

@ -49,11 +49,17 @@
<div class="good-info"> <div class="good-info">
<div class="good-info-pos"> <div class="good-info-pos">
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div> <div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
<div
v-if="g.refundAuditResult == '2' && (g.orderStatus = '10' || g.orderStatus == '11')"
style="color: red; font-size: 15px"
>
已拒绝退款该产品不支持退货/退款
</div>
</div> </div>
</div> </div>
<div class="good-price-num"> <div class="good-price-num">
<div class="good-price-num-pos"> <div class="good-price-num-pos">
<div class="price">{{ g.unitPrice }} / {{ g.unit }} * {{ g.quantity }}</div> <div class="price">{{ g.unitPrice }} / {{ g.unit }} * {{ g.quantity }}</div>
<div class="total"> <div class="total">
<div class="amount">{{ (g.unitPrice * g.quantity).toFixed(2) }}</div> <div class="amount">{{ (g.unitPrice * g.quantity).toFixed(2) }}</div>
<!-- <div class="amount">{{ (g.unitPrice * g.quantity + g.carriage).toFixed(2) }}</div> --> <!-- <div class="amount">{{ (g.unitPrice * g.quantity + g.carriage).toFixed(2) }}</div> -->
@ -74,6 +80,14 @@
<div v-if="o.orderStatus == '1'" class="right-item do-btn"> <div v-if="o.orderStatus == '1'" class="right-item do-btn">
<el-button @click="doCancel(o.id)">取消订单</el-button> <el-button @click="doCancel(o.id)">取消订单</el-button>
</div> </div>
<div
v-if="o.orderStatus == '2' || o.orderStatus == '3' || o.orderStatus == '4' || o.orderStatus == '5'"
class="right-item do-btn"
>
<el-button type="danger" @click="doPay(o.id)">退货/退款</el-button>
</div>
<!-- <div v-if="o.orderStatus == '5'" class="right-item">已发货</div> --> <!-- <div v-if="o.orderStatus == '5'" class="right-item">已发货</div> -->
<!-- <div v-if="o.orderStatus == '5'" class="right-item text-link">快递单号</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> <el-button type="primary" class="right-item do-btn" @click="goInfo(o.id)">订单详情</el-button>
@ -101,6 +115,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="pager">
<div style="margin-bottom: 3px">{{ total }}</div>
<el-pagination :page-size="20" :pager-count="11" layout="prev, pager, next" :total="total" @change="pagerChange" />
</div>
</div> </div>
</div> </div>
</div> </div>
@ -109,6 +127,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { ElMessage } from 'element-plus';
import common from './components/common.vue'; import common from './components/common.vue';
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils'; import { isEmpty, getAssetsFile } from '@/utils';
@ -121,14 +140,31 @@ const route = useRoute();
const router = useRouter(); const router = useRouter();
let page = reactive({ let page = reactive({
current: 1, current: 1,
size: 10, size: 20,
}); });
let total = ref(0);
let show = ref(false); let show = ref(false);
let handleClick = (value) => { let handleClick = (value) => {
activeCurrent.value = value; activeCurrent.value = value;
page.orderStatus = value; page.orderStatus = value;
if (value == 5) {
page.orderStatus = value + ',4';
}
store.getData(page).then((res) => {
total.value = res.total;
if (res.records.length > 0) {
show.value = true;
} else {
show.value = false;
}
console.log(show.value);
});
};
const pagerChange = (value) => {
console.log(page);
page.current = value;
store.getData(page).then((res) => { store.getData(page).then((res) => {
console.log(res);
if (res.records.length > 0) { if (res.records.length > 0) {
show.value = true; show.value = true;
} else { } else {
@ -150,7 +186,7 @@ let bottomList = reactive([
{ title: '待付款', name: '1' }, { title: '待付款', name: '1' },
{ title: '待发货', name: '3' }, { title: '待发货', name: '3' },
// { title: '', name: '6' }, // { title: '', name: '6' },
{ title: '待收货', name: '5' }, { title: '待收货', name: '4' },
{ title: '已收货', name: '6' }, { title: '已收货', name: '6' },
{ title: '退款中', name: '10' }, { title: '退款中', name: '10' },
{ title: '已退款', name: '11' }, { title: '已退款', name: '11' },
@ -159,6 +195,7 @@ let bottomList = reactive([
onMounted(() => { onMounted(() => {
page.orderStatus = 'all'; page.orderStatus = 'all';
store.getData(page).then((res) => { store.getData(page).then((res) => {
total.value = res.total;
if (res.records.length > 0) { if (res.records.length > 0) {
show.value = true; show.value = true;
} else { } else {
@ -169,6 +206,11 @@ onMounted(() => {
const sureToReceives = (id) => { const sureToReceives = (id) => {
sureToReceive({ orderId: id }).then((res) => { sureToReceive({ orderId: id }).then((res) => {
ElMessage({
message: '确认收货成功',
type: 'success',
plain: true,
});
store.getData(page); store.getData(page);
}); });
}; };
@ -214,23 +256,36 @@ let orderList = reactive([
const doPay = (id) => { const doPay = (id) => {
router.push({ router.push({
path: '/sub-operation-service/orderSuccess', path: '/sub-operation-service/orderDetails',
query: { id: id }, query: { id: id, page: JSON.stringify(page) },
}); });
}; };
const doCancel = (id) => { const doCancel = (id) => {
cancelOrder({ id: id }).then((res) => { cancelOrder({ id: id }).then((res) => {
ElMessage({
message: '取消订单成功',
type: 'success',
plain: true,
});
store.getData(page); store.getData(page);
}); });
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pager {
align-items: center;
display: flex;
position: fixed;
bottom: 42px;
color: #999999;
font-size: 12px;
}
.user-orders-warp { .user-orders-warp {
width: 100%; width: 100%;
.user-orders-content { .user-orders-content {
margin-top: 16px; margin-top: 16px;
padding: 16px; padding: 16px 16px 30px 16px;
width: 100%; width: 100%;
height: calc(100vh - 136px); height: calc(100vh - 136px);
border-radius: 16px; border-radius: 16px;
@ -265,6 +320,7 @@ const doCancel = (id) => {
} }
} }
.order-list-warp { .order-list-warp {
position: relative;
overflow-y: auto; overflow-y: auto;
width: 100%; width: 100%;
height: calc(100% - 60px); height: calc(100% - 60px);