feat: 分页参数问题处理

This commit is contained in:
lzhizhao 2025-08-17 13:28:14 +08:00
parent 70133838a0
commit 535cbc02e7
4 changed files with 55 additions and 30 deletions

View File

@ -2,11 +2,12 @@ import $http from "@/utils/httpRequest.js";
export const marketing = { export const marketing = {
// 会员等级列表 // 会员等级列表
marketingLevelPage: data => { marketingLevelPage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/memberUnitMemberLevel/list`, url: `/merchant-api/memberUnitMemberLevel/list`,
method: "post", method: "post",
data data,
params
}); });
}, },
addMarketingLevel: data => { addMarketingLevel: data => {
@ -41,11 +42,12 @@ export const marketing = {
}); });
}, },
//会员用户 //会员用户
marketingUserPage: data => { marketingUserPage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/membershipUser/page`, url: `/merchant-api/membershipUser/page`,
method: "post", method: "post",
data data,
params
}); });
}, },
memberUnitUserDetail: data => { memberUnitUserDetail: data => {
@ -163,19 +165,21 @@ export const marketing = {
}); });
}, },
//积分明细分页查询 //积分明细分页查询
pointsChangePage: data => { pointsChangePage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/membershipUser/pointsChangePage`, url: `/merchant-api/membershipUser/pointsChangePage`,
method: "post", method: "post",
data data,
params
}); });
}, },
//成长值变化分页查询 //成长值变化分页查询
growthValueChangePage: data => { growthValueChangePage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/membershipUser/growthValueChangePage`, url: `/merchant-api/membershipUser/growthValueChangePage`,
method: "post", method: "post",
data data,
params
}); });
}, },
//获取会员优惠券列表 //获取会员优惠券列表
@ -189,11 +193,12 @@ export const marketing = {
// 新增积分商品相关接口 // 新增积分商品相关接口
// 获取积分商品分页信息 // 获取积分商品分页信息
membershipPointsProductPage: data => { membershipPointsProductPage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/membershipPointsProduct/page`, url: `/merchant-api/membershipPointsProduct/page`,
method: "post", method: "post",
data data,
params
}); });
}, },
@ -243,11 +248,12 @@ export const marketing = {
}, },
// 双倍积分商品列表 // 双倍积分商品列表
getDoublePointsProductPage: data => { getDoublePointsProductPage: (data, params) => {
return $http.request({ return $http.request({
url: `/merchant-api/product/double-points/page`, url: `/merchant-api/product/double-points/page`,
method: "post", method: "post",
data data,
params
}); });
}, },

View File

@ -52,8 +52,13 @@ export const mer_admin = {
); );
}, },
//商品规格分页 //商品规格分页
getProductSpecificationPage: data => { getProductSpecificationPage: (data, params) => {
return $http.post(`/merchant-api/product/specification/page`, data); return $http.request({
url: `/merchant-api/product/specification/page`,
method: "post",
data,
params
});
}, },
//商品概况 //商品概况
getProductOverview: data => { getProductOverview: data => {

View File

@ -249,19 +249,21 @@ export default {
methods: { methods: {
queryList(pageNo, pageSize) { queryList(pageNo, pageSize) {
// 使 // 使
const queryParams = { const data = {
shopIdList: this.formInline.shopIdList || [], shopIdList: this.formInline.shopIdList || [],
productId: this.formInline.productId || "", productId: this.formInline.productId || "",
productName: this.formInline.productName || "", productName: this.formInline.productName || ""
// productSpecId: this.formInline.productSpecId || "", // productSpecId: this.formInline.productSpecId || "",
// productSpecName: this.formInline.productSpecName || "", // productSpecName: this.formInline.productSpecName || "",
// 使 };
const params = {
pageNumber: pageNo, pageNumber: pageNo,
pageSize: pageSize pageSize: pageSize
}; };
this.$api.marketing this.$api.marketing
.membershipPointsProductPage(queryParams) .membershipPointsProductPage(data, params)
.then(res => { .then(res => {
console.log(res); console.log(res);
this.$refs.oTable.complete( this.$refs.oTable.complete(
@ -330,7 +332,7 @@ export default {
}, },
// //
queryDoublePointsList(pageNo, pageSize) { queryDoublePointsList(pageNo, pageSize) {
const queryParams = { const data = {
shopIdList: this.doublePointsFormInline.shopIdList || [], shopIdList: this.doublePointsFormInline.shopIdList || [],
shopName: this.doublePointsFormInline.shopName || "", shopName: this.doublePointsFormInline.shopName || "",
productName: this.doublePointsFormInline.productName || "", productName: this.doublePointsFormInline.productName || "",
@ -339,17 +341,22 @@ export default {
}; };
// enableDoublePointsnull // enableDoublePointsnull
if (queryParams.enableDoublePoints === null) { if (data.enableDoublePoints === null) {
delete queryParams.enableDoublePoints; delete data.enableDoublePoints;
} }
const params = {
pageNumber: pageNo,
pageSize: pageSize
};
this.$api.marketing this.$api.marketing
.getDoublePointsProductPage(queryParams) .getDoublePointsProductPage(data, params)
.then(res => { .then(res => {
console.log("双倍积分列表:", res); console.log("双倍积分列表:", res);
this.$refs.doublePointsTable.complete( this.$refs.doublePointsTable.complete(
res.data.data.data || [], res.data.data.data || [],
res.data.data.data ? res.data.data.data.length : 0 Number(res.data.data.total || 0)
); );
}) })
.catch(err => { .catch(err => {

View File

@ -167,17 +167,24 @@ export default {
loadProducts() { loadProducts() {
this.loading = true; this.loading = true;
// //
const data = {
shopIdList: [], //
shopName: this.searchForm.shopName || "",
productName: this.searchForm.productName || "",
productId: this.searchForm.productId || ""
};
const params = {
pageNumber: this.pagination.currentPage,
pageSize: this.pagination.pageSize
};
this.$api.mer_admin this.$api.mer_admin
.getProductSpecificationPage({ .getProductSpecificationPage(data, params)
shopIdList: [], //
shopName: this.searchForm.shopName || "",
productName: this.searchForm.productName || "",
productId: this.searchForm.productId || ""
})
.then(res => { .then(res => {
console.log("商品规格列表:", res); console.log("商品规格列表:", res);
this.productList = res.data.data.data || []; this.productList = res.data.data.data || [];
this.pagination.total = this.productList.length; // 使 this.pagination.total = Number(res.data.data.total || 0);
this.loading = false; this.loading = false;
}) })
.catch(err => { .catch(err => {