|
@@ -15,7 +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, orderStatusEnum } from '@/api/order'
|
|
import { orderList, orderStatusEnum } from '@/api/order'
|
|
import { formatNumber } from '@/utils'
|
|
import { formatNumber } from '@/utils'
|
|
-import { toPage } from '@/utils/page'
|
|
|
|
|
|
+import { getPageParams, toPage } from '@/utils/page'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'MyOrders', // 我的订单
|
|
name: 'MyOrders', // 我的订单
|
|
@@ -80,8 +80,20 @@ async function queryList(pageNo: number, pageSize: number) {
|
|
paging.value.complete(false)
|
|
paging.value.complete(false)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-onLoad(() => {
|
|
|
|
|
|
+onLoad((options) => {
|
|
getOrderStatus()
|
|
getOrderStatus()
|
|
|
|
+
|
|
|
|
+ // 处理页面参数,如果有type参数则切换到对应的tab
|
|
|
|
+ if (options) {
|
|
|
|
+ const params = getPageParams(options)
|
|
|
|
+ if (params.type !== undefined) {
|
|
|
|
+ // 确保type值在有效范围内
|
|
|
|
+ const typeValue = Number(params.type)
|
|
|
|
+ if (typeValue >= 0 && typeValue <= 4) {
|
|
|
|
+ tab.value = typeValue
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
|