feat: 分页参数问题处理
This commit is contained in:
parent
70133838a0
commit
535cbc02e7
|
@ -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
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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 {
|
|||
};
|
||||
|
||||
// 如果enableDoublePoints为null,则不传该参数
|
||||
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 => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue