Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
王水玲
9 years ago
Commit
c5fdda347c8e01d9ddd2ce19e6f1816946b62840
1 parent
3736110b
商品详情接口修改
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
apps/product/models/item-handler.js
apps/product/models/item.js
apps/product/models/item-handler.js
View file @
c5fdda3
...
...
@@ -255,12 +255,12 @@ const setBrandBanner = (base, brand, shop) => {
let
resData
=
{},
banner
=
{};
if
(
base
.
brand
)
{
let
info
=
base
.
brand
;
if
(
base
.
brandInfo
)
{
let
info
=
base
.
brandInfo
;
// 基础品牌数据
banner
=
{
brandId
:
info
.
i
d
,
brandId
:
info
.
brandI
d
,
bgColor
:
'#000'
,
brandLogo
:
{
link
:
`
/
product
/
shop
/
$
{
info
.
brandDomain
}
`
,
// 品牌跳转链接
...
...
@@ -405,7 +405,7 @@ const setProductData = base => {
}
// 如果status为0,即skc下架时,则库存设为0
if
(
subValue
.
status
===
0
)
{
if
(
base
.
status
===
0
||
subValue
.
status
===
0
)
{
size
.
num
=
0
;
}
...
...
apps/product/models/item.js
View file @
c5fdda3
...
...
@@ -56,6 +56,7 @@ const _getMultiResourceByBaseInfo = (base) => {
}
return
Promise
.
all
(
promiseData
).
then
(
result
=>
{
return
{
sizeInfo
:
result
[
0
],
comfort
:
result
[
1
].
data
,
...
...
@@ -92,11 +93,15 @@ const getProductItemData = (params, url, uid) => {
result
=
camelCase
(
result
.
data
);
// 如果status为0,即商品下架时则返回空对象
if
(
!
result
.
goodsList
[
0
].
status
)
{
return
resData
;
if
(
!
result
)
{
return
;
}
// 如果status为0,即商品下架时则返回空对象
//if (!result.status) {
// return resData;
//}
if
(
!
result
.
productName
&&
!
result
.
productSkn
&&
!
result
.
salesPrice
&&
...
...
@@ -117,7 +122,6 @@ const getProductItemData = (params, url, uid) => {
}
return
_getMultiResourceByBaseInfo
(
result
).
then
(
mulRes
=>
{
Object
.
assign
(
data
,
itemFun
.
setBrandBanner
(
result
,
mulRes
.
brandBanner
,
mulRes
.
shopInfo
),
// banner
itemFun
.
setPathNav
(
mulRes
.
sort
,
result
.
productName
,
params
.
channel
),
// 面包屑导航
...
...
Please
register
or
login
to post a comment