修复订单列表 tab 切换叠加问题
parent
fe76f2fc90
commit
12332f0f30
|
@ -49,13 +49,7 @@
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { formatAfterSaleStatus, formatAfterSaleStatusDescription, handleAfterSaleButtons } from '@/sheep/hooks/useGoods';
|
import { formatAfterSaleStatus, formatAfterSaleStatusDescription, handleAfterSaleButtons } from '@/sheep/hooks/useGoods';
|
||||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||||
|
import { resetPagination } from '@/sheep/util';
|
||||||
const paginationNull = {
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10
|
|
||||||
};
|
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
currentTab: 0,
|
currentTab: 0,
|
||||||
|
@ -94,7 +88,7 @@
|
||||||
|
|
||||||
// 切换选项卡
|
// 切换选项卡
|
||||||
function onTabsChange(e) {
|
function onTabsChange(e) {
|
||||||
state.pagination = paginationNull
|
resetPagination(state.pagination);
|
||||||
state.currentTab = e.index;
|
state.currentTab = e.index;
|
||||||
getOrderList();
|
getOrderList();
|
||||||
}
|
}
|
||||||
|
@ -126,7 +120,7 @@
|
||||||
}
|
}
|
||||||
const { code } = await AfterSaleApi.cancelAfterSale(orderId);
|
const { code } = await AfterSaleApi.cancelAfterSale(orderId);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
state.pagination = paginationNull
|
resetPagination(state.pagination);
|
||||||
await getOrderList();
|
await getOrderList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -91,13 +91,7 @@
|
||||||
isEmpty
|
isEmpty
|
||||||
} from 'lodash';
|
} from 'lodash';
|
||||||
import OrderApi from '@/sheep/api/trade/order';
|
import OrderApi from '@/sheep/api/trade/order';
|
||||||
|
import { resetPagination } from '@/sheep/util';
|
||||||
const paginationNull = {
|
|
||||||
list: [],
|
|
||||||
total: 0,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 5,
|
|
||||||
};
|
|
||||||
|
|
||||||
// 数据
|
// 数据
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
@ -138,7 +132,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 重头加载代码
|
// 重头加载代码
|
||||||
state.pagination = paginationNull;
|
resetPagination(state.pagination);
|
||||||
state.currentTab = e.index;
|
state.currentTab = e.index;
|
||||||
getOrderList();
|
getOrderList();
|
||||||
}
|
}
|
||||||
|
@ -191,8 +185,8 @@
|
||||||
// 正常的确认收货流程
|
// 正常的确认收货流程
|
||||||
const { code } = await OrderApi.receiveOrder(order.id);
|
const { code } = await OrderApi.receiveOrder(order.id);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
state.pagination = paginationNull;
|
resetPagination(state.pagination);
|
||||||
await getOrderList();
|
await getOrderList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +309,7 @@
|
||||||
|
|
||||||
// 下拉刷新
|
// 下拉刷新
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
state.pagination = paginationNull;
|
resetPagination(state.pagination);
|
||||||
getOrderList();
|
getOrderList();
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
|
|
Loading…
Reference in New Issue