diff --git a/pages/order/aftersale/list.vue b/pages/order/aftersale/list.vue index 7af6f328..64624960 100644 --- a/pages/order/aftersale/list.vue +++ b/pages/order/aftersale/list.vue @@ -49,13 +49,7 @@ import _ from 'lodash'; import { formatAfterSaleStatus, formatAfterSaleStatusDescription, handleAfterSaleButtons } from '@/sheep/hooks/useGoods'; import AfterSaleApi from '@/sheep/api/trade/afterSale'; - - const paginationNull = { - list: [], - total: 0, - pageNo: 1, - pageSize: 10 - }; + import { resetPagination } from '@/sheep/util'; const state = reactive({ currentTab: 0, @@ -94,7 +88,7 @@ // 切换选项卡 function onTabsChange(e) { - state.pagination = paginationNull + resetPagination(state.pagination); state.currentTab = e.index; getOrderList(); } @@ -126,7 +120,7 @@ } const { code } = await AfterSaleApi.cancelAfterSale(orderId); if (code === 0) { - state.pagination = paginationNull + resetPagination(state.pagination); await getOrderList(); } }, diff --git a/pages/order/list.vue b/pages/order/list.vue index 4b47f940..d9ac7080 100644 --- a/pages/order/list.vue +++ b/pages/order/list.vue @@ -91,13 +91,7 @@ isEmpty } from 'lodash'; import OrderApi from '@/sheep/api/trade/order'; - - const paginationNull = { - list: [], - total: 0, - pageNo: 1, - pageSize: 5, - }; + import { resetPagination } from '@/sheep/util'; // 数据 const state = reactive({ @@ -138,7 +132,7 @@ return; } // 重头加载代码 - state.pagination = paginationNull; + resetPagination(state.pagination); state.currentTab = e.index; getOrderList(); } @@ -191,8 +185,8 @@ // 正常的确认收货流程 const { code } = await OrderApi.receiveOrder(order.id); if (code === 0) { - state.pagination = paginationNull; - await getOrderList(); + resetPagination(state.pagination); + await getOrderList(); } } @@ -315,7 +309,7 @@ // 下拉刷新 onPullDownRefresh(() => { - state.pagination = paginationNull; + resetPagination(state.pagination); getOrderList(); setTimeout(function() { uni.stopPullDownRefresh();