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

View File

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

View File

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

View File

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