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
yyq
9 years ago
Commit
0d194d0ad80b3ddcb3d84d539a844a5accaf00c9
1 parent
2c2b454c
分享相关
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
apps/product/controllers/item.js
apps/product/models/item-handler.js
apps/product/models/item.js
public/js/product/item.page.js
apps/product/controllers/item.js
View file @
0d194d0
...
...
@@ -241,7 +241,7 @@ const index = (req, res, next) => {
// }
// };
Item
.
getProductItemData
(
req
.
params
,
req
.
user
.
uid
).
then
(
result
=>
{
Item
.
getProductItemData
(
req
.
params
,
req
.
u
rl
,
req
.
u
ser
.
uid
).
then
(
result
=>
{
if
(
_
.
isEmpty
(
result
))
{
return
next
();
}
...
...
apps/product/models/item-handler.js
View file @
0d194d0
...
...
@@ -360,6 +360,14 @@ const setProductData = base => {
}
}
// 分享相关,产品的链接
resData
.
share
=
{
weixinUrl
:
helpers
.
urlFormat
(
base
.
mainPath
),
shareTitle
:
resData
.
name
,
shareImg
:
resData
.
img
,
shareDesc
:
base
.
phrase
};
return
resData
;
};
...
...
apps/product/models/item.js
View file @
0d194d0
...
...
@@ -40,7 +40,7 @@ const _getMultiResourceByBaseInfo = (base) => {
});
};
let
getProductItemData
=
(
params
,
uid
)
=>
{
let
getProductItemData
=
(
params
,
u
rl
,
u
id
)
=>
{
let
pid
=
params
[
0
];
// let gid = params[1];
...
...
@@ -55,6 +55,7 @@ let getProductItemData = (params, uid) => {
}
result
.
uid
=
uid
;
result
.
mainPath
=
url
;
// 商品基本信息
data
.
goodInfo
=
itemFUN
.
setProductData
(
result
);
...
...
public/js/product/item.page.js
View file @
0d194d0
...
...
@@ -30,6 +30,7 @@ var thumbsLoaded = [],
id
=
$main
.
data
(
'id'
);
require
(
'../common/header'
);
require
(
'../plugins/share'
);
lazyload
(
$
(
'img.lazy'
));
...
...
@@ -103,8 +104,6 @@ $thumbWrap.each(function() {
}
});
// $thumbWrap.parent().animate({visibility: 'visible'});
$thumbWrap
.
parent
().
removeClass
(
'hide'
);
// 展示图
...
...
@@ -161,7 +160,7 @@ $('.size-list').on('click', 'li', function() {
$this
.
addClass
(
'cur'
);
}
});
// 加入购物袋
$addToBag
.
click
(
function
()
{
var
sku
=
getBuyProduct
();
...
...
@@ -181,7 +180,12 @@ $addToBag.click(function() {
});
}
});
// 继续购物
$
(
'#keep-shopping'
).
click
(
function
()
{
$balanceWrapper
.
slideUp
(
SLIDETIME
);
$tradeWrapper
.
slideDown
(
SLIDETIME
);
});
// 商品收藏
$
(
'#collect-product'
).
click
(
function
()
{
var
$this
=
$
(
this
),
param
=
{
...
...
@@ -204,5 +208,4 @@ $('#collect-product').click(function() {
location
.
href
=
data
.
data
.
refer
;
}
});
});
...
...
Please
register
or
login
to post a comment