feat: 创建订单接口
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user