From 535cbc02e7466b7e31872811f3c231113283d9c6 Mon Sep 17 00:00:00 2001 From: lzhizhao <790086754@qq.com> Date: Sun, 17 Aug 2025 13:28:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=86=E9=A1=B5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/marketing.js | 30 +++++++++++-------- src/api/modules/mer_admin.js | 9 ++++-- .../modules/marketing/points-mall/index.vue | 25 ++++++++++------ .../points-mall/popup/product-selector.vue | 21 ++++++++----- 4 files changed, 55 insertions(+), 30 deletions(-) diff --git a/src/api/modules/marketing.js b/src/api/modules/marketing.js index 955c0ba..152224c 100644 --- a/src/api/modules/marketing.js +++ b/src/api/modules/marketing.js @@ -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 }); }, diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index 3055847..5c97df2 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -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 => { diff --git a/src/views/modules/marketing/points-mall/index.vue b/src/views/modules/marketing/points-mall/index.vue index 23227fe..1d06328 100644 --- a/src/views/modules/marketing/points-mall/index.vue +++ b/src/views/modules/marketing/points-mall/index.vue @@ -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 => { diff --git a/src/views/modules/marketing/points-mall/popup/product-selector.vue b/src/views/modules/marketing/points-mall/popup/product-selector.vue index 73f2733..352e4cf 100644 --- a/src/views/modules/marketing/points-mall/popup/product-selector.vue +++ b/src/views/modules/marketing/points-mall/popup/product-selector.vue @@ -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 => {