|
|
@@ -30,6 +30,29 @@ Page({
|
|
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
+
|
|
|
+ },
|
|
|
+ onReady: function() {
|
|
|
+
|
|
|
+ },
|
|
|
+ //下拉刷新
|
|
|
+ onPullDownRefresh: function () {
|
|
|
+ this.setData({
|
|
|
+ pageNo: 1, //当前分页
|
|
|
+ isScroll: true, //是否可以滚动
|
|
|
+ list: [],
|
|
|
+ })
|
|
|
+ this.start();
|
|
|
+ wx.stopPullDownRefresh();
|
|
|
+ },
|
|
|
+ onReachBottom: function() {
|
|
|
+ var pageNo = this.data.pageNo + 1;
|
|
|
+ this.setData({
|
|
|
+ pageNo
|
|
|
+ })
|
|
|
+ this.fetchList()
|
|
|
+ },
|
|
|
+ onShow: function() {
|
|
|
if (app.globalData.userInfo) {
|
|
|
console.log('有info===', app.globalData)
|
|
|
this.start()
|
|
|
@@ -51,25 +74,19 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- onReady: function() {
|
|
|
-
|
|
|
- },
|
|
|
- onReachBottom: function() {
|
|
|
- var pageNo = this.data.pageNo + 1;
|
|
|
- this.setData({
|
|
|
- pageNo
|
|
|
- })
|
|
|
- this.fetchList()
|
|
|
- },
|
|
|
- onShow: function() {
|
|
|
-
|
|
|
- },
|
|
|
start() {
|
|
|
+ let cityName = wx.getStorageSync('city') || app.globalData.userInfo.city || '无锡'
|
|
|
+ let cityCode = wx.getStorageSync('cityCode') || '320200';
|
|
|
+ console.log(cityName)
|
|
|
+ console.log(cityCode)
|
|
|
this.setData({
|
|
|
- cityName: updataStorageData('city') || app.globalData.userInfo.city || '无锡'
|
|
|
+ cityName: cityName,
|
|
|
+ cityCode: cityCode,
|
|
|
+ pageNo: 1, //当前分页
|
|
|
+ isScroll: true, //是否可以滚动
|
|
|
+ list: []
|
|
|
})
|
|
|
this.fetchList()
|
|
|
- // this.fetchPt()
|
|
|
},
|
|
|
|
|
|
//获取拼团列表数据
|
|
|
@@ -130,7 +147,7 @@ Page({
|
|
|
onShareAppMessage: function() {
|
|
|
return {
|
|
|
title: '快来开心工作看看吧',
|
|
|
- path: '/pages/index/index?shareToken=' + updataStorageData('shareToken'),
|
|
|
+ path: '/pages/index/index',
|
|
|
imageUrl: ''
|
|
|
}
|
|
|
},
|