Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangwenxue
5 years ago
Commit
c4421725654363cd6cfd91be6ea6062bd0958f44
1 parent
5e7b5391
商品详情: 调整资源位
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
apps/store/product/actions.js
config/product-api-map.js
apps/store/product/actions.js
View file @
c442172
...
...
@@ -5,7 +5,14 @@ import Vue from 'vue';
export
default
{
async
fetchProductInfo
({
commit
},
{
productId
})
{
const
queryTasks
=
[
''
,
'/resource'
,
'/recommend'
].
map
(
path
=>
{
return
this
.
$api
.
get
(
`
/
api
/
ufo
/
product$
{
path
}
`
,
{
product_id
:
productId
}).
then
(
result
=>
{
let
params
=
{
product_id
:
productId
};
if
(
path
===
'/resource'
)
{
params
=
{
content_code
:
'05e4f5782dfc3a5e10d39b8f04a7dcb9'
,
};
}
return
this
.
$api
.
get
(
`
/
api
/
ufo
/
product$
{
path
}
`
,
params
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
return
result
.
data
;
}
else
{
...
...
@@ -14,10 +21,12 @@ export default {
});
});
const
[
detail
,
resource
,
recommend
]
=
await
Promise
.
all
(
queryTasks
);
let
[
detail
,
resource
,
recommend
]
=
await
Promise
.
all
(
queryTasks
);
resource
=
get
(
resource
,
'[0].data[0]'
,
null
);
commit
(
Types
.
UPDATE_PRODUCT_DETAIL
,
Object
.
assign
(
detail
.
product_info
,
{
resource
:
get
(
resource
,
'[0].data[0]'
,
null
)
,
resource
,
recommend
:
recommend
&&
recommend
.
product_list
||
[],
}));
},
...
...
config/product-api-map.js
View file @
c442172
...
...
@@ -43,9 +43,9 @@ module.exports = {
'/api/ufo/product/resource'
:
{
ufo
:
true
,
auth
:
false
,
api
:
'ufo.
product.resource
'
,
api
:
'ufo.
resource.get
'
,
params
:
{
product_id
:
{
type
:
Number
},
// 商品id
content_code
:
{
type
:
String
},
},
},
...
...
Please
register
or
login
to post a comment