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
3d3dcc433d2ba861b801514bf5bd37f6822ef203
1 parent
177746e9
fix bug 1739
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
38 deletions
apps/me/views/partial/collection/editorial.hbs
apps/product/controllers/query.js
apps/product/models/helpers.js
apps/product/models/search.js
public/js/me/favorite.brand.page.js
public/js/me/favorite.editorial.page.js
public/js/me/favorite.page.js
public/js/product/list/list-search.js
apps/me/views/partial/collection/editorial.hbs
View file @
3d3dcc4
...
...
@@ -10,7 +10,7 @@
{{>
icon
/
checkbox
}}
</div>
<div
class=
"editorial-cover"
>
<
div
class=
"editorial-cate"
>
{{
categoryName
}}
</div
>
<
!--<div class="editorial-cate">
{{
categoryName
}}
</div>--
>
<a
href=
"/editorial/
{{
id
}}
.html"
target=
"_blank"
>
<img
src=
"
{{
image
src
240
160
1
}}
"
alt=
""
>
</a>
...
...
apps/product/controllers/query.js
View file @
3d3dcc4
...
...
@@ -37,7 +37,7 @@ const Query = {
let
nav
=
[
DataHelper
.
getChannelNav
(
channel
)];
nav
.
push
({
name
:
query
?
`
"${query}"
共
$
{
data
.
total
}
个结果`
:
`共
$
{
data
.
total
}
个结果`
name
:
query
?
`
"${query}"
共
$
{
data
.
total
}
个结果`
:
`共
$
{
data
.
total
||
0
}
个结果`
});
if
(
data
.
filter
)
{
...
...
apps/product/models/helpers.js
View file @
3d3dcc4
...
...
@@ -391,11 +391,10 @@ const helpers = {
}
if
(
q
.
standard
)
{
let
standardIds
=
q
.
standard
.
split
(
','
);
filter
.
standard
.
forEach
(
s
=>
{
s
.
sub
.
forEach
(
b
=>
{
if
(
b
.
standardId
===
parseInt
(
standardIds
[
1
],
10
))
{
_
.
forEach
(
filter
.
standard
,
s
=>
{
_
.
forEach
(
s
.
sub
,
b
=>
{
if
(
q
.
standard
.
indexOf
(
'_'
+
b
.
standardId
)
>
0
)
{
b
.
checked
=
true
;
filters
.
push
(
this
.
newFilter
(
'standard'
,
q
.
standard
,
b
.
standardName
));
}
...
...
apps/product/models/search.js
View file @
3d3dcc4
...
...
@@ -32,8 +32,7 @@ function _paramHanlde(obj) {
// if (obj.standard) {
// let standards = obj.standard.split(',');
//
// obj.standard_id = standards[0];
// obj.standard_value_id = standards[1];
// obj.standard = JSON.stringify(standards);
// }
let
_gender
;
...
...
public/js/me/favorite.brand.page.js
View file @
3d3dcc4
...
...
@@ -3,7 +3,8 @@
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/20
*/
var
dialog
=
require
(
'../plugins/dialog'
);
var
_confirm
=
dialog
.
Confirm
;
var
FavoriteBrand
=
{
init
:
function
()
{
...
...
@@ -66,6 +67,12 @@ var FavoriteBrand = {
FavoriteBrand
.
doCancelMulti
(
shopId
.
join
(
','
),
brandId
.
join
(
','
));
});
},
_showConfirm
:
function
(
cb
)
{
new
_confirm
({
content
:
'<h1 class="title">确认删除</h1><p>您确定要删除该收藏么?</p>'
,
cb
:
cb
}).
show
();
},
moveSlide
:
function
(
ele
)
{
var
wrap
=
$
(
ele
).
parent
().
next
(
'.slide-wrap'
);
var
currLi
=
$
(
'ul li.show'
,
wrap
);
...
...
@@ -79,23 +86,27 @@ var FavoriteBrand = {
}
},
doCancel
:
function
(
ids
,
type
)
{
$
.
post
(
'/me/collection/cancel'
,
{
type
:
type
||
'brand'
,
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/brand'
;
}
this
.
_showConfirm
(
function
()
{
$
.
post
(
'/me/collection/cancel'
,
{
type
:
type
||
'brand'
,
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/brand'
;
}
});
});
},
doCancelMulti
:
function
(
shops
,
brands
)
{
$
.
post
(
'/me/collection/cancel/multi'
,
{
shops
:
shops
,
brands
:
brands
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/brand'
;
}
this
.
_showConfirm
(
function
()
{
$
.
post
(
'/me/collection/cancel/multi'
,
{
shops
:
shops
,
brands
:
brands
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/brand'
;
}
});
});
}
};
...
...
public/js/me/favorite.editorial.page.js
View file @
3d3dcc4
...
...
@@ -3,6 +3,8 @@
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/20
*/
var
dialog
=
require
(
'../plugins/dialog'
);
var
_confirm
=
dialog
.
Confirm
;
var
FavoriteEditorial
=
{
...
...
@@ -50,13 +52,21 @@ var FavoriteEditorial = {
FavoriteEditorial
.
doCancel
(
ids
.
join
(
','
));
});
},
_showConfirm
:
function
(
cb
)
{
new
_confirm
({
content
:
'<h1 class="title">确认删除</h1><p>您确定要删除该收藏么?</p>'
,
cb
:
cb
}).
show
();
},
doCancel
:
function
(
ids
)
{
$
.
post
(
'/me/collection/editorial/cancel'
,
{
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/editorial'
;
}
this
.
_showConfirm
(
function
()
{
$
.
post
(
'/me/collection/editorial/cancel'
,
{
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection/editorial'
;
}
});
});
}
};
...
...
public/js/me/favorite.page.js
View file @
3d3dcc4
...
...
@@ -5,23 +5,34 @@
*/
var
lazyload
=
require
(
'yoho-jquery-lazyload'
);
var
dialog
=
require
(
'../plugins/dialog'
);
var
_confirm
=
dialog
.
Confirm
;
var
$root
=
$
(
'.favorite-products'
);
require
(
'./me'
);
require
(
'../plugins/check'
);
function
_showConfirm
(
cb
)
{
new
_confirm
({
content
:
'<h1 class="title">确认删除</h1><p>您确定要删除该收藏么?</p>'
,
cb
:
cb
}).
show
();
}
function
doCancel
(
ids
)
{
$
.
post
(
'/me/collection/cancel'
,
{
type
:
'product'
,
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection'
;
}
_showConfirm
(
function
()
{
$
.
post
(
'/me/collection/cancel'
,
{
type
:
'product'
,
ids
:
ids
},
function
(
data
)
{
if
(
data
.
code
===
200
)
{
location
.
href
=
'/me/collection'
;
}
});
});
}
function
eventBind
()
{
$
(
'.check-all'
,
$root
).
check
({
type
:
'checkbox'
,
...
...
public/js/product/list/list-search.js
View file @
3d3dcc4
...
...
@@ -138,9 +138,14 @@ var YohoListPage = {
group
:
'standard'
,
onChange
:
function
(
ele
,
checked
,
value
)
{
var
parentId
=
$
(
ele
).
parents
(
'.body'
).
data
(
'value'
);
var
standard
=
query
.
standard
||
''
;
if
(
standard
)
{
standard
=
standard
+
','
;
}
YohoListPage
.
go
({
standard
:
parentId
+
',
'
+
value
standard
:
standard
+
parentId
+
'_
'
+
value
});
}
});
...
...
Please
register
or
login
to post a comment