Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
fc3886ff
Commit
fc3886ff
authored
May 14, 2019
by
Junling Bu
Browse files
fix[litemall-vue]: 收藏功能修复
parent
868764c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-vue/src/views/items/detail/index.vue
View file @
fc3886ff
...
...
@@ -148,12 +148,17 @@ computed: {
},
addCollect
()
{
collectAddOrDelete
({
valueId
:
this
.
itemId
,
type
:
0
}).
then
(
res
=>
{
let
type
=
res
.
data
.
data
.
type
;
this
.
goods
.
userHasCollect
=
type
===
'
add
'
?
1
:
0
;
this
.
$toast
({
message
:
type
===
'
add
'
?
'
添加成功
'
:
'
取消成功
'
,
duration
:
1500
});
if
(
this
.
goods
.
userHasCollect
===
1
){
this
.
goods
.
userHasCollect
=
0
}
else
{
this
.
goods
.
userHasCollect
=
1
this
.
$toast
({
message
:
'
收藏成功
'
,
duration
:
1500
});
}
});
},
getProductId
(
s1
,
s2
)
{
...
...
litemall-vue/src/views/user/module-collect/index.vue
View file @
fc3886ff
...
...
@@ -60,8 +60,10 @@ export default {
methods
:
{
init
()
{
collectList
({
type
:
0
,
page
:
this
.
page
,
limit
:
this
.
limit
}).
then
(
res
=>
{
const
{
collectList
,
page
}
=
res
.
data
.
data
;
this
.
items
.
push
(...
collectList
);
this
.
page
=
res
.
data
.
data
.
page
;
this
.
limit
=
res
.
data
.
data
.
limit
;
this
.
total
=
res
.
data
.
data
.
total
;
this
.
items
.
push
(...
res
.
data
.
data
.
list
);
});
},
cancelCollect
(
event
,
i
,
item
)
{
...
...
Write
Preview
Supports
Markdown
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