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