下来刷新性能优化
This commit is contained in:
parent
78ceda87ef
commit
0d4b86754d
|
|
@ -5,6 +5,7 @@
|
|||
"pages/newGoods/newGoods",
|
||||
"pages/hotGoods/hotGoods",
|
||||
"pages/ucenter/index/index",
|
||||
"pages/ucenter/main/index",
|
||||
"pages/ucenter/address/address",
|
||||
"pages/ucenter/addressAdd/addressAdd",
|
||||
"pages/ucenter/feedback/feedback",
|
||||
|
|
@ -49,13 +50,13 @@
|
|||
"lib/home/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarBackgroundColor": "#85c43f",
|
||||
"navigationBarTitleText": "聚惠星",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"backgroundTextStyle": "dark"
|
||||
},
|
||||
"navigationBarBackgroundColor": "#85c43f",
|
||||
"navigationBarTitleText": "聚惠星",
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"backgroundTextStyle": "dark"
|
||||
},
|
||||
"tabBar": {
|
||||
"backgroundColor": "#fafafa",
|
||||
"borderStyle": "white",
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ module.exports = {
|
|||
CouponReceive: WxApiRoot + 'coupon/receive', //优惠券领取
|
||||
CouponReceiveAll: WxApiRoot + 'coupon/receiveAll', //优惠券领取
|
||||
CouponExchange: WxApiRoot + 'coupon/exchange', //优惠券兑换
|
||||
GetUserCoupon:WxApiRoot + 'coupon/getUserCoupon',//用户个人可领取优惠券查询
|
||||
GetUserCoupon: WxApiRoot + 'coupon/getUserCoupon',//用户个人可领取优惠券查询
|
||||
|
||||
StorageUpload: WxApiRoot + 'storage/upload', //图片上传,
|
||||
|
||||
|
|
@ -100,5 +100,7 @@ module.exports = {
|
|||
BrokerageMain: WxApiRoot + 'brokerage/main',//佣金收益主页面
|
||||
SettleOrderList: WxApiRoot + 'brokerage/settleOrderList',//佣金收益主页面
|
||||
ExtractList: WxApiRoot + 'brokerage/extractList',//佣金账号提现记录
|
||||
ArticleDetail: WxApiRoot + 'article/detail' //公告详情
|
||||
ArticleDetail: WxApiRoot + 'article/detail',//公告详情
|
||||
ApplyAgency: WxApiRoot + 'user/applyAgency',//代理申请
|
||||
GetSharedUrl: WxApiRoot + 'user/getSharedUrl' //获取推广二维码
|
||||
};
|
||||
|
|
@ -10,7 +10,8 @@ Page({
|
|||
brand: {},
|
||||
goodsList: [],
|
||||
page: 1,
|
||||
size: 200
|
||||
size: 10,
|
||||
totalPages: 1
|
||||
},
|
||||
onLoad: function(options) {
|
||||
// 页面初始化 options为页面跳转所带来的参数
|
||||
|
|
@ -45,7 +46,8 @@ Page({
|
|||
.then(function(res) {
|
||||
if (res.errno === 0) {
|
||||
that.setData({
|
||||
goodsList: res.data.goodsList
|
||||
goodsList: that.data.goodsList.concat(res.data.goodsList),
|
||||
totalPages: res.data.totalPages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -65,5 +67,20 @@ Page({
|
|||
onUnload: function() {
|
||||
// 页面关闭
|
||||
|
||||
}
|
||||
},
|
||||
onReachBottom:function() {
|
||||
if (this.data.totalPages > this.data.page) {
|
||||
this.setData({
|
||||
page: this.data.page + 1
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '已经到底了!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.getGoodsList();
|
||||
}
|
||||
})
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<view class="service-policy">
|
||||
<view class="item">全场优惠券抵扣</view>
|
||||
<view class="item">7天无忧快速退货</view>
|
||||
<view class="item">满66元免邮费</view>
|
||||
<view class="item">满40元免邮费</view>
|
||||
</view>
|
||||
<view class="no-cart" wx:if="{{cartGoods.length <= 0 && brandCartgoods.length <=0 }}">
|
||||
<view class="c">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ Page({
|
|||
scrollTop: 0,
|
||||
scrollHeight: 0,
|
||||
page: 1,
|
||||
size: 500
|
||||
size: 10,
|
||||
totalPages: 1
|
||||
},
|
||||
onLoad: function(options) {
|
||||
// 页面初始化 options为页面跳转所带来的参数
|
||||
|
|
@ -100,7 +101,8 @@ Page({
|
|||
})
|
||||
.then(function(res) {
|
||||
that.setData({
|
||||
goodsList: res.data.goodsList,
|
||||
goodsList: that.data.goodsList.concat(res.data.goodsList),
|
||||
totalPages: res.data.totalPages
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
@ -124,9 +126,27 @@ Page({
|
|||
});
|
||||
}
|
||||
this.setData({
|
||||
id: event.currentTarget.dataset.id
|
||||
id: event.currentTarget.dataset.id,
|
||||
goodsList: [],
|
||||
page: 1,
|
||||
totalPages: 1
|
||||
});
|
||||
|
||||
this.getCategoryInfo();
|
||||
}
|
||||
},
|
||||
onReachBottom:function() {
|
||||
if (this.data.totalPages > this.data.page) {
|
||||
this.setData({
|
||||
page: this.data.page + 1
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '已经到底了!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.getGoodsList();
|
||||
}
|
||||
})
|
||||
|
|
@ -16,7 +16,8 @@ Page({
|
|||
currentSort: 'browse',
|
||||
currentSortOrder: 'desc',
|
||||
page: 1,
|
||||
size: 200
|
||||
size: 10,
|
||||
totalPages: 1
|
||||
},
|
||||
getCategoryList: function() {
|
||||
var that = this;
|
||||
|
|
@ -46,8 +47,9 @@ Page({
|
|||
.then(function(res) {
|
||||
if (res.errno === 0) {
|
||||
that.setData({
|
||||
goodsList: res.data.goodsList,
|
||||
filterCategory: res.data.filterCategoryList
|
||||
goodsList: that.data.goodsList.concat(res.data.goodsList),
|
||||
filterCategory: res.data.filterCategoryList,
|
||||
totalPages: res.data.totalPages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -128,5 +130,20 @@ Page({
|
|||
'categoryId': this.data.filterCategory[currentIndex].id
|
||||
});
|
||||
this.getGoodsList();
|
||||
},
|
||||
onReachBottom:function() {
|
||||
if (this.data.totalPages > this.data.page) {
|
||||
this.setData({
|
||||
page: this.data.page + 1
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '已经到底了!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.getGoodsList();
|
||||
}
|
||||
})
|
||||
|
|
@ -16,7 +16,8 @@ Page({
|
|||
currentSort: 'add_time',
|
||||
currentSortOrder: 'desc',
|
||||
page: 1,
|
||||
size: 200
|
||||
size: 10,
|
||||
totalPages: 1
|
||||
},
|
||||
getGoodsList: function() {
|
||||
var that = this;
|
||||
|
|
@ -32,8 +33,9 @@ Page({
|
|||
.then(function(res) {
|
||||
if (res.errno === 0) {
|
||||
that.setData({
|
||||
goodsList: res.data.goodsList,
|
||||
filterCategory: res.data.filterCategoryList
|
||||
goodsList: that.data.goodsList.concat(res.data.goodsList),
|
||||
filterCategory: res.data.filterCategoryList,
|
||||
totalPages: res.data.totalPages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -113,6 +115,20 @@ Page({
|
|||
'categoryId': this.data.filterCategory[currentIndex].id
|
||||
});
|
||||
this.getGoodsList();
|
||||
|
||||
},
|
||||
onReachBottom:function() {
|
||||
if (this.data.totalPages > this.data.page) {
|
||||
this.setData({
|
||||
page: this.data.page + 1
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '已经到底了!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.getGoodsList();
|
||||
}
|
||||
})
|
||||
|
|
@ -17,8 +17,9 @@ Page({
|
|||
defaultKeyword: {},
|
||||
hotKeyword: [],
|
||||
page: 1,
|
||||
size: 20,
|
||||
categoryId: 0
|
||||
size: 10,
|
||||
categoryId: 0,
|
||||
totalPages: 1
|
||||
},
|
||||
//事件处理函数
|
||||
closeSearch: function() {
|
||||
|
|
@ -104,8 +105,9 @@ Page({
|
|||
that.setData({
|
||||
searchStatus: true,
|
||||
categoryFilter: false,
|
||||
goodsList: res.data.goodsList,
|
||||
filterCategory: res.data.filterCategoryList
|
||||
goodsList: that.data.goodsList.concat(res.data.goodsList),
|
||||
filterCategory: res.data.filterCategoryList,
|
||||
totalPages: res.data.totalPages
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +127,7 @@ Page({
|
|||
this.setData({
|
||||
keyword: keyword,
|
||||
page: 1,
|
||||
totalPages: 1,
|
||||
categoryId: 0,
|
||||
goodsList: []
|
||||
});
|
||||
|
|
@ -185,11 +188,27 @@ Page({
|
|||
categoryFilter: false,
|
||||
categoryId: currentCategory.id,
|
||||
page: 1,
|
||||
totalPages: 1,
|
||||
goodsList: []
|
||||
});
|
||||
this.getGoodsList();
|
||||
},
|
||||
onKeywordConfirm(event) {
|
||||
this.getSearchResult(event.detail.value);
|
||||
}
|
||||
},
|
||||
onReachBottom:function() {
|
||||
if (this.data.totalPages > this.data.page) {
|
||||
this.setData({
|
||||
page: this.data.page + 1
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '已经到底了!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.getGoodsList();
|
||||
}
|
||||
})
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
"list": []
|
||||
},
|
||||
"miniprogram": {
|
||||
"current": 22,
|
||||
"current": 38,
|
||||
"list": [
|
||||
{
|
||||
"id": -1,
|
||||
|
|
@ -269,6 +269,13 @@
|
|||
"name": "优惠券列表",
|
||||
"pathName": "pages/coupon/coupon",
|
||||
"query": ""
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"name": "QcCode",
|
||||
"pathName": "pages/index/index",
|
||||
"query": "shareUserId=100",
|
||||
"scene": 1011
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue