|
@@ -15,6 +15,7 @@ import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
|
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
|
|
import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
|
|
import { orderList } from '@/api/order'
|
|
import { orderList } from '@/api/order'
|
|
import { formatNumber } from '@/utils'
|
|
import { formatNumber } from '@/utils'
|
|
|
|
+import { toPage } from '@/utils/page'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'MyOrders', // 我的订单
|
|
name: 'MyOrders', // 我的订单
|
|
@@ -50,9 +51,10 @@ const tabList = ref<any>([
|
|
value: 4,
|
|
value: 4,
|
|
},
|
|
},
|
|
])
|
|
])
|
|
|
|
+
|
|
// 搜索结果
|
|
// 搜索结果
|
|
const dataList = ref<any[]>([])
|
|
const dataList = ref<any[]>([])
|
|
-async function queryList(pageNo, pageSize) {
|
|
|
|
|
|
+async function queryList(pageNo: number, pageSize: number) {
|
|
// 此处请求仅为演示,请替换为自己项目中的请求
|
|
// 此处请求仅为演示,请替换为自己项目中的请求
|
|
try {
|
|
try {
|
|
const res = await orderList({
|
|
const res = await orderList({
|
|
@@ -61,59 +63,54 @@ async function queryList(pageNo, pageSize) {
|
|
type: tab.value, // 根据tab的值来查询不同状态的订单
|
|
type: tab.value, // 根据tab的值来查询不同状态的订单
|
|
userId: userInfo.value.userId,
|
|
userId: userInfo.value.userId,
|
|
})
|
|
})
|
|
- paging.value[tab.value].complete(res.data.list)
|
|
|
|
|
|
+ paging.value.complete(res.data.list)
|
|
}
|
|
}
|
|
catch {
|
|
catch {
|
|
- paging.value[tab.value].complete(false)
|
|
|
|
|
|
+ paging.value.complete(false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-function toPage() {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/myOrders/orderDetail',
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
- <wd-tabs v-model="tab" swipeable sticky custom-class="bg-transparent!">
|
|
|
|
- <wd-tab v-for="tabItem in tabList" :key="tabItem" :title="tabItem.label" :value="tabItem.value">
|
|
|
|
- <z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
|
|
|
- <wd-card v-for="item in dataList" :key="item.orderId" type="rectangle" custom-class="px-24rpx! py-6rpx!" custom-content-class="py-18rpx!" custom-title-class="py-18rpx!" @click="toPage">
|
|
|
|
- <template #title>
|
|
|
|
- <view class="flex items-center justify-between">
|
|
|
|
- <view class="text-28rpx text-#000">
|
|
|
|
- Order ID:{{ item.orderId }}
|
|
|
|
- </view>
|
|
|
|
- <wd-text size="26rpx" type="primary" text="Completed" />
|
|
|
|
|
|
+ <z-paging ref="paging" v-model="dataList" use-page-scroll @query="queryList">
|
|
|
|
+ <template #top>
|
|
|
|
+ <wd-tabs v-model="tab" custom-class="bg-transparent!" @click="() => queryList(1, 20)">
|
|
|
|
+ <wd-tab v-for="tabItem in tabList" :key="tabItem.value" :title="tabItem.label" :name="tabItem.value" />
|
|
|
|
+ </wd-tabs>
|
|
|
|
+ </template>
|
|
|
|
+ <wd-card v-for="item in dataList" :key="item.orderId" type="rectangle" custom-class="px-24rpx! py-6rpx!" custom-content-class="py-18rpx!" custom-title-class="py-18rpx!" @click="toPage('/pages/myOrders/orderDetail', { id: item.orderId })">
|
|
|
|
+ <template #title>
|
|
|
|
+ <view class="flex items-center justify-between">
|
|
|
|
+ <view class="text-28rpx text-#000">
|
|
|
|
+ Order ID:{{ item.orderId }}
|
|
|
|
+ </view>
|
|
|
|
+ <wd-text size="26rpx" type="primary" text="Completed" />
|
|
|
|
+ </view>
|
|
|
|
+ </template>
|
|
|
|
+ <view class="flex items-center gap-24rpx">
|
|
|
|
+ <image
|
|
|
|
+ src="/static/images/avatar.jpg"
|
|
|
|
+ class="h-140rpx w-140rpx shrink-0"
|
|
|
|
+ />
|
|
|
|
+ <view class="flex-1">
|
|
|
|
+ <view class="line-clamp-2 text-28rpx text-#000">
|
|
|
|
+ SUCGLES for iPhone 14 Plus Case with MagSafe [Ultra Strong Magnetic]
|
|
|
|
+ </view>
|
|
|
|
+ <view class="py-4rpx text-24rpx text-#3A444C">
|
|
|
|
+ Color:Black Grey
|
|
|
|
+ </view>
|
|
|
|
+ <view class="flex items-center justify-between text-24rpx text-#3A444C">
|
|
|
|
+ <view>
|
|
|
|
+ ৳ {{ formatNumber(item.payPrice) }}
|
|
</view>
|
|
</view>
|
|
- </template>
|
|
|
|
- <view class="flex items-center gap-24rpx">
|
|
|
|
- <image
|
|
|
|
- src="/static/images/avatar.jpg"
|
|
|
|
- class="h-140rpx w-140rpx shrink-0"
|
|
|
|
- />
|
|
|
|
- <view class="flex-1">
|
|
|
|
- <view class="line-clamp-2 text-28rpx text-#000">
|
|
|
|
- SUCGLES for iPhone 14 Plus Case with MagSafe [Ultra Strong Magnetic]
|
|
|
|
- </view>
|
|
|
|
- <view class="py-4rpx text-24rpx text-#3A444C">
|
|
|
|
- Color:Black Grey
|
|
|
|
- </view>
|
|
|
|
- <view class="flex items-center justify-between text-24rpx text-#3A444C">
|
|
|
|
- <view>
|
|
|
|
- ৳ {{ formatNumber(item.payPrice) }}
|
|
|
|
- </view>
|
|
|
|
- <view>
|
|
|
|
- Quantity:1
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view>
|
|
|
|
+ Quantity:1
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </wd-card>
|
|
|
|
- </z-paging>
|
|
|
|
- </wd-tab>
|
|
|
|
- </wd-tabs>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </wd-card>
|
|
|
|
+ </z-paging>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|