Commit 22d0345e authored by Junling Bu's avatar Junling Bu
Browse files

fix[litemall-wx, renard-wx]: 小程序端的页面参数统一采用limit,而不是原来的size

parent c5b8b3c5
...@@ -5,7 +5,7 @@ Page({ ...@@ -5,7 +5,7 @@ Page({
data: { data: {
brandList: [], brandList: [],
page: 1, page: 1,
size: 10, limit: 10,
totalPages: 1 totalPages: 1
}, },
onLoad: function(options) { onLoad: function(options) {
...@@ -19,7 +19,7 @@ Page({ ...@@ -19,7 +19,7 @@ Page({
let that = this; let that = this;
util.request(api.BrandList, { util.request(api.BrandList, {
page: that.data.page, page: that.data.page,
limit: that.data.size limit: that.data.limit
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
......
...@@ -10,7 +10,7 @@ Page({ ...@@ -10,7 +10,7 @@ Page({
brand: {}, brand: {},
goodsList: [], goodsList: [],
page: 1, page: 1,
size: 100 limit: 10
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
...@@ -40,7 +40,7 @@ Page({ ...@@ -40,7 +40,7 @@ Page({
util.request(api.GoodsList, { util.request(api.GoodsList, {
brandId: that.data.id, brandId: that.data.id,
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) {
......
...@@ -105,7 +105,7 @@ Page({ ...@@ -105,7 +105,7 @@ Page({
console.log('onPullDownRefresh'); console.log('onPullDownRefresh');
if (this.data.showType == 0) { if (this.data.showType == 0) {
if (this.data.allCount / this.data.size < this.data.allPage) { if (this.data.allCount / this.data.limit < this.data.allPage) {
return false; return false;
} }
...@@ -113,7 +113,7 @@ Page({ ...@@ -113,7 +113,7 @@ Page({
'allPage': this.data.allPage + 1 'allPage': this.data.allPage + 1
}); });
} else { } else {
if (this.data.hasPicCount / this.data.size < this.data.picPage) { if (this.data.hasPicCount / this.data.limit < this.data.picPage) {
return false; return false;
} }
......
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
data: { data: {
grouponList: [], grouponList: [],
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
...@@ -89,15 +89,15 @@ Page({ ...@@ -89,15 +89,15 @@ Page({
util.request(api.GroupOnList, { util.request(api.GroupOnList, {
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) {
that.setData({ that.setData({
scrollTop: 0, scrollTop: 0,
grouponList: res.data.data, grouponList: res.data.list,
showPage: true, showPage: true,
count: res.data.count count: res.data.total
}); });
} }
wx.hideToast(); wx.hideToast();
...@@ -106,7 +106,7 @@ Page({ ...@@ -106,7 +106,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;
} }
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<scroll-view class="groupon-list" scroll-y="true" scroll-top="{{scrollTop}}"> <scroll-view class="groupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
<view class="item" wx:for="{{grouponList}}" wx:for-index="index" wx:for-item="item" wx:key="id"> <view class="item" wx:for="{{grouponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.goods.id}}"> <navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.goods.picUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right"> <view class="right">
<view class="text"> <view class="text">
<view class="header"> <view class="header">
<text class="name">{{item.goods.name}}</text> <text class="name">{{item.name}}</text>
<view class="capsule-tag"> <view class="capsule-tag">
<zan-capsule color="#a78845" leftText="团" rightText="{{item.groupon_member}}" /> <zan-capsule color="#a78845" leftText="{{item.grouponMember}}人成团" rightText="立减{{item.grouponDiscount}}" />
</view> </view>
</view> </view>
<text class="desc">{{item.goods.brief}}</text> <text class="desc">{{item.brief}}</text>
<view class="price"> <view class="price">
<view class="counterPrice">价:¥{{item.goods.counterPrice}}</view> <view class="counterPrice">价:¥{{item.retailPrice}}</view>
<view class="retailPrice">价:¥{{item.groupon_price}}</view> <view class="retailPrice">团购价:¥{{item.grouponPrice}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,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
...@@ -24,7 +24,7 @@ Page({ ...@@ -24,7 +24,7 @@ Page({
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
orderList: res.data.data orderList: res.data.list
}); });
} }
}); });
......
...@@ -10,7 +10,7 @@ Page({ ...@@ -10,7 +10,7 @@ Page({
data: { data: {
issueList: [], issueList: [],
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
showPage: false showPage: false
}, },
...@@ -72,7 +72,7 @@ Page({ ...@@ -72,7 +72,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;
} }
...@@ -93,7 +93,7 @@ Page({ ...@@ -93,7 +93,7 @@ Page({
util.request(api.IssueList, { util.request(api.IssueList, {
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) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,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>
</view> </view>
\ No newline at end of file
...@@ -15,7 +15,7 @@ Page({ ...@@ -15,7 +15,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;
...@@ -37,7 +37,7 @@ Page({ ...@@ -37,7 +37,7 @@ Page({
util.request(api.CommentList, { util.request(api.CommentList, {
valueId: that.data.valueId, valueId: that.data.valueId,
type: that.data.type, type: that.data.type,
size: that.data.size, limit: that.data.limit,
page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage), page: (that.data.showType == 0 ? that.data.allPage : that.data.picPage),
showType: that.data.showType showType: that.data.showType
}).then(function(res) { }).then(function(res) {
...@@ -95,20 +95,20 @@ Page({ ...@@ -95,20 +95,20 @@ Page({
console.log('onPullDownRefresh'); console.log('onPullDownRefresh');
if (this.data.showType == 0) { if (this.data.showType == 0) {
if (this.data.allCount / this.data.size < this.data.allPage) { if (this.data.allCount / this.data.limit < this.data.allPage) {
return false; return false;
} }
this.setData({ this.setData({
'allPage': this.data.allPage + 1 allPage: this.data.allPage + 1
}); });
} else { } else {
if (this.data.hasPicCount / this.data.size < this.data.picPage) { if (this.data.hasPicCount / this.data.limit < this.data.picPage) {
return false; return false;
} }
this.setData({ this.setData({
'picPage': this.data.picPage + 1 picPage: this.data.picPage + 1
}); });
} }
......
...@@ -49,7 +49,7 @@ Page({ ...@@ -49,7 +49,7 @@ Page({
type: 1, type: 1,
showType: 0, showType: 0,
page: 1, page: 1,
size: 5 limit: 5
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
......
...@@ -8,7 +8,7 @@ Page({ ...@@ -8,7 +8,7 @@ Page({
type: 0, type: 0,
collectList: [], collectList: [],
page: 1, page: 1,
size: 10, limit: 10,
totalPages: 1 totalPages: 1
}, },
getCollectList() { getCollectList() {
...@@ -19,7 +19,7 @@ Page({ ...@@ -19,7 +19,7 @@ Page({
util.request(api.CollectList, { util.request(api.CollectList, {
type: that.data.type, type: that.data.type,
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) {
that.setData({ that.setData({
......
...@@ -9,7 +9,7 @@ Page({ ...@@ -9,7 +9,7 @@ Page({
code: '', code: '',
status: 0, status: 0,
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
...@@ -82,7 +82,7 @@ Page({ ...@@ -82,7 +82,7 @@ Page({
util.request(api.CouponMyList, { util.request(api.CouponMyList, {
status: that.data.status, status: that.data.status,
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) {
...@@ -131,7 +131,7 @@ Page({ ...@@ -131,7 +131,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;
} }
...@@ -159,7 +159,7 @@ Page({ ...@@ -159,7 +159,7 @@ Page({
couponList: [], couponList: [],
status: e.currentTarget.dataset.index, status: e.currentTarget.dataset.index,
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
......
...@@ -5,7 +5,7 @@ Page({ ...@@ -5,7 +5,7 @@ Page({
data: { data: {
brandList: [], brandList: [],
page: 1, page: 1,
size: 10, limit: 10,
totalPages: 1 totalPages: 1
}, },
onLoad: function(options) { onLoad: function(options) {
...@@ -19,7 +19,7 @@ Page({ ...@@ -19,7 +19,7 @@ Page({
let that = this; let that = this;
util.request(api.BrandList, { util.request(api.BrandList, {
page: that.data.page, page: that.data.page,
limit: that.data.size limit: that.data.limit
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
......
...@@ -9,7 +9,7 @@ Page({ ...@@ -9,7 +9,7 @@ Page({
brand: {}, brand: {},
goodsList: [], goodsList: [],
page: 1, page: 1,
size: 100 limit: 10
}, },
onLoad: function(options) { onLoad: function(options) {
// 页面初始化 options为页面跳转所带来的参数 // 页面初始化 options为页面跳转所带来的参数
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
util.request(api.GoodsList, { util.request(api.GoodsList, {
brandId: that.data.id, brandId: that.data.id,
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) {
......
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
data: { data: {
grouponList: [], grouponList: [],
page: 1, page: 1,
size: 10, limit: 10,
count: 0, count: 0,
scrollTop: 0, scrollTop: 0,
showPage: false showPage: false
...@@ -89,15 +89,15 @@ Page({ ...@@ -89,15 +89,15 @@ Page({
util.request(api.GroupOnList, { util.request(api.GroupOnList, {
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) {
that.setData({ that.setData({
scrollTop: 0, scrollTop: 0,
grouponList: res.data.data, grouponList: res.data.list,
showPage: true, showPage: true,
count: res.data.count count: res.data.total
}); });
} }
wx.hideToast(); wx.hideToast();
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
<scroll-view class="groupon-list" scroll-y="true" scroll-top="{{scrollTop}}"> <scroll-view class="groupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
<view class="item" wx:for="{{grouponList}}" wx:for-index="index" wx:for-item="item" wx:key="id"> <view class="item" wx:for="{{grouponList}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.goods.id}}"> <navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.goods.picUrl}}" background-size="cover"></image> <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
<view class="right"> <view class="right">
<view class="text"> <view class="text">
<view class="header"> <view class="header">
<text class="name">{{item.goods.name}}</text> <text class="name">{{item.name}}</text>
<view class="capsule-tag"> <view class="capsule-tag">
<zan-capsule color="#a78845" leftText="团" rightText="{{item.groupon_member}}" /> <zan-capsule color="#a78845" leftText="{{item.grouponMember}}人成团" rightText="立减{{item.grouponDiscount}}" />
</view> </view>
</view> </view>
<text class="desc">{{item.goods.brief}}</text> <text class="desc">{{item.brief}}</text>
<view class="price"> <view class="price">
<view class="counterPrice">价:¥{{item.goods.counterPrice}}</view> <view class="counterPrice">价:¥{{item.retailPrice}}</view>
<view class="retailPrice">价:¥{{item.groupon_price}}</view> <view class="retailPrice">团购价:¥{{item.grouponPrice}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,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
...@@ -32,7 +32,7 @@ Page({ ...@@ -32,7 +32,7 @@ Page({
}).then(function(res) { }).then(function(res) {
if (res.errno === 0) { if (res.errno === 0) {
that.setData({ that.setData({
orderList: res.data.data orderList: res.data.list
}); });
wx.hideLoading(); wx.hideLoading();
} }
......
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