Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
fb83e0400a
@ -9,8 +9,8 @@ export function shoppingCart(params = {}) {
|
||||
//删除购物车
|
||||
export function deleteChooseGoods(params = {}) {
|
||||
return request('user-center/shoppingCart/deleteChooseGoods', {
|
||||
method: 'GET',
|
||||
params,
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
//商品添加数量
|
||||
|
@ -109,13 +109,25 @@
|
||||
<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 v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
|
||||
<div>申请退款原因</div>
|
||||
<div style="color: #999999">{{ detailsData.refundReason }}</div>
|
||||
</div>
|
||||
<div v-if="detailsData.orderStatus == '11'" class="order-list-warp-right-list">
|
||||
<div>退款金额</div>
|
||||
<div style="color: red">{{ detailsData.refundAmount }}</div>
|
||||
<div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
|
||||
<div>申请退款时间</div>
|
||||
<div style="color: #999999">{{ detailsData.refundApproveTime }}</div>
|
||||
</div>
|
||||
<div v-if="detailsData.orderStatus == '11' || detailsData.orderStatus == '10'" class="order-list-warp-right-list">
|
||||
<div style="color: red">申请退款金额</div>
|
||||
<div style="color: red">¥{{ detailsData.payableAmount }}</div>
|
||||
</div>
|
||||
<div v-if="detailsData.orderStatus == '10' || detailsData.orderStatus == '11'" class="order-list-warp-right-list">
|
||||
<div>申请退款结果</div>
|
||||
<div>{{ detailsData.refundAuditResult }}</div>
|
||||
</div>
|
||||
<div v-if="detailsData.orderStatus == '10' && detailsData.refundFailReason" class="order-list-warp-right-list">
|
||||
<div>拒绝退款原因</div>
|
||||
<div>{{ detailsData.refundFailReason }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="detailsData.totalAmount" style="margin-top: 30px">
|
||||
@ -141,19 +153,17 @@
|
||||
</div>
|
||||
<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 == '2' || detailsData.orderStatus == '3' || detailsData.orderStatus == '4' || detailsData.orderStatus == '5'
|
||||
"
|
||||
class="button-bottom"
|
||||
@click="confirmReceipt()"
|
||||
>
|
||||
<div v-if="detailsData.orderStatus == '4' || detailsData.orderStatus == '5'" class="button-bottom" @click="confirmReceipt()">
|
||||
确认收货
|
||||
</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'
|
||||
detailsData.orderStatus == '2' ||
|
||||
detailsData.orderStatus == '3' ||
|
||||
detailsData.orderStatus == '4' ||
|
||||
detailsData.orderStatus == '5' ||
|
||||
detailsData.orderStatus == '6'
|
||||
"
|
||||
class="button-bottoms"
|
||||
@click="refund()"
|
||||
@ -170,7 +180,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<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 { ref, reactive, computed, onMounted } from 'vue';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
@ -219,7 +230,14 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const confirmReceipt = () => {
|
||||
sureToReceive({ orderId: detailsData.value.id }).then((res) => {
|
||||
ElMessage({
|
||||
message: '确认收货成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
getDetails();
|
||||
});
|
||||
};
|
||||
|
||||
const change = (value) => {
|
||||
@ -240,6 +258,11 @@ const changeAddress = (value) => {
|
||||
const doCancel = () => {
|
||||
cancelOrder({ id: route.query.id }).then((res) => {
|
||||
store.getData(JSON.parse(route.query.page)).then((res) => {
|
||||
ElMessage({
|
||||
message: '取消订单成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
router.back();
|
||||
});
|
||||
});
|
||||
@ -256,6 +279,11 @@ const upRefund = () => {
|
||||
refundType: optionsValue.value,
|
||||
refundReason: input.value,
|
||||
}).then((res) => {
|
||||
ElMessage({
|
||||
message: '退货/退款成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
getDetails();
|
||||
refundVs.value = false;
|
||||
});
|
||||
@ -263,6 +291,11 @@ const upRefund = () => {
|
||||
|
||||
const upAddress = () => {
|
||||
updateOrderReceiveAddress({ orderId: route.query.id, addressId: addressId.value }).then((res) => {
|
||||
ElMessage({
|
||||
message: '修改地址成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
getDetails();
|
||||
dialogVisible.value = false;
|
||||
});
|
||||
|
@ -23,10 +23,6 @@
|
||||
<div v-else class="conetnt-warp">
|
||||
<div class="content-item-warp">
|
||||
<div v-for="(n, index) in data" :key="n.id" class="content-item">
|
||||
<div class="shop-info" @click="toCheckShop(index)">
|
||||
<div class="shop-do">
|
||||
<ischeck :value="n.ischeck"></ischeck>
|
||||
</div>
|
||||
<!-- <div class="shop-img">
|
||||
<costomImg
|
||||
:url="'images/ecommerce/' + 'pic.png'"
|
||||
@ -34,8 +30,12 @@
|
||||
:is-view="false"
|
||||
></costomImg>
|
||||
</div> -->
|
||||
<span class="shop-name txt-ellipsis clamp2">{{ n.cartName }}</span>
|
||||
<!-- <div class="shop-info" @click="toCheckShop(index)">
|
||||
<div class="shop-do">
|
||||
<ischeck :value="n.ischeck"></ischeck>
|
||||
</div>
|
||||
<span class="shop-name txt-ellipsis clamp2">{{ n.cartName }}</span>
|
||||
</div> -->
|
||||
|
||||
<div v-if="n.cartDetails && n.cartDetails.length > 0" class="good-list">
|
||||
<div v-for="(g, indexg) in n.cartDetails" :key="indexg" class="good-item">
|
||||
@ -113,7 +113,7 @@ let isAll = ref(false);
|
||||
let data = ref([]);
|
||||
let page = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
size: 100,
|
||||
});
|
||||
let ids = ref([]);
|
||||
|
||||
@ -223,12 +223,18 @@ const toCheckAll = () => {
|
||||
m.ischeck = isAll.value;
|
||||
if (m.cartDetails && m.cartDetails.length > 0) {
|
||||
m.cartDetails = setCheck(m.cartDetails, isAll.value);
|
||||
if (isAll.value) {
|
||||
m.cartDetails.forEach((res, index) => {
|
||||
ids.value.push(res.id);
|
||||
});
|
||||
} else {
|
||||
ids.value = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log(ids.value);
|
||||
};
|
||||
|
||||
const setCheck = (data, val) => {
|
||||
@ -260,6 +266,7 @@ const toCheckGood = (indexP, index) => {
|
||||
// 如果值不存在则添加
|
||||
ids.value.push(data.value[indexP].cartDetails[index].id);
|
||||
}
|
||||
console.log(ids.value);
|
||||
if (indexP > -1 && index > -1) {
|
||||
let list = data.value[indexP].cartDetails;
|
||||
list[index].ischeck = !list[index].ischeck;
|
||||
@ -295,6 +302,8 @@ const setIsAll = () => {
|
||||
};
|
||||
|
||||
const doSingleDel = (indexP, index) => {
|
||||
let list = [];
|
||||
list.push(data.value[indexP].cartDetails[index].id);
|
||||
if (indexP > -1 && index > -1) {
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
@ -303,10 +312,12 @@ const doSingleDel = (indexP, index) => {
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
deleteChooseGoods({ goodsIds: [data.value[indexP].cartDetails[index].id] });
|
||||
deleteChooseGoods({ goodsIds: list.join(',') });
|
||||
data.value[indexP].cartDetails.splice(index, 1);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
//批量删除
|
||||
@ -327,10 +338,17 @@ const doBatchDel = () => {
|
||||
})
|
||||
.then(() => {
|
||||
// 删除逻辑
|
||||
const filteredData = removeCheckedItems(data);
|
||||
// const filteredData = removeCheckedItems(data);
|
||||
// console.log(filteredData);
|
||||
data.value = filteredData;
|
||||
deleteChooseGoods(ids.value);
|
||||
// data.value = filteredData;
|
||||
deleteChooseGoods({ goodsIds: ids.value.join(',') });
|
||||
setTimeout(() => {
|
||||
shoppingCart(page).then((res) => {
|
||||
console.log(res.data.records);
|
||||
data.value = res.data.records;
|
||||
addIsCheckProperty(data);
|
||||
});
|
||||
}, 500);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="addr-list">
|
||||
<div class="addr-list-top">
|
||||
<div class="back">
|
||||
<el-icon><ArrowLeftBold /></el-icon>
|
||||
<el-icon @click="goBack()"><ArrowLeftBold /></el-icon>
|
||||
<span>确认收货地址</span>
|
||||
</div>
|
||||
<div class="addr-manage" @click="goAddressList()">管理地址</div>
|
||||
@ -184,6 +184,10 @@ const getAddressList = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
router.back();
|
||||
};
|
||||
|
||||
const getOrderInfo = () => {
|
||||
upOrderInfoList({ id: route.query.id }).then((res) => {
|
||||
datalist.value = res.data.records;
|
||||
|
@ -49,11 +49,14 @@
|
||||
<div class="good-info">
|
||||
<div class="good-info-pos">
|
||||
<div class="txt-ellipsis clamp2">{{ g.productName || '--' }}</div>
|
||||
<div v-if="o.refundAuditResult == '拒绝退款' && o.orderStatus == '10'" style="color: red; font-size: 15px">
|
||||
已拒绝退款:{{ o.refundFailReason }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="good-price-num">
|
||||
<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="amount">{{ (g.unitPrice * g.quantity).toFixed(2) }}</div>
|
||||
<!-- <div class="amount">{{ (g.unitPrice * g.quantity + g.carriage).toFixed(2) }}</div> -->
|
||||
@ -74,6 +77,14 @@
|
||||
<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 == '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 text-link">快递单号</div> -->
|
||||
<el-button type="primary" class="right-item do-btn" @click="goInfo(o.id)">订单详情</el-button>
|
||||
@ -101,6 +112,10 @@
|
||||
</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>
|
||||
@ -109,6 +124,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { isEmpty, getAssetsFile } from '@/utils';
|
||||
@ -121,14 +137,31 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
let page = reactive({
|
||||
current: 1,
|
||||
size: 10,
|
||||
size: 20,
|
||||
});
|
||||
let total = ref(0);
|
||||
let show = ref(false);
|
||||
let handleClick = (value) => {
|
||||
activeCurrent.value = 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) => {
|
||||
console.log(res);
|
||||
if (res.records.length > 0) {
|
||||
show.value = true;
|
||||
} else {
|
||||
@ -150,7 +183,7 @@ let bottomList = reactive([
|
||||
{ title: '待付款', name: '1' },
|
||||
{ title: '待发货', name: '3' },
|
||||
// { title: '已发货', name: '6' },
|
||||
{ title: '待收货', name: '5' },
|
||||
{ title: '待收货', name: '4' },
|
||||
{ title: '已收货', name: '6' },
|
||||
{ title: '退款中', name: '10' },
|
||||
{ title: '已退款', name: '11' },
|
||||
@ -159,6 +192,7 @@ let bottomList = reactive([
|
||||
onMounted(() => {
|
||||
page.orderStatus = 'all';
|
||||
store.getData(page).then((res) => {
|
||||
total.value = res.total;
|
||||
if (res.records.length > 0) {
|
||||
show.value = true;
|
||||
} else {
|
||||
@ -169,6 +203,11 @@ onMounted(() => {
|
||||
|
||||
const sureToReceives = (id) => {
|
||||
sureToReceive({ orderId: id }).then((res) => {
|
||||
ElMessage({
|
||||
message: '确认收货成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
store.getData(page);
|
||||
});
|
||||
};
|
||||
@ -214,23 +253,36 @@ let orderList = reactive([
|
||||
|
||||
const doPay = (id) => {
|
||||
router.push({
|
||||
path: '/sub-operation-service/orderSuccess',
|
||||
query: { id: id },
|
||||
path: '/sub-operation-service/orderDetails',
|
||||
query: { id: id, page: JSON.stringify(page) },
|
||||
});
|
||||
};
|
||||
|
||||
const doCancel = (id) => {
|
||||
cancelOrder({ id: id }).then((res) => {
|
||||
ElMessage({
|
||||
message: '取消订单成功',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
});
|
||||
store.getData(page);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.pager {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 42px;
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.user-orders-warp {
|
||||
width: 100%;
|
||||
.user-orders-content {
|
||||
margin-top: 16px;
|
||||
padding: 16px;
|
||||
padding: 16px 16px 30px 16px;
|
||||
width: 100%;
|
||||
height: calc(100vh - 136px);
|
||||
border-radius: 16px;
|
||||
@ -265,6 +317,7 @@ const doCancel = (id) => {
|
||||
}
|
||||
}
|
||||
.order-list-warp {
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
height: calc(100% - 60px);
|
||||
|
Loading…
x
Reference in New Issue
Block a user