|
@@ -18,9 +18,9 @@ import {
|
|
import {
|
|
import {
|
|
myInit
|
|
myInit
|
|
} from '../../component/my/my';
|
|
} from '../../component/my/my';
|
|
-import {
|
|
|
|
- followInit
|
|
|
|
-} from '../../component/follow/follow';
|
|
|
|
|
|
+// import {
|
|
|
|
+// followInit
|
|
|
|
+// } from '../../component/follow/follow';
|
|
// import '../../utils/hls';
|
|
// import '../../utils/hls';
|
|
import httpRequestApi from '../../utils/APIClient';
|
|
import httpRequestApi from '../../utils/APIClient';
|
|
import httputil from '../../utils/httpUtil';
|
|
import httputil from '../../utils/httpUtil';
|
|
@@ -30,8 +30,7 @@ import {
|
|
|
|
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
- tab: [
|
|
|
|
- {
|
|
|
|
|
|
+ tab: [{
|
|
name: '我的',
|
|
name: '我的',
|
|
templates: 'my',
|
|
templates: 'my',
|
|
},
|
|
},
|
|
@@ -47,7 +46,7 @@ Page({
|
|
// name: '动态',
|
|
// name: '动态',
|
|
// templates: 'follow',
|
|
// templates: 'follow',
|
|
// },
|
|
// },
|
|
-
|
|
|
|
|
|
+
|
|
],
|
|
],
|
|
winH: 568,
|
|
winH: 568,
|
|
myIndex: 1,
|
|
myIndex: 1,
|
|
@@ -63,8 +62,11 @@ Page({
|
|
hotInput: '12345',
|
|
hotInput: '12345',
|
|
mineSettingInfo: '528',
|
|
mineSettingInfo: '528',
|
|
hide: true,
|
|
hide: true,
|
|
- isIOS:app.globalData.isIOS,
|
|
|
|
- ifHaveMore: true
|
|
|
|
|
|
+ isIOS: app.globalData.isIOS,
|
|
|
|
+ ifHaveMore: true,
|
|
|
|
+ indexSignDialog: false,
|
|
|
|
+ indexMissionDialog: false,
|
|
|
|
+ unfinishedCount:0
|
|
},
|
|
},
|
|
jurisdiction: function () {
|
|
jurisdiction: function () {
|
|
//隐藏弹框
|
|
//隐藏弹框
|
|
@@ -103,16 +105,8 @@ Page({
|
|
hotInit(this);
|
|
hotInit(this);
|
|
}
|
|
}
|
|
if (myIndex == 2) {
|
|
if (myIndex == 2) {
|
|
- // this.setData({
|
|
|
|
- // followPageNo: 1
|
|
|
|
- // })
|
|
|
|
- // followInit(this);
|
|
|
|
groupInit(this);
|
|
groupInit(this);
|
|
}
|
|
}
|
|
- if (myIndex == 3) {
|
|
|
|
- // console.log(this.data.isIOS)
|
|
|
|
- myInit(this);
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
this.uid = wx.getStorageSync('uid');
|
|
this.uid = wx.getStorageSync('uid');
|
|
@@ -126,7 +120,27 @@ Page({
|
|
if (options.index) {
|
|
if (options.index) {
|
|
this.updateData(options.index)
|
|
this.updateData(options.index)
|
|
}
|
|
}
|
|
- hotInit(this)
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ if(wx.getStorageSync('uid')){
|
|
|
|
+ httpRequestApi.userLoginRecord().success(res => {
|
|
|
|
+ if (res.data.data) {
|
|
|
|
+ // 有数据弹任务窗口
|
|
|
|
+ if(this.data.unfinishedCount > 0){
|
|
|
|
+ this.setData({
|
|
|
|
+ indexSignDialog: true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // 没数据弹签到
|
|
|
|
+ this.setData({
|
|
|
|
+ indexMissionDialog: true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }, 2800)
|
|
|
|
+ // hotInit(this)
|
|
// this.init();
|
|
// this.init();
|
|
|
|
|
|
},
|
|
},
|
|
@@ -135,21 +149,25 @@ Page({
|
|
title: '小学课文朗读配音'
|
|
title: '小学课文朗读配音'
|
|
})
|
|
})
|
|
// this.init();
|
|
// this.init();
|
|
- getOpenidSessionKey((res) => {}, (error) => {
|
|
|
|
|
|
+ getOpenidSessionKey((res) => {
|
|
|
|
+ hotInit(this)
|
|
|
|
+ }, (error) => {
|
|
// console.log(error)
|
|
// console.log(error)
|
|
this.setData({
|
|
this.setData({
|
|
hide: !this.data.hide
|
|
hide: !this.data.hide
|
|
})
|
|
})
|
|
|
|
+ return;
|
|
});
|
|
});
|
|
- if (this.data.myIndex === 3) {
|
|
|
|
- this.getUserWorksInfo();
|
|
|
|
|
|
+ if (this.data.myIndex === 0) {
|
|
|
|
+ // 从修改信息页面退回
|
|
|
|
+ this.getUserWorksInfo(true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//初始化数据
|
|
//初始化数据
|
|
// init: function () {
|
|
// init: function () {
|
|
// httputil.getOpenidSessionKey((res) => {
|
|
// httputil.getOpenidSessionKey((res) => {
|
|
// console.log('微信的用户信息', res)
|
|
// console.log('微信的用户信息', res)
|
|
-
|
|
|
|
|
|
+
|
|
// }, (error) => {
|
|
// }, (error) => {
|
|
// console.log(1111111111111111)
|
|
// console.log(1111111111111111)
|
|
// // this.jurisdiction()
|
|
// // this.jurisdiction()
|
|
@@ -159,14 +177,28 @@ Page({
|
|
// });
|
|
// });
|
|
// },
|
|
// },
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- getUserWorksInfo: function () {
|
|
|
|
- console.log(wx.getStorageSync('user'));
|
|
|
|
|
|
+ getUserWorksInfo: function (flag) {
|
|
|
|
+ console.log(flag)
|
|
|
|
+ if (flag) {
|
|
|
|
+ httpRequestApi.getUserWorksInfo().success(res => {
|
|
|
|
+ const str = 'myData.user.user.nickName';
|
|
|
|
+ this.setData({
|
|
|
|
+ [str]: res.data.data.user.nickName
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const userLocal = wx.getStorageSync('user')
|
|
|
|
+ console.log(userLocal)
|
|
|
|
+ const str = 'myData.user';
|
|
|
|
+ this.setData({
|
|
|
|
+ [str]: userLocal
|
|
|
|
+ })
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
this.data.myData.user = res.data.data;
|
|
this.data.myData.user = res.data.data;
|
|
- this.data.myData.user.user.birthday = this.data.myData.user.user.birthday ? formatDate(res.data.data.user.birthday,3) : '2018年1月1日';
|
|
|
|
httpRequestApi.userIntoPage('pages/index/index', '首页我的').success((res) => {})
|
|
httpRequestApi.userIntoPage('pages/index/index', '首页我的').success((res) => {})
|
|
- if(this.data.myData.user.myRead){
|
|
|
|
- this.data.myData.user.myRead.gmtCreated = formatDate(this.data.myData.user.myRead.gmtCreated,4)
|
|
|
|
|
|
+ if (this.data.myData.user.myRead) {
|
|
|
|
+ this.data.myData.user.myRead.gmtCreated = formatDate(this.data.myData.user.myRead.gmtCreated, 4)
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
myData: this.data.myData,
|
|
myData: this.data.myData,
|
|
@@ -194,19 +226,19 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 当前在推荐页面 加载推荐
|
|
// 当前在推荐页面 加载推荐
|
|
- 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)
|
|
|
|
+ // this.setData({
|
|
|
|
+ // recommendPageNo: this.data.recommendPageNo + 1
|
|
|
|
+ // })
|
|
|
|
+ // if (this.data.recommendPageNo <= this.data.recommendTotalNo) {
|
|
|
|
+ // this.getHotRecommend(this.uid, this.data.recommendPageNo, 3);
|
|
|
|
+
|
|
|
|
+ // } else {
|
|
|
|
+ // console.log('没有更多')
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
|
|
- } else {
|
|
|
|
- console.log('没有更多')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
onPullDownRefresh: function () {
|
|
onPullDownRefresh: function () {
|
|
//当前在团购页下拉加载
|
|
//当前在团购页下拉加载
|
|
@@ -219,7 +251,7 @@ Page({
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
- },1500);
|
|
|
|
|
|
+ }, 1500);
|
|
},
|
|
},
|
|
// 获取全部课本
|
|
// 获取全部课本
|
|
// getBookList: function () {
|
|
// getBookList: function () {
|
|
@@ -235,7 +267,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`
|
|
});
|
|
});
|
|
@@ -244,22 +276,40 @@ Page({
|
|
[str]: 0
|
|
[str]: 0
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- toMyCollage: function(e){
|
|
|
|
- if(app.globalData.isIOS){
|
|
|
|
|
|
+ toMyCollage: function (e) {
|
|
|
|
+ if (app.globalData.isIOS) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的助力`
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的助力`
|
|
});
|
|
});
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的拼团`
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的拼团`
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ toMyCourse: function(){
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ 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){
|
|
|
|
+ this.setData({
|
|
|
|
+ indexSignDialog: false
|
|
|
|
+ })
|
|
|
|
+ console.log(e.detail.formId)
|
|
|
|
+ httpRequestApi.postFormId(e.detail.formId).success(res=>{console.log(res)})
|
|
|
|
+ this.goToFlower();
|
|
|
|
+ },
|
|
|
|
+ missionBtn: function(){
|
|
|
|
+ this.setData({
|
|
|
|
+ indexMissionDialog: false
|
|
|
|
+ })
|
|
|
|
+ this.goToFlower();
|
|
}
|
|
}
|
|
-
|
|
|
|
})
|
|
})
|