拼团:订单下单的接入

pull/37/head
YunaiV 2024-01-13 18:24:00 +08:00
parent a063553488
commit c3bb0a2ddc
4 changed files with 18 additions and 2 deletions

View File

@ -73,7 +73,8 @@
//
onMounted(async () => {
//
const { data } = await CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 1 , 10);
// status = 0
const { data } = await CombinationApi.getHeadCombinationRecordList(props.modelValue.id, 0 , 10);
state.list = data;
});
</script>

View File

@ -1,3 +1,4 @@
<!-- 拼团商品详情 -->
<template>
<s-layout :onShareAppMessage="shareInfo" navbar="goods">
<!-- 标题栏 -->
@ -152,7 +153,6 @@
import CombinationApi from "@/sheep/api/promotion/combination";
import SpuApi from "@/sheep/api/product/spu";
const headerBg = sheep.$url.css('/static/img/shop/goods/groupon-bg.png');
const btnBg = sheep.$url.css('/static/img/shop/goods/groupon-btn.png');
const disabledBtnBg = sheep.$url.css(
@ -226,6 +226,7 @@
}
//
// TODO @
const shareInfo = computed(() => {
if (isEmpty(state.activity)) return {};
return sheep.$platform.share.getShareInfo(

View File

@ -208,6 +208,8 @@
addressId: state.addressInfo.id,
deliveryType: 1, // TODO
pointStatus: false, // TODO
combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId
});
if (code !== 0) {
return;
@ -231,6 +233,8 @@
addressId: state.addressInfo.id,
deliveryType: 1, // TODO
pointStatus: false, // TODO
combinationActivityId: state.orderPayload.combinationActivityId,
combinationHeadId: state.orderPayload.combinationHeadId
});
if (code !== 0) {
return;

View File

@ -13,6 +13,12 @@ const OrderApi = {
if (!(data.addressId > 0)) {
delete data2.addressId;
}
if (!(data.combinationActivityId) > 0) {
delete data2.combinationActivityId;
}
if (!(data.combinationHeadId > 0)) {
delete data2.combinationHeadId;
}
// 解决 SpringMVC 接受 List<Item> 参数的问题
delete data2.items;
for (let i = 0; i < data.items.length; i++) {
@ -28,6 +34,10 @@ const OrderApi = {
return request({
url: `/app-api/trade/order/settlement?${queryString}`,
method: 'GET',
custom: {
showError: true,
showLoading: true,
},
});
},
// 创建订单