diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index 33168cd..82ae6d2 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -1,67 +1,86 @@ -import $http from '@/utils/httpRequest.js' -import city_data from '@/utils/country-level2-data.js' +import $http from "@/utils/httpRequest.js"; +import city_data from "@/utils/country-level2-data.js"; export const mer_admin = { - /** - * 登录 - * @param {object} params LoginParam - * @param {number} params.type - * @param {string} params.role - * @param {string} params.username - * @param {string} params.password - * @param {string} params.mobile - * @param {string} params.code - * @returns - */ - loginByAccount: (params) => { - return $http.post(`/auth/login`, { - ...params, - type: 1 - }) - }, - loginByMobile: (params) => { - return $http.post(`/merchant-api/auth/sms/login`, { - ...params, - type: 2 - }) - }, - getYZM(mobile) { - return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); - }, - getInfo() { - return $http.get(`/merchant-api/auth/info`); - }, - //商品管理 - //保存商品信息 - saveProduct: (data) => { - return $http.post(`/merchant-api/product/save`, data); - }, - //保存商品基本信息 - saveProductBase: (data) => { - return $http.post(`/merchant-api/product/save/basic`, data); - }, - //返回商品分类以及列表(聚合) - getPolyProduct: (data) => { - return $http.post(`/merchant-api/product/polymerization/list`, data); - }, - //商品分页 - getProductPage: (data) => { - return $http.post(`/merchant-api/product/page`, data); - }, - //商户商品分类 - getProductCategory: () => { - return $http.get(`/merchant-api/product/category/list?shopId=${JSON.parse(sessionStorage.getItem('userInfo')).shopId}`); - }, - //获取销售单位 - getSaleUnit: (data) => { - return $http.request({ url: `/merchant-api/product/unit/list`, method: 'get', params: data }); - }, - //文件上传 - uploadFile:()=>{ - return `${window.SITE_CONFIG['baseUrl']}/merchant-api/file/upload` - }, - //直接获取城市数据 - getCityOptions:()=>{ - return city_data; - } -} \ No newline at end of file + /** + * 登录 + * @param {object} params LoginParam + * @param {number} params.type + * @param {string} params.role + * @param {string} params.username + * @param {string} params.password + * @param {string} params.mobile + * @param {string} params.code + * @returns + */ + loginByAccount: (params) => { + return $http.post(`/auth/login`, { + ...params, + type: 1, + }); + }, + loginByMobile: (params) => { + return $http.post(`/merchant-api/auth/sms/login`, { + ...params, + type: 2, + }); + }, + getYZM(mobile) { + return $http.get(`/merchant-api/auth/login/code?mobile=${mobile}`); + }, + getInfo() { + return $http.get(`/merchant-api/auth/info`); + }, + //商品管理 + //保存商品信息 + saveProduct: (data) => { + return $http.post(`/merchant-api/product/save`, data); + }, + //保存商品基本信息 + saveProductBase: (data) => { + return $http.post(`/merchant-api/product/save/basic`, 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 + ); + }, + //商户商品分类 + getProductCategory: () => { + return $http.get( + `/merchant-api/product/category/list?shopId=${ + JSON.parse(sessionStorage.getItem("userInfo")).shopId + }` + ); + }, + //批量删除商品 + BatchDeleteProducts: (data) => { + return $http.post(`/merchant-api/product/batch/delete`, data); + }, + //上架或下架商品 + putOnShelvesProducts: (data) => { + return $http.post(`/merchant-api/product/batch/update/status`, data); + }, + //获取销售单位 + getSaleUnit: (data) => { + return $http.request({ + url: `/merchant-api/product/unit/list`, + method: "get", + params: data, + }); + }, + //文件上传 + uploadFile: () => { + return `${window.SITE_CONFIG["baseUrl"]}/merchant-api/file/upload`; + }, + //直接获取城市数据 + getCityOptions: () => { + return city_data; + }, +}; diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index 306fa01..8704e8c 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -1,10 +1,13 @@ diff --git a/src/views/modules/product/popup/add-or-update.vue b/src/views/modules/product/popup/add-or-update.vue index 236b45d..8e55662 100644 --- a/src/views/modules/product/popup/add-or-update.vue +++ b/src/views/modules/product/popup/add-or-update.vue @@ -10,7 +10,7 @@ :modalHandles="modalHandles" >