chore: 简化小商场代码。
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详情页面“大家都在看”推荐商品
|
||||
*
|
||||
|
||||
@@ -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', //品牌列表
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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', //品牌列表
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user