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