Browse Source

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

Junling Bu 6 years ago
parent
commit
22d0345eec

+ 2 - 2
litemall-wx/pages/brand/brand.js

@@ -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({

+ 2 - 2
litemall-wx/pages/brandDetail/brandDetail.js

@@ -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) {

+ 2 - 2
litemall-wx/pages/comment/comment.js

@@ -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;
       }
 

+ 5 - 5
litemall-wx/pages/groupon/grouponList/grouponList.js

@@ -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;
     }
 

+ 8 - 8
litemall-wx/pages/groupon/grouponList/grouponList.wxml

@@ -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>

+ 1 - 1
litemall-wx/pages/groupon/myGroupon/myGroupon.js

@@ -24,7 +24,7 @@ Page({
     }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
-          orderList: res.data.data
+          orderList: res.data.list
         });
       }
     });

+ 3 - 3
litemall-wx/pages/help/help.js

@@ -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) {
 

+ 1 - 1
litemall-wx/pages/help/help.wxml

@@ -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>

+ 6 - 6
litemall-wx/pages/topicComment/topicComment.js

@@ -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
       });
     }
 

+ 1 - 1
litemall-wx/pages/topicDetail/topicDetail.js

@@ -49,7 +49,7 @@ Page({
       type: 1,
       showType: 0,
       page: 1,
-      size: 5
+      limit: 5
     }).then(function(res) {
       if (res.errno === 0) {
         that.setData({

+ 2 - 2
litemall-wx/pages/ucenter/collect/collect.js

@@ -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({

+ 4 - 4
litemall-wx/pages/ucenter/couponList/couponList.js

@@ -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

+ 2 - 2
renard-wx/pages/brand/brand.js

@@ -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({

+ 2 - 2
renard-wx/pages/brandDetail/brandDetail.js

@@ -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) {

+ 4 - 4
renard-wx/pages/groupon/grouponList/grouponList.js

@@ -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();

+ 8 - 8
renard-wx/pages/groupon/grouponList/grouponList.wxml

@@ -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>

+ 1 - 1
renard-wx/pages/groupon/myGroupon/myGroupon.js

@@ -32,7 +32,7 @@ Page({
     }).then(function(res) {
       if (res.errno === 0) {
         that.setData({
-          orderList: res.data.data
+          orderList: res.data.list
         });
         wx.hideLoading();
       }