diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js
index 019e790..0447eb5 100644
--- a/src/api/modules/mer_admin.js
+++ b/src/api/modules/mer_admin.js
@@ -14,15 +14,15 @@ export const mer_admin = {
* @param {string} params.code
* @returns
*/
- loginByAccount: (params) => {
+ loginByAccount: params => {
return $http.post(`/merchant-api/auth/login`, {
- ...params,
+ ...params
});
},
- loginByMobile: (params) => {
+ loginByMobile: params => {
return $http.post(`/merchant-api/auth/sms/login`, {
...params,
- type: 2,
+ type: 2
});
},
getYZM(mobile) {
@@ -33,51 +33,54 @@ export const mer_admin = {
},
//商品管理
//保存商品信息
- saveProduct: (data) => {
+ saveProduct: data => {
return $http.post(`/merchant-api/product/save`, data);
},
//保存商品基本信息
- saveProductBase: (data) => {
+ saveProductBase: data => {
return $http.post(`/merchant-api/product/save/basic`, data);
},
//返回商品分类以及列表(聚合)
- getPolyProduct: (data) => {
+ getPolyProduct: data => {
return $http.post(`/merchant-api/product/polymerization/list`, data);
},
//商品分页
- getProductPage: (data) => {
- return $http.post(`/merchant-api/product/page?pageNumber=${data.p.pageNumber}&pageSize=${data.p.pageSize}`, data);
+ getProductPage: data => {
+ return $http.post(
+ `/merchant-api/product/page?pageNumber=${data.p.pageNumber}&pageSize=${data.p.pageSize}`,
+ data
+ );
},
//商品概况
- getProductOverview: (data) => {
+ getProductOverview: data => {
return $http.post(`/merchant-api/product/overview`, data);
},
//商户商品分类
- getProductCategory: (data) => {
+ getProductCategory: data => {
return $http.request({
url: `/merchant-api/product/category/list`,
method: "get",
- params: data,
+ params: data
});
},
//上架或下架
- putOnShelvesProducts: (data) => {
+ putOnShelvesProducts: data => {
return $http.post(`/merchant-api/product/batch/update/status`, data);
},
//批量删除商品
- BatchDeleteProducts: (data) => {
+ BatchDeleteProducts: data => {
return $http.post(`/merchant-api/product/batch/delete`, data);
},
//打折扣
- setDiscounts: (data) => {
+ setDiscounts: data => {
return $http.post(`merchant-api/activity/save`, data);
},
//获取销售单位
- getSaleUnit: (data) => {
+ getSaleUnit: data => {
return $http.request({
url: `/merchant-api/product/unit/list`,
method: "get",
- params: data,
+ params: data
});
},
//文件上传
@@ -93,92 +96,92 @@ export const mer_admin = {
return $http.get(`/merchant-api/common/pca`);
},
//添加运费模板
- addShippingTemplate: (data) => {
+ addShippingTemplate: data => {
return $http.post(`/merchant-api/shippingTemplates/add`, data);
},
//删除模板
- removeShippingTemplate: (id) => {
+ removeShippingTemplate: id => {
return $http.post(
`/merchant-api/shippingTemplates/delete`,
qs.stringify({
- id,
+ id
}),
{
headers: {
- "Content-Type": "application/x-www-form-urlencoded",
- },
+ "Content-Type": "application/x-www-form-urlencoded"
+ }
}
);
},
//更新模板
- updateShippingTemplate: (data) => {
+ updateShippingTemplate: data => {
return $http.post(`/merchant-api/shippingTemplates/update`, data);
},
//获取模板分页
- getShippingTemplatePage: (data) => {
+ getShippingTemplatePage: data => {
return $http.request({
method: "get",
url: "/merchant-api/shippingTemplates/page",
- params: data,
+ params: data
});
},
//获取配送模板列表
- getShippingTemplateList: (data) => {
+ getShippingTemplateList: data => {
return $http.request({
method: "get",
url: "/merchant-api/shippingTemplates/list",
- params: data,
+ params: data
});
},
//获取模板详情
- getShippingTemplateInfo: (id) => {
+ getShippingTemplateInfo: id => {
return $http.request({
method: "get",
url: "/merchant-api/shippingTemplates/detail",
hidemsg: true,
- params: { id },
+ params: { id }
});
},
//银行卡分页
- bankCardPage: (data) => {
+ bankCardPage: data => {
return $http.request({
method: "get",
url: "/merchant-api/bank/page",
- params: data,
+ params: data
});
},
//添加商家端私账银行卡
- bankCardAdd: (data) => {
+ bankCardAdd: data => {
return $http.post(`/merchant-api/bank/pri-create`, data);
},
//添加商家端公账银行卡
- publicAccountBankCardAdd: (data) => {
+ publicAccountBankCardAdd: data => {
return $http.post(`/merchant-api/bank/pub-create`, data);
},
//删除银行卡
- bankCardDelete: (data) => {
+ bankCardDelete: data => {
return $http.post(`/merchant-api/bank/delete?id=${data}`);
},
//设置默认银行卡
- defaultBank: (data) => {
+ defaultBank: data => {
return $http.post(
`/merchant-api/bank/default-bank?linkId=${data.linkId}&bankId=${data.bankId}`
);
},
//获取银行卡详情
- bankCardDetail: (id) => {
+ bankCardDetail: id => {
return $http.request({
method: "get",
url: "/merchant-api/bank/detail",
- params: { id },
+ params: { id }
});
},
//市场下的店铺列表
- storeList: (data) => {
+ storeList: data => {
return $http.request({
method: "get",
url: `/merchant-api/market/shop_list`,
- params: data,
+ params: data
});
},
//获取品牌信息
@@ -186,111 +189,111 @@ export const mer_admin = {
return $http.request({
method: "get",
url: `/merchant-api/brand/info`,
- params: {},
+ params: {}
});
},
//编辑品牌信息
- editBrandInfo: (data) => {
+ editBrandInfo: data => {
return $http.put(`/merchant-api/brand/edit`, data);
},
//修改密码
- changePassword: (data) => {
+ changePassword: data => {
return $http.put(`/merchant-api/auth/change/pwd`, data);
},
//修改简单密码
- simplePassword: (data) => {
+ simplePassword: data => {
return $http.put(`/merchant-api/auth/update_password`, data);
},
//修改管理员
- editAdmin: (data) => {
+ editAdmin: data => {
return $http.put(`/merchant-api/brand/change/administrator`, data);
},
//获取验证码
- getCaptcha: (data) => {
+ getCaptcha: data => {
return $http.request({
method: "get",
url: `/merchant-api/brand/sms_code`,
- params: data,
+ params: data
});
},
//全部订单管理
- orderPage: (data) => {
+ orderPage: data => {
return $http.request({
method: "get",
url: `/merchant-api/manager/order/page`,
- params: data,
+ params: data
});
},
//根据店铺查询订单
- shopOrderPage: (data) => {
+ shopOrderPage: data => {
return $http.request({
method: "get",
url: `/merchant-api/manager/merchant/order/page`,
- params: data,
+ params: data
});
},
// 轮播图分页
- bannerPage: (data) => {
+ bannerPage: data => {
return $http.request({
method: "get",
url: `/admin-api/banner/page`,
- params: data,
+ params: data
});
},
// 轮播图添加
- bannerAdd: (data) => {
+ bannerAdd: data => {
return $http.post(`/admin-api/banner/add`, data);
},
//编辑轮播图
- bannerUpdate: (data) => {
+ bannerUpdate: data => {
return $http.post(`/admin-api/banner/update`, data);
},
//删除轮播图
- bannerDelete: (data) => {
+ bannerDelete: data => {
return $http.post(`/admin-api/banner/delete`, data);
},
//排序轮播图
- sortBanner: (data) => {
+ sortBanner: data => {
return $http.post(`/admin-api/banner/update/sort`, data);
},
// 公告分页
- noticePage: (data) => {
+ noticePage: data => {
return $http.request({
method: "get",
url: `/admin-api/notice/page`,
- params: data,
+ params: data
});
},
// 公告添加
- noticeAdd: (data) => {
+ noticeAdd: data => {
return $http.post(`/admin-api/notice/add`, data);
},
//编辑公告
- noticeUpdate: (data) => {
+ noticeUpdate: data => {
return $http.post(`/admin-api/notice/update`, data);
},
//删除公告
- noticeDelete: (data) => {
+ noticeDelete: data => {
return $http.post(`/admin-api/notice/delete`, data);
},
//排序公告
- sortnotice: (data) => {
+ sortnotice: data => {
return $http.post(`/admin-api/notice/update/sort`, data);
},
//品牌和分销商的订单
- distributorOrBrandOrderPage: (data) => {
+ distributorOrBrandOrderPage: data => {
return $http.request({
method: "get",
url: `/merchant-api/backend/order/page`,
- params: data,
+ params: data
});
},
//订单概述
- orderOverview: (data) => {
+ orderOverview: data => {
return $http.request({
method: "get",
url: `/merchant-api/backend/order/overview`,
- params: data,
+ params: data
});
},
/**
@@ -298,11 +301,11 @@ export const mer_admin = {
* @param {object} data 查询参数
* @returns {Promise}
*/
- getApplyRecord: (data) => {
+ getApplyRecord: data => {
return $http.request({
method: "get",
url: "/merchant-api/distribution/apply_record",
- params: data,
+ params: data
});
},
/**
@@ -310,11 +313,11 @@ export const mer_admin = {
* @param {object} data 审核参数
* @returns {Promise}
*/
- auditApplyRecord: (data) => {
+ auditApplyRecord: data => {
return $http.request({
method: "put",
url: "/merchant-api/distribution/audit",
- params: data,
+ params: data
});
},
/**
@@ -322,11 +325,14 @@ export const mer_admin = {
* @param {object} data 审核参数
* @returns {Promise}
*/
- passAllApplyRecord: (data) => {
+ passAllApplyRecord: data => {
return $http.request({
method: "put",
url: "/merchant-api/distribution/pass_all",
- params: data,
+ params: data
});
},
+ membershipEnableList: data => {
+ return $http.post(`/merchant-api/membershipEnable/list`, data);
+ }
};
diff --git a/src/views/modules/marketing/level/index.vue b/src/views/modules/marketing/level/index.vue
index 266583c..deefeb0 100644
--- a/src/views/modules/marketing/level/index.vue
+++ b/src/views/modules/marketing/level/index.vue
@@ -43,18 +43,16 @@
-
+
-
- {{ scope.row.memberLevels.join(", ") }}
+
+ {{ scope.row.levelInfo }}
-
@@ -102,28 +100,31 @@ export default {
},
getList() {
- // 根据选择的摊铺ID筛选数据
+ // 根据选择的摊铺ID查询数据
if (this.formInline.shopIds.length === 0) {
this.tableData = [];
return;
}
- const selectedStores = this.storeList.filter(store =>
- this.formInline.shopIds.includes(store.shopId)
- );
-
- this.tableData = selectedStores.map(store => ({
- shopId: store.shopId,
- shopName: store.shopName,
- enableMember: Math.random() > 0.5, // 随机生成启用状态
- memberLevels: this.generateRandomLevels()
- }));
- },
-
- generateRandomLevels() {
- const levels = ["lv1", "lv2", "lv3", "lv4"];
- const count = Math.floor(Math.random() * 4) + 1;
- return levels.slice(0, count);
+ // 调用membershipEnableList接口
+ this.$api.mer_admin
+ .membershipEnableList({
+ shopIdList: this.formInline.shopIds.join(",")
+ })
+ .then(res => {
+ console.log("会员等级列表数据:", res);
+ if (res.data && res.data.code == 200) {
+ this.tableData = res.data.data || [];
+ } else {
+ this.$message.error(res.data?.message || "获取会员等级列表失败");
+ this.tableData = [];
+ }
+ })
+ .catch(err => {
+ console.error("获取会员等级列表失败:", err);
+ this.$message.error("获取会员等级列表失败");
+ this.tableData = [];
+ });
},
handleShopChange() {
@@ -136,9 +137,13 @@ export default {
"Toggle member for shop:",
row.shopName,
"Enable:",
- row.enableMember
+ row.enable
);
// 这里应该调用API更新状态
+ // 可以根据需要添加更新接口调用
+ this.$message.success(
+ `${row.shopName} 会员功能已${row.enable ? "启用" : "禁用"}`
+ );
},
// 关闭已打开的等级明细页面