Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
op-web-service
Commits
dfc262f4
Commit
dfc262f4
authored
Sep 01, 2021
by
liwenhong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lwh/goods-add-time'
# Conflicts: # src/pages/Activity/releaseProduc/index.vue
parents
c4870fa3
a310011d
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
555 additions
and
541 deletions
+555
-541
goods.js
server/controllers/goods.js
+147
-136
router.js
server/router.js
+1
-0
index.less
src/pages/Goods/List/index.less
+3
-0
index.vue
src/pages/Goods/List/index.vue
+341
-344
goods.js
src/service/Goods/goods.js
+63
-61
No files found.
server/controllers/goods.js
View file @
dfc262f4
...
@@ -16,168 +16,179 @@ const req = require("../utils/request").httpReq;
...
@@ -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
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_category_list`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"GET"
method
:
"GET"
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 获取商品列表
// 获取商品列表
exports
.
getList
=
async
ctx
=>
{
exports
.
getList
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_list`
;
const
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_list`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"GET"
,
method
:
"GET"
,
qs
:
ctx
.
request
.
query
qs
:
ctx
.
request
.
query
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 商品上架
// 商品上架
exports
.
putOnline
=
async
ctx
=>
{
exports
.
putOnline
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/online`
;
const
url
=
`
${
GOODS_URI
}
/goods/background/online`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 商品下架
// 商品下架
exports
.
putOffline
=
async
ctx
=>
{
exports
.
putOffline
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/offline`
;
const
url
=
`
${
GOODS_URI
}
/goods/background/offline`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
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
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 获取商品详情列表
// 获取商品详情列表
exports
.
getGoodsInfo
=
async
ctx
=>
{
exports
.
getGoodsInfo
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_info`
;
const
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_info`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"GET"
,
method
:
"GET"
,
qs
:
ctx
.
request
.
query
qs
:
ctx
.
request
.
query
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 商品审核通过
// 商品审核通过
exports
.
postSuccess
=
async
ctx
=>
{
exports
.
postSuccess
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/goods/background/audit_pass`
,
url
:
`
${
GOODS_URI
}
/goods/background/audit_pass`
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 营销活动列表
// 营销活动列表
exports
.
getMarketingList
=
async
ctx
=>
{
exports
.
getMarketingList
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/marketing/background/marketing_list`
;
const
url
=
`
${
GOODS_URI
}
/marketing/background/marketing_list`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 检查商品名称是否被占用
// 检查商品名称是否被占用
exports
.
checkGoodsName
=
async
ctx
=>
{
exports
.
checkGoodsName
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/goods/background/check_goods_name`
,
url
:
`
${
GOODS_URI
}
/goods/background/check_goods_name`
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 获取查询活动列表
// 获取查询活动列表
exports
.
getFindGoodsList
=
async
ctx
=>
{
exports
.
getFindGoodsList
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/marketing/background/goods_list`
;
const
url
=
`
${
GOODS_URI
}
/marketing/background/goods_list`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 审核拒绝
// 审核拒绝
exports
.
auditReject
=
async
ctx
=>
{
exports
.
auditReject
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/goods/background/audit_reject`
,
url
:
`
${
GOODS_URI
}
/goods/background/audit_reject`
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
}
}
;
// 添加活动列表
// 添加活动列表
exports
.
getAddMarketingList
=
async
ctx
=>
{
exports
.
getAddMarketingList
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/marketing/background/add_marketing`
;
const
url
=
`
${
GOODS_URI
}
/marketing/background/add_marketing`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 获取门店列表
// 获取门店列表
exports
.
getShopsList
=
async
ctx
=>
{
exports
.
getShopsList
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/shop/background/shop_list`
,
url
:
`
${
GOODS_URI
}
/shop/background/shop_list`
,
method
:
"GET"
,
method
:
"GET"
,
qs
:
ctx
.
request
.
query
qs
:
ctx
.
request
.
query
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 添加门店
// 添加门店
exports
.
addShop
=
async
ctx
=>
{
exports
.
addShop
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/shop/background/add_shop`
,
url
:
`
${
GOODS_URI
}
/shop/background/add_shop`
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
}
}
;
// 查看列表详情
// 查看列表详情
exports
.
getMarketingInfo
=
async
ctx
=>
{
exports
.
getMarketingInfo
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/marketing/background/marketing_info`
;
const
url
=
`
${
GOODS_URI
}
/marketing/background/marketing_info`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 修改商品
// 修改商品
exports
.
editGoods
=
async
ctx
=>
{
exports
.
editGoods
=
async
(
ctx
)
=>
{
const
opts
=
{
const
opts
=
{
url
:
`
${
GOODS_URI
}
/goods/background/edit_goods`
,
url
:
`
${
GOODS_URI
}
/goods/background/edit_goods`
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
}
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
};
// 开启关闭状态
// 开启关闭状态
exports
.
updateMarketingList
=
async
ctx
=>
{
exports
.
updateMarketingList
=
async
(
ctx
)
=>
{
const
url
=
`
${
GOODS_URI
}
/marketing/background/update_marketing`
;
const
url
=
`
${
GOODS_URI
}
/marketing/background/update_marketing`
;
const
opts
=
{
const
opts
=
{
url
,
url
,
method
:
"POST"
,
method
:
"POST"
,
json
:
true
,
json
:
true
,
body
:
ctx
.
request
.
body
body
:
ctx
.
request
.
body
,
};
};
const
res
=
await
req
(
ctx
,
opts
);
const
res
=
await
req
(
ctx
,
opts
);
ctx
.
body
=
res
;
ctx
.
body
=
res
;
...
...
server/router.js
View file @
dfc262f4
...
@@ -49,6 +49,7 @@ router.get(`${API_VERSION}/get_goods_category_list`, goods.getCategoryList);
...
@@ -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
.
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/online`
,
goods
.
putOnline
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/offline`
,
goods
.
putOffline
);
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
.
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/audit_pass`
,
goods
.
postSuccess
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/check_goods_name`
,
goods
.
checkGoodsName
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/check_goods_name`
,
goods
.
checkGoodsName
);
...
...
src/pages/Goods/List/index.less
View file @
dfc262f4
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
}
}
}
}
}
}
.pick-time {
margin-left: 10px;
}
.commodity_list {
.commodity_list {
margin-top: 30px;
margin-top: 30px;
}
}
...
...
src/pages/Goods/List/index.vue
View file @
dfc262f4
This diff is collapsed.
Click to expand it.
src/service/Goods/goods.js
View file @
dfc262f4
import
axios
from
"@/utils/request"
;
import
axios
from
"@/utils/request"
;
// 获取商品分类项
// 获取商品分类项
export
async
function
getGoodsList
()
{
export
async
function
getGoodsList
()
{
const
res
=
await
axios
.
get
(
"/api/v1/get_goods_category_list"
);
const
res
=
await
axios
.
get
(
"/api/v1/get_goods_category_list"
);
return
res
;
return
res
;
}
}
// 获取商品列表
// 获取商品列表
export
async
function
getList
(
params
)
{
export
async
function
getList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/get_goods_list"
,
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/get_goods_list"
,
{
params
params
,
});
});
return
res
;
return
res
;
}
}
// 商品上架
// 商品上架
export
async
function
putOnline
(
query
)
{
export
async
function
putOnline
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/online"
,
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/online"
,
{
goods_spu_id
:
query
goods_spu_id
:
query
,
});
});
return
res
;
return
res
;
}
}
// 商品下架
// 商品下架
export
async
function
putOffline
(
query
)
{
export
async
function
putOffline
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/offline"
,
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/offline"
,
{
goods_spu_id
:
query
goods_spu_id
:
query
,
});
});
return
res
;
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"
,
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/get_goods_info"
,
{
params
params
,
});
});
return
res
;
return
res
;
}
}
// 商品详情-审核通过
// 商品详情-审核通过
export
async
function
postSuccess
(
query
)
{
export
async
function
postSuccess
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/audit_pass"
,
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/audit_pass"
,
{
goods_spu_id
:
query
goods_spu_id
:
query
,
});
});
return
res
;
return
res
;
}
}
// 审核拒绝
// 审核拒绝
export
async
function
auditReject
(
query
)
{
export
async
function
auditReject
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/audit_reject"
,
query
);
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/audit_reject"
,
query
);
return
res
;
return
res
;
}
}
// 商品详情-检查商品名称是否重复
// 商品详情-检查商品名称是否重复
export
async
function
checkGoodsName
(
params
)
{
export
async
function
checkGoodsName
(
params
)
{
const
res
=
await
axios
.
post
(
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/check_goods_name"
,
params
);
"/api/v1/goods/background/check_goods_name"
,
params
);
return
res
;
return
res
;
}
}
// 获取门店表单
// 获取门店表单
export
async
function
getShopsList
(
params
)
{
export
async
function
getShopsList
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/shop/background/shop_list"
,
{
params
});
const
res
=
await
axios
.
get
(
"/api/v1/shop/background/shop_list"
,
{
params
});
return
res
;
return
res
;
}
}
// 添加门店信息
// 添加门店信息
export
async
function
postAddShop
(
query
)
{
export
async
function
postAddShop
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/shop/background/add_shop"
,
query
);
const
res
=
await
axios
.
post
(
"/api/v1/shop/background/add_shop"
,
query
);
return
res
;
return
res
;
}
}
export
async
function
editGoods
(
query
)
{
export
async
function
editGoods
(
query
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/edit_goods"
,
query
);
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/edit_goods"
,
query
);
return
res
;
return
res
;
}
}
// 获取营销活动列表
// 获取营销活动列表
export
async
function
getMarketingList
(
params
)
{
export
async
function
getMarketingList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/get_marketing_list"
,
params
);
const
res
=
await
axios
.
post
(
"/api/v1/get_marketing_list"
,
params
);
return
res
;
return
res
;
}
}
// 获取查询商品列表
// 获取查询商品列表
export
async
function
getFindGoodsList
(
params
)
{
export
async
function
getFindGoodsList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/get_find_goods_list"
,
params
);
const
res
=
await
axios
.
post
(
"/api/v1/get_find_goods_list"
,
params
);
return
res
;
return
res
;
}
}
// 获取添加活动列表
// 获取添加活动列表
export
async
function
getAddMarketingList
(
params
)
{
export
async
function
getAddMarketingList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/get_addmarketing_list"
,
params
);
const
res
=
await
axios
.
post
(
"/api/v1/get_addmarketing_list"
,
params
);
return
res
;
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
);
const
res
=
await
axios
.
post
(
"/api/v1/get_marketing_info"
,
marketing_id
);
return
res
;
return
res
;
}
}
// 获取开启关闭
// 获取开启关闭
export
async
function
updateMarketingList
(
params
)
{
export
async
function
updateMarketingList
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/update_marketing_list"
,
params
);
const
res
=
await
axios
.
post
(
"/api/v1/update_marketing_list"
,
params
);
return
res
;
return
res
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment