Commit ca5d9984 authored by Junling Bu's avatar Junling Bu
Browse files

refactor: 分页的中每页的数量统一采用limit,而不是size

parent 6db1c80d
...@@ -1090,7 +1090,7 @@ public interface Storage { ...@@ -1090,7 +1090,7 @@ public interface Storage {
public class WxTopicController { public class WxTopicController {
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
... ...
...@@ -1144,7 +1144,7 @@ public interface Storage { ...@@ -1144,7 +1144,7 @@ public interface Storage {
public class WxTopicController { public class WxTopicController {
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
... ...
......
...@@ -26,7 +26,7 @@ public class LitemallIssueService { ...@@ -26,7 +26,7 @@ public class LitemallIssueService {
issueMapper.insertSelective(issue); issueMapper.insertSelective(issue);
} }
public List<LitemallIssue> querySelective(String question, Integer page, Integer size, String sort, String order) { public List<LitemallIssue> querySelective(String question, Integer page, Integer limit, String sort, String order) {
LitemallIssueExample example = new LitemallIssueExample(); LitemallIssueExample example = new LitemallIssueExample();
LitemallIssueExample.Criteria criteria = example.createCriteria(); LitemallIssueExample.Criteria criteria = example.createCriteria();
...@@ -39,7 +39,7 @@ public class LitemallIssueService { ...@@ -39,7 +39,7 @@ public class LitemallIssueService {
example.setOrderByClause(sort + " " + order); example.setOrderByClause(sort + " " + order);
} }
PageHelper.startPage(page, size); PageHelper.startPage(page, limit);
return issueMapper.selectByExample(example); return issueMapper.selectByExample(example);
} }
......
...@@ -28,11 +28,11 @@ public class LitemallKeywordService { ...@@ -28,11 +28,11 @@ public class LitemallKeywordService {
return keywordsMapper.selectByExample(example); return keywordsMapper.selectByExample(example);
} }
public List<LitemallKeyword> queryByKeyword(String keyword, Integer page, Integer size) { public List<LitemallKeyword> queryByKeyword(String keyword, Integer page, Integer limit) {
LitemallKeywordExample example = new LitemallKeywordExample(); LitemallKeywordExample example = new LitemallKeywordExample();
example.setDistinct(true); example.setDistinct(true);
example.or().andKeywordLike("%" + keyword + "%").andDeletedEqualTo(false); example.or().andKeywordLike("%" + keyword + "%").andDeletedEqualTo(false);
PageHelper.startPage(page, size); PageHelper.startPage(page, limit);
return keywordsMapper.selectByExampleSelective(example, LitemallKeyword.Column.keyword); return keywordsMapper.selectByExampleSelective(example, LitemallKeyword.Column.keyword);
} }
......
...@@ -69,7 +69,7 @@ public class LitemallOrderService { ...@@ -69,7 +69,7 @@ public class LitemallOrderService {
return orderSn; return orderSn;
} }
public List<LitemallOrder> queryByOrderStatus(Integer userId, List<Short> orderStatus, Integer page, Integer size) { public List<LitemallOrder> queryByOrderStatus(Integer userId, List<Short> orderStatus, Integer page, Integer limit) {
LitemallOrderExample example = new LitemallOrderExample(); LitemallOrderExample example = new LitemallOrderExample();
example.setOrderByClause(LitemallOrder.Column.addTime.desc()); example.setOrderByClause(LitemallOrder.Column.addTime.desc());
LitemallOrderExample.Criteria criteria = example.or(); LitemallOrderExample.Criteria criteria = example.or();
...@@ -78,11 +78,11 @@ public class LitemallOrderService { ...@@ -78,11 +78,11 @@ public class LitemallOrderService {
criteria.andOrderStatusIn(orderStatus); criteria.andOrderStatusIn(orderStatus);
} }
criteria.andDeletedEqualTo(false); criteria.andDeletedEqualTo(false);
PageHelper.startPage(page, size); PageHelper.startPage(page, limit);
return litemallOrderMapper.selectByExample(example); return litemallOrderMapper.selectByExample(example);
} }
public List<LitemallOrder> querySelective(Integer userId, String orderSn, List<Short> orderStatusArray, Integer page, Integer size, String sort, String order) { public List<LitemallOrder> querySelective(Integer userId, String orderSn, List<Short> orderStatusArray, Integer page, Integer limit, String sort, String order) {
LitemallOrderExample example = new LitemallOrderExample(); LitemallOrderExample example = new LitemallOrderExample();
LitemallOrderExample.Criteria criteria = example.createCriteria(); LitemallOrderExample.Criteria criteria = example.createCriteria();
...@@ -101,7 +101,7 @@ public class LitemallOrderService { ...@@ -101,7 +101,7 @@ public class LitemallOrderService {
example.setOrderByClause(sort + " " + order); example.setOrderByClause(sort + " " + order);
} }
PageHelper.startPage(page, size); PageHelper.startPage(page, limit);
return litemallOrderMapper.selectByExample(example); return litemallOrderMapper.selectByExample(example);
} }
......
...@@ -37,7 +37,7 @@ public class LitemallRoleService { ...@@ -37,7 +37,7 @@ public class LitemallRoleService {
} }
public List<LitemallRole> querySelective(String name, Integer page, Integer size, String sort, String order) { public List<LitemallRole> querySelective(String name, Integer page, Integer limit, String sort, String order) {
LitemallRoleExample example = new LitemallRoleExample(); LitemallRoleExample example = new LitemallRoleExample();
LitemallRoleExample.Criteria criteria = example.createCriteria(); LitemallRoleExample.Criteria criteria = example.createCriteria();
...@@ -50,7 +50,7 @@ public class LitemallRoleService { ...@@ -50,7 +50,7 @@ public class LitemallRoleService {
example.setOrderByClause(sort + " " + order); example.setOrderByClause(sort + " " + order);
} }
PageHelper.startPage(page, size); PageHelper.startPage(page, limit);
return roleMapper.selectByExample(example); return roleMapper.selectByExample(example);
} }
......
...@@ -127,18 +127,18 @@ public class WxOrderService { ...@@ -127,18 +127,18 @@ public class WxOrderService {
* 3,待收货; * 3,待收货;
* 4,待评价。 * 4,待评价。
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 订单列表 * @return 订单列表
*/ */
public Object list(Integer userId, Integer showType, Integer page, Integer size) { public Object list(Integer userId, Integer showType, Integer page, Integer limit) {
if (userId == null) { if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
List<Short> orderStatus = OrderUtil.orderStatus(showType); List<Short> orderStatus = OrderUtil.orderStatus(showType);
List<LitemallOrder> orderList = orderService.queryByOrderStatus(userId, orderStatus, page, size); List<LitemallOrder> orderList = orderService.queryByOrderStatus(userId, orderStatus, page, limit);
long count = PageInfo.of(orderList).getTotal(); long count = PageInfo.of(orderList).getTotal();
int totalPages = (int) Math.ceil((double) count / size); int totalPages = (int) Math.ceil((double) count / limit);
List<Map<String, Object>> orderVoList = new ArrayList<>(orderList.size()); List<Map<String, Object>> orderVoList = new ArrayList<>(orderList.size());
for (LitemallOrder order : orderList) { for (LitemallOrder order : orderList) {
......
...@@ -33,16 +33,16 @@ public class WxBrandController { ...@@ -33,16 +33,16 @@ public class WxBrandController {
* 品牌列表 * 品牌列表
* *
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 品牌列表 * @return 品牌列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
List<LitemallBrand> brandList = brandService.queryVO(page, size); List<LitemallBrand> brandList = brandService.queryVO(page, limit);
int total = brandService.queryTotalCount(); int total = brandService.queryTotalCount();
int totalPages = (int) Math.ceil((double) total / size); int totalPages = (int) Math.ceil((double) total / limit);
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("brandList", brandList); data.put("brandList", brandList);
......
...@@ -40,21 +40,21 @@ public class WxCollectController { ...@@ -40,21 +40,21 @@ public class WxCollectController {
* @param userId 用户ID * @param userId 用户ID
* @param type 类型,如果是0则是商品收藏,如果是1则是专题收藏 * @param type 类型,如果是0则是商品收藏,如果是1则是专题收藏
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 用户收藏列表 * @return 用户收藏列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@LoginUser Integer userId, public Object list(@LoginUser Integer userId,
@NotNull Byte type, @NotNull Byte type,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
if (userId == null) { if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
List<LitemallCollect> collectList = collectService.queryByType(userId, type, page, size); List<LitemallCollect> collectList = collectService.queryByType(userId, type, page, limit);
int count = collectService.countByType(userId, type); int count = collectService.countByType(userId, type);
int totalPages = (int) Math.ceil((double) count / size); int totalPages = (int) Math.ceil((double) count / limit);
List<Object> collects = new ArrayList<>(collectList.size()); List<Object> collects = new ArrayList<>(collectList.size());
for (LitemallCollect collect : collectList) { for (LitemallCollect collect : collectList) {
......
...@@ -126,7 +126,7 @@ public class WxCommentController { ...@@ -126,7 +126,7 @@ public class WxCommentController {
* @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。 * @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。 * @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 评论列表 * @return 评论列表
*/ */
@GetMapping("list") @GetMapping("list")
...@@ -134,8 +134,8 @@ public class WxCommentController { ...@@ -134,8 +134,8 @@ public class WxCommentController {
@NotNull Integer valueId, @NotNull Integer valueId,
@NotNull Integer showType, @NotNull Integer showType,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
List<LitemallComment> commentList = commentService.query(type, valueId, showType, page, size); List<LitemallComment> commentList = commentService.query(type, valueId, showType, page, limit);
long count = PageInfo.of(commentList).getTotal(); long count = PageInfo.of(commentList).getTotal();
List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size()); List<Map<String, Object>> commentVoList = new ArrayList<>(commentList.size());
......
...@@ -51,18 +51,18 @@ public class WxCouponController { ...@@ -51,18 +51,18 @@ public class WxCouponController {
* 优惠券列表 * 优惠券列表
* *
* @param page * @param page
* @param size * @param limit
* @param sort * @param sort
* @param order * @param order
* @return * @return
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
List<LitemallCoupon> couponList = couponService.queryList(page, size, sort, order); List<LitemallCoupon> couponList = couponService.queryList(page, limit, sort, order);
int total = couponService.queryTotal(); int total = couponService.queryTotal();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("data", couponList); data.put("data", couponList);
...@@ -76,7 +76,7 @@ public class WxCouponController { ...@@ -76,7 +76,7 @@ public class WxCouponController {
* @param userId * @param userId
* @param status * @param status
* @param page * @param page
* @param size * @param limit
* @param sort * @param sort
* @param order * @param order
* @return * @return
...@@ -85,14 +85,14 @@ public class WxCouponController { ...@@ -85,14 +85,14 @@ public class WxCouponController {
public Object mylist(@LoginUser Integer userId, public Object mylist(@LoginUser Integer userId,
@NotNull Short status, @NotNull Short status,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
if (userId == null) { if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
List<LitemallCouponUser> couponUserList = couponUserService.queryList(userId, null, status, page, size, sort, order); List<LitemallCouponUser> couponUserList = couponUserService.queryList(userId, null, status, page, limit, sort, order);
List<CouponVo> couponVoList = change(couponUserList); List<CouponVo> couponVoList = change(couponUserList);
int total = couponService.queryTotal(); int total = couponService.queryTotal();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
......
...@@ -70,20 +70,20 @@ public class WxFootprintController { ...@@ -70,20 +70,20 @@ public class WxFootprintController {
* 用户足迹列表 * 用户足迹列表
* *
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 用户足迹列表 * @return 用户足迹列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@LoginUser Integer userId, public Object list(@LoginUser Integer userId,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
if (userId == null) { if (userId == null) {
return ResponseUtil.unlogin(); return ResponseUtil.unlogin();
} }
List<LitemallFootprint> footprintList = footprintService.queryByAddTime(userId, page, size); List<LitemallFootprint> footprintList = footprintService.queryByAddTime(userId, page, limit);
long count = PageInfo.of(footprintList).getTotal(); long count = PageInfo.of(footprintList).getTotal();
int totalPages = (int) Math.ceil((double) count / size); int totalPages = (int) Math.ceil((double) count / limit);
List<Object> footprintVoList = new ArrayList<>(footprintList.size()); List<Object> footprintVoList = new ArrayList<>(footprintList.size());
for (LitemallFootprint footprint : footprintList) { for (LitemallFootprint footprint : footprintList) {
......
...@@ -237,7 +237,7 @@ public class WxGoodsController { ...@@ -237,7 +237,7 @@ public class WxGoodsController {
* @param isHot 是否热买,可选 * @param isHot 是否热买,可选
* @param userId 用户ID * @param userId 用户ID
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @param sort 排序方式,支持"add_time", "retail_price"或"name" * @param sort 排序方式,支持"add_time", "retail_price"或"name"
* @param order 排序类型,顺序或者降序 * @param order 排序类型,顺序或者降序
* @return 根据条件搜素的商品详情 * @return 根据条件搜素的商品详情
...@@ -251,7 +251,7 @@ public class WxGoodsController { ...@@ -251,7 +251,7 @@ public class WxGoodsController {
Boolean isHot, Boolean isHot,
@LoginUser Integer userId, @LoginUser Integer userId,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort(accepts = {"add_time", "retail_price", "name"}) @RequestParam(defaultValue = "add_time") String sort, @Sort(accepts = {"add_time", "retail_price", "name"}) @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
...@@ -265,7 +265,7 @@ public class WxGoodsController { ...@@ -265,7 +265,7 @@ public class WxGoodsController {
} }
//查询列表数据 //查询列表数据
List<LitemallGoods> goodsList = goodsService.querySelective(categoryId, brandId, keyword, isHot, isNew, page, size, sort, order); List<LitemallGoods> goodsList = goodsService.querySelective(categoryId, brandId, keyword, isHot, isNew, page, limit, sort, order);
// 查询商品所属类目列表。 // 查询商品所属类目列表。
List<Integer> goodsCatIds = goodsService.getCatIds(brandId, keyword, isHot, isNew); List<Integer> goodsCatIds = goodsService.getCatIds(brandId, keyword, isHot, isNew);
......
...@@ -59,15 +59,15 @@ public class WxGrouponController { ...@@ -59,15 +59,15 @@ public class WxGrouponController {
* 团购规则列表 * 团购规则列表
* *
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 团购规则列表 * @return 团购规则列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
List<Map<String, Object>> topicList = grouponRulesService.queryList(page, size, sort, order); List<Map<String, Object>> topicList = grouponRulesService.queryList(page, limit, sort, order);
long total = PageInfo.of(topicList).getTotal(); long total = PageInfo.of(topicList).getTotal();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("data", topicList); data.put("data", topicList);
......
...@@ -27,15 +27,15 @@ public class WxOrderController { ...@@ -27,15 +27,15 @@ public class WxOrderController {
* @param userId 用户ID * @param userId 用户ID
* @param showType 订单信息 * @param showType 订单信息
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 订单列表 * @return 订单列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@LoginUser Integer userId, public Object list(@LoginUser Integer userId,
@RequestParam(defaultValue = "0") Integer showType, @RequestParam(defaultValue = "0") Integer showType,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
return wxOrderService.list(userId, showType, page, size); return wxOrderService.list(userId, showType, page, limit);
} }
/** /**
......
...@@ -76,8 +76,8 @@ public class WxSearchController { ...@@ -76,8 +76,8 @@ public class WxSearchController {
@GetMapping("helper") @GetMapping("helper")
public Object helper(@NotEmpty String keyword, public Object helper(@NotEmpty String keyword,
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) { @RequestParam(defaultValue = "10") Integer limit) {
List<LitemallKeyword> keywordsList = keywordsService.queryByKeyword(keyword, page, size); List<LitemallKeyword> keywordsList = keywordsService.queryByKeyword(keyword, page, limit);
String[] keys = new String[keywordsList.size()]; String[] keys = new String[keywordsList.size()];
int index = 0; int index = 0;
for (LitemallKeyword key : keywordsList) { for (LitemallKeyword key : keywordsList) {
......
...@@ -40,15 +40,15 @@ public class WxTopicController { ...@@ -40,15 +40,15 @@ public class WxTopicController {
* 专题列表 * 专题列表
* *
* @param page 分页页数 * @param page 分页页数
* @param size 分页大小 * @param limit 分页大小
* @return 专题列表 * @return 专题列表
*/ */
@GetMapping("list") @GetMapping("list")
public Object list(@RequestParam(defaultValue = "1") Integer page, public Object list(@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size, @RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort, @Sort @RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) { @Order @RequestParam(defaultValue = "desc") String order) {
List<LitemallTopic> topicList = topicService.queryList(page, size, sort, order); List<LitemallTopic> topicList = topicService.queryList(page, limit, sort, order);
int total = topicService.queryTotal(); int total = topicService.queryTotal();
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("data", topicList); data.put("data", topicList);
......
...@@ -14,7 +14,7 @@ Page({ ...@@ -14,7 +14,7 @@ Page({
hasPicCount: 0, hasPicCount: 0,
allPage: 1, allPage: 1,
picPage: 1, picPage: 1,
size: 20 limit: 20
}, },
getCommentCount: function() { getCommentCount: function() {
let that = this; let that = this;
......
...@@ -7,7 +7,7 @@ Page({ ...@@ -7,7 +7,7 @@ Page({
data: { data: {
couponList: [], couponList: [],
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
...@@ -86,7 +86,7 @@ Page({ ...@@ -86,7 +86,7 @@ Page({
util.request(api.CouponList, { util.request(api.CouponList, {
page: that.data.page, page: that.data.page,
size: that.data.size limit: that.data.limit
}).then(function (res) { }).then(function (res) {
if (res.errno === 0) { if (res.errno === 0) {
...@@ -124,7 +124,7 @@ Page({ ...@@ -124,7 +124,7 @@ Page({
}, },
nextPage: function (event) { nextPage: function (event) {
var that = this; var that = this;
if (this.data.page > that.data.count / that.data.size) { if (this.data.page > that.data.count / that.data.limit) {
return true; return true;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="page" wx:if="{{showPage}}"> <view class="page" wx:if="{{showPage}}">
<view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view> <view class="prev {{ page <= 1 ? 'disabled' : ''}}" bindtap="prevPage">上一页</view>
<view class="next {{ (count / size) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view> <view class="next {{ (count / limit) < page ? 'disabled' : ''}}" bindtap="nextPage">下一页</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
\ No newline at end of file
...@@ -16,7 +16,7 @@ Page({ ...@@ -16,7 +16,7 @@ Page({
currentSort: 'add_time', currentSort: 'add_time',
currentSortOrder: 'desc', currentSortOrder: 'desc',
page: 1, page: 1,
size: 100 limit: 100
}, },
getGoodsList: function() { getGoodsList: function() {
var that = this; var that = this;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment