|
@@ -93,12 +93,12 @@ Page({
|
|
|
isVip: null,
|
|
|
isIos: null
|
|
|
},
|
|
|
- jurisdiction: function() {
|
|
|
+ jurisdiction: function () {
|
|
|
//隐藏弹框
|
|
|
this.setData({
|
|
|
- hide: !this.data.hide
|
|
|
- })
|
|
|
- //登录页信息
|
|
|
+ hide: !this.data.hide
|
|
|
+ })
|
|
|
+ //登录页信息
|
|
|
this.updateData(0)
|
|
|
},
|
|
|
// 隐藏升级弹窗
|
|
@@ -113,14 +113,14 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
//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 = parseInt(index);
|
|
|
this.setData({
|
|
|
myIndex,
|
|
@@ -142,7 +142,7 @@ Page({
|
|
|
}
|
|
|
|
|
|
/* 关注和我的需要登陆后查看 */
|
|
|
-
|
|
|
+ console.log(this.data.isLogin,'zzzzzzzzz');
|
|
|
if (!this.data.isLogin) {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/login/login?index=${myIndex}`
|
|
@@ -151,7 +151,7 @@ Page({
|
|
|
}
|
|
|
|
|
|
console.log('继续')
|
|
|
- // 刷新关注列表
|
|
|
+ // 刷新关注列表
|
|
|
if (myIndex == 1) {
|
|
|
this.setData({
|
|
|
videoList: [],
|
|
@@ -190,7 +190,7 @@ Page({
|
|
|
|
|
|
|
|
|
},
|
|
|
- showPage: function() {
|
|
|
+ showPage: function () {
|
|
|
let options = this.data.options;
|
|
|
console.log('this.data.workId', this.data.workId)
|
|
|
if (this.data.workId) {
|
|
@@ -264,7 +264,7 @@ Page({
|
|
|
}
|
|
|
}, 2800)
|
|
|
},
|
|
|
- onLoad: function(options) {
|
|
|
+ onLoad: function (options) {
|
|
|
this.setData({
|
|
|
isIos: app.globalData.isIOS
|
|
|
})
|
|
@@ -310,20 +310,20 @@ Page({
|
|
|
})
|
|
|
getOpenidNoLogin((res) => {
|
|
|
console.log('getOpenidNoLogin', res)
|
|
|
- /**获取权限和订单信息 */
|
|
|
- // 获取商品信息
|
|
|
+ /**获取权限和订单信息 */
|
|
|
+ // 获取商品信息
|
|
|
httpRequestApi.getProductActivity().success(res => {
|
|
|
- wx.setStorageSync('price', res.data.data.price / 100)
|
|
|
- wx.setStorageSync('productId', res.data.data.id)
|
|
|
- if (options.type && options.type === 'iphone') {
|
|
|
- this.setData({
|
|
|
- payPrice: res.data.data.price / 100
|
|
|
- })
|
|
|
- }
|
|
|
- }).fail(error => {
|
|
|
- console.log(error)
|
|
|
- })
|
|
|
- // 获取用户权限
|
|
|
+ wx.setStorageSync('price', res.data.data.price / 100)
|
|
|
+ wx.setStorageSync('productId', res.data.data.id)
|
|
|
+ if (options.type && options.type === 'iphone') {
|
|
|
+ this.setData({
|
|
|
+ payPrice: res.data.data.price / 100
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).fail(error => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ // 获取用户权限
|
|
|
this.getHelpAuth()
|
|
|
if (!res.data.data.grade) {
|
|
|
// 没有年级的老用户
|
|
@@ -386,7 +386,7 @@ Page({
|
|
|
console.log('nextMargin', res.pixelRatio)
|
|
|
console.log('windowHeight', res.windowHeight)
|
|
|
console.log('windowWidth', res.windowWidth)
|
|
|
- // let ratio = res.pixelRatio;
|
|
|
+ // let ratio = res.pixelRatio;
|
|
|
let ratio = (res.screenHeight / res.screenWidth) * 1.1;
|
|
|
console.log('比例系数', ratio)
|
|
|
let winH = res.windowHeight * ratio;
|
|
@@ -434,7 +434,7 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- onShow: function() {
|
|
|
+ onShow: function () {
|
|
|
let grade = wx.getStorageSync('grade');
|
|
|
this.setData({
|
|
|
gradeActivity: grade
|
|
@@ -474,7 +474,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- onHide: function() {
|
|
|
+ onHide: function () {
|
|
|
const str = 'hotData.inputFocus'
|
|
|
this.setData({
|
|
|
[str]: false
|
|
@@ -483,7 +483,7 @@ Page({
|
|
|
/* 两个接口维护同一个数组,手动的结束后添加算法的 */
|
|
|
// 推荐页信息 获取消息和手动推荐内容
|
|
|
// 获取热门作品 算法出来的
|
|
|
- getHotRecommend: function() {
|
|
|
+ getHotRecommend: function () {
|
|
|
let grade = wx.getStorageSync('grade')
|
|
|
let pageNo = this.data.recommendPageNo;
|
|
|
let pageSize = this.data.recommendPageSize;
|
|
@@ -552,15 +552,15 @@ Page({
|
|
|
// tempList.push(temp);
|
|
|
});
|
|
|
console.log('当前list', this.data.videoList)
|
|
|
- // if (!notSet) {
|
|
|
+ // if (!notSet) {
|
|
|
this.setData({
|
|
|
- videoList: this.data.videoList
|
|
|
- })
|
|
|
- // }
|
|
|
+ videoList: this.data.videoList
|
|
|
+ })
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
// 获取用户信息
|
|
|
- getUserWorksInfo: function(flag) {
|
|
|
+ getUserWorksInfo: function (flag) {
|
|
|
if (flag) {
|
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
|
const userInfo = this.formatGrade(res.data.data.user);
|
|
@@ -614,7 +614,7 @@ Page({
|
|
|
}
|
|
|
return userInfo;
|
|
|
},
|
|
|
- videoChange: function(e) {
|
|
|
+ videoChange: function (e) {
|
|
|
if (e.detail.activeId === this.data.updateId) {
|
|
|
console.log('应该刷新')
|
|
|
if (this.data.myIndex === 1) {
|
|
@@ -637,7 +637,7 @@ Page({
|
|
|
|
|
|
},
|
|
|
// 触底加载
|
|
|
- onReachBottom: function() {
|
|
|
+ onReachBottom: function () {
|
|
|
if (this.data.myIndex === 2) {
|
|
|
this.setData({
|
|
|
coursePageNo: this.data.coursePageNo + 1
|
|
@@ -677,17 +677,17 @@ Page({
|
|
|
// }
|
|
|
|
|
|
},
|
|
|
- onPullDownRefresh: function() {
|
|
|
+ onPullDownRefresh: function () {
|
|
|
//当前在团购页下拉加载
|
|
|
this.updateData(this.data.myIndex)
|
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
|
- //模拟加载
|
|
|
- setTimeout(function() {
|
|
|
+ //模拟加载
|
|
|
+ setTimeout(function () {
|
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
|
}, 1000);
|
|
|
},
|
|
|
- goToMessage: function() {
|
|
|
+ goToMessage: function () {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/social/insideMessage/insideMessage`
|
|
|
});
|
|
@@ -697,10 +697,10 @@ Page({
|
|
|
[str]: 0
|
|
|
})
|
|
|
},
|
|
|
- goToService: function() {
|
|
|
+ goToService: function () {
|
|
|
httpRequestApi.userEvent('SERVICE');
|
|
|
},
|
|
|
- toMyCollage: function(e) {
|
|
|
+ toMyCollage: function (e) {
|
|
|
if (app.globalData.isIOS) {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/groupPage/my-group/my-group?title=我的助力`
|
|
@@ -712,19 +712,19 @@ Page({
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- toMyCourse: function() {
|
|
|
+ toMyCourse: function () {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/user/mycourse/mycourse?title=我的课程`
|
|
|
});
|
|
|
},
|
|
|
- goToFlower: function() {
|
|
|
+ goToFlower: function () {
|
|
|
wx.navigateTo({
|
|
|
url: `../../pages/social/littleFlower/littleFlower`
|
|
|
});
|
|
|
httpRequestApi.userEvent('INTEGRAL');
|
|
|
|
|
|
},
|
|
|
- signInBtn: function(e) {
|
|
|
+ signInBtn: function (e) {
|
|
|
this.setData({
|
|
|
indexSignDialog: false
|
|
|
})
|
|
@@ -734,13 +734,13 @@ Page({
|
|
|
})
|
|
|
this.goToFlower();
|
|
|
},
|
|
|
- missionBtn: function() {
|
|
|
+ missionBtn: function () {
|
|
|
this.setData({
|
|
|
indexMissionDialog: false
|
|
|
})
|
|
|
this.goToFlower();
|
|
|
},
|
|
|
- getUserAuth: function() {
|
|
|
+ getUserAuth: function () {
|
|
|
httpRequestApi.getUserAuth().success(res => {
|
|
|
console.log(res)
|
|
|
const str = 'myData.isVIP'
|
|
@@ -755,11 +755,11 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- delHideMyWork: function() {
|
|
|
+ delHideMyWork: function () {
|
|
|
this.getMyRead()
|
|
|
},
|
|
|
// 获取我的朗读
|
|
|
- getMyRead: function() {
|
|
|
+ getMyRead: function () {
|
|
|
httpRequestApi.myRead().success(res => {
|
|
|
console.log(123123, res)
|
|
|
console.log('mydata', this.data.myData)
|
|
@@ -817,7 +817,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
// 评论区点击
|
|
|
- commentTap: function(e) {
|
|
|
+ commentTap: function (e) {
|
|
|
console.log('点击评论区', e)
|
|
|
if (e.target.dataset.type === 'blank') {
|
|
|
if (this.data.commentShow && this.data.commentId) {
|
|
@@ -834,11 +834,11 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- touchMove: function(e) {
|
|
|
+ touchMove: function (e) {
|
|
|
return
|
|
|
},
|
|
|
// 打开评论
|
|
|
- openComment: function(e) {
|
|
|
+ openComment: function (e) {
|
|
|
//
|
|
|
console.log('id', e.detail.activeId)
|
|
|
console.log('id', e)
|
|
@@ -846,17 +846,17 @@ Page({
|
|
|
commentShow: !this.data.commentShow,
|
|
|
commentId: e.detail.activeId,
|
|
|
commentIndex: e.detail.activeIndex
|
|
|
- // commentList: []
|
|
|
+ // commentList: []
|
|
|
});
|
|
|
// this.getReply(e.detail.activeId);
|
|
|
},
|
|
|
// 获取评论信息
|
|
|
- getReply: function(columnId) {
|
|
|
+ getReply: function (columnId) {
|
|
|
debugger
|
|
|
// let columnId = this.data.id;
|
|
|
console.log(123123123, columnId)
|
|
|
- // let pageNo = this.data.pageNo;
|
|
|
- // let pageSize = this.data.pageSize;
|
|
|
+ // let pageNo = this.data.pageNo;
|
|
|
+ // let pageSize = this.data.pageSize;
|
|
|
httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
|
|
|
console.log('reply', res)
|
|
|
const commentList = res.data.data.list;
|
|
@@ -883,7 +883,7 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
// 发布回复
|
|
|
- sendReply: function(e) {
|
|
|
+ sendReply: function (e) {
|
|
|
console.log('triger', e.detail.content);
|
|
|
let data = {
|
|
|
columnId: this.data.commentId,
|
|
@@ -901,13 +901,13 @@ Page({
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
- gradeTap: function() {
|
|
|
+ gradeTap: function () {
|
|
|
// console.log("组件回调,返回上一页");
|
|
|
this.setData({
|
|
|
isGradeShow: true
|
|
|
})
|
|
|
},
|
|
|
- onShareAppMessage: function(res) {
|
|
|
+ onShareAppMessage: function (res) {
|
|
|
console.log('onShareAppMessage>>>>>>>>>>>>')
|
|
|
console.log('this.data', this.data)
|
|
|
if (res.from === 'button') {
|
|
@@ -923,7 +923,7 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- openShare: function(e) {
|
|
|
+ openShare: function (e) {
|
|
|
console.log('点击分享', e)
|
|
|
this.setData({
|
|
|
shareTitle: e.detail.currentTarget.dataset.title,
|
|
@@ -934,7 +934,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
// 修改年级
|
|
|
- changeGrade: function(e) {
|
|
|
+ changeGrade: function (e) {
|
|
|
const grade = e.target.dataset.code;
|
|
|
|
|
|
wx.setStorageSync('grade', grade)
|
|
@@ -953,7 +953,7 @@ Page({
|
|
|
};
|
|
|
getOpenidNoLogin((res) => {
|
|
|
console.log('getOpenidNoLogin', res)
|
|
|
- // 登录或注册完成 展示页面
|
|
|
+ // 登录或注册完成 展示页面
|
|
|
if (res.data.data.wechatName) {
|
|
|
this.setData({
|
|
|
isLogin: true
|
|
@@ -973,7 +973,7 @@ Page({
|
|
|
}, grade);
|
|
|
},
|
|
|
|
|
|
- getFollowData: function() {
|
|
|
+ getFollowData: function () {
|
|
|
httpRequestApi.getFollowWorks(this.data.followPageNo, this.data.followPageSize).success(res => {
|
|
|
if (res.data.data.totalSize === 0) {
|
|
|
this.setData({
|
|
@@ -996,7 +996,7 @@ Page({
|
|
|
httpRequestApi.userEvent('SUBSCRIBE');
|
|
|
},
|
|
|
// 点击用户头像区域
|
|
|
- headTapHandler: function(e) {
|
|
|
+ headTapHandler: function (e) {
|
|
|
console.log('点击头像', e)
|
|
|
let tapId = e.detail.activeId;
|
|
|
// 点击头像既关注 测试
|
|
@@ -1004,7 +1004,7 @@ Page({
|
|
|
console.log(res)
|
|
|
})
|
|
|
},
|
|
|
- getCoursesList: function() {
|
|
|
+ getCoursesList: function () {
|
|
|
const grade = wx.getStorageSync('grade');
|
|
|
const data = {
|
|
|
pageNo: this.data.coursePageNo,
|
|
@@ -1024,7 +1024,7 @@ Page({
|
|
|
})
|
|
|
httpRequestApi.userEvent('RESOURCES');
|
|
|
},
|
|
|
- goToReading: function(e) {
|
|
|
+ goToReading: function (e) {
|
|
|
console.log('去朗读', e)
|
|
|
const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
|
|
|
const index = e.currentTarget.dataset.index;
|
|
@@ -1085,16 +1085,16 @@ Page({
|
|
|
if (1) {
|
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
|
const data = {
|
|
|
- avatar: obj.avatar,
|
|
|
- author: obj.author,
|
|
|
- iconImg: obj.iconImg,
|
|
|
- title: obj.title,
|
|
|
- path: `pages/index/index`,
|
|
|
- scene: obj.id,
|
|
|
- productId: 1
|
|
|
- // tip: this.data.tip,
|
|
|
- }
|
|
|
- // console.log(data)
|
|
|
+ avatar: obj.avatar,
|
|
|
+ author: obj.author,
|
|
|
+ iconImg: obj.iconImg,
|
|
|
+ title: obj.title,
|
|
|
+ path: `pages/index/index`,
|
|
|
+ scene: obj.id,
|
|
|
+ productId: 1
|
|
|
+ // tip: this.data.tip,
|
|
|
+ }
|
|
|
+ // console.log(data)
|
|
|
this.setData({
|
|
|
noScroll: 'noScroll',
|
|
|
shareTitle: obj.title,
|
|
@@ -1104,7 +1104,7 @@ Page({
|
|
|
this.shareDialog.share(data);
|
|
|
}
|
|
|
},
|
|
|
- collectTap: function(e) {
|
|
|
+ collectTap: function (e) {
|
|
|
const index = e.detail.index;
|
|
|
let str = `videoList[${index}].isFavorite`;
|
|
|
let str2 = `videoList[${index}].favoritesAmount`;
|
|
@@ -1114,23 +1114,23 @@ Page({
|
|
|
[str2]: favoritesAmount
|
|
|
})
|
|
|
},
|
|
|
- likeTap: function(e) {
|
|
|
+ likeTap: function (e) {
|
|
|
console.log('点赞', e)
|
|
|
const index = e.detail.index;
|
|
|
let likeStr = `videoList[${index}].isLike`;
|
|
|
let likeNumStr = `videoList[${index}].likes`;
|
|
|
this.setData({
|
|
|
- [likeStr]: true,
|
|
|
- [likeNumStr]: this.data.videoList[index].likes + 1
|
|
|
- })
|
|
|
- // this.flowerAnimationHandler()
|
|
|
+ [likeStr]: true,
|
|
|
+ [likeNumStr]: this.data.videoList[index].likes + 1
|
|
|
+ })
|
|
|
+ // this.flowerAnimationHandler()
|
|
|
},
|
|
|
- flowerAnimationHandler: function() {
|
|
|
+ flowerAnimationHandler: function () {
|
|
|
this.flowerBox = this.selectComponent("#flower-box");
|
|
|
console.log('this.flower', this.flowerBox)
|
|
|
this.flowerBox.comeOut();
|
|
|
},
|
|
|
- addShareAmount: function(e) {
|
|
|
+ addShareAmount: function (e) {
|
|
|
console.log('+++++1', e)
|
|
|
let str = `videoList[${e.detail.index}].shareAmount`;
|
|
|
this.setData({
|
|
@@ -1142,12 +1142,12 @@ Page({
|
|
|
*/
|
|
|
goToActivity() {
|
|
|
httpRequestApi.postActEvent('BANNER').success(res => {
|
|
|
- console.log('活动banner', res)
|
|
|
- })
|
|
|
- // wx.navigateTo({
|
|
|
- // url: `../activity/index/index`
|
|
|
- // // url: `../activity/rule/rule`
|
|
|
- // });
|
|
|
+ console.log('活动banner', res)
|
|
|
+ })
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: `../activity/index/index`
|
|
|
+ // // url: `../activity/rule/rule`
|
|
|
+ // });
|
|
|
wx.navigateTo({
|
|
|
url: `../activity/goodList/goodList`
|
|
|
});
|
|
@@ -1179,11 +1179,11 @@ Page({
|
|
|
console.log(res)
|
|
|
if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'reject') {
|
|
|
console.log('用户不同意订阅')
|
|
|
- // 用户不同意订阅
|
|
|
+ // 用户不同意订阅
|
|
|
wx.setStorageSync('message', false)
|
|
|
} else if (res['KJ0YtcAacJNSXDBsE27JXqoaFrcJ1-N6Jcu85yTtQuY'] === 'accept') {
|
|
|
console.log('订阅成功')
|
|
|
- // 用户点击统一订阅
|
|
|
+ // 用户点击统一订阅
|
|
|
wx.setStorageSync('message', true)
|
|
|
}
|
|
|
wx.navigateTo({
|