|
@@ -1,7 +1,9 @@
|
|
//index.js
|
|
//index.js
|
|
//获取应用实例
|
|
//获取应用实例
|
|
// 获取授权登录
|
|
// 获取授权登录
|
|
-
|
|
|
|
|
|
+import {
|
|
|
|
+ actionRecord
|
|
|
|
+} from '~/api/global'
|
|
import {
|
|
import {
|
|
getOpenidSessionKey
|
|
getOpenidSessionKey
|
|
} from '../../utils/httpUtil';
|
|
} from '../../utils/httpUtil';
|
|
@@ -91,12 +93,12 @@ Page({
|
|
isIos: null,
|
|
isIos: null,
|
|
temporaryGrade: null
|
|
temporaryGrade: null
|
|
},
|
|
},
|
|
- jurisdiction: function() {
|
|
|
|
|
|
+ jurisdiction: function () {
|
|
//隐藏弹框
|
|
//隐藏弹框
|
|
this.setData({
|
|
this.setData({
|
|
- hide: !this.data.hide
|
|
|
|
- })
|
|
|
|
- //登录页信息
|
|
|
|
|
|
+ hide: !this.data.hide
|
|
|
|
+ })
|
|
|
|
+ //登录页信息
|
|
this.updateData(0)
|
|
this.updateData(0)
|
|
},
|
|
},
|
|
// 隐藏升级弹窗
|
|
// 隐藏升级弹窗
|
|
@@ -111,14 +113,14 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//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 = parseInt(index);
|
|
let myIndex = parseInt(index);
|
|
this.setData({
|
|
this.setData({
|
|
myIndex,
|
|
myIndex,
|
|
@@ -182,7 +184,7 @@ Page({
|
|
return;
|
|
return;
|
|
} */
|
|
} */
|
|
},
|
|
},
|
|
- showPage: function() {
|
|
|
|
|
|
+ showPage: function () {
|
|
let options = this.data.options;
|
|
let options = this.data.options;
|
|
if (this.data.workId) {
|
|
if (this.data.workId) {
|
|
// 需要在推荐第一个上插入一条分享或者刚朗读完数据
|
|
// 需要在推荐第一个上插入一条分享或者刚朗读完数据
|
|
@@ -254,7 +256,7 @@ Page({
|
|
}
|
|
}
|
|
}, 2800)
|
|
}, 2800)
|
|
},
|
|
},
|
|
- onLoad: function(options) {
|
|
|
|
|
|
+ onLoad: function (options) {
|
|
if (wx.getStorageSync('uid')) {
|
|
if (wx.getStorageSync('uid')) {
|
|
this.setData({
|
|
this.setData({
|
|
isLogin: true
|
|
isLogin: true
|
|
@@ -265,17 +267,17 @@ Page({
|
|
/**获取权限和订单信息 */
|
|
/**获取权限和订单信息 */
|
|
// 获取商品信息
|
|
// 获取商品信息
|
|
httpRequestApi.getProductActivity().success(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()
|
|
this.getHelpAuth()
|
|
if (!res.data.data.grade) {
|
|
if (!res.data.data.grade) {
|
|
this.setData({
|
|
this.setData({
|
|
@@ -294,17 +296,17 @@ Page({
|
|
}
|
|
}
|
|
// 获取商品信息
|
|
// 获取商品信息
|
|
httpRequestApi.getProductActivity().success(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()
|
|
this.getHelpAuth()
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
@@ -399,7 +401,7 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onShow: function() {
|
|
|
|
|
|
+ onShow: function () {
|
|
let grade = wx.getStorageSync('grade');
|
|
let grade = wx.getStorageSync('grade');
|
|
this.setData({
|
|
this.setData({
|
|
gradeActivity: grade
|
|
gradeActivity: grade
|
|
@@ -439,7 +441,7 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- onHide: function() {
|
|
|
|
|
|
+ onHide: function () {
|
|
const str = 'hotData.inputFocus'
|
|
const str = 'hotData.inputFocus'
|
|
this.setData({
|
|
this.setData({
|
|
[str]: false
|
|
[str]: false
|
|
@@ -448,7 +450,7 @@ Page({
|
|
/* 两个接口维护同一个数组,手动的结束后添加算法的 */
|
|
/* 两个接口维护同一个数组,手动的结束后添加算法的 */
|
|
// 推荐页信息 获取消息和手动推荐内容
|
|
// 推荐页信息 获取消息和手动推荐内容
|
|
// 获取热门作品 算法出来的
|
|
// 获取热门作品 算法出来的
|
|
- getHotRecommend: function() {
|
|
|
|
|
|
+ getHotRecommend: function () {
|
|
let grade = wx.getStorageSync('grade')
|
|
let grade = wx.getStorageSync('grade')
|
|
let pageNo = this.data.recommendPageNo;
|
|
let pageNo = this.data.recommendPageNo;
|
|
let pageSize = this.data.recommendPageSize;
|
|
let pageSize = this.data.recommendPageSize;
|
|
@@ -518,15 +520,15 @@ Page({
|
|
// tempList.push(temp);
|
|
// tempList.push(temp);
|
|
});
|
|
});
|
|
console.log('当前list', this.data.videoList)
|
|
console.log('当前list', this.data.videoList)
|
|
- // if (!notSet) {
|
|
|
|
|
|
+ // if (!notSet) {
|
|
this.setData({
|
|
this.setData({
|
|
- videoList: this.data.videoList
|
|
|
|
- })
|
|
|
|
- // }
|
|
|
|
|
|
+ videoList: this.data.videoList
|
|
|
|
+ })
|
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
},
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- getUserWorksInfo: function(flag) {
|
|
|
|
|
|
+ getUserWorksInfo: function (flag) {
|
|
if (flag) {
|
|
if (flag) {
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
httpRequestApi.getUserWorksInfo().success(res => {
|
|
const userInfo = this.formatGrade(res.data.data.user);
|
|
const userInfo = this.formatGrade(res.data.data.user);
|
|
@@ -580,7 +582,7 @@ Page({
|
|
}
|
|
}
|
|
return userInfo;
|
|
return userInfo;
|
|
},
|
|
},
|
|
- videoChange: function(e) {
|
|
|
|
|
|
+ videoChange: function (e) {
|
|
if (e.detail.activeId === this.data.updateId) {
|
|
if (e.detail.activeId === this.data.updateId) {
|
|
console.log('应该刷新')
|
|
console.log('应该刷新')
|
|
if (this.data.myIndex === 1) {
|
|
if (this.data.myIndex === 1) {
|
|
@@ -603,7 +605,7 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
// 触底加载
|
|
// 触底加载
|
|
- onReachBottom: function() {
|
|
|
|
|
|
+ onReachBottom: function () {
|
|
if (this.data.myIndex === 2) {
|
|
if (this.data.myIndex === 2) {
|
|
this.setData({
|
|
this.setData({
|
|
coursePageNo: this.data.coursePageNo + 1
|
|
coursePageNo: this.data.coursePageNo + 1
|
|
@@ -627,17 +629,17 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onPullDownRefresh: function() {
|
|
|
|
|
|
+ onPullDownRefresh: function () {
|
|
//当前在团购页下拉加载
|
|
//当前在团购页下拉加载
|
|
this.updateData(this.data.myIndex)
|
|
this.updateData(this.data.myIndex)
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
- //模拟加载
|
|
|
|
- setTimeout(function() {
|
|
|
|
|
|
+ //模拟加载
|
|
|
|
+ setTimeout(function () {
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.hideNavigationBarLoading() //完成停止加载
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
wx.stopPullDownRefresh() //停止下拉刷新
|
|
}, 1000);
|
|
}, 1000);
|
|
},
|
|
},
|
|
- goToMessage: function() {
|
|
|
|
|
|
+ goToMessage: function () {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../../pages/social/insideMessage/insideMessage`
|
|
url: `../../pages/social/insideMessage/insideMessage`
|
|
});
|
|
});
|
|
@@ -647,10 +649,10 @@ Page({
|
|
[str]: 0
|
|
[str]: 0
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- goToService: function() {
|
|
|
|
|
|
+ goToService: function () {
|
|
httpRequestApi.userEvent('SERVICE');
|
|
httpRequestApi.userEvent('SERVICE');
|
|
},
|
|
},
|
|
- 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=我的助力`
|
|
@@ -662,19 +664,19 @@ 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`
|
|
});
|
|
});
|
|
httpRequestApi.userEvent('INTEGRAL');
|
|
httpRequestApi.userEvent('INTEGRAL');
|
|
|
|
|
|
},
|
|
},
|
|
- signInBtn: function(e) {
|
|
|
|
|
|
+ signInBtn: function (e) {
|
|
this.setData({
|
|
this.setData({
|
|
indexSignDialog: false
|
|
indexSignDialog: false
|
|
})
|
|
})
|
|
@@ -684,13 +686,13 @@ Page({
|
|
})
|
|
})
|
|
this.goToFlower();
|
|
this.goToFlower();
|
|
},
|
|
},
|
|
- missionBtn: function() {
|
|
|
|
|
|
+ missionBtn: function () {
|
|
this.setData({
|
|
this.setData({
|
|
indexMissionDialog: false
|
|
indexMissionDialog: false
|
|
})
|
|
})
|
|
this.goToFlower();
|
|
this.goToFlower();
|
|
},
|
|
},
|
|
- getUserAuth: function() {
|
|
|
|
|
|
+ getUserAuth: function () {
|
|
httpRequestApi.getUserAuth().success(res => {
|
|
httpRequestApi.getUserAuth().success(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
const str = 'myData.isVIP'
|
|
const str = 'myData.isVIP'
|
|
@@ -705,11 +707,11 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- delHideMyWork: function() {
|
|
|
|
|
|
+ delHideMyWork: function () {
|
|
this.getMyRead()
|
|
this.getMyRead()
|
|
},
|
|
},
|
|
// 获取我的朗读
|
|
// 获取我的朗读
|
|
- getMyRead: function() {
|
|
|
|
|
|
+ getMyRead: function () {
|
|
httpRequestApi.myRead().success(res => {
|
|
httpRequestApi.myRead().success(res => {
|
|
console.log(123123, res)
|
|
console.log(123123, res)
|
|
console.log('mydata', this.data.myData)
|
|
console.log('mydata', this.data.myData)
|
|
@@ -766,7 +768,7 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 评论区点击
|
|
// 评论区点击
|
|
- commentTap: function(e) {
|
|
|
|
|
|
+ commentTap: function (e) {
|
|
console.log('点击评论区', e)
|
|
console.log('点击评论区', e)
|
|
if (e.target.dataset.type === 'blank') {
|
|
if (e.target.dataset.type === 'blank') {
|
|
if (this.data.commentShow && this.data.commentId) {
|
|
if (this.data.commentShow && this.data.commentId) {
|
|
@@ -782,11 +784,11 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- touchMove: function(e) {
|
|
|
|
|
|
+ touchMove: function (e) {
|
|
return
|
|
return
|
|
},
|
|
},
|
|
// 打开评论
|
|
// 打开评论
|
|
- openComment: function(e) {
|
|
|
|
|
|
+ openComment: function (e) {
|
|
//
|
|
//
|
|
console.log('id', e.detail.activeId)
|
|
console.log('id', e.detail.activeId)
|
|
console.log('id', e)
|
|
console.log('id', e)
|
|
@@ -794,17 +796,17 @@ Page({
|
|
commentShow: !this.data.commentShow,
|
|
commentShow: !this.data.commentShow,
|
|
commentId: e.detail.activeId,
|
|
commentId: e.detail.activeId,
|
|
commentIndex: e.detail.activeIndex
|
|
commentIndex: e.detail.activeIndex
|
|
- // commentList: []
|
|
|
|
|
|
+ // commentList: []
|
|
});
|
|
});
|
|
// this.getReply(e.detail.activeId);
|
|
// this.getReply(e.detail.activeId);
|
|
},
|
|
},
|
|
// 获取评论信息
|
|
// 获取评论信息
|
|
- getReply: function(columnId) {
|
|
|
|
|
|
+ getReply: function (columnId) {
|
|
debugger
|
|
debugger
|
|
// let columnId = this.data.id;
|
|
// let columnId = this.data.id;
|
|
console.log(123123123, columnId)
|
|
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) => {
|
|
httpRequestApi.getReply(this.uid, columnId, 1, 10).success((res) => {
|
|
console.log('reply', res)
|
|
console.log('reply', res)
|
|
const commentList = res.data.data.list;
|
|
const commentList = res.data.data.list;
|
|
@@ -831,7 +833,7 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 发布回复
|
|
// 发布回复
|
|
- sendReply: function(e) {
|
|
|
|
|
|
+ sendReply: function (e) {
|
|
console.log('triger', e.detail.content);
|
|
console.log('triger', e.detail.content);
|
|
let data = {
|
|
let data = {
|
|
columnId: this.data.commentId,
|
|
columnId: this.data.commentId,
|
|
@@ -849,13 +851,13 @@ Page({
|
|
})
|
|
})
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- gradeTap: function() {
|
|
|
|
|
|
+ gradeTap: function () {
|
|
// console.log("组件回调,返回上一页");
|
|
// console.log("组件回调,返回上一页");
|
|
this.setData({
|
|
this.setData({
|
|
isGradeShow: true
|
|
isGradeShow: true
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onShareAppMessage: function(res) {
|
|
|
|
|
|
+ onShareAppMessage: function (res) {
|
|
if (res.from === 'button') {
|
|
if (res.from === 'button') {
|
|
return {
|
|
return {
|
|
title: '请欣赏我的课文朗读作品,点赞+评论。',
|
|
title: '请欣赏我的课文朗读作品,点赞+评论。',
|
|
@@ -869,15 +871,15 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- openShare: function(e) {
|
|
|
|
|
|
+ openShare: function (e) {
|
|
console.log('点击分享', e)
|
|
console.log('点击分享', e)
|
|
- /* this.setData({
|
|
|
|
- shareTitle: e.detail.currentTarget.dataset.title,
|
|
|
|
- shareId: e.detail.currentTarget.dataset.id,
|
|
|
|
- shareImg: e.detail.currentTarget.dataset.shareimg,
|
|
|
|
- goToShare: true,
|
|
|
|
- ifTapActivity: e.detail.currentTarget.dataset.activity
|
|
|
|
- }) */
|
|
|
|
|
|
+ /* this.setData({
|
|
|
|
+ shareTitle: e.detail.currentTarget.dataset.title,
|
|
|
|
+ shareId: e.detail.currentTarget.dataset.id,
|
|
|
|
+ shareImg: e.detail.currentTarget.dataset.shareimg,
|
|
|
|
+ goToShare: true,
|
|
|
|
+ ifTapActivity: e.detail.currentTarget.dataset.activity
|
|
|
|
+ }) */
|
|
},
|
|
},
|
|
// 选择年纪
|
|
// 选择年纪
|
|
selectGrade({
|
|
selectGrade({
|
|
@@ -893,7 +895,7 @@ Page({
|
|
console.log(code);
|
|
console.log(code);
|
|
},
|
|
},
|
|
// 修改年级
|
|
// 修改年级
|
|
- changeGrade: function(e) {
|
|
|
|
|
|
+ changeGrade: function (e) {
|
|
const grade = this.data.temporaryGrade
|
|
const grade = this.data.temporaryGrade
|
|
if (!grade) {
|
|
if (!grade) {
|
|
return wx.showToast({
|
|
return wx.showToast({
|
|
@@ -917,7 +919,7 @@ Page({
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- getFollowData: function() {
|
|
|
|
|
|
+ getFollowData: function () {
|
|
httpRequestApi.getFollowWorks(this.data.followPageNo, this.data.followPageSize).success(res => {
|
|
httpRequestApi.getFollowWorks(this.data.followPageNo, this.data.followPageSize).success(res => {
|
|
if (res.data.data.totalSize === 0) {
|
|
if (res.data.data.totalSize === 0) {
|
|
this.setData({
|
|
this.setData({
|
|
@@ -940,7 +942,7 @@ Page({
|
|
httpRequestApi.userEvent('SUBSCRIBE');
|
|
httpRequestApi.userEvent('SUBSCRIBE');
|
|
},
|
|
},
|
|
// 点击用户头像区域
|
|
// 点击用户头像区域
|
|
- headTapHandler: function(e) {
|
|
|
|
|
|
+ headTapHandler: function (e) {
|
|
console.log('点击头像', e)
|
|
console.log('点击头像', e)
|
|
let tapId = e.detail.activeId;
|
|
let tapId = e.detail.activeId;
|
|
// 点击头像既关注 测试
|
|
// 点击头像既关注 测试
|
|
@@ -948,7 +950,7 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getCoursesList: function() {
|
|
|
|
|
|
+ getCoursesList: function () {
|
|
const grade = wx.getStorageSync('grade');
|
|
const grade = wx.getStorageSync('grade');
|
|
const data = {
|
|
const data = {
|
|
pageNo: this.data.coursePageNo,
|
|
pageNo: this.data.coursePageNo,
|
|
@@ -968,7 +970,7 @@ Page({
|
|
})
|
|
})
|
|
httpRequestApi.userEvent('RESOURCES');
|
|
httpRequestApi.userEvent('RESOURCES');
|
|
},
|
|
},
|
|
- goToReading: function(e) {
|
|
|
|
|
|
+ goToReading: function (e) {
|
|
console.log('去朗读', e)
|
|
console.log('去朗读', e)
|
|
const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
|
|
const id = e.detail.activeId ? e.detail.activeId : e.currentTarget.dataset.id;
|
|
const index = e.currentTarget.dataset.index;
|
|
const index = e.currentTarget.dataset.index;
|
|
@@ -1029,16 +1031,16 @@ Page({
|
|
if (1) {
|
|
if (1) {
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
this.shareDialog = this.selectComponent("#share-dialog");
|
|
const data = {
|
|
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({
|
|
this.setData({
|
|
noScroll: 'noScroll',
|
|
noScroll: 'noScroll',
|
|
shareTitle: obj.title,
|
|
shareTitle: obj.title,
|
|
@@ -1048,7 +1050,7 @@ Page({
|
|
this.shareDialog.share(data);
|
|
this.shareDialog.share(data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- collectTap: function(e) {
|
|
|
|
|
|
+ collectTap: function (e) {
|
|
const index = e.detail.index;
|
|
const index = e.detail.index;
|
|
let str = `videoList[${index}].isFavorite`;
|
|
let str = `videoList[${index}].isFavorite`;
|
|
let str2 = `videoList[${index}].favoritesAmount`;
|
|
let str2 = `videoList[${index}].favoritesAmount`;
|
|
@@ -1058,7 +1060,7 @@ Page({
|
|
[str2]: favoritesAmount
|
|
[str2]: favoritesAmount
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- likeTap: function(e) {
|
|
|
|
|
|
+ likeTap: function (e) {
|
|
console.log('点赞', e)
|
|
console.log('点赞', e)
|
|
const index = e.detail.index;
|
|
const index = e.detail.index;
|
|
let likeStr = `videoList[${index}].isLike`;
|
|
let likeStr = `videoList[${index}].isLike`;
|
|
@@ -1068,7 +1070,7 @@ Page({
|
|
[likeNumStr]: this.data.videoList[index].likes + 1
|
|
[likeNumStr]: this.data.videoList[index].likes + 1
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- addShareAmount: function(e) {
|
|
|
|
|
|
+ addShareAmount: function (e) {
|
|
let str = `videoList[${e.detail.index}].shareAmount`;
|
|
let str = `videoList[${e.detail.index}].shareAmount`;
|
|
this.setData({
|
|
this.setData({
|
|
[str]: this.data.videoList[e.detail.index].shareAmount + 1
|
|
[str]: this.data.videoList[e.detail.index].shareAmount + 1
|
|
@@ -1079,16 +1081,20 @@ Page({
|
|
*/
|
|
*/
|
|
goToActivity() {
|
|
goToActivity() {
|
|
httpRequestApi.postActEvent('BANNER').success(res => {
|
|
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({
|
|
wx.navigateTo({
|
|
url: `../activity/goodList/goodList`
|
|
url: `../activity/goodList/goodList`
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ async goToCard() {
|
|
|
|
+ await actionRecord({
|
|
|
|
+ action: 'NEW_YEAR_ACTIVITY_BANNER'
|
|
|
|
+ })
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: '/pages/activityList/index',
|
|
|
|
+ })
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* banner点击
|
|
* banner点击
|
|
*/
|
|
*/
|
|
@@ -1319,20 +1325,20 @@ Page({
|
|
sc.onload = () => {
|
|
sc.onload = () => {
|
|
ctx.drawImage(sc, 12, 220, 20, 20)
|
|
ctx.drawImage(sc, 12, 220, 20, 20)
|
|
ctx.fillText('收藏', 36, 238)
|
|
ctx.fillText('收藏', 36, 238)
|
|
- //分享
|
|
|
|
|
|
+ //分享
|
|
let fx = canvas.createImage();
|
|
let fx = canvas.createImage();
|
|
fx.src = '/static/index/share.png'
|
|
fx.src = '/static/index/share.png'
|
|
fx.onload = () => {
|
|
fx.onload = () => {
|
|
ctx.drawImage(fx, 78, 220, 22, 22)
|
|
ctx.drawImage(fx, 78, 220, 22, 22)
|
|
ctx.fillText('分享', 104, 238)
|
|
ctx.fillText('分享', 104, 238)
|
|
- //点赞
|
|
|
|
|
|
+ //点赞
|
|
let dz = canvas.createImage();
|
|
let dz = canvas.createImage();
|
|
dz.src = video.isLike ? '/static/index/heart_colored.png' : '/static/index/heart.png'
|
|
dz.src = video.isLike ? '/static/index/heart_colored.png' : '/static/index/heart.png'
|
|
|
|
|
|
dz.onload = () => {
|
|
dz.onload = () => {
|
|
ctx.drawImage(dz, 258, 222, 22, 22)
|
|
ctx.drawImage(dz, 258, 222, 22, 22)
|
|
ctx.fillText(video.likes, 284, 238)
|
|
ctx.fillText(video.likes, 284, 238)
|
|
- //评论
|
|
|
|
|
|
+ //评论
|
|
let pl = canvas.createImage();
|
|
let pl = canvas.createImage();
|
|
pl.src = '/static/index/comment.png'
|
|
pl.src = '/static/index/comment.png'
|
|
pl.onload = () => {
|
|
pl.onload = () => {
|
|
@@ -1362,7 +1368,7 @@ Page({
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onShareTimeline: function() {
|
|
|
|
|
|
+ onShareTimeline: function () {
|
|
return {
|
|
return {
|
|
title: '终于找到适合孩子的朗读神器了!动画配音,边玩边学!',
|
|
title: '终于找到适合孩子的朗读神器了!动画配音,边玩边学!',
|
|
query: `uid=${wx.getStorageSync('uid')}`,
|
|
query: `uid=${wx.getStorageSync('uid')}`,
|