Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
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
郭成尧
9 years ago
Commit
947154a1f363d394ba05ff6ba7d53a8b0fb77a9c
1 parent
3125d719
'收藏店铺优化'
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
8 deletions
apps/product/controllers/shop.js
apps/product/models/shop-api.js
apps/product/models/shop.js
public/vue/product/shop/shop-box.vue
public/vue/product/shop/top-bar.vue
apps/product/controllers/shop.js
View file @
947154a
...
...
@@ -52,7 +52,7 @@ module.exports = {
}).
catch
(
next
);
},
/* 收藏店铺 */
/* 收藏
品牌或者
店铺 */
collectShop
:
(
req
,
res
,
next
)
=>
{
if
(
!
req
.
user
.
uid
)
{
return
res
.
json
({
...
...
@@ -62,10 +62,10 @@ module.exports = {
}
shopModel
.
collectShopData
({
shopId
:
req
.
body
.
shopId
,
favId
:
req
.
body
.
favId
,
id
:
req
.
body
.
isBlkShop
?
req
.
body
.
shopId
:
req
.
body
.
brandId
,
favId
:
req
.
body
.
isBlkShop
?
req
.
body
.
shopId
:
req
.
body
.
brandId
,
uid
:
req
.
user
.
uid
,
type
:
'brand'
,
type
:
req
.
body
.
isBlkShop
?
'shop'
:
'brand'
,
isFav
:
req
.
body
.
isFav
}).
then
(
result
=>
{
res
.
json
(
result
);
...
...
apps/product/models/shop-api.js
View file @
947154a
...
...
@@ -103,8 +103,8 @@ module.exports = {
*/
collectShopOriginData
(
params
)
{
let
finalParams
=
{
id
:
params
.
shopId
,
fav_id
:
params
.
shopId
,
id
:
params
.
id
,
fav_id
:
params
.
favId
,
uid
:
params
.
uid
,
type
:
params
.
type
};
...
...
apps/product/models/shop.js
View file @
947154a
...
...
@@ -28,7 +28,8 @@ const getShopData = params => {
/* 品牌名称 */
Object
.
assign
(
finalResult
,
{
brandName
:
result
.
data
.
brand_name
brandName
:
result
.
data
.
brand_name
,
brandId
:
result
.
data
.
id
});
/* 品牌是否有店铺 */
...
...
public/vue/product/shop/shop-box.vue
View file @
947154a
...
...
@@ -89,6 +89,7 @@
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
brandName: result.brandName,
brandId: result.brandId, // 不是分享的参数,收藏店铺使用
shopId: result.shopId, // 不是分享的参数,收藏店铺使用
isFav: result.isFav // 不是分享的参数,收藏店铺使用
};
...
...
public/vue/product/shop/top-bar.vue
View file @
947154a
...
...
@@ -84,8 +84,10 @@
/* 收藏或者取消收藏店铺 */
collectShop() {
let data = {
brandId: this.shareData.brandId,
shopId: this.shareData.shopId,
isFav: this.shareData.isFav
isFav: this.shareData.isFav,
isBlkShop: this.shareData.isBlkShop
};
$.post({
...
...
Please
register
or
login
to post a comment