Commit dfc262f4 authored by liwenhong's avatar liwenhong

Merge branch 'lwh/goods-add-time'

# Conflicts:
#	src/pages/Activity/releaseProduc/index.vue
parents c4870fa3 a310011d
......@@ -16,168 +16,179 @@ const req = require("../utils/request").httpReq;
* };
*/
// 获取分类
exports.getCategoryList = async ctx => {
exports.getCategoryList = async (ctx) => {
const url = `${GOODS_URI}/goods/background/get_goods_category_list`;
const opts = {
url,
method: "GET"
method: "GET",
};
ctx.body = await req(ctx, opts);
};
// 获取商品列表
exports.getList = async ctx => {
exports.getList = async (ctx) => {
const url = `${GOODS_URI}/goods/background/get_goods_list`;
const opts = {
url,
method: "GET",
qs: ctx.request.query
qs: ctx.request.query,
};
ctx.body = await req(ctx, opts);
};
// 商品上架
exports.putOnline = async ctx => {
exports.putOnline = async (ctx) => {
const url = `${GOODS_URI}/goods/background/online`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 商品下架
exports.putOffline = async ctx => {
exports.putOffline = async (ctx) => {
const url = `${GOODS_URI}/goods/background/offline`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 设置商品上架
exports.putOnlineSite = async (ctx) => {
const url = `${GOODS_URI}/goods/background/online_site`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 获取商品详情列表
exports.getGoodsInfo = async ctx => {
exports.getGoodsInfo = async (ctx) => {
const url = `${GOODS_URI}/goods/background/get_goods_info`;
const opts = {
url,
method: "GET",
qs: ctx.request.query
qs: ctx.request.query,
};
ctx.body = await req(ctx, opts);
};
// 商品审核通过
exports.postSuccess = async ctx => {
exports.postSuccess = async (ctx) => {
const opts = {
url: `${GOODS_URI}/goods/background/audit_pass`,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 营销活动列表
exports.getMarketingList = async ctx => {
exports.getMarketingList = async (ctx) => {
const url = `${GOODS_URI}/marketing/background/marketing_list`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 检查商品名称是否被占用
exports.checkGoodsName = async ctx => {
exports.checkGoodsName = async (ctx) => {
const opts = {
url: `${GOODS_URI}/goods/background/check_goods_name`,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 获取查询活动列表
exports.getFindGoodsList = async ctx => {
exports.getFindGoodsList = async (ctx) => {
const url = `${GOODS_URI}/marketing/background/goods_list`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 审核拒绝
exports.auditReject = async ctx => {
exports.auditReject = async (ctx) => {
const opts = {
url: `${GOODS_URI}/goods/background/audit_reject`,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
}
};
// 添加活动列表
exports.getAddMarketingList = async ctx => {
exports.getAddMarketingList = async (ctx) => {
const url = `${GOODS_URI}/marketing/background/add_marketing`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 获取门店列表
exports.getShopsList = async ctx => {
exports.getShopsList = async (ctx) => {
const opts = {
url: `${GOODS_URI}/shop/background/shop_list`,
method: "GET",
qs: ctx.request.query
qs: ctx.request.query,
};
ctx.body = await req(ctx, opts);
};
// 添加门店
exports.addShop = async ctx => {
exports.addShop = async (ctx) => {
const opts = {
url: `${GOODS_URI}/shop/background/add_shop`,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
}
};
// 查看列表详情
exports.getMarketingInfo = async ctx => {
exports.getMarketingInfo = async (ctx) => {
const url = `${GOODS_URI}/marketing/background/marketing_info`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 修改商品
exports.editGoods = async ctx => {
exports.editGoods = async (ctx) => {
const opts = {
url: `${GOODS_URI}/goods/background/edit_goods`,
method: "POST",
json: true,
body: ctx.request.body
}
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 开启关闭状态
exports.updateMarketingList = async ctx => {
exports.updateMarketingList = async (ctx) => {
const url = `${GOODS_URI}/marketing/background/update_marketing`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
body: ctx.request.body,
};
const res = await req(ctx, opts);
ctx.body = res;
......
......@@ -49,6 +49,7 @@ router.get(`${API_VERSION}/get_goods_category_list`, goods.getCategoryList);
router.get(`${API_VERSION}/goods/background/get_goods_list`, goods.getList);
router.post(`${API_VERSION}/goods/background/online`, goods.putOnline);
router.post(`${API_VERSION}/goods/background/offline`, goods.putOffline);
router.post(`${API_VERSION}/goods/background/putOnlineSite`, goods.putOnlineSite);
router.get(`${API_VERSION}/goods/background/get_goods_info`, goods.getGoodsInfo);
router.post(`${API_VERSION}/goods/background/audit_pass`, goods.postSuccess);
router.post(`${API_VERSION}/goods/background/check_goods_name`, goods.checkGoodsName);
......
......@@ -17,6 +17,9 @@
}
}
}
.pick-time {
margin-left: 10px;
}
.commodity_list {
margin-top: 30px;
}
......
This diff is collapsed.
import axios from "@/utils/request";
// 获取商品分类项
export async function getGoodsList () {
export async function getGoodsList() {
const res = await axios.get("/api/v1/get_goods_category_list");
return res;
}
// 获取商品列表
export async function getList (params) {
export async function getList(params) {
const res = await axios.get("/api/v1/goods/background/get_goods_list", {
params
params,
});
return res;
}
// 商品上架
export async function putOnline (query) {
export async function putOnline(query) {
const res = await axios.post("/api/v1/goods/background/online", {
goods_spu_id: query
goods_spu_id: query,
});
return res;
}
// 商品下架
export async function putOffline (query) {
export async function putOffline(query) {
const res = await axios.post("/api/v1/goods/background/offline", {
goods_spu_id: query
goods_spu_id: query,
});
return res;
}
// 设置商品上架
export async function putOnlineSite(params) {
const res = await axios.post("/api/v1/goods/background/putOnlineSite", params);
return res;
}
// 获取商品详情列表
export async function getGoodsInfo (params) {
export async function getGoodsInfo(params) {
const res = await axios.get("/api/v1/goods/background/get_goods_info", {
params
params,
});
return res;
}
// 商品详情-审核通过
export async function postSuccess (query) {
export async function postSuccess(query) {
const res = await axios.post("/api/v1/goods/background/audit_pass", {
goods_spu_id: query
goods_spu_id: query,
});
return res;
}
// 审核拒绝
export async function auditReject (query) {
export async function auditReject(query) {
const res = await axios.post("/api/v1/goods/background/audit_reject", query);
return res;
}
// 商品详情-检查商品名称是否重复
export async function checkGoodsName (params) {
const res = await axios.post(
"/api/v1/goods/background/check_goods_name",
params
);
export async function checkGoodsName(params) {
const res = await axios.post("/api/v1/goods/background/check_goods_name", params);
return res;
}
// 获取门店表单
export async function getShopsList (params) {
export async function getShopsList(params) {
const res = await axios.get("/api/v1/shop/background/shop_list", { params });
return res;
}
// 添加门店信息
export async function postAddShop (query) {
export async function postAddShop(query) {
const res = await axios.post("/api/v1/shop/background/add_shop", query);
return res;
}
export async function editGoods (query) {
export async function editGoods(query) {
const res = await axios.post("/api/v1/goods/background/edit_goods", query);
return res;
}
// 获取营销活动列表
export async function getMarketingList (params) {
export async function getMarketingList(params) {
const res = await axios.post("/api/v1/get_marketing_list", params);
return res;
}
// 获取查询商品列表
export async function getFindGoodsList (params) {
export async function getFindGoodsList(params) {
const res = await axios.post("/api/v1/get_find_goods_list", params);
return res;
}
// 获取添加活动列表
export async function getAddMarketingList (params) {
export async function getAddMarketingList(params) {
const res = await axios.post("/api/v1/get_addmarketing_list", params);
return res;
}
// 获取查看列表
export async function getMarketingInfo (marketing_id) {
export async function getMarketingInfo(marketing_id) {
const res = await axios.post("/api/v1/get_marketing_info", marketing_id);
return res;
}
// 获取开启关闭
export async function updateMarketingList (params) {
export async function updateMarketingList(params) {
const res = await axios.post("/api/v1/update_marketing_list", params);
return res;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment