feat: 增加现金支付

This commit is contained in:
HongRun Liu
2026-08-05 10:51:29 +08:00
parent 1daec0121b
commit 25da673443
16 changed files with 1535 additions and 1230 deletions
+41 -13
View File
@@ -72,7 +72,11 @@
<view class="copy" @click.stop="onCopy">
<image :src="`${$url}goods/copy2.svg`" mode="scaleToFill" />
</view>
<truckLine :data="state.orderInfo" :code="1" v-if="state.orderInfo.deliveryTime"></truckLine>
<truckLine
:data="state.orderInfo"
:code="1"
v-if="state.orderInfo.deliveryTime"
></truckLine>
</view>
<view class="notice-item flex-row ju-between">
<text class="title c0">下单时间</text>
@@ -103,8 +107,14 @@
@now="nowShipment"
@confirm="confirmReceiveOrder"
@pay="goPay"
@cancel="cancelAiOrder"
/>
<card_orderBan v-else :data="state.orderInfo" @downData="getOrderDetail" type="2"></card_orderBan>
<card_orderBan
v-else
:data="state.orderInfo"
@downData="getOrderDetail"
type="2"
></card_orderBan>
</view>
</su-fixed>
</s-pages>
@@ -114,10 +124,7 @@
import sheep from '@/sheep';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { computed, reactive, ref } from 'vue';
import {
fen2yuan,
handleOrderButtons,
} from '@/sheep/hooks/useGoods';
import { fen2yuan, handleOrderButtons } from '@/sheep/hooks/useGoods';
import OrderApi from '@/sheep/api/trade/order';
import {
aiDelayedShipment,
@@ -126,11 +133,13 @@
giftConfirmReceive,
getOrderDetail as getAiOrderDetail,
getOpenOrderDetail,
cancelOrder as cancelAiOrderRequest,
cancelOpenOrder,
} from '@/sheep/api/ai';
import StoreApi from '@/sheep/api/trade/store';
import card_order from '@/components/orderItem/card_order.vue';
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
import truckLine from '@/components/truckLine/truckLine.vue'
import truckLine from '@/components/truckLine/truckLine.vue';
import PickUpVerify from '@/pages/order/pickUpVerify.vue';
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png');
@@ -143,7 +152,6 @@
source: '',
});
// ========== 门店自提(核销) ==========
const systemStore = ref({}); // 门店信息
@@ -178,7 +186,7 @@
const status = Number(state.orderInfo?.status);
if ([0, 20].includes(status)) return true;
if (isPickUpOrder.value) return false;
return [10, 50].includes(status);
return [10, 50, 70].includes(status);
});
const resolvePickUpStoreId = (data = {}) => {
@@ -256,9 +264,10 @@
const confirmReceiveOrder = async () => {
const id = resolveAiOrderId(state.orderInfo);
if (!id) return;
const req = Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
? giftConfirmReceive
: aiConfirmReceive;
const req =
Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
? giftConfirmReceive
: aiConfirmReceive;
const { code } = await req({ id });
if (code === 0) {
getOrderDetail();
@@ -281,6 +290,25 @@
});
};
const cancelAiOrder = () => {
const id = resolveAiOrderId(state.orderInfo);
if (!id) return;
uni.showModal({
title: '提示',
content: '确定要取消订单吗?',
confirmColor: '#FA7E31',
success: async (res) => {
if (!res.confirm) return;
const request =
Number(state.orderInfo?.type) === 5 || String(state.orderType) === '5'
? cancelOpenOrder
: cancelAiOrderRequest;
const result = await request({ id });
if (result.code === 0) await getOrderDetail();
},
});
};
async function getOrderDetail() {
let id = state.orderInfo.id;
// 对详情数据进行适配
@@ -350,7 +378,7 @@
type: 1,
},
{
title: "随机优惠",
title: '随机优惠',
value: 'randomDiscountPrice',
type: 1,
},
+6
View File
@@ -72,6 +72,7 @@
:data="v"
@downData="downCallback(state.currentTab)"
:index="state.currentTab"
:isAfterSale="tabMaps[state.currentTab].id === 4"
>
</orderItem>
</view>
@@ -119,6 +120,11 @@
name: '待支付',
value: 0,
},
{
id: 70,
name: '现金待确认',
value: 70,
},
{
id: 10,
name: '待发货',