|
@@ -32,11 +32,11 @@
|
|
</view>
|
|
</view>
|
|
<view class="packing-fee">
|
|
<view class="packing-fee">
|
|
<text>打包费</text>
|
|
<text>打包费</text>
|
|
- <text>${{ deliveryOrderDto.packCharge }}</text>
|
|
|
|
|
|
+ <text>${{ deliveryOrderDto.packCharge || 0 }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="delivery-fee">
|
|
<view class="delivery-fee">
|
|
<text>配送费</text>
|
|
<text>配送费</text>
|
|
- <text>${{ deliveryOrderDto.deliveryFee }}</text>
|
|
|
|
|
|
+ <text>${{ deliveryOrderDto.deliveryFee || 0 }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="line"></view>
|
|
<view class="line"></view>
|
|
<view class="total-fee">
|
|
<view class="total-fee">
|
|
@@ -80,6 +80,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { reactive, ref } from 'vue';
|
|
import { reactive, ref } from 'vue';
|
|
import { createOrder } from '@/api/food';
|
|
import { createOrder } from '@/api/food';
|
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
import BottomSafeWrapper from '@/components/bottom-safe-wrapper/index.vue';
|
|
import BottomSafeWrapper from '@/components/bottom-safe-wrapper/index.vue';
|
|
|
|
|
|
@@ -148,7 +149,9 @@ async function settlement() {
|
|
number: i.count,
|
|
number: i.count,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- // const { data } = await createOrder({ deliveryOrderItemsDtoList, deliveryOrderDto });
|
|
|
|
|
|
+ deliveryOrderDto.orderTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
+ const { data } = await createOrder({ deliveryOrderItemsDtoList, deliveryOrderDto });
|
|
|
|
+ deliveryOrderDto.docNo = data;
|
|
await uni.setStorageSync('deliveryOrderDto', JSON.stringify(deliveryOrderDto));
|
|
await uni.setStorageSync('deliveryOrderDto', JSON.stringify(deliveryOrderDto));
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: "/pages/profile/order/order-detail/index",
|
|
url: "/pages/profile/order/order-detail/index",
|
|
@@ -157,7 +160,7 @@ async function settlement() {
|
|
|
|
|
|
const totalPrice = computed(() => {
|
|
const totalPrice = computed(() => {
|
|
const sum = cartItems.value.reduce((sum, item) => sum + item.price * item.count, 0);
|
|
const sum = cartItems.value.reduce((sum, item) => sum + item.price * item.count, 0);
|
|
- const orderAmount = parseFloat(sum.toFixed(2)) + Number(deliveryOrderDto.packCharge) + Number(deliveryOrderDto.deliveryFee);
|
|
|
|
|
|
+ const orderAmount = parseFloat(sum.toFixed(2)) + Number(deliveryOrderDto.packCharge || 0) + Number(deliveryOrderDto.deliveryFee || 0);
|
|
deliveryOrderDto.orderAmount = orderAmount;
|
|
deliveryOrderDto.orderAmount = orderAmount;
|
|
deliveryOrderDto.payAmount = orderAmount;
|
|
deliveryOrderDto.payAmount = orderAmount;
|
|
return orderAmount;
|
|
return orderAmount;
|