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