|
@@ -68,7 +68,7 @@ Page({
|
|
indexMissionDialog: false,
|
|
indexMissionDialog: false,
|
|
unfinishedCount: 0
|
|
unfinishedCount: 0
|
|
},
|
|
},
|
|
- jurisdiction: function () {
|
|
|
|
|
|
+ jurisdiction: function() {
|
|
//隐藏弹框
|
|
//隐藏弹框
|
|
this.setData({
|
|
this.setData({
|
|
hide: !this.data.hide
|
|
hide: !this.data.hide
|
|
@@ -77,14 +77,14 @@ Page({
|
|
this.onShow();
|
|
this.onShow();
|
|
},
|
|
},
|
|
//tab点击
|
|
//tab点击
|
|
- switcher: function ({
|
|
|
|
|
|
+ switcher: function({
|
|
currentTarget
|
|
currentTarget
|
|
}) {
|
|
}) {
|
|
if (currentTarget.dataset.index === this.data.myIndex) return;
|
|
if (currentTarget.dataset.index === this.data.myIndex) return;
|
|
this.updateData(currentTarget.dataset.index);
|
|
this.updateData(currentTarget.dataset.index);
|
|
},
|
|
},
|
|
// 根据index 更新template
|
|
// 根据index 更新template
|
|
- updateData: function (index) {
|
|
|
|
|
|
+ updateData: function(index) {
|
|
let myIndex = index;
|
|
let myIndex = index;
|
|
let templates = this.data.tab[myIndex].templates;
|
|
let templates = this.data.tab[myIndex].templates;
|
|
this.setData({
|
|
this.setData({
|
|
@@ -108,7 +108,7 @@ Page({
|
|
groupInit(this);
|
|
groupInit(this);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onLoad: function (options) {
|
|
|
|
|
|
+ onLoad: function(options) {
|
|
this.uid = wx.getStorageSync('uid');
|
|
this.uid = wx.getStorageSync('uid');
|
|
wx.getSystemInfo({
|
|
wx.getSystemInfo({
|
|
success: (res) => {
|
|
success: (res) => {
|
|
@@ -123,8 +123,8 @@ Page({
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (wx.getStorageSync('uid')) {
|
|
if (wx.getStorageSync('uid')) {
|
|
httpRequestApi.userLoginRecord().success(res => {
|
|
httpRequestApi.userLoginRecord().success(res => {
|
|
- if (res.data.data.length !== 0) {
|
|
|
|
- // 有数据弹任务窗口
|
|
|
|
|
|
+ if (res.data.data && res.data.data.length !== 0) {
|
|
|
|
+ // 有数据弹签到
|
|
if (this.data.unfinishedCount > 0) {
|
|
if (this.data.unfinishedCount > 0) {
|
|
this.setData({
|
|
this.setData({
|
|
indexSignDialog: true
|
|
indexSignDialog: true
|
|
@@ -132,11 +132,11 @@ Page({
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- // 没数据弹签到
|
|
|
|
|
|
+ // 没数据弹任务
|
|
let oldDay = wx.getStorageSync('oldDay');
|
|
let oldDay = wx.getStorageSync('oldDay');
|
|
let newDate = new Date();
|
|
let newDate = new Date();
|
|
let day = newDate.getDate() < 10 ? '0' + newDate.getDate() : newDate.getDate()
|
|
let day = newDate.getDate() < 10 ? '0' + newDate.getDate() : newDate.getDate()
|
|
- let timeStep =(newDate.getMonth() + 1).toString() + day
|
|
|
|
|
|
+ let timeStep = (newDate.getMonth() + 1).toString() + day
|
|
if (oldDay) {
|
|
if (oldDay) {
|
|
let temp = parseInt(timeStep) - parseInt(oldDay)
|
|
let temp = parseInt(timeStep) - parseInt(oldDay)
|
|
if (temp > 0) {
|
|
if (temp > 0) {
|
|
@@ -159,7 +159,7 @@ Page({
|
|
// this.init();
|
|
// this.init();
|
|
|
|
|
|
},
|
|
},
|
|
- onShow: function () {
|
|
|
|
|
|
+ onShow: function() {
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
title: '小学课文朗读配音'
|
|
title: '小学课文朗读配音'
|
|
})
|
|
})
|
|
@@ -169,7 +169,7 @@ Page({
|
|
}, (error) => {
|
|
}, (error) => {
|
|
// console.log(error)
|
|
// console.log(error)
|
|
|
|
|
|
- wx.setStorageSync('userSourseType','normal')
|
|
|
|
|
|
+ wx.setStorageSync('userSourseType', 'normal')
|
|
this.setData({
|
|
this.setData({
|
|
hide: !this.data.hide
|
|
hide: !this.data.hide
|
|
})
|
|
})
|
|
@@ -180,11 +180,11 @@ Page({
|
|
this.getUserWorksInfo(true);
|
|
this.getUserWorksInfo(true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onHide: function(){
|
|
|
|
|
|
+ onHide: function() {
|
|
const str = 'hotData.inputFocus'
|
|
const str = 'hotData.inputFocus'
|
|
- this.setData({
|
|
|
|
- [str]: false
|
|
|
|
- });
|
|
|
|
|
|
+ this.setData({
|
|
|
|
+ [str]: false
|
|
|
|
+ });
|
|
},
|
|
},
|
|
//初始化数据
|
|
//初始化数据
|
|
// init: function () {
|
|
// init: function () {
|
|
@@ -200,7 +200,7 @@ Page({
|
|
// });
|
|
// });
|
|
// },
|
|
// },
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- getUserWorksInfo: function (flag) {
|
|
|
|
|
|
+ getUserWorksInfo: function(flag) {
|
|
console.log(flag)
|
|
console.log(flag)
|
|
if (flag) {
|
|
if (flag) {
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
@@ -231,8 +231,8 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 触底加载
|
|
// 触底加载
|
|
- onReachBottom: function () {
|
|
|
|
- console.log(this.data.myIndex )
|
|
|
|
|
|
+ onReachBottom: function() {
|
|
|
|
+ console.log(this.data.myIndex)
|
|
if (this.data.myIndex === 0) {
|
|
if (this.data.myIndex === 0) {
|
|
this.setData({
|
|
this.setData({
|
|
followPageNo: this.data.followPageNo + 1
|
|
followPageNo: this.data.followPageNo + 1
|
|
@@ -246,7 +246,7 @@ Page({
|
|
ifHaveMore: false
|
|
ifHaveMore: false
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
// 当前在推荐页面 加载推荐
|
|
// 当前在推荐页面 加载推荐
|
|
if (this.data.myIndex === 1) {
|
|
if (this.data.myIndex === 1) {
|
|
console.log(this.data.recommendPageNo)
|
|
console.log(this.data.recommendPageNo)
|
|
@@ -263,7 +263,7 @@ Page({
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- onPullDownRefresh: function () {
|
|
|
|
|
|
+ onPullDownRefresh: function() {
|
|
//当前在团购页下拉加载
|
|
//当前在团购页下拉加载
|
|
if (this.data.myIndex === 0) {
|
|
if (this.data.myIndex === 0) {
|
|
// groupInit(this);
|
|
// groupInit(this);
|
|
@@ -271,7 +271,7 @@ Page({
|
|
|
|
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
//模拟加载
|
|
//模拟加载
|
|
- setTimeout(function () {
|
|
|
|
|
|
+ setTimeout(function() {
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
}, 1500);
|
|
}, 1500);
|
|
@@ -290,7 +290,7 @@ Page({
|
|
// console.log('错误', error)
|
|
// console.log('错误', error)
|
|
// })
|
|
// })
|
|
// },
|
|
// },
|
|
- goToMessage: function () {
|
|
|
|
|
|
+ goToMessage: function() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/social/insideMessage/insideMessage`
|
|
url: `../../pages/social/insideMessage/insideMessage`
|
|
});
|
|
});
|
|
@@ -299,7 +299,7 @@ Page({
|
|
[str]: 0
|
|
[str]: 0
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- toMyCollage: function (e) {
|
|
|
|
|
|
+ toMyCollage: function(e) {
|
|
if (app.globalData.isIOS) {
|
|
if (app.globalData.isIOS) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的助力`
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的助力`
|
|
@@ -311,17 +311,17 @@ Page({
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- toMyCourse: function () {
|
|
|
|
|
|
+ toMyCourse: function() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/user/mycourse/mycourse?title=我的课程`
|
|
url: `../../pages/user/mycourse/mycourse?title=我的课程`
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- goToFlower: function () {
|
|
|
|
|
|
+ goToFlower: function() {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/social/littleFlower/littleFlower`
|
|
url: `../../pages/social/littleFlower/littleFlower`
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- signInBtn: function (e) {
|
|
|
|
|
|
+ signInBtn: function(e) {
|
|
this.setData({
|
|
this.setData({
|
|
indexSignDialog: false
|
|
indexSignDialog: false
|
|
})
|
|
})
|
|
@@ -331,7 +331,7 @@ Page({
|
|
})
|
|
})
|
|
this.goToFlower();
|
|
this.goToFlower();
|
|
},
|
|
},
|
|
- missionBtn: function () {
|
|
|
|
|
|
+ missionBtn: function() {
|
|
this.setData({
|
|
this.setData({
|
|
indexMissionDialog: false
|
|
indexMissionDialog: false
|
|
})
|
|
})
|