|
@@ -51,9 +51,9 @@ Page({
|
|
|
winH: 568,
|
|
|
myIndex: 1,
|
|
|
followData: [],
|
|
|
- recommendPageNo: 1,
|
|
|
- recommendTotalNo: 0,
|
|
|
- followPageNo: 0,
|
|
|
+ recommendPageNo: 0,
|
|
|
+ recommendTotalNo: 1,
|
|
|
+ followPageNo: 1,
|
|
|
followPageTotalNo: 1,
|
|
|
myData: {},
|
|
|
templates: 'hot',
|
|
@@ -66,7 +66,7 @@ Page({
|
|
|
ifHaveMore: true,
|
|
|
indexSignDialog: false,
|
|
|
indexMissionDialog: false,
|
|
|
- unfinishedCount:0
|
|
|
+ unfinishedCount: 0
|
|
|
},
|
|
|
jurisdiction: function () {
|
|
|
//隐藏弹框
|
|
@@ -94,14 +94,14 @@ Page({
|
|
|
if (myIndex == 0) {
|
|
|
// groupInit(this);
|
|
|
this.setData({
|
|
|
- followPageNo: 0,
|
|
|
+ followPageNo: 1,
|
|
|
})
|
|
|
myInit(this);
|
|
|
}
|
|
|
if (myIndex == 1) {
|
|
|
- this.setData({
|
|
|
- recommendPageNo: 1
|
|
|
- })
|
|
|
+ // this.setData({
|
|
|
+ // recommendPageNo: 0
|
|
|
+ // })
|
|
|
hotInit(this);
|
|
|
}
|
|
|
if (myIndex == 2) {
|
|
@@ -121,21 +121,35 @@ Page({
|
|
|
this.updateData(options.index)
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- if(wx.getStorageSync('uid')){
|
|
|
+ if (wx.getStorageSync('uid')) {
|
|
|
httpRequestApi.userLoginRecord().success(res => {
|
|
|
if (res.data.data) {
|
|
|
// 有数据弹任务窗口
|
|
|
- if(this.data.unfinishedCount > 0){
|
|
|
+ if (this.data.unfinishedCount > 0) {
|
|
|
this.setData({
|
|
|
indexSignDialog: true
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
// 没数据弹签到
|
|
|
- this.setData({
|
|
|
- indexMissionDialog: true
|
|
|
- })
|
|
|
+ let oldDay = wx.getStorageSync('oldDay');
|
|
|
+ let newDate = new Date();
|
|
|
+ let timeStep =(newDate.getMonth() + 1).toString() + newDate.getDate().toString()
|
|
|
+ if (oldDay) {
|
|
|
+ let temp = parseInt(timeStep) - parseInt(oldDay)
|
|
|
+ if (temp > 0) {
|
|
|
+ wx.setStorageSync('oldDay', timeStep);
|
|
|
+ this.setData({
|
|
|
+ indexMissionDialog: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wx.setStorageSync('oldDay', timeStep);
|
|
|
+ this.setData({
|
|
|
+ indexMissionDialog: true
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -163,6 +177,12 @@ Page({
|
|
|
this.getUserWorksInfo(true);
|
|
|
}
|
|
|
},
|
|
|
+ onHide: function(){
|
|
|
+ const str = 'hotData.inputFocus'
|
|
|
+ this.setData({
|
|
|
+ [str]: false
|
|
|
+ });
|
|
|
+ },
|
|
|
//初始化数据
|
|
|
// init: function () {
|
|
|
// httputil.getOpenidSessionKey((res) => {
|
|
@@ -209,9 +229,8 @@ Page({
|
|
|
},
|
|
|
// 触底加载
|
|
|
onReachBottom: function () {
|
|
|
+ console.log(this.data.myIndex )
|
|
|
if (this.data.myIndex === 0) {
|
|
|
- console.log(this.data.followPageTotalNo)
|
|
|
- console.log(this.data.followPageNo)
|
|
|
this.setData({
|
|
|
followPageNo: this.data.followPageNo + 1
|
|
|
})
|
|
@@ -224,26 +243,27 @@ Page({
|
|
|
ifHaveMore: false
|
|
|
})
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
// 当前在推荐页面 加载推荐
|
|
|
- // if (this.data.myIndex === 1) {
|
|
|
- // console.log(this.data.recommendPageNo)
|
|
|
- // this.setData({
|
|
|
- // recommendPageNo: this.data.recommendPageNo + 1
|
|
|
- // })
|
|
|
- // if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
|
|
|
- // this.getHotRecommend(this.uid, this.data.recommendPageNo, 3);
|
|
|
+ if (this.data.myIndex === 1) {
|
|
|
+ console.log(this.data.recommendPageNo)
|
|
|
+ console.log(this.data.recommendTotalNo)
|
|
|
+ this.setData({
|
|
|
+ recommendPageNo: this.data.recommendPageNo + 1
|
|
|
+ })
|
|
|
+ if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
|
|
|
+ this.getHotRecommendSecond(this.uid, this.data.recommendPageNo, 3);
|
|
|
|
|
|
- // } else {
|
|
|
- // console.log('没有更多')
|
|
|
- // }
|
|
|
- // }
|
|
|
+ } else {
|
|
|
+ console.log('没有更多')
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
onPullDownRefresh: function () {
|
|
|
//当前在团购页下拉加载
|
|
|
if (this.data.myIndex === 0) {
|
|
|
- groupInit(this);
|
|
|
+ // groupInit(this);
|
|
|
}
|
|
|
|
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
@@ -288,7 +308,7 @@ Page({
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- toMyCourse: function(){
|
|
|
+ toMyCourse: function () {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/user/mycourse/mycourse?title=我的课程`
|
|
|
});
|
|
@@ -298,15 +318,17 @@ Page({
|
|
|
url: `../../pages/social/littleFlower/littleFlower`
|
|
|
});
|
|
|
},
|
|
|
- signInBtn: function (e){
|
|
|
+ signInBtn: function (e) {
|
|
|
this.setData({
|
|
|
indexSignDialog: false
|
|
|
})
|
|
|
console.log(e.detail.formId)
|
|
|
- httpRequestApi.postFormId(e.detail.formId).success(res=>{console.log(res)})
|
|
|
+ httpRequestApi.postFormId(e.detail.formId).success(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
this.goToFlower();
|
|
|
},
|
|
|
- missionBtn: function(){
|
|
|
+ missionBtn: function () {
|
|
|
this.setData({
|
|
|
indexMissionDialog: false
|
|
|
})
|