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
5cd86f69
Commit
5cd86f69
authored
Mar 09, 2019
by
Junling Bu
Browse files
chore: 简化小商场代码。
parent
98e6190c
Changes
7
Hide whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java
View file @
5cd86f69
...
...
@@ -284,39 +284,6 @@ public class WxGoodsController {
return
ResponseUtil
.
ok
(
data
);
}
/**
* 新品首发页面的横幅
*
* @return 新品首发页面的横幅
*/
@GetMapping
(
"new"
)
public
Object
newGoods
()
{
Map
<
String
,
String
>
bannerInfo
=
new
HashMap
<>();
bannerInfo
.
put
(
"url"
,
""
);
bannerInfo
.
put
(
"name"
,
SystemConfig
.
getNewBannerTitle
());
bannerInfo
.
put
(
"imgUrl"
,
SystemConfig
.
getNewImageUrl
());
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"bannerInfo"
,
bannerInfo
);
return
ResponseUtil
.
ok
(
data
);
}
/**
* 人气推荐页面的横幅
*
* @return 人气推荐页面的横幅
*/
@GetMapping
(
"hot"
)
public
Object
hotGoods
()
{
Map
<
String
,
String
>
bannerInfo
=
new
HashMap
<>();
bannerInfo
.
put
(
"url"
,
""
);
bannerInfo
.
put
(
"name"
,
SystemConfig
.
getHotBannerTitle
());
bannerInfo
.
put
(
"imgUrl"
,
SystemConfig
.
getHotImageUrl
());
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"bannerInfo"
,
bannerInfo
);
return
ResponseUtil
.
ok
(
data
);
}
/**
* 商品详情页面“大家都在看”推荐商品
*
...
...
litemall-wx/config/api.js
View file @
5cd86f69
...
...
@@ -25,8 +25,6 @@ module.exports = {
GoodsList
:
WxApiRoot
+
'
goods/list
'
,
//获得商品列表
GoodsCategory
:
WxApiRoot
+
'
goods/category
'
,
//获得分类数据
GoodsDetail
:
WxApiRoot
+
'
goods/detail
'
,
//获得商品的详情
GoodsNew
:
WxApiRoot
+
'
goods/new
'
,
//新品
GoodsHot
:
WxApiRoot
+
'
goods/hot
'
,
//热门
GoodsRelated
:
WxApiRoot
+
'
goods/related
'
,
//商品详情页的关联商品(大家都在看)
BrandList
:
WxApiRoot
+
'
brand/list
'
,
//品牌列表
...
...
litemall-wx/pages/hotGoods/hotGoods.js
View file @
5cd86f69
...
...
@@ -5,8 +5,8 @@ var app = getApp();
Page
({
data
:
{
bannerInfo
:
{
'
imgUrl
'
:
''
,
'
name
'
:
''
'
imgUrl
'
:
'
http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png
'
,
'
name
'
:
'
大家都在买的
'
},
categoryFilter
:
false
,
filterCategory
:
[],
...
...
@@ -18,16 +18,6 @@ Page({
page
:
1
,
size
:
100
},
getBanner
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
GoodsHot
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
bannerInfo
:
res
.
data
.
bannerInfo
,
});
}
});
},
getCategoryList
:
function
()
{
var
that
=
this
;
...
...
@@ -65,7 +55,6 @@ Page({
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
getBanner
();
this
.
getGoodsList
();
},
onReady
:
function
()
{
...
...
litemall-wx/pages/newGoods/newGoods.js
View file @
5cd86f69
...
...
@@ -5,8 +5,8 @@ var app = getApp();
Page
({
data
:
{
bannerInfo
:
{
'
imgUrl
'
:
''
,
'
name
'
:
''
'
imgUrl
'
:
'
http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png
'
,
'
name
'
:
'
大家都在买的
'
},
categoryFilter
:
false
,
filterCategory
:
[],
...
...
@@ -18,16 +18,6 @@ Page({
page
:
1
,
size
:
100
},
getBanner
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
GoodsNew
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
bannerInfo
:
res
.
data
.
bannerInfo
,
});
}
});
},
getGoodsList
:
function
()
{
var
that
=
this
;
...
...
@@ -50,7 +40,6 @@ Page({
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
getBanner
();
this
.
getGoodsList
();
},
onReady
:
function
()
{
...
...
renard-wx/config/api.js
View file @
5cd86f69
...
...
@@ -24,8 +24,6 @@ module.exports = {
GoodsList
:
WxApiRoot
+
'
goods/list
'
,
//获得商品列表
GoodsCategory
:
WxApiRoot
+
'
goods/category
'
,
//获得分类数据
GoodsDetail
:
WxApiRoot
+
'
goods/detail
'
,
//获得商品的详情
GoodsNew
:
WxApiRoot
+
'
goods/new
'
,
//新品
GoodsHot
:
WxApiRoot
+
'
goods/hot
'
,
//热门
GoodsRelated
:
WxApiRoot
+
'
goods/related
'
,
//商品详情页的关联商品(大家都在看)
BrandList
:
WxApiRoot
+
'
brand/list
'
,
//品牌列表
...
...
renard-wx/pages/hotGoods/hotGoods.js
View file @
5cd86f69
...
...
@@ -5,8 +5,8 @@ var app = getApp();
Page
({
data
:
{
bannerInfo
:
{
'
imgUrl
'
:
''
,
'
name
'
:
''
'
imgUrl
'
:
'
http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png
'
,
'
name
'
:
'
大家都在买的
'
},
categoryFilter
:
false
,
filterCategory
:
[],
...
...
@@ -18,16 +18,6 @@ Page({
page
:
1
,
size
:
100
},
getBanner
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
GoodsHot
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
bannerInfo
:
res
.
data
.
bannerInfo
,
});
}
});
},
getCategoryList
:
function
()
{
var
that
=
this
;
...
...
@@ -65,7 +55,6 @@ Page({
},
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
getBanner
();
this
.
getGoodsList
();
},
onReady
:
function
()
{
...
...
renard-wx/pages/newGoods/newGoods.js
View file @
5cd86f69
...
...
@@ -5,8 +5,8 @@ var app = getApp();
Page
({
data
:
{
bannerInfo
:
{
'
imgUrl
'
:
''
,
'
name
'
:
''
'
imgUrl
'
:
'
http://yanxuan.nosdn.127.net/8976116db321744084774643a933c5ce.png
'
,
'
name
'
:
'
大家都在买的
'
},
categoryFilter
:
false
,
filterCategory
:
[],
...
...
@@ -20,21 +20,9 @@ Page({
},
onPullDownRefresh
()
{
this
.
getBanner
();
this
.
getGoodsList
();
wx
.
stopPullDownRefresh
()
//停止下拉刷新
},
getBanner
:
function
()
{
let
that
=
this
;
util
.
request
(
api
.
GoodsNew
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
bannerInfo
:
res
.
data
.
bannerInfo
,
});
}
});
},
getGoodsList
:
function
()
{
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
...
...
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