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
3abfeea8
Commit
3abfeea8
authored
Jul 08, 2018
by
Junling Bu
Browse files
修复商品排序问题
parent
d2a561f3
Changes
45
Show whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java
View file @
3abfeea8
...
...
@@ -32,8 +32,6 @@ public class WxCartController {
private
LitemallGoodsSpecificationService
goodsSpecificationService
;
@Autowired
private
LitemallAddressService
addressService
;
@Autowired
private
LitemallCouponService
apiCouponService
;
/**
* 购物车
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java
View file @
3abfeea8
...
...
@@ -3,7 +3,6 @@ package org.linlinjava.litemall.wx.web;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.linlinjava.litemall.db.domain.LitemallComment
;
import
org.linlinjava.litemall.db.service.LitemallCommentService
;
import
org.linlinjava.litemall.db.service.LitemallCouponService
;
import
org.linlinjava.litemall.db.service.LitemallUserService
;
import
org.linlinjava.litemall.core.util.ResponseUtil
;
import
org.linlinjava.litemall.wx.annotation.LoginUser
;
...
...
@@ -26,8 +25,6 @@ public class WxCommentController {
@Autowired
private
LitemallUserService
userService
;
@Autowired
private
LitemallCouponService
couponService
;
@Autowired
private
UserInfoService
userInfoService
;
/**
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java
View file @
3abfeea8
...
...
@@ -5,7 +5,6 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.linlinjava.litemall.db.domain.*
;
import
org.linlinjava.litemall.db.service.*
;
import
org.linlinjava.litemall.db.util.SortUtil
;
import
org.linlinjava.litemall.core.util.ResponseUtil
;
import
org.linlinjava.litemall.wx.annotation.LoginUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -48,8 +47,6 @@ public class WxGoodsController {
@Autowired
private
LitemallSearchHistoryService
searchHistoryService
;
@Autowired
private
LitemallCouponService
apiCouponService
;
@Autowired
private
LitemallCartService
cartService
;
@Autowired
private
LitemallGoodsSpecificationService
goodsSpecificationService
;
...
...
@@ -229,14 +226,12 @@ public class WxGoodsController {
* 失败则 { errno: XXX, errmsg: XXX }
*/
@GetMapping
(
"list"
)
public
Object
list
(
Integer
categoryId
,
Integer
brandId
,
String
keyword
,
Integer
isNew
,
Integer
isHot
,
public
Object
list
(
Integer
categoryId
,
Integer
brandId
,
String
keyword
,
Boolean
isNew
,
Boolean
isHot
,
@LoginUser
Integer
userId
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
Integer
size
,
String
sort
,
String
order
)
{
String
sortWithOrder
=
SortUtil
.
goodsSort
(
sort
,
order
);
//添加到搜索历史
if
(
userId
!=
null
&&
!
StringUtils
.
isNullOrEmpty
(
keyword
))
{
LitemallSearchHistory
searchHistoryVo
=
new
LitemallSearchHistory
();
...
...
@@ -248,8 +243,8 @@ public class WxGoodsController {
}
//查询列表数据
List
<
LitemallGoods
>
goodsList
=
goodsService
.
querySelective
(
categoryId
,
brandId
,
keyword
,
isHot
,
isNew
,
page
,
size
,
sort
WithO
rder
);
int
total
=
goodsService
.
countSelective
(
categoryId
,
brandId
,
keyword
,
isHot
,
isNew
,
page
,
size
,
sort
WithO
rder
);
List
<
LitemallGoods
>
goodsList
=
goodsService
.
querySelective
(
categoryId
,
brandId
,
keyword
,
isHot
,
isNew
,
page
,
size
,
sort
,
o
rder
);
int
total
=
goodsService
.
countSelective
(
categoryId
,
brandId
,
keyword
,
isHot
,
isNew
,
page
,
size
,
sort
,
o
rder
);
// 查询商品所属类目列表。
List
<
Integer
>
goodsCatIds
=
goodsService
.
getCatIds
(
brandId
,
keyword
,
isHot
,
isNew
);
...
...
litemall-wx/pages/hotGoods/hotGoods.js
View file @
3abfeea8
...
...
@@ -13,6 +13,7 @@ Page({
goodsList
:
[],
categoryId
:
0
,
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
page
:
1
,
size
:
100
...
...
@@ -42,7 +43,7 @@ Page({
getGoodsList
:
function
(){
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
isHot
:
1
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
Type
,
categoryId
:
that
.
data
.
categoryId
})
util
.
request
(
api
.
GoodsList
,
{
isHot
:
true
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
,
categoryId
:
that
.
data
.
categoryId
})
.
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -80,7 +81,8 @@ Page({
this
.
setData
({
categoryFilter
:
!
this
.
data
.
categoryFilter
,
currentSortType
:
'
category
'
,
currentSortOrder
:
'
asc
'
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
});
break
;
case
'
priceSort
'
:
...
...
@@ -90,6 +92,7 @@ Page({
}
this
.
setData
({
currentSortType
:
'
price
'
,
currentSort
:
'
retail_price
'
,
currentSortOrder
:
tmpSortOrder
,
categoryFilter
:
false
});
...
...
@@ -100,6 +103,7 @@ Page({
//综合排序
this
.
setData
({
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
categoryFilter
:
false
,
categoryId
:
0
,
...
...
litemall-wx/pages/newGoods/newGoods.js
View file @
3abfeea8
...
...
@@ -13,6 +13,7 @@ Page({
goodsList
:
[],
categoryId
:
0
,
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
page
:
1
,
size
:
100
...
...
@@ -30,7 +31,7 @@ Page({
getGoodsList
:
function
()
{
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
isNew
:
1
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
Type
,
categoryId
:
that
.
data
.
categoryId
})
util
.
request
(
api
.
GoodsList
,
{
isNew
:
true
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
,
categoryId
:
that
.
data
.
categoryId
})
.
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -67,7 +68,8 @@ Page({
this
.
setData
({
categoryFilter
:
!
this
.
data
.
categoryFilter
,
currentSortType
:
'
category
'
,
currentSortOrder
:
'
asc
'
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
});
break
;
case
'
priceSort
'
:
...
...
@@ -77,6 +79,7 @@ Page({
}
this
.
setData
({
currentSortType
:
'
price
'
,
currentSort
:
'
retail_price
'
,
currentSortOrder
:
tmpSortOrder
,
categoryFilter
:
false
});
...
...
@@ -87,6 +90,7 @@ Page({
//综合排序
this
.
setData
({
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
categoryFilter
:
false
,
categoryId
:
0
...
...
Prev
1
2
3
Next
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