feat: 创建订单接口

This commit is contained in:
2026-05-21 14:55:31 +08:00
parent 8c080d3e22
commit d772cae6bc
3 changed files with 61 additions and 30 deletions

View File

@@ -74,8 +74,9 @@
</template>
<script setup lang="ts">
import { computed, shallowRef } from 'vue'
import { computed, shallowRef, onMounted,ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { fetchMyOrders } from '@/api/user'
import ScItem from '@/views/shoppingCart/sc-item.vue'
type OrderStatus = 'all' | 'paid' | 'unpaid' | 'cancelled'
@@ -211,6 +212,20 @@ const getOrderActionLabel = (status: ActualOrderStatus) => {
if (status === 'unpaid') return t('Wardrobe.orders.actions.completePayment')
return t('Wardrobe.orders.actions.buyAgain')
}
const orderParams =ref({
page: 1,
pageSize: 10,
status: ''
})
const fetchAllOrders = () => {
fetchMyOrders(orderParams.value)
}
onMounted(() => {
fetchAllOrders()
})
</script>
<style lang="less" scoped>