feat:货品接口带分页

This commit is contained in:
2026-09-02 18:47:30 +08:00
parent 469451232a
commit b1d3ec9b2f
5 changed files with 27 additions and 23 deletions
+8 -12
View File
@@ -47,7 +47,7 @@
import Header from '@/components/common/header.vue';
import TopSafe from '@/components/common/top-safe.nvue';
import MyBtn from '@/components/common/my-btn.vue';
import { searchList } from '@/api/product.js';
import { searchList, getSearchGoodsList } from '@/api/product.js';
import { getAcctBalance } from "@/api/finance.js";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
@@ -146,21 +146,17 @@ export default {
minDeduction: currentSwiperItem.minDeduction || 0,
maxDeduction: currentSwiperItem.maxDeduction || 999999,
};
searchList(params).then((res) => {
let curPageLen = res.data ? res.data.length : 0;
let totalCount = (res.data && res.data.total !== undefined)
? res.data.total
: ((res.data && res.data.totalCount !== undefined)
? res.data.totalCount
: (res.total !== undefined ? res.total : (res.totalCount !== undefined ? res.totalCount : 0)));
getSearchGoodsList(params).then((res) => {
let resData = res.data || {};
let curList = resData.entitys || [];
let curPageLen = curList.length;
let totalCount = resData.totalCount !== undefined ? resData.totalCount : 0;
if (page.num === 1) this.dataList = [];
if (res.data) {
this.dataList = this.dataList.concat(res.data);
}
this.dataList = this.dataList.concat(curList);
this.waterfall();
this.mescroll.endBySize(curPageLen, totalCount);
this.mescroll && this.mescroll.endBySize(curPageLen, totalCount);
}).catch(() => {
this.mescroll && this.mescroll.endErr();
});