创建订单
This commit is contained in:
@@ -34,6 +34,9 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { FormatBytes, FormatDate } from '@/utils/tools'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { CreateOrder } from '@/api/shoppingCart'
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
list: {
|
||||
type: Array,
|
||||
@@ -57,7 +60,11 @@
|
||||
})
|
||||
const totalAmount = computed(() => props.list.reduce((pre, cur) => pre + cur.amount, 0).toFixed(2))
|
||||
const handleCheckout = () => {
|
||||
console.log('购买:', props.list)
|
||||
const ids = props.list.map((v: any) => v.listingId)
|
||||
console.log('购买:', ids)
|
||||
CreateOrder(ids, true).then((res) => {
|
||||
router.go(0)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user